On 3/23/06, JimD <[EMAIL PROTECTED]> wrote:
> I have been using Linux for a number of years and the one "trick" I
> have never read how to do is something like:
>
> sudo echo "app-portage/porthole ~*" >> /etc/portage/package.keywords

if you do this, you'll execute sudo echo and try to redirect the
output as the normal user, because the shell doesn't know you're
sudoying ;)

Sudo takes a command as parameter, enclose the whole command in quotes
and try again, like this:

sudo "echo "app-portage/porthole ~*" >> /etc/portage/package.keywords"

>
> Another one I always wanted to know if it is possible is:
>
> sudo > /var/log/foo.log

Same as above...

>
> Both give me error message.  Are either of these command possible?
>
> I used to always just use su, though now I like sudo better.  I just
> can't for the life of me get "sudo echo" or "sudo >" to work.  I can
> sudo su and then do the commands, however I am lazy and want to save
> having to "exit" out from su.
>
> Jim
> --
> gentoo-user@gentoo.org mailing list
>
>


--
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------

-- 
gentoo-user@gentoo.org mailing list

Reply via email to