On 11/6/19 4:37 PM, Oğuz wrote:
cat <<EOF
$(seq 10
EOF

prints 1, while it should report a syntax error.

Thanks for the report. Bash has, for some years, allowed EOF/EOS to terminate a command substitution in certain circumstances, but this really
only shows up when you're expanding it inside a here-document. There is a
(relatively cryptic) warning message, but that only shows up in development
builds. It seems reasonable to make the behavior when expanding here-
documents match the behavior outside them.

Chet


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to