Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout

From
Philipp-Joachim Ost <hidden>
Date
2021-01-25 16:17:03
Reply to
Alejandro Colomar, 2021-01-24
Am 24.01.2021 um 13:18 schrieb Alejandro Colomar:
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;
Why don't you just do

echo foo > /etc/foo

or

sudo sh -c 'echo foo > /etc/foo' ?

I don't normally use sudo, so there might be some better way of using it.

Kind regards,
Philipp
Thread (19 messages) 19 messages, 7 authors, last reply 2021-03-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help