From: Andrew Timberlake Date: 2009-01-05T15:59:21+09:00 Subject: Re: Question about run external program in Ruby ------=_Part_246546_30263136.1231138826877 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Check $?.exitstatus On Mon, Jan 5, 2009 at 8:08 AM, Zhao Yi wrote: > I use this method to run a external program in ruby: > > io=IO.popen("lsa 2>&1")do |f| > while line =f.gets do > puts line > end > end > > I can get both stdout and stderr output but how can I get the command > return value? > > thanks. > -- > Posted via http://www.ruby-forum.com/. > > -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain ------=_Part_246546_30263136.1231138826877--