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

Re: grammar triviality with '&&'



On Mar 1,  9:01am, Ray Andrews wrote:
}
} I see, so it's not a 'hard' syntactic issue

Actually it IS a "hard" syntactic issue, in the sense that the grammar
for all *nix shells [1] both immemorial and standard, formally defines
newline as equivalent to semicolon.

You can demonstrate that this is the case [2] by:

torch% false && ; echo AND || ; echo OR
OR
torch% false ; && echo AND ; || echo OR
zsh: parse error near `&&'


[1] I don't consider here "shells" written to use the syntax of other
interpreted languages, such as shells that execute perl or php or
python statements.

[2] Actually bash throws a syntax error on that "&& ;", but both zsh
and ksh accept it.  Chet?



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