Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ksh gurus..

Status
Not open for further replies.

nandamuri

Programmer
Feb 26, 2002
15
0
0
US
I have a script test.sh. I am trying to add traps to this script. This script invokes installp. installp takes around 5 mins to complete. After installp i have some 30 lines of shell commands. So when i send a signal like "CTRL+C" when the script is executing installp line, the installp process is stopping. How can i avoid this.

Basically how can i trap a signal sent to parent process shell script when it is executing a child process with out stopping the child process.
Example code:
#!/bin/ksh

trap 'cannot stop the execution' 1 2 3 15
# Do some thing for the next 20 lines
installp -qagcX blah
# Do some more for the next 20 lines.

# End of script

NOw if we send "CTRL+C" in the shell that the above script is being executed when the script is executing installp i want the installp to continue without any problem.
Note: The script may contain some syntax errors.

TIA
kant
 
Hi,

Try using nohup before your installp command

see &quot;man nohup<CR>&quot; for details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top