bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incomplete command substitution in here-document not regarded as an


From: Chet Ramey
Subject: Re: Incomplete command substitution in here-document not regarded as an error
Date: Thu, 7 Nov 2019 15:06:37 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.2.1

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    address@hidden    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]