From: Robert Klemme Date: 2009-06-19T16:56:16+09:00 Subject: Re: How to capture the output of a call to Kernel.system 2009/6/18 Michael Guterl : > On Thu, Jun 18, 2009 at 2:01 PM, Wes Gamble wrote: >> I suspect that this is an extremely simple question to answer. >> >> How do you capture the output of a system call? >> >> For example, if I do this: >> >>>> x = system("date") >> Thu Jun 18 13:00:00 CDT 2009 >> => true >>>> x >> => true >> >> I would like to capture the output of the date command.  How do I do it? > > x = `date` > > if you need to capture more than just stdout, i recommend the systemu gem. There's also IO.popen and Open3.popen which are part of the standard library IIRC. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/