Access output from command prompts


#1

hi,

Can Ruby access output from command prompts as it appears?

Thanks and Regards,
Ganesan.A


#2

Ganesan,

It all depends on the specific situation. If you happen to be using the Mixlib::ShellOut class, the output of the run_command can be read with the #stdout method. This class also offers a :input option as part of the initializer that should pass any input into STDIN when running a command (http://www.rubydoc.info/github/opscode/mixlib-shellout/Mixlib/ShellOut#input-instance_method). I recommend checking out the Mixlib::ShellOut class if you haven’t already.

Hope this helps!

Curtis Stewart
Consultant
m 217.390.5067
Skype cstewart8710
cstewart@momentumsi.commailto:cstewart@momentumsi.com
www.momentumsi.comhttp://www.momentumsi.com/

[cid:71466434-A311-4F82-BC03-F7D6BA0FA526]http://www.momentumsi.com/http://www.momentumsi.com/

Cloud Migration - Architecture - DevOps - Big Data - App Dev

On May 7, 2014, at 5:49 AM, ganesan15785@gmail.commailto:ganesan15785@gmail.com wrote:

hi,

Can Ruby access output from command prompts as it appears?

Thanks and Regards,
Ganesan.A