In Debian bug #716789, you wrote:
> [cat <<EOF | sh || echo "`echo hi` die" ... fails]

The cause is likely that the command substitution incorrectly uses the
outer here-document state. For example, dash treats these four lines

cat <<EOF `true
hi
EOF
`

as a complete command that prints hi. This is incorrect: a here-document
shall only be recognized after the next NEWLINE token, and the command
substitution is a WORD token. So the here-document should only be read
after the fourth line, and hi and EOF should be executed as commands.
This problem also occurs if new-style command substitution is used.

In the example in the original bug report, the old-style command
substitution not containing any newline generates an end-of-file
condition on the inner string. Dash then assumes that the here-document
is not coming, again corrupting the outer here-document state from the
inner parse.

This bug was fixed in FreeBSD sh in SVN r208655. I expect it will not be
completely trivial to port it over, though.

-- 
Jilles Tjoelker


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to