Date: Sat, 14 May 2022 03:56:32 +0700 From: "Robert Elz via austin-group-l at The Open Group" <austin-group-l@opengroup.org> Message-ID: <2459.1652475...@jinx.noi.kre.to>
| | Show your work. | I no longer remember the exact command I used (cannot even locate the | message you're quoting from), I finally did ... This is what I see: bash5 $ echo $BASH_VERSION 5.1.16(1)-release bash5 $ jobs bash5 $ set +m bash5 $ sleep 20 | sleep 20 & sleep 30 | sleep 30 & jobs -l; ps jT [1] 1868 [2] 1847 [1]- 29632 Running sleep 20 1868 | sleep 20 & [2]+ 2715 Running sleep 30 1847 | sleep 30 & USER PID PPID PGID SESS JOBC STAT TTY TIME COMMAND kre 355 1847 5699 d0d6d7 0 S+ pts/26 0:00.00 sleep 30 kre 410 29632 5699 d0d6d7 0 S+ pts/26 0:00.00 sleep 20 kre 1687 1868 5699 d0d6d7 0 S+ pts/26 0:00.00 sleep 20 kre 1847 5699 5699 d0d6d7 0 S+ pts/26 0:00.00 -bash kre 1868 5699 5699 d0d6d7 0 S+ pts/26 0:00.00 -bash kre 2715 5699 5699 d0d6d7 0 S+ pts/26 0:00.00 -bash kre 4319 2715 5699 d0d6d7 0 R+ pts/26 0:00.00 sleep 30 (bash) kre 5333 5699 5699 d0d6d7 0 O+ pts/26 0:00.00 ps -jT kre 5699 3620 5699 d0d6d7 0 Ss+ pts/26 0:00.03 -bash kre 29632 5699 5699 d0d6d7 0 S+ pts/26 0:00.00 -bash bash5 $ echo $$ 5699 bash5 $ Note that pids 29632 and 1868 (which jobs claims are "sleep") are actually bash, the sleep processes are 410 and 1687. Similarly for job 2. Everything is in process group 5699 (the interactive shell's pid). When one kills %1 processes 29632 and 1868 get killed, processes 410 and 1687 do not. You can decide whether the extra interposed bash processes are intentional or not, as I said in the previous message, that is not wrong. The inability to signal the (unknown) grandchildren is expected (the same kind of thing would happen if the command were "make" and there's a whole tree of make, compiler, linker, ... processes running - this is unavoidable). kre