Advertisement
Dijit

trap example

Oct 15th, 2012
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.20 KB | None | 0 0
  1. LOCKFILE="/tmp/lockfile.tmp"
  2. trap "echo wat" HUP 1
  3. trap "echo boo" SIGINT SIGTERM 1 3 4 5 6 7 8 9
  4. trap "{ rm -fv $LOCKFILE ; exit 255 ; }" EXIT
  5.  
  6. touch $LOCKFILE
  7. #makewhatis -u -w
  8. sleep 60
  9. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement