Can Ruby access output from shell commands as it appears?

Posted by Ciryon on Stack Overflow See other posts from Stack Overflow or by Ciryon
Published on 2010-04-29T22:47:40Z Indexed on 2010/04/29 22:57 UTC
Read the original article Hit count: 256

My Ruby script is running a shell command and parsing the output from it. However, it seems the command is first executed and output saved in an array. I would like to be able to access the output lines in real time just as they are printed. I've played around with threads, but haven't got it to work. Any suggestions?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about command-prompt