I have use your method , it didn't work .
Like:
sudo echo "sys-boot/grub:2 **" >>
/etc/portage/package.accept_keywords/package.keywords.grub2 echo
"sys-boot/grub:2 **" | sudo tee
/etc/portage/package.accept_keywords/package.keywords.grub2

And the result :
zjhui@gentoo ~ $ ls -l
/etc/portage/package.accept_keywords/package.keywords.grub2
-rw-r--r-- 1 root root 0 Jul  1 10:37
/etc/portage/package.accept_keywords/package.keywords.grub2

It's an empty file.


2012/7/1 Éric DUNAND <eric.dunand...@eriknet.eu>

> Le Sat, 30 Jun 2012 19:48:28 +0100,
> Neil Bothwick <n...@digimed.co.uk> a écrit :
>
> > On Sun, 1 Jul 2012 01:27:49 +0800, 赵佳晖 wrote:
> >
> > > In some cases , when i run somethings with "sudo" , it tells me
> > > "Permission Denied" , then i should turn to root . i forgot to
> > > record the cases .  Did anyone have any ideas ?
> >
> > Are you trying to redirect the output? That can give this message
> > because the redirection is performed as the user running sudo, not as
> > root.
> >
> >
>
> If Neil is right, you may want to read man tee. It work roughly like
> that:
> instead of                       do
> sudo echo sthg > /etc/file.cfg   echo sthg | sudo tee /etc/file.cfg
> sudo echo sthg >> /etc/file.cfg  echo sthg | sudo tee -a /etc/file.cfg
> --
> Éric DUNAND
>
>


-- 
好好学习,天天向上!!!

Reply via email to