When using e.g. rsync
, I'd like to tee
its output such that I can both view the current progress live, and have a log for later. Using just piping | tee logfile
the logfile will contain many lines à la
0 files...<CR>
100 files...<CR>
200 files...<CR>
Where the carriage-return <CR>
is used to have the live output replace the current line. For the stdout
part of tee
this is exactly the desired behavior, but is there any way to have the logfile drop anything between a <CR>
and the last <LF>
? (I'm not asking for a rsync
specific answer, that's just the example!) Maybe some sed
-piping in between?