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)