[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Error handling with command calls

Stefan Schmidt

7/14/2008 2:35:00 PM

Hello,

I'm trying to rewrite a Bash shell script with Ruby.

`do_something`
if $?.exitstatus != 0
handle_error
end

`do_some_other_thing`
if $?.exitstatus != 0
handle_error
end

How can I avoid having to poll exitstatus after every command call? I'm looking for something to replace bash's trap.

Stefan