From: "Iñaki Baz Castillo" Date: 2011-02-01T08:09:15+09:00 Subject: How to know the exit status within at_exit() block? 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. -- Iñaki Baz Castillo