As a zsh/process substitution noob, I expected
cat <(cat) and
cat | cat to do the same thing: copy lines from stdin to stdout. My understanding was that both would execute a
cat in a subshell, redirect the subshell
cat's stdout to a temporary named pipe, and then execute another
cat in the current shell with its stdin redirected to the pipe.
cat <(cat) lets me type at my terminal, but none of the input lines get copied and
^D fails to signal
cat | cat works as expected though.
As a further experiment, I checked if
cat =(cat) has similar difficulties as
cat <(cat), but it works as I expected: all of stdin up to a
^D gets copied to stdout in one go.
Can anyone help me understand what zsh is doing under the hood?