From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1625 invoked from network); 29 Nov 1997 02:10:08 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 29 Nov 1997 02:10:08 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id VAA21131; Fri, 28 Nov 1997 21:04:39 -0500 (EST) Resent-Date: Fri, 28 Nov 1997 21:04:13 -0500 (EST) Message-ID: <19971128200444.42485@emsphone.com> Date: Fri, 28 Nov 1997 20:04:44 -0600 From: Dan Nelson To: mito@aparima.com Cc: zsh-users@math.gatech.edu Subject: Re: strange arithmetic References: <19971128140924.07137@retriever> <347F26A5.BBB84546@sangacorp.com> <19971128153022.58317@retriever> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.87.6e In-Reply-To: <19971128153022.58317@retriever>; from "Louis-David Mitterrand" on Fri Nov 28 15:30:22 GMT 1997 X-OS: FreeBSD 2.2-970701-RELENG Resent-Message-ID: <"6KaiO2.0.e95.SWtVq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1163 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu In the last episode (Nov 28), Louis-David Mitterrand said: > > > % i=0;while ! [[ $[++i] < 900 ]];do;echo $i;done > > > % 1 > > > % 2 > > > [...] > > > % 90 > > > > > > Is this normal? > > Thanks to you and zefram, I guess I've been exposed to Perl for a little > too long (the time I could put off learning shell scripting ;-). > > And to think I thought I had discovered a bug in mighty zsh .. I'm not sure what Perl has to do with your confusion, unless Perl uses [[ .. ]] to signify arithmetic evaluation? I'd check the Perl man pages, but as they are split into 35 (!!!!!) sections, I won't. Thank goodness for "man zshall". I think [[ ]] is a builtin version of the test command, with more testing capabilities. You probably wanted to use the (( )) construct in zsh, to do arithmetic evaluation of your test. -Dan Nelson dnelson@emsphone.com