Ingemar Nilsson wrote:

> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 3.0
> Patch Level: 16
> Release Status: release
> 
> Description:
>         In some cases, background processes receive SIGINT from the
>         terminal where it was started even though the manual states
>         that such processes are immune to keyboard-generated signals.
>         This is best explained by trying out the example below.
> 
>         There is a reason for the seemingly complex sleep arrangement
>         in test2. This is really a condensed version of a much larger
>         script, but it still demonstrates the problem well.

I think you're slightly misunderstanding how job control and process
groups interact.

When you run test1 from an interactive shell with job control enabled,
it is placed into a separate process group.  The terminal's foreground
process group is set to test1's process group, which means that group
receives keyboard-generated signals like SIGINT.

The shell started to run test1 is not interactive, so job control is
disabled.  This means that all processes started by test1 and its
descendants are placed into the same process group.  Since this is
the terminal's foreground process group, these processes receive the
SIGINT.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live Strong.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://tiswww.tis.case.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to