Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: for-command problem
- X-seq: zsh-users 1123
- From: Bernd Eggink <eggink@xxxxxxxxxxxxxxxxxx>
- To: Bruce Stephens <B.Stephens@xxxxxxxxx>
- Subject: Re: for-command problem
- Date: Mon, 03 Nov 1997 23:21:36 +0100
- Cc: zsh-users@xxxxxxxxxxxxxxx
- Organization: Regionales Rechenzentrum der Uni Hamburg
- References: <199711031720.MAA27902@xxxxxxxxxxxxxxx>
- Sender: rz2a022@xxxxxxxxxxxxxxxxxx
Bruce Stephens wrote:
>
> agn@xxxxxxxxx said:
> > for ((let n=1; $n < 12 ; let n=$n+1))
> > do
> > echo $n
> > done
>
> This works:
>
> for ((n=1; $n<12; n=$n+1))
> do
> echo $n
> done
The $ is not necessary, since the expressions are evaluated as
arithmetic expressions. Thus:
for (( n = 1; n < 12; ++n ))
do ...
done
--
Bernd Eggink
Regionales Rechenzentrum der Universitaet Hamburg
eggink@xxxxxxxxxxxxxxxxxx
http://www.rrz.uni-hamburg.de/eggink/BEggink.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author