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!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using STDIN that has no line breaks
by ig (Vicar) on Mar 08, 2009 at 23:30 UTC | |
Re: using STDIN that has no line breaks
by Illuminatus (Curate) on Mar 08, 2009 at 23:51 UTC | |
Re: using STDIN that has no line breaks
by Anonymous Monk on Mar 08, 2009 at 22:07 UTC | |
Re: using STDIN that has no line breaks
by jplindstrom (Monsignor) on Mar 09, 2009 at 13:41 UTC | |
Re: using STDIN that has no line breaks
by macguide (Initiate) on Mar 09, 2009 at 16:47 UTC |
Back to
Seekers of Perl Wisdom