A ksh script (let's call it abc.sh) gets kicked off from a menu program using "nohup abc.sh &". The process ID of abc.sh can be recieved (pid=$!).
abc.sh runs an Oracle PL/SQL script (it creates a child process).
In order to stop the abc.sh (and the child) in menu program
I can not pass the bellow result to a kill command:
basically the above line returns the required process IDs (Parent and child) but I can not pass it to kill command. If I could I was free!!!!
If someone knows better way to kill a process along with its children please let know...
An idea: Is it possible to trap the termination signal coming from menu program in abc.sh and stop all the child processes forked from abc.sh in one shot... It's an idea!
Another question:
Now I can kill the process and its children. I was just wondering if it is possible to trap the termination signal coming from menu program in abc.sh and do some more stuff like sending a message or something...
Basically I want abc.sh do something when it gets killed through menu program...