Am executing an application thru a shell script say S.sh and the executed application becomes the child of S.sh process.The exact thing i need is if i kill the parent process the child shud get killed automatically.Any idea??
trap Trapit 1 2 15 # cleanup if script is aborted
# the numbers signify different signals
# don't believe a trap will work if someone
# does a kill -9 against your script
# do your regular code here
# try doing a ctrl-c and see what happens.
# you can modify the actins in the function
# kill %1 would kill the first job
# if you ran a child script in the background.
# kill -9 would kill the parent script.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.