Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: for-command problem



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