From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11220 invoked from network); 13 Sep 1999 17:23:31 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 13 Sep 1999 17:23:31 -0000 Received: (qmail 8972 invoked by alias); 13 Sep 1999 17:23:16 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2600 Received: (qmail 8965 invoked from network); 13 Sep 1999 17:23:14 -0000 From: "Bart Schaefer" Message-Id: <990913172256.ZM25324@candle.brasslantern.com> Date: Mon, 13 Sep 1999 17:22:55 +0000 In-Reply-To: <19990913123528.A14510@cj952583-b.alex1.va.home.com> Comments: In reply to Sweth Chandramouli "Re: evaluating a condition" (Sep 13, 12:35pm) References: <990912235140.ZM23741@candle.brasslantern.com> <19990913123528.A14510@cj952583-b.alex1.va.home.com> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: Sweth Chandramouli , zsh-users@sunsite.auc.dk Subject: Re: evaluating a condition MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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.