Thread (19 messages) flat view 19 messages, 7 authors, 2021-03-15

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

From: Alex Henrie <hidden>
Date: 2021-01-27 04:59:58

On Sun, Jan 24, 2021 at 9:04 PM Bernhard Voelker
[off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help