- May
- 13,399
- 190
The first below seems to work correctly; the second doesn't. What's up?
Here's another pair that makes me wonder what's going on.
I can fix the bad one with more parentheses (but if I don't understand what's going on, I won't remember to do it!).
Code:
v:\> echo a^r^nb^r^nc^r^nd | do x in @con: ( echo %x )
a
b
c
d
v:\> echo a^r^nb^r^nc^r^nd | do x in @con: ( set foo=bar & echo %x )
b
c
d
ECHO is OFF
Here's another pair that makes me wonder what's going on.
Code:
v:\> echo a^r^nb^r^nc^r^nd | do x in @con: ( set foo=bar & echo %x )
b
c
d
ECHO is OFF
v:\> echo a^r^nb^r^nc^r^nd | do x in @con: ( echo %x & set foo=bar )
a
b
c
d
I can fix the bad one with more parentheses (but if I don't understand what's going on, I won't remember to do it!).
Code:
v:\> echo a^r^nb^r^nc^r^nd | (do x in @con: ( set foo=bar & echo %x ))
a
b
c
d