Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 2021 18:40:45 -0700
From:      Alex Henrie <alexhenrie24@gmail.com>
To:        Bernhard Voelker <mail@bernhard-voelker.de>
Cc:        Otto Moerbeek <otto@drijf.net>, Coreutils <coreutils@gnu.org>,  Alejandro Colomar <alx.manpages@gmail.com>, Fabrice BAUZAC <noon@mykolab.com>,  Juli Mallett <juli@clockworksquid.com>, Jeffrey Walton <noloader@gmail.com>,  freebsd-hackers@freebsd.org, William Ahern <william@25thandclement.com>,  Roman Czyborra <roman@czyborra.com>, oshogbo@freebsd.org, tech@openbsd.org,  Christian Groessler <chris@groessler.org>, linux-api@vger.kernel.org,  Michael Kerrisk <mtk.manpages@gmail.com>, Ed Schouten <ed@nuxi.nl>, Eric Pruitt <eric.pruitt@gmail.com>
Subject:   Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout
Message-ID:  <CAMMLpeRsvi%2BGjdn2ypikNrc0uW6K_dqOChasqYJ7Fv%2B_TMuC4g@mail.gmail.com>
In-Reply-To: <d0f93c40-c471-7ef7-fa9a-2f467d775d3e@bernhard-voelker.de>
References:  <1f8ce444-35e2-56a7-dbd1-34e885372b11@gmail.com> <20210124121845.38293-1-alx.manpages@gmail.com> <YA2ztHUATu1gOxoV@clue.drijf.net> <CAMMLpeSLbWtRrrzOjB6DJgZCem8KWpy7_pWmr6ecuGrSmg4Eng@mail.gmail.com> <d0f93c40-c471-7ef7-fa9a-2f467d775d3e@bernhard-voelker.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 24, 2021 at 9:04 PM Bernhard Voelker
<mail@bernhard-voelker.de> wrote:
>
> An off-tech argument: ask a local plumber if he'd would ever use
> a tee piece instead of a pipe end piece.  I guess he would only
> if he wouldn't have anything else at hand.

According to POSIX, tee writes to "zero or more files."[1] So the
"local plumber" analogy already doesn't hold, because a plumber would
never put in a tee and then immediately cap it off so that the flow
can only go to one place, but commands like `echo foo | tee | tee |
tee` are already explicitly allowed.

> A word to the proposed patch: what should happen, if the user does
> not give a file?
>   A | B | tee -q
> The patch just silently ignored that situation which feels wrong.

Personally, I like the idea of only having to type `echo foo | tee -q`
instead of `echo foo > /dev/null`, so I think the patch indeed does
the right thing in that case.

-Alex

[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/tee.html



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMMLpeRsvi%2BGjdn2ypikNrc0uW6K_dqOChasqYJ7Fv%2B_TMuC4g>