Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: twisted braces
- X-seq: zsh-users 9144
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: twisted braces
- Date: Sun, 24 Jul 2005 09:42:36 +0000
- In-reply-to: <70e6e1decknsmiktk8l114194omchju2lc@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <70e6e1decknsmiktk8l114194omchju2lc@xxxxxxx>
On Jul 24, 7:46am, zzapper wrote:
}
} I got into a twist recently with conditional braces ie if (( [[ and [
(( ... )) is not for conditional expressions, it's for arithmetic. It
happens that the results of arithmetic can be tested with "if" et al.,
but that's not its primary purpose.
} My problems were solved by using the single [.
That probably means you needed filename generation or another operation
that occurs for ordinary commands.
} I read in the doc that (( was no longer recommended?
Where? Quote, please. If true, that should be repaired.
} From my Bash days I seem to think [[ was required for substring matching?
[[ ... ]] is a true syntactic construct whereas [ ... ] is merely a
command (a synonym for "test ..."). Therefore the shell applies very
different rules inside [[ ... ]], one of which is that comparisons
use pattern matching and another of which is that filename generation
is not performed (so that glob patterns can be used for comparisons).
} Comments?
RTFM?
In particular, the sections "Shell Grammar" and "Conditional Expressions".
Messages sorted by:
Reverse Date,
Date,
Thread,
Author