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

Re: I've forgotten again how to do this --> 0-100



On Thu, Jan 15, 1998 at 10:28:37AM +0000, Andrew Main wrote:
> Timothy J Luoma wrote:
> >for i in 0-100; do
> >	echo $i
> >done
> 
> for ((i=0;i<=100;i++)); do
> 	echo $i
> done
> 
> takes less memory than the brace expansion method.

how does it compare (memory-wise) to the following:

while (( $i < 101 )); do
   echo $i
   i=$((i+1))
done

(the brace expansion method makes the most sense to me, intuitively, followed by 
the version i used above; the syntax of your for statement, however, always 
confuses me.)

	
-- 
"Countin' on a remedy I've counted on before
Goin' with a cure that's never failed me
What you call the disease
I call the remedy"  -- The Mighty Mighty Bosstones



Messages sorted by: Reverse Date, Date, Thread, Author