New option: --progress-newline

Paul Slootman paul at debian.org
Thu May 11 10:28:49 GMT 2006


On Thu 11 May 2006, Ryan T. Sammartino wrote:

> In trying to write a nice GUI for rsync, it was difficult to read
> rsync's stdout
> when using --progress, as --progress uses \r to make things pretty on
> a terminal,
> but it's painful to read into another process.

Well... shouldn't be that much of a problem? Putting this tr command in
the pipe should help:

    tr '\r' '\n'


> The attached patch made it much easier for me to read and parse the output 
> from
> --progress by adding a command-line option --progress-newline, which simply
> causes --progress to use \n instead of \r for eol to ease reading stdout.

A bigger issue may be that output is buffered when writing into a pipe,
which means you only get rsync's output when the buffer is full. This is
referred to in (long-standing) Debian bug #48108 (see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48108).


Paul Slootman


More information about the rsync mailing list