Hi,

On Thu, 23 Mar 2006 16:03:08 -0500
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

That's because your _current_ shell interprets the ">>". What you want
can be done with

sudo sh -c '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

I guess you want to use

... | sudo sh -c 'cat > /var/log/foo.log'

You can create a short script that does both (nice idea, I currently wrote
them for me, too...):

---:suappend:---
#!/bin/sh
exec sudo sh -c "cat >> \"$1\""
---snip---

and you can do:

echo "blah" | suappend /var/log/blah.log

etc.pp.

-hwh
-- 
[email protected] mailing list

Reply via email to