Tassilo Horn
4/4/2006 9:27:00 AM
Hi,
since I don't like bash or other shell languages too much, I've started
writing more and more system administration scripts in ruby, which works
great and saves much time. I invoke the commands which should be
executed with 'Kernel.`'.
But there's one problem with that. If my_command produces output when
being executed directly from the shell prompt, I won't see it when I
call it in a ruby script with `my_command`.
To get along this I normally use
$stdout << `my_command`
but then the output will not be shown until my_command finishes. If
my_command takes some time, the user running the script will have no
feedback.
Is there a way to directly redirect my_command's output to stdout? Or
are there other ways to work arround this?
Much thanks in advance,
Tassilo