From: Suraj Kurapati Date: 2008-10-04T02:04:49+09:00 Subject: Re: Using Shell linux commands in Ruby! Lex Williams wrote: > Another way to execute a command would be through the system method. See also IO#popen: >> IO.popen('cat', 'w+') {|f| f << 'hello'; f.close_write; puts f.read } hello => nil >> puts $?.exitstatus 0 => nil > But then you couldn't get the command output that easily, > since system returns an exit code . Wrong. Obtaining the output of a command has nothing to do with the exit code: >> `false` => "" >> puts $?.exitstatus 1 => nil -- Posted via http://www.ruby-forum.com/.