On 11/22/17 8:17 PM, PePa wrote: > On 11/23/2017 02:23 AM, Chet Ramey wrote: >> The bash-4.2 man page defers the description of here strings to the >> description of here documents. The lines in a here document do not undergo >> word splitting. It was a bug in bash-4.2 that the WORD in a here string >> was split. >> >> This finally got fixed in bash-4.4, as described by this CHANGES entry: >> >> z. Bash no longer splits the expansion of here-strings, as the >> documentation >> has always said. > > I would think it is useful (and according to how things work in general) to > have a different behavior for <<<"$a" and <<<$a > > If one wants to have all line-breaks, spaces and tabs preserved, use > <<<"$a" otherwise use <<<$a
Here strings are, as the documentation says, a variant of here documents. There should be no behavioral difference between v=$'abc\tdef' cat <<EOF $v EOF and cat <<<$v -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/