From: jackster the jackle Date: 2008-10-18T08:11:29+09:00 Subject: Re: Error Exception if script doesn't run It seems to work but not for this command, perhaps since scp gets executed (but does not complete) the system variable is not false? [code] `scp -i /home/jsmith/.ssh/id_rsa /files*.tar jsmith@172.20.1.1:` [/code] The error code I get when I run the script manually is as follows because 172.20.1.1 is no longer on the network: ssh: connect to host 172.20.1.1 port 22: No route to host lost connection I was hoping the system variable would trip when this command fails? jack Joel VanderWerf wrote: > jackster the jackle wrote: >> I notice that any shell commands that I have in the script that fail do >> not trigger a Ruby exception, how do I get my Ruby script to send these? > > Check the return value of #system, like this: > > irb(main):002:0> unless system "false"; puts "failed!"; end > failed! > => nil -- Posted via http://www.ruby-forum.com/.