WAD DO, ECHO, and trailing whitespace

May 20, 2008
12,165
133
Syracuse, NY, USA
Can you please change this behavior?
Code:
v:\> echos foo^t & echo bar
foo    bar

v:\> (echos foo^t & echo bar)
foo    bar

v:\> do i=1 to 5 (echos foo^t & echo bar)
foobar
foobar
foobar
foobar
foobar
 
May 20, 2008
12,165
133
Syracuse, NY, USA
Shouldn't you be doubling the carat in the last example?
Yeah! Thanks! But it doesn't make a heck of a lot of sense (the memorable kind of sense) ... I don't have to double %s but I do have to double ^s.
Code:
v:\> do i=1 to 5 (echos %_second^^s & delay 1 )
40 41 42 43 44
 

rconn

Administrator
Staff member
May 14, 2008
12,556
167
WAD - the ( ) in a DO is not a command group, it's a command line to execute. The ^ is parsed and expanded before the DO is executed. This is no different from a FOR argument list.

And no, it can't be changed (but I could remove the DO () syntax if you prefer).
 

Similar threads