Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
grammar triviality with '&&'
- X-seq: zsh-users 19935
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh Users <zsh-users@xxxxxxx>
- Subject: grammar triviality with '&&'
- Date: Sun, 01 Mar 2015 08:07:16 -0800
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I notice that zsh is quite tolerant as far as most
line wrap situations go, except for this:
[ -e file1 ] &&
[ -e file2 ] &&
echo 'both files exist'
... good
[ -e file1 ]
&& [ -e file2 ]
&& echo 'both files exist'
... syntax error, but we can fix it like this:
[ -e file1 ]\
&& [ -e file2 ]\
&& echo 'both files exist'
I'm wondering why the line continuation is strictly necessary.
IOW, why doesn't the parser permit the '&&' on a new line?
I've been trying to come up with something that would
cause an ambiguity if it were permitted, but can't find anything,
but I doubt the rule would be there otherwise.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author