Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh heredoc crash



On Sep 11,  7:02pm, Peter Stephenson wrote:
}
} A "line" that matches a "word" means what it says:

OK.  Bash almost works the same way:

$ echo "$(cat <<EOF
> something
> EOF)"
bash: warning: here-document at line 5 delimited by end-of-file (wanted `EOF')
bash: warning: here-document at line 5 delimited by end-of-file (wanted `EOF')
bash: warning: here-document at line 1 delimited by end-of-file (wanted `EOF')
something
EOF)
$ 

So it similarly treats "EOF)" as part of the here-document / not a match
for the end delimiter, but it also closes the quoted string rather than
leave the parser hanging expecting more lines of here-document.

Given our current parsing paradigm I can't think of a way to have zsh
look for "end of here-document or end of current quote whichever comes
first" and the zsh behavior is consistent with the command substitution
having not yet closed either, so I guess we're fine.



Messages sorted by: Reverse Date, Date, Thread, Author