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

leading zeros in for/foreach loops



% for i in {01..03}; echo $i
01
02
03

% foreach i ( {01..03} ); echo $i; end
01
02
03

But these two commands don't give me leading zeros if I FIRST run this:
% for ((i=1;i<=3;i++)) echo $i
1
2
3

Can someone please explain this to me?  Does this for loop do
something strange with the variable "i"?  How can I avoid that?

Thanks so much!
 Andy


-- 
 Our scientific power has outrun our spiritual power.
 We have guided missiles and misguided men.
   (Martin Luther King Jr.)



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