On 2/9/22 1:30 AM, Bernhard Voelker wrote:
> On 2/9/22 04:27, Nikos Papaspyrou wrote:
>> Notice that the LOG file contains more than can be seen in the standard
>> output. Three lines were printed with progress information, each starting
>> with a carriage return character (0d). Only the last one remained and can
>> be seen in the standard output. This is frustrating if one needs to edit
>> or otherwise process the LOG file.
> 
> What's wrong with
>   $ tr -d '\r' < LOG
> or
>   $ tr '\r' '\n' < LOG
> to show the output on the terminal later again?

I think he's trying to do:

  generate_data | sed 's/[^\r]*\r//g' | tee output.txt

But I found it unclear from the description. (My own first reaction was
"dos2unix works in a pipe".) I agree it's not tee's job.

Also, the lines don't START with \r, they END with \r. Even if you're eliding
differently terminated lines you believe will be overridden, it's still a line
terminator.

Rob

Reply via email to