1 |
Hi, |
2 |
|
3 |
On Thu, 23 Mar 2006 16:03:08 -0500 |
4 |
JimD <Jim@×××××××××××××××××.org> wrote: |
5 |
|
6 |
> I have been using Linux for a number of years and the one "trick" I |
7 |
> have never read how to do is something like: |
8 |
> |
9 |
> sudo echo "app-portage/porthole ~*" >> /etc/portage/package.keywords |
10 |
|
11 |
That's because your _current_ shell interprets the ">>". What you want |
12 |
can be done with |
13 |
|
14 |
sudo sh -c 'echo "app-portage/porthole ~*" >> /etc/portage/package.keywords' |
15 |
|
16 |
> Another one I always wanted to know if it is possible is: |
17 |
> |
18 |
> sudo > /var/log/foo.log |
19 |
|
20 |
I guess you want to use |
21 |
|
22 |
... | sudo sh -c 'cat > /var/log/foo.log' |
23 |
|
24 |
You can create a short script that does both (nice idea, I currently wrote |
25 |
them for me, too...): |
26 |
|
27 |
---:suappend:--- |
28 |
#!/bin/sh |
29 |
exec sudo sh -c "cat >> \"$1\"" |
30 |
---snip--- |
31 |
|
32 |
and you can do: |
33 |
|
34 |
echo "blah" | suappend /var/log/blah.log |
35 |
|
36 |
etc.pp. |
37 |
|
38 |
-hwh |
39 |
-- |
40 |
gentoo-user@g.o mailing list |