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



On Tue, Apr 17, 2018 at 11:29 PM, Stephane Chazelas
<stephane.chazelas@xxxxxxxxx> wrote:
>
> $ echo ${foo::=bar} | echo $foo
> bar
>
> I suspect if you reuse "time" code, that won't address this
> case.

The time parse isn't directly re-usable anyway; it's the general
technique (have a placeholder at the front that can be updated if the
command separator indicates the job will be backgrounded) that's of
interest.  The case above needs a placeholder at the beginning of each
command, whereas the "&" case needs one at the beginning of each
pipeline.  That does mean that

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

needs two placeholders before the first echo.



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