Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created February 19, 2009 05:02
Show Gist options
  • Save wuputah/66735 to your computer and use it in GitHub Desktop.
Save wuputah/66735 to your computer and use it in GitHub Desktop.
begin
sleep(1000)
rescue Exception
raise "Oh how awful, I was sleeping here!"
end
$ ruby 1.rb &
[1] 70877
$ kill -TERM %1
test.rb:4: Oh how awful, I was sleeping here! (RuntimeError)
[1]+ Exit 1 ruby test.rb
trap('TERM') { Kernel.exit! }
begin
sleep(1000)
rescue Exception
raise "Oh how awful, I was sleeping here!"
end
$ ruby test.rb &
[1] 70966
$ kill -TERM %1
[1]+ Exit 1 ruby test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment