Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh heredoc crash
- X-seq: zsh-workers 39286
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: zsh heredoc crash
- Date: Sun, 11 Sep 2016 18:13:28 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=qZi7J2QG6V3okbICitIkAsbwFYudtORGpJiZzaPsO4I=; b=jMqkcGruj/tD2TekveKxKgFPG2TuiIw1zvMcIBzScMp4TCy5rWXBhh5XlASHgm0G1A Uq209k7dppL2XLPfL63G5QKsYM1BbKht+LRPc5wfXM7swZx9JpjxPt0NXa4WP0/0ZiMg KgdHOovfqY0mQly9pwPqOanP76cp9bJJoDngzn+Emjtm7hPMskiZ5LYj23pObV9jWr5Q 1z6wC5DJp7CQV4wRxrzES34KhuQivOxdnj/u2qb+G0byItNpg9TOkZ2F78bCbeiHpX8/ wP6uR3tJ2BZlXJgOk9HbIzxK/zwc22AO1v4bUgg3sEO6koBklbSMPXqlQu2JLabNaOXg fBgQ==
- In-reply-to: <20160911190255.541e973d@ntlworld.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAHAq8pEm1FHNvoUJUq2t86P-QKtMdT3uScDUGn-dCscJUGvWew@mail.gmail.com> <25855010.qczLe9GZ8n@kdudka-nb> <20160909173515.4cb8392e@pwslap01u.europe.root.pri> <160909180250.ZM19582@torch.brasslantern.com> <20160911190255.541e973d@ntlworld.com>
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