Re: the context of expansion for output redirection

2009-09-29 Thread Chet Ramey
Lewis Hyatt wrote: > Hello- > > I was somewhat surprised to see the following behavior (this is 3.1.17): > > $ x=0; /bin/echo > /tmp/$((++x)); echo $x > 0 > $ x=0; echo > /tmp/$((++x)); echo $x > 1 > > I guess in the first case the expansion of $((++x)) is taking place after > forking, whereas i

the context of expansion for output redirection

2009-09-28 Thread Lewis Hyatt
Hello- I was somewhat surprised to see the following behavior (this is 3.1.17): $ x=0; /bin/echo > /tmp/$((++x)); echo $x 0 $ x=0; echo > /tmp/$((++x)); echo $x 1 I guess in the first case the expansion of $((++x)) is taking place after forking, whereas in the second case there is no forked proc