Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 2021 17:06:24 +0100
From:      Philipp-Joachim Ost <pj@smo.de>
To:        Alejandro Colomar <alx.manpages@gmail.com>, Bernhard Voelker <mail@bernhard-voelker.de>, Alex Henrie <alexhenrie24@gmail.com>, Christian Groessler <chris@groessler.org>, =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigbrady.com>, Coreutils <coreutils@gnu.org>, William Ahern <william@25thandclement.com>, Erik Auerswald <auerswal@unix-ag.uni-kl.de>, Eric Pruitt <eric.pruitt@gmail.com>, Jeffrey Walton <noloader@gmail.com>
Cc:        Michael Kerrisk <mtk.manpages@gmail.com>, Fabrice BAUZAC <noon@mykolab.com>, tech@openbsd.org, freebsd-hackers@freebsd.org, linux-api@vger.kernel.org, juli@clockworksquid.com, ed@nuxi.nl, oshogbo@freebsd.org
Subject:   Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout
Message-ID:  <aa519ecf-b062-3100-f76f-c51c4ca8f497@smo.de>
In-Reply-To: <20210124121845.38293-1-alx.manpages@gmail.com>
References:  <1f8ce444-35e2-56a7-dbd1-34e885372b11@gmail.com> <20210124121845.38293-1-alx.manpages@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?aa519ecf-b062-3100-f76f-c51c4ca8f497>