[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: |
Rodney W. Grimes |
Subject: |
Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout |
Date: |
Wed, 27 Jan 2021 04:40:41 -0800 (PST) |
> On 2021/01/26 05:57, Rodney W. Grimes wrote:
>
> > > So, I would remove '-i, --input-stream'. (And if you think it's
> > > missing, maybe write a program to read from any FD and write to stdout.)
>
> > Its name is cat(1)
> > cat /dev/fd/# >outputfile
> >
> ----
> Except the problem, which I've run into before, is to
> have such a command executable by 'root' and output by 'root',
> Have you ever tried to drop your file caches?
> need to echo "3" to /proc/sys/vm/drop_caches. Except if you are
> a normal user, you need to elevate to root first, but what you
> suggest won't work:
>
> echo "3" | sudo cat >/proc/sys/vm/dropcaches
> -bash: /proc/sys/vm/drop_caches: Permission denied
>
> Cat isn't writing the file -- bash is. I ended up using
> dd at the time, but tq seems more efficient:
Because you failed to tell sudo that and bash your
exact intentions... you need to quote or escape the redirection
so that it is passed into sudo and not executed by bash.
> echo "3" |sudo tq /proc/sys/vm/dropcaches
>
> (which does work).
>
>
--
Rod Grimes rgrimes@freebsd.org
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, (continued)
- 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
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, L A Walsh, 2021/01/27
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Fabrice BAUZAC-STEHLY, 2021/01/29
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Eric Pruitt, 2021/01/29
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout,
Rodney W. Grimes <=
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Alex Henrie, 2021/01/26
- (resend) - simple fix to eliminate the need for a new feature in 'tee'. (was Re: [PATCH v3 (resend)] tee: ...), L A Walsh, 2021/01/26
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Rodney W. Grimes, 2021/01/27
- Re: [PATCH v3 (resend)] tee: Add -q, --quiet, --silent option to not write to stdout, Philipp-Joachim Ost, 2021/01/25
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Eric Pruitt, 2021/01/21
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Christian Groessler, 2021/01/21
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Jeffrey Walton, 2021/01/21
- Re: [PATCH] tee: Add -q, --quiet option to not write to stdout, Eric Pruitt, 2021/01/21
- 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, Bernhard Voelker, 2021/01/21