If I have this perl app:
print `someshellscript.sh`;
that prints bunch of stuff and takes a long time to complete, how can I print that output in the middle of execution of the shell script?
Looks like Perl will only print the someshellscript.sh result when it completes, is there a way to make output flush in the middle of execution?
What you probably want to do is something like this:
This runs
someshellscript.shand opens a pipe that reads its output. Thewhileloop reads each line of output generated by the script and prints it. See the open documentation page for more information.