[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not wri
From: |
Alejandro Colomar (man-pages) |
Subject: |
Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout |
Date: |
Sun, 24 Jan 2021 17:22:10 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 |
On 1/24/21 5:11 PM, Teran McKinney wrote:
> On 2021-01-24 13-18-46 , Alejandro Colomar wrote:
>> This is useful for using tee to just write to a file,
>> at the end of a pipeline,
>> without having to redirect to /dev/null
>>
>> Example:
>>
>> echo 'foo' | sudo tee -q /etc/foo;
>>
>> is equivalent to the old (and ugly)
>>
>> echo 'foo' | sudo tee /etc/foo >/dev/null;
>>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
[...]
>
> Hi,
>
> Why is this a thing?
>
> The point of tee is to write a file *and* to stdout. If you don't want use
> that, use:
>
> `> file`
>
> To overwrite.
>
> Or
>
> `>> file`
>
> To append.
>
> I guess the only reason this would be used is if you wanted to write
> multiple files at the same time, which tee supports.
>
> -Teran
>
Hi Teran,
The rationale is that protected files can't be modified with '>', unless
you give superuser rights to the whole shell. If you want fine-grained
control over the rights of the tools in the pipeline, you'll come to
times where you want the write step to be the only one to have those,
and you can't [sudo >] nor [sudo >>], which by the way I would consider
an even better solution, but which would require much more work, and
designing a completely new idiom for it, which would face much more
objection too.
Regards,
Alex
--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, (continued)
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Erik Auerswald, 2021/01/22
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Alex Henrie, 2021/01/21
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Bernhard Voelker, 2021/01/21
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Alejandro Colomar (man-pages), 2021/01/21
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Alejandro Colomar (man-pages), 2021/01/21
- [PATCH v2] tee: Add -q, --quiet, --silent option to not write to stdout, Alejandro Colomar, 2021/01/21
- Re: [PATCH v2] tee: Add -q, --quiet, --silent option to not write to stdout, Alejandro Colomar (man-pages), 2021/01/22
- [PATCH] tee: Add -q, --quiet, --silent option to not write to stdout, Alejandro Colomar, 2021/01/23
- [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Alejandro Colomar, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Teran McKinney, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout,
Alejandro Colomar (man-pages) <=
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Otto Moerbeek, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Theo de Raadt, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Alex Henrie, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Otto Moerbeek, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Bernhard Voelker, 2021/01/24
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Alejandro Colomar (man-pages), 2021/01/25
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Alejandro Colomar (man-pages), 2021/01/26
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Rodney W. Grimes, 2021/01/26
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, L A Walsh, 2021/01/26
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Christian Groessler, 2021/01/27