Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "echo | ps -j $(:) | cat | cat | cat" runs components in different process groups



2018-04-17 10:19:47 +0100, Peter Stephenson:
[...]
> > % echo ${foo::=bar} & echo $foo
> > [1] 31940
> > bar
> > % bar
[...]
> It certainly looks rather unexpected.  I think most of us staring at it
> would assume the entire command line was evaluated in the background.
> It's hard to believe anyone is deliberately relying on this behaviour.
> I think it would be fine to change with a note about the
> incompatibility.
[...]

But then again (as already mentioned in 42527)

$ echo ${foo::=bar} | echo $foo
bar

is equally surprising to me (and at the root of most of the
problems in this thread as the expansions are not done in the
job's process group).

foo | bar

to me is like

foo & bar

except for the pipe() that connects them.

I suspect if you reuse "time" code, that won't address this
case.

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author