On 12/20/18 12:02 AM, Bize Ma wrote:
> 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 $

The terminal ends up in the wrong process group, and the parent shell can't
do anything about it. You either get EOF on stdin, -1/EIO on the read, or a
SIGHUP.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to