Re: Non-expanding here-documents inside command substitution are subject to newline joining

2017-02-11 Thread Chet Ramey
On 2/11/17 12:11 AM, Michael Homer wrote: > If the same command is put inside command substitution instead, Bash (and > pdksh) behaves differently than the others, and performs newline joining to > have a single line in the middle “def ghi”. Given > x=$(cat <<'EOT' > abc > def \ >

Non-expanding here-documents inside command substitution are subject to newline joining

2017-02-10 Thread Michael Homer
Bash has an unusual behaviour when a non-expanding here-document (<<‘EOT’) is used inside $(…) command substitution. Newline joining occurs within the document when it would not if the same document were not inside a command substitution, while other shells do not perform it in either case. Thi