Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: evaluating a condition
- X-seq: zsh-users 2600
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Sweth Chandramouli <sweth@xxxxxxx>, zsh-users@xxxxxxxxxxxxxx
- Subject: Re: evaluating a condition
- Date: Mon, 13 Sep 1999 17:22:55 +0000
- In-reply-to: <19990913123528.A14510@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.3.96.990912203255.17690A-100000@xxxxxxxxxxxxxxxxxx> <990912235140.ZM23741@xxxxxxxxxxxxxxxxxxxxxxx> <19990913123528.A14510@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author