From: Tyler Knappe Date: 2009-06-24T03:15:25+09:00 Subject: Re: Capturing System Call Return Values? Roger Pack wrote: >> 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 >> $?. > > So did that answer your question? If not maybe you can help me > understand more what was trying to happen here. > Cheers. > -=r No, I had expected to see test == True, as my python script returns True. All I see is ruby capturing all stdout and storing it in test. I can see where the confusion is coming in, lets say my python script instead of returning true, returns an array of values. I want test to equal that array of values. -- Posted via http://www.ruby-forum.com/.