coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tee: add --remove-cr option


From: Rob Landley
Subject: Re: tee: add --remove-cr option
Date: Wed, 9 Feb 2022 12:50:27 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

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

[Prev in Thread] Current Thread [Next in Thread]