On 26/12/2020 21:22, Alex Henrie wrote:
On Sat, Dec 26, 2020 at 10:16 AM Fabrice BAUZAC <n...@mykolab.com> wrote:
Why not
echo foo | sudo sh -c "exec cat > protected.txt"
or
echo foo | sudo dd of=protected.txt status=none
Those are both very cumbersome commands to type for such a simple and
common operation.
If something is really needed, I would suggest an option to "cat" rather
than "tee":
echo foo | sudo cat --output=protected.txt
echo foo | sudo cat -oprotected.txt
That sounds like a great solution. I'll get started on a patch!
Not ideal as you would need options to control appending or truncating.
This would be adding extra incompat, for just another way to do things.
Consequently I'd also not be on for accepting such a change to cat either.
cheers,
Pádraig