I'm digging through different sources, but can't find a good description of the anatomy of child reaping. This is a simple case of what I would like to understand.
$ cat <( sleep 100 & wait ) &
[1] 14247
$ ps ax -O pgid | grep $$
12126 12126 S pts/17 00:00:00 bash
14248 12126 S pts/17 00:00:00 bash
14249 12126 S pts/17 00:00:00 sleep 100
14251 14250 S pts/17 00:00:00 grep --color=auto 12126
$ kill -2 14248
$ ps ax -O pgid | grep $$
12126 12126 S pts/17 00:00:00 bash
14248 12126 Z pts/17 00:00:00 [bash] <defunct>
14249 12126 S pts/17 00:00:00 sleep 100
14255 14254 S pts/17 00:00:00 grep --color=auto 12126
Why is the zombie waiting for the kid?
Can you explain this one? Do I need to know C and read Bash source code to get a wider understanding of this or is there any documentation? I've already consulted:
- various links on this site and Stack Overflow
- The Linux Command Line by W. Shotts
man bash
- Bash Reference Manual (in Bash source code docs)
- Bash Guide for Beginners @ tldp.org
- Advanced Bash-Scripting Guide
GNU bash, version 4.3.42(1)-release (x86_64-pc-linux-gnu)
Linux 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux