Open a new terminal like xterm, change prompt to something like:

    PS1=' $SHLVL $ '

Start a couple of bash subshells:

    1 $ bash
    2 $ bash
    3 $ echo $$
    9371

Suspend the last one:

    3 $ suspend
    [1]+ Stopped                 bash
    2 $ echo $$
    9313
    2 $

Make the suspended shell continue:

    2 $ kill -CONT 9371

The parent gets killed

    1 $ echo $$
    9034
     1 $

Take a look at:
https://unix.stackexchange.com/questions/379507/weird-terminating-background-bash-kills-the-parent

Reply via email to