> I believe you use "trap" to catch a ctrl-c in bash, but I've never 
> experimented with it. See, e.g., 
> http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_12_02.html

So in order to better organize your trap, you can do something like
this:

cleanup()
{ 
   #do cleanup here
   echo quitting
   exit 1  # or whatever err code you'd like
}

trap "cleanup" SIGINT SIGQUIT

sleep 60


And:

trap "" SIGINT SIQGUIT 

ignores signals during critical sections of code.


_______________________________________________
Fwlug mailing list
[email protected]
http://fortwaynelug.org/mailman/listinfo/fwlug_fortwaynelug.org

Reply via email to