I would like to print the exit status from within the current Ruby 
script to a log file. I have been messing a bit with $?, but that way I 
get "pid 8144 exit 0" in the log file and "Interrupted" goes to terminal 
- I wanted "Interrupted" in the log file. I have not been able to make 
trap() do the trick, and with trap I loose the default exit and stack 
trace output (I think trap is to be avoided).

The log file is just a file dedicated to this script.


Cheers,


Martin


Robert Klemme wrote:
> 2010/6/18 Martin Hansen <mail / maasha.dk>:
>> I would like to, for a given script, to print the exit status - such as
>> normal, interrupted, terminated, etc. to a log file. How can I do that?
> 
> Not clear what you intend to do.  Is the script a Ruby script?  Then
> you do it with any process.  Do you want to print the status of
> another program in a Ruby script?  Where do you want to print that?
> 
> Cheers
> 
> robert

-- 
Posted via http://www.ruby-forum.com/.