From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: twisted braces
Date: Sun, 24 Jul 2005 09:42:36 +0000 [thread overview]
Message-ID: <1050724094236.ZM20745@candle.brasslantern.com> (raw)
In-Reply-To: <70e6e1decknsmiktk8l114194omchju2lc@4ax.com>
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".
prev parent reply other threads:[~2005-07-24 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-24 6:46 zzapper
2005-07-24 9:42 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1050724094236.ZM20745@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).