in reply to Stopping subprocesses

See perlipc, search for "negative". Sending a signal to a negative PID sends the signal to a process group. However, heed the instructions to IGNORE it within 'A' so that you don't kill your original 'A' process.

After a little research following our discussion in the CB, it appears that the shell creates a new process group when you run 'A'. On further thought, this makes a lot of sense, or else signals sent to 'A' could also cause actions in your shell.

Update: Per CB discussion (thanks tye), perhaps kill SIGINT -getpgrp() would be more appropriate. Verify the variable of the signal.

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Stopping subprocesses
by James Board (Beadle) on Aug 24, 2010 at 13:58 UTC
    My attempt at the negative PID didn't work. The complaint was "Bad signal number". What did you mean by the negative PID? IS that the negative of the PID of B?

      My attempt at the negative PID didn't work. The complaint was "Bad signal number".

      Your negative pid was taken to be the signal number. Explicitly specify the signal and you should be ok

      $ perl -esleep & [1] 3298 $ kill -3298 bash: kill: 3298: invalid signal specification $ kill -KILL -3298 $ [1]+ Killed perl -esleep