zsh-users
 help / color / mirror / code / Atom feed
* for-command problem
@ 1997-11-03 15:14 Andres Gomez Navarro
  1997-11-03 15:56 ` Bruce Stephens
  0 siblings, 1 reply; 3+ messages in thread
From: Andres Gomez Navarro @ 1997-11-03 15:14 UTC (permalink / raw)
  To: 'zsh-users@math.gatech.edu'



----------
Hello:
	 I have a ZSHELL problem:

Why this elementary script does not work?

for 
 ((let n=1; $n < 12 ; let n=$n+1)) 
do
 echo $n
done

neither this:

for  ((let n=1; $n < 12 ; let n=$n+1))   echo -$n

Could you help me. Thanks,
				Andres Gomez


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: for-command problem
  1997-11-03 15:14 for-command problem Andres Gomez Navarro
@ 1997-11-03 15:56 ` Bruce Stephens
  1997-11-03 22:21   ` Bernd Eggink
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Stephens @ 1997-11-03 15:56 UTC (permalink / raw)
  To: zsh-users


agn@uitesa.es 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: for-command problem
  1997-11-03 15:56 ` Bruce Stephens
@ 1997-11-03 22:21   ` Bernd Eggink
  0 siblings, 0 replies; 3+ messages in thread
From: Bernd Eggink @ 1997-11-03 22:21 UTC (permalink / raw)
  To: Bruce Stephens; +Cc: zsh-users

Bruce Stephens wrote:
> 
> agn@uitesa.es 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@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-11-03 22:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-03 15:14 for-command problem Andres Gomez Navarro
1997-11-03 15:56 ` Bruce Stephens
1997-11-03 22:21   ` Bernd Eggink

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).