If I do this:
output = %x{some_script}
...then I have the stuff printed to stdout stored in output; but I don't see it appear on the screen.
On the other hand, if I do this:
success = system "some_script"
...then I see the output appear on the screen, but I don't have it stored in a variable (success just holds a boolean value).
Is there some way to get both? I'm aware I could do this:
output = %x{some_script}
puts output
But the problem there is that some_script might be a pretty long-running script, in which case I see nothing until the whole thing is finished. I'd prefer to see output as it's produced, and when it's finished to have it all stored in the output variable.