Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: grammar triviality with '&&'
On Mar 2, 3:27am, Vincent Lefevre wrote:
}
} However "&& [ -e file2 ]" could constitute a list too. There is
} currently a parse error, but zsh could have an extension to accept
} it as being equivalent to: "[[ $? -eq 0 ]] && [ -e file2 ]". Would
} there be anything wrong with such an extension?
If nothing else, the errexit option would fail. With errexit,
false
|| anything
would never get beyond "false", whereas
false || anything
proceeds at least through "anything".
You also get strange crap like
while && this; do || if && that; then || thus; fi; done
which would mean what, exactly?
Finally if it's OK to have nothing before && / ||, then it would also be
syntactically OK to write
&& || && || && && ...
No.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author