pk wrote: >> Because that's POSIX' choice? > > No, POSIX allow either behavior. In fact, it allows any behavior ranging > from running all parts in their own subshells, to running all parts in the > current shell.
"...each command of a multi-command pipeline is in a subshell environment; as an extension, however, any or all commands in a pipeline may be executed in the current environment. All other commands shall be executed in the current shell environment."