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-15 10:38:07 -0700, Bart Schaefer:
> On Sun, Apr 15, 2018 at 9:23 AM, Stephane Chazelas <
> stephane.chazelas@xxxxxxxxx> wrote:
> 
> >
> > Also note that
> >
> > echo $(sleep 10) & echo started
> >
> > Only outputs "started" after 10 seconds.
> >
> 
> I would say that's actually correct.  $(sleep 10) is *not* a background
> job, it's output has to be collected before the first "echo" can run.  The
> shell has no intrinsic idea that there won't be any output.

But it could do that collection in the child process like all
other shells do.

-- 
Stephane



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