macguide has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to handle output from another program that does not use line breaks in some of it's output?
I am piping Rsync's output to a perl script so that I can see Rsync's file transfers as they happen. The problem is that Rsync outputs the file transfer progress without line breaks, and only sends a line break after each transfer is complete. I think Rsync does this so that when you run in from the command line the percentage number just changes instead of filling your terminal screen with lots of lines. So I want to be able to view the <STDIN> data before the final line break is sent. Any ideas?
Or should I scrap this idea and just send the output of Rsync to a log file and have Perl evaluate the tail of the log file every few seconds?
Thanks!
I am piping Rsync's output to a perl script so that I can see Rsync's file transfers as they happen. The problem is that Rsync outputs the file transfer progress without line breaks, and only sends a line break after each transfer is complete. I think Rsync does this so that when you run in from the command line the percentage number just changes instead of filling your terminal screen with lots of lines. So I want to be able to view the <STDIN> data before the final line break is sent. Any ideas?
Or should I scrap this idea and just send the output of Rsync to a log file and have Perl evaluate the tail of the log file every few seconds?
Thanks!
Back to
Seekers of Perl Wisdom