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

substituted command won't inherit stdin in pipeline



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.

This works though

    echo foo | { echo "$(cat)"; }

and it doesn't make any sense, both should work as per the standard if I'm
not mistaken.

Is this a bug, or documented behavior?

---

    $ zsh --version
    zsh 5.4.2 (x86_64-ubuntu-linux-gnu)


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