* Hans-Werner Hilse <[EMAIL PROTECTED]> [04/05/06 21:00]:
> Hi,
> 
> On Thu, 4 May 2006 18:55:28 +0300
> Moshe Kaminsky <[EMAIL PROTECTED]> wrote:
> 
> > Funny, I just tried the same, and it worked. It also didn't print any 
> > "after" (appropriately, since the sig handler includes 'exit'), and I 
> > didn't find any sleep process. Maybe it was from some different 
> > experiment?
> 
> I don't think so. You probably sent the signal to the child process
> (CTRL-C, perhaps?) and the script at once, not to the parent only.
> 
> proper way would be to try it like this:
> 
> ./test.sh &
> # wait some short time
> kill -TERM $!
> 
> After that I see that the child process is still running.

You are right. I was using 'kill -TERM %1', which sends the signal to 
the whole group, I guess. Anyway, I just tried the analogous thing with 
perl, and it does work. I wonder what is the reasoning in the bash case.

Moshe

Attachment: pgp51eZp2xREW.pgp
Description: PGP signature

Reply via email to