On Wed, 14 Feb 2001, rpjday wrote:

> > >
> > >Try:
> > >        trap 'kill 0' 0 1 2 3
> > >
> > >This should cleanup all the children.
> 
> huh?  i understand all of the above except for the "kill
> 0" command.  what does it mean to say "kill 0"?  what
> signal is being sent to what, exactly? 

See:
        man killpg

The try this little script:

-- cut --

#!/bin/bash

sleep 15 &
sleep 15 &
sleep 15 &
sleep 15 &
sleep 15 &

# kill 0

-- cut --

After running it, immediately type:

        ps fx

This will show all of the sleep commands still running.

Remove the `#' from the kill command at the end... then run
the script again, following with the ps command. All of the
sleep commands will be gone... because they are terminated
as part of the "process group". 

A brief referenced is made to `kill 0' in the bash man page
at the beginning of the "SIGNALS" section.


-- 
John Darrah (u05192)    | Dept: N/C Programming
Giddens Industries      | Ph: (425) 353-0405 #229
PO box 3190             | Ph: (206) 767-4212 #229
Everett  WA    98203    | Fx: (206) 764-9639



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to