>>>>> On Sat, 19 Dec 2015, Michał Górny wrote:

>   read -d '' -r -a DOC_CONTENTS <<<"${DOC_CONTENTS}"

> This performs word splitting into an array. Then you can do:

>   echo -e "${DOC_CONTENTS[*]}" | ...

The first line fails for me:

$ DOC_CONTENTS="test"
$ read -d '' -r -a DOC_CONTENTS <<<"${DOC_CONTENTS}"
$ echo $?
1

(I guess it is encountering EOF on the temporary file created by the
string redirection, but how would one distinguish this from other
errors?)

Besides, it is hard to understand what this code does, as compared to
the "set -f" solution.

Ulrich

Attachment: pgpwkQkTra60u.pgp
Description: PGP signature

Reply via email to