[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:54:13 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
On 2/9/22 3:28 AM, Nikos Papaspyrou wrote:
> On Wed, Feb 9, 2022 at 9:14 AM Nikos Papaspyrou <nikolaos@google.com> wrote:
>>
>> On Wed, Feb 9, 2022 at 8:30 AM Bernhard Voelker
>> <mail@bernhard-voelker.de> wrote:
>> >
>> > > 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.
>
> On second thought, with the proposed option:
>
> $ tee --remove-cr FILE1 FILE2 ...
>
> is equivalent to:
>
> $ tee >(remove-cr > FILE1) >(remove-cr > FILE2) ...
>
> where remove-cr is a filter that does:
input | remove-cr | tee FILE1 FILE2
Or:
remove-cr < FILE | tee FILE1 FILE2
https://en.wikipedia.org/wiki/Pipeline_(Unix)
Rob
- tee: add --remove-cr option, Nikos Papaspyrou, 2022/02/09
- tee: add --remove-cr option, Nikos Papaspyrou, 2022/02/09
- Re: tee: add --remove-cr option, Bernhard Voelker, 2022/02/09
- Re: tee: add --remove-cr option, Nikos Papaspyrou, 2022/02/09
- Re: tee: add --remove-cr option, Nikos Papaspyrou, 2022/02/09
- Re: tee: add --remove-cr option,
Rob Landley <=
- Re: tee: add --remove-cr option, Nikos Papaspyrou, 2022/02/09
- Re: tee: add --remove-cr option, Bernhard Voelker, 2022/02/09
- Re: tee: add --remove-cr option, Nikos Papaspyrou, 2022/02/09
- Re: tee: add --remove-cr option, Rob Landley, 2022/02/09