On Wed, Feb 9, 2022 at 8:30 AM Bernhard Voelker <m...@bernhard-voelker.de> 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?
If one settles to filter the LOG after it's saved, the intended behavior is to remove these lines. So it would be something like: $ cat LOG | sed 's/\r/@REMOVE\n/g' | sed '/@REMOVE$/d' > > More specifically, lines ending with carriage return are sent to the > > standard output but not to the files. > > -1 > IMO it's not tee(1)'s business to modify the content it is streaming. This is a fair comment and in principle I can only agree. However, if the intended behavior is to send something different to the LOG file from what goes to the standard output, there's no easy way to obtain it unless sed implements it. -- Nikolaos Papaspyrou Software Engineer nikol...@google.com Google Germany GmbH Erika-Mann-Strasse 33 80636 Muenchen Geschaeftsfuehrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Falls Sie diese faelschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, loeschen Sie alle Kopien und Anhaenge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.