Hi, my program invokes "exit true" or "exit false" and I want to catch
such return code into at_exit() block, but I don't know how to do
that.

I would like something as:


at_exit(exit_status) {
  puts "exiting with status #{status}"
}

if SOMETHING
  exit true
else
  exit false
end


Of course I call "exit" from lof of clases/modules under my project so
I cannot use a local scope variable "status" (and I wouldn't like to
use a global variable).

Thanks for any suggestion.

-- 
Iaki Baz Castillo
<ibc / aliax.net>