![]() |
Start another program from Ruby and view ouput?
I have a stupid question.
I know in Ruby you can get the output of a command by encasing itin backquotes. For example: :
$ irbNow, my question. Say I have a program like apt-get (pacman in this case). What I want to do is start the program from inside a Ruby script and see the output as it's running. I think this is possible, because I've seen it done in other scripts (though not necessarily Ruby). Any ideas? :) |
You could try using IO :: popen:
:
$ irb(It's hard to tell by just reading this but there is a delay between when it prints 1 and 2 when I did it) |
| All times are GMT -5. The time now is 1:51 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC