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

"echo | ps -j $(:) | cat | cat | cat" runs components in different process groups



From
https://unix.stackexchange.com/questions/411688/zsh-cant-input-to-terminal-when-piping-stdin-and-stdout-with-variable-command-t

$ echo | ps -j $(:) | cat | cat | cat
  PID  PGID   SID TTY          TIME CMD
 4858  4858  4858 pts/4    00:00:02 zsh
23813 23813  4858 pts/4    00:00:00 zsh
23895 23895  4858 pts/4    00:00:00 ps
23896 23896  4858 pts/4    00:00:00 cat
23897 23897  4858 pts/4    00:00:00 cat
23898 23898  4858 pts/4    00:00:00 cat

See how they all run in different process groups (they should
all be in the same one, same job).

Note that the conditions to reproduce the problem seem to be
quite specific:

- the first pipeline component must be a builtin or compound command
- the second component must have a command substitution in the
  arguments (OK when in targets of redirections).

(tested with git head on Debian amd64)

-- 
Stephane



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