zsh-users
 help / color / mirror / code / Atom feed
* leading zeros in for/foreach loops
@ 2016-02-15 18:07 Andy Spiegl
  2016-02-15 18:59 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Spiegl @ 2016-02-15 18:07 UTC (permalink / raw)
  To: Zsh Users

% 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.)


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

end of thread, other threads:[~2016-02-15 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-15 18:07 leading zeros in for/foreach loops Andy Spiegl
2016-02-15 18:59 ` Bart Schaefer

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).