Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
grammar
- X-seq: zsh-users 30604
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: grammar
- Date: Wed, 29 Apr 2026 08:59:26 -0700
- Archived-at: <https://zsh.org/users/30604>
- List-id: <zsh-users.zsh.org>
I was going thru some old stuff and I came
across something like this:
% if [[ $path ]] echo $path
... it works, which makes me uncomfortable because it ain't good
grammar. Or is it? Without the usual:
if [[ ]]; then
fi
... I'm surprised that it works. Perhaps it ends up being exactly
like:
[[ $path ]] && echo $path ?
Should I view the 'then ... fi' grammar as just optional code
block controllers?
And:
(( length > max )) && length=max
... is there a shorter syntax for that? I'll bet there is.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author