From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: Sweth Chandramouli <sweth@gwu.edu>, zsh-users@sunsite.auc.dk
Subject: Re: evaluating a condition
Date: Mon, 13 Sep 1999 17:22:55 +0000 [thread overview]
Message-ID: <990913172256.ZM25324@candle.brasslantern.com> (raw)
In-Reply-To: <19990913123528.A14510@cj952583-b.alex1.va.home.com>
On Sep 13, 12:35pm, Sweth Chandramouli wrote:
> Subject: Re: evaluating a condition
> On Sun, Sep 12, 1999 at 11:51:39PM +0000, Bart Schaefer wrote:
> > On Sep 12, 8:41pm, Gaspar Bakos wrote:
> > } export min=$3;export max=$4;
> > } if (($[min]<10 && $[max]<10)) then
> > ^^
> > There's a metafied space here. I think zsh is interpreting "\240$[max]" as
> > an identifier; e.g. if max=11, the identifier name is "\240\061\061". That
> > identifier isn't defined, so it's value is 0 which is always < 10.
> ??? what?
> ((...)), at least according to the docs (and as implemented in ksh)
> is just another syntax for `let '...''. all the "metafying" (actually,
> quoting is unmetafying) does is prevent the shell from interpreting
I said there was a metafied space there: I didn't say zsh metafied it.
There's a "\240" character there in the input; cut'n'paste that through
"cat -v" and you'll see "...10 &&M- $[max]...". This has nothing whatever
to do with zsh's internal "metafication" process.
> > This is a danger of permitting identifiers to contain non-ascii characters.
> ??? okay, what did you do to bart? :)
> i assume you meant non-printable and not non-ascii here, though
> technically a space is still printable.
I meant outside the range 0-127 (decimal), though technically I suppose I
actually meant outside the range 27-126.
> one related question that i've long wondered but never about cared
> enough to ask: is there a difference between the $[...] and ${...} notations?
Yeah. $[...] evaluates ... as a math expression, the same as $((...)).
So really it's completely unnecessary inside ((...)), but I didn't want to
answer too many questions at once.
next prev parent reply other threads:[~1999-09-13 17:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-09-12 18:41 Gaspar Bakos
1999-09-12 23:51 ` Bart Schaefer
1999-09-13 16:35 ` Sweth Chandramouli
1999-09-13 17:22 ` Bart Schaefer [this message]
1999-09-13 7:20 ` Johannes Mähner
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=990913172256.ZM25324@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=sweth@gwu.edu \
--cc=zsh-users@sunsite.auc.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).