17 Feb
2012
17 Feb
'12
5:24 p.m.
On 2012-02-17 at 19:00 +0200, Mantas Mikulėnas wrote:
Commands in a pipe would be executed using subshells, so any changes the 'while' loop makes to variables would be lost when the subshell exited.
I wasn't aware of this. I guess I was lucky I didn't run into a problem with this in all my scripts up to now. Also zsh doesn't seem to use subshells for commands in pipelines. So in zsh both forms would indeed yield the same result. But thank you for the explanation. Regards, Sebastian