Zsh Mailing List Archive
Messages sorted by:
Re: '<<-' here-documents oddity with line continuation
- X-seq: zsh-workers 42352
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: '<<-' here-documents oddity with line continuation
- Date: Fri, 9 Feb 2018 15:27:15 +0000
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LpCWo6DJCCROFNqAHqqpnM5DiIXqUfRMqTnskkmuqcQ=; b=q7AUiwnBrTTXGaQRI5j6+JGycEIP/g/SNu+jpFtzWBbYE9oUrWsjBCAjbq3F5G3rmx dX32GXNiSrir0tDF0aMZOoCewdYMdO9JfB8Xikd7a9XDwOFn412R9V6CDrpIdvYQdERo DN2ykBGcUSQ7asoANgufwjg505y86eCkrVKnbtdJzSb9pjtwvDQ5AEVymkTr68doBXt2 mxRzn/VtwuHWaCTKmoyChGUNbY7xGJ3hHC0czI4j4fuwNISgrfhECrU2jawG2GTWuxUU NLUlxYEy1LMx8nJzudaITcYFW/m1Nhx8zH/9PONSwcIDautMMNL0uULOdVkPYdZeeeUu E3YQ==
- In-reply-to: <email@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- List-unsubscribe: <mailto:firstname.lastname@example.org>
- Mail-followup-to: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <email@example.com> <CGME20180209070228epcas4p120a455bcebc8c9e56e62aab679ba61f2@epcas4p1.samsung.com> <firstname.lastname@example.org> <email@example.com>
2018-02-09 09:24:27 +0000, Peter Stephenson:
> On Fri, 9 Feb 2018 08:01:41 +0100
> Martijn Dekker <martijn@xxxxxxxx> wrote:
> > Meanwhile I would welcome opinions whether either or both of these
> > issues should be fixed unconditionally, or in emulation only -- and, if
> > the latter, what shell option to attach it to. POSIX_STRINGS maybe?
> Thanks for the patch.
> I think the question is whether existing users are more likely to be
> relying on this behaviour, or simply finding it confusing. I'd actaully
> hazard the latter --- line continuation is more useful if it's doing
> something a bit more predictable --- so I'd be inclined just to include
> the patch. But I expect there are arguments the other way.
I agree it makes sense of treating it as a minor compatibility
Note that there's also:
cat << EOF
which zsh does differently from other shells (and that nobody
would ever do).
About order and token recognition to reply on Martijn's initial
report, note that in:
echo "$(echo 'foo\
echo "$(cat << 'EOF'
The \<LF> is meant *not* to be treated as a line continuation.
bash fixed a bug recently for that (the latter used to output
"foobar", it's only fixed on the development branch).
So there has to be some level of tokenisation and parsing done
before line continuation is handled. It's not like in C where
it's done as one of the first steps of the pre-processing stage.
Messages sorted by: