jida...@jidanni.org wrote: > Might not be documented: > > $ cat q > for i in : :; do :|: > x$((++a)); echo =$a=; done; ls x?; rm x? > for i in : :; do : > x$((++b)); echo =$b=; done; ls x?; rm x? > $ bash q > == > == > x1 > =1= > =2= > x1 x2 > >
I don't think it's specific to arithmetics. I rather think the redirection (since it's part of the simple command, not the pipeline) happens in the subshell. The side effects affect the arithmetics, of course. J. PS: I don't know if that's worth to document, I would have epxected that behaviour. But I may be wrong anyways.