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

Re: substituted command won't inherit stdin in pipeline



On Wed, Nov 13, 2019 at 4:00 PM Stephane Chazelas <
stephane.chazelas@xxxxxxxxx> wrote:

> 2019-11-13 12:52:20 +0300, Oğuz:
> > On all sh implementations I have, this command
> >
> >     echo foo | echo "$(cat)"
> >
> > prints 'foo', except for zsh, it hangs instead. From that I gather cat
> > doesn't inherit echo's stdin, and it waits for input.
> [...]
>
> Not exactly what happens in that the expansions in the arguments
> of the commands in the pipeline are performed in the parent,
> from left to right, not in the processes that run the
> individualy pipe components (also note that the right-most pipe
> component is run in the current shell anyway, like in ksh93,
> unlike in bash).
>
[...]

Now I'm confused. Is this what standard says, or what zsh does?


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