1 |
>>>>> On Sat, 19 Dec 2015, Michał Górny wrote: |
2 |
|
3 |
>> set -f |
4 |
>> echo -e ${DOC_CONTENTS} | ... |
5 |
>> |
6 |
>> versus: |
7 |
>> |
8 |
>> read -d '' -r -a DOC_CONTENTS <<<"${DOC_CONTENTS}" |
9 |
>> echo -e "${DOC_CONTENTS[*]}" | ... |
10 |
>> |
11 |
>> The second one is (IMHO) harder to understand, less efficient, and |
12 |
>> relies on undocumented behaviour. |
13 |
|
14 |
> On WHAT?! |
15 |
|
16 |
Documentation of the read command doesn't specify behaviour for an |
17 |
empty argument of the -d option: |
18 |
|
19 |
`-d DELIM' |
20 |
The first character of DELIM is used to terminate the input |
21 |
line, rather than newline. |
22 |
|
23 |
Ulrich |