Trapit () # trap function
{
echo "Script aborted!... \c"
echo "Cleaning up... \c"
kill %1
kill -9 $$
}
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.
hope this helps,
RObert Robert G. Jordan
Robert@JORDAN2000.com
Unix Sys Admin
Chicago, Illinois U.S.A.
![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)