On Sun, 20 Dec 2015 00:56:39 +0100 Ulrich Mueller <[email protected]> wrote:
> >>>>> On Sat, 19 Dec 2015, Michał Górny wrote:
>
> >> set -f
> >> echo -e ${DOC_CONTENTS} | ...
> >>
> >> versus:
> >>
> >> read -d '' -r -a DOC_CONTENTS <<<"${DOC_CONTENTS}"
> >> echo -e "${DOC_CONTENTS[*]}" | ...
> >>
> >> The second one is (IMHO) harder to understand, less efficient, and
> >> relies on undocumented behaviour.
>
> > On WHAT?!
>
> Documentation of the read command doesn't specify behaviour for an
> empty argument of the -d option:
>
> `-d DELIM'
> The first character of DELIM is used to terminate the input
> line, rather than newline.
Feel free to use $'\0' if that makes it more explicit for you.
--
Best regards,
Michał Górny
<http://dev.gentoo.org/~mgorny/>
pgpaxCpJoTY4B.pgp
Description: OpenPGP digital signature
