Use sponge from the moreutils package. It has the advantage that it does not write to stdout.
echo test | sudo sponge /tmp/foo
Use the -a option to append to a file instead of overwriting it.
Use sponge from the moreutils package. It has the advantage that it does not write to stdout.
echo test | sudo sponge /tmp/foo
Use the -a option to append to a file instead of overwriting it.