From: Tyler Knappe Date: 2009-06-24T01:19:01+09:00 Subject: Re: Capturing System Call Return Values? Roger Pack wrote: > > Hmm. > >>> `bad` > (irb):1: command not found: bad > => "" >>> $? > => # >>> system("bad") > => false > irb(main):004:0> $? > => # > > Appears a little buggy on windows for some reason. > > C:\dev\blade_copy>irb >>> `bad` >>> $? > => # # this is wrong >>> system("bad") > => false >>> $? > => # >>> `bad` >>> $? > => # # and now it's right. Odd. > > -=r irb(main):008:0> path = "python [..path..]/test.py" => "python [..path..]/test.py" irb(main):009:0> test = %x[#{path}] => "Testing! my script \n2nd line\n" irb(main):010:0> test => "Testing! my script \n2nd line\n" irb(main):011:0> $? => # irb(main):012:0> test = `python [..path..]/test.py` => "Testing! my script \n2nd line\n" irb(main):013:0> test => "Testing! my script \n2nd line\n" irb(main):014:0> $? => # irb(main):015:0> test =/= True in either case, which is what I was looking for, nor is $?. -- Posted via http://www.ruby-forum.com/.