Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strange arithmetic
- X-seq: zsh-users 1162
- From: Louis-David Mitterrand <mito@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: strange arithmetic
- Date: Fri, 28 Nov 1997 15:30:22 -0500
- In-reply-to: <347F26A5.BBB84546@xxxxxxxxxxxxx>; from Alain Caron on Fri, Nov 28, 1997 at 03:16:37PM -0500
- References: <19971128140924.07137@retriever> <347F26A5.BBB84546@xxxxxxxxxxxxx>
- Reply-to: mito@xxxxxxxxxxx
On Fri, Nov 28, 1997 at 03:16:37PM -0500, Alain Caron wrote:
> > % 90
> >
> > 90 ?? I asked for 900 and it stops at 90. On the other hand the
> > following:
> >
> > % i=0;while ! [[ $[++i] = 900 ]];do;echo $i;done
> > % 1
> > % 2
> > [...]
> > % 899
> >
> > Is this normal?
>
> This is, I presume, because ">" and "=" are doing a lexicographic
> comparison. For a numeric
> comparison, use "-gt" and "-eq" operators.
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 ..
--
Louis-David Mitterrand
http://www.aparima.com
mito@xxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author