how to write the standard output to an unwritable with sudo?

Giorgos Keramidas keramida at ceid.upatras.gr
Sat Mar 29 19:52:32 PDT 2008


On Sun, 30 Mar 2008 10:13:02 +0800, lveax <lveax.m at gmail.com> wrote:
> $ whoami
> v
>
> $ ll a
> -rw-r--r--  1 root  v  0 Mar 30 10:02 a
>
> $ sudo cat > a
> a: Permission denied.

You have to redirect output 'within' sudo, so try using:

    sudo sh -c 'cat > unwritable'



More information about the freebsd-questions mailing list