ptreeコマンドをつかうと、親プロセスと子プロセスの関係を表示できます。
実際のところ
こんなの感じで、testExitの中でtestSubをよむというモンがあったとしあmす。
$ cat testExit.bash
#! /bin/bash
COUNT=0
function catchHup () {
printf HUP
}
trap "printf '\n\r`basename $0` is closing.'" EXIT
trap catchHup HUP
trap "printf 'deadbeef'" CHLD
./testSub.sh
read
exit 1$ cat testSub.sh #! /bin/bash read exit 1
これを表示するとこんな感じ
~$ pstree
init─┬─init───bash
├─init───bash───pstree
└─{init}