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

For loop bug



Tried on zsh 4.0.4 and 4.0.6:

  % for i in 1 2 3; do echo $i || break; done && echo X
  1
  X
  2
  X
  3
  X
  X
  % 

That looks somewhat incorrect...

Removing the "|| break" makes it work as expected:

  % for i in 1 2 3; do echo $i; done && echo X 
  1
  2
  3
  X
  % 

Same with grouping the echo and break statements:

  % for i in 1 2 3; do {echo $i || break}; done && echo X
  1
  2
  3
  X
  % 

Or did I miss something?

Phil.



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