Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: evaluating a condition
- X-seq: zsh-users 2595
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Gaspar Bakos <bakos@xxxxxxxxxx>, zsh-users@xxxxxxxxxxxxxx
- Subject: Re: evaluating a condition
- Date: Sun, 12 Sep 1999 23:51:39 +0000
- In-reply-to: <Pine.LNX.3.96.990912203255.17690A-100000@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.3.96.990912203255.17690A-100000@xxxxxxxxxxxxxxxxxx>
On Sep 12, 8:41pm, Gaspar Bakos wrote:
} Subject: evaluating a condition
}
} I have the following script, and I would like to print the numbers in the
} terminal from ${min} to ${max}, if both of them are smaller than 10.
At first I thought you'd found a bug in the math parser, but:
} 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.
} for i in {${min}..${max}}; do echo $i; done
} fi
This is a danger of permitting identifiers to contain non-ascii characters.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author