On Mon, Feb 20, 2017 at 11:25:22PM +0100, Florian Mayer wrote: > echo foo | tee >(echo $$) >(echo $$) >/dev/null | cat > > returns the same PID twice.
$$ is the PID of the main shell. I think what you want is the PID of each subshell, $BASHPID. imadev:~$ cat <(echo $$) <(echo $$) 3751 3751 imadev:~$ cat <(echo $BASHPID) <(echo $BASHPID) 3284 3285