[sclug] sudo / su
Spencer Collyer
spencer at lasermount.plus.com
Wed Jan 10 07:17:36 UTC 2007
On Wed, 10 Jan 2007 01:52:22 +0000, Robin Lewis wrote:
> Darren Davison wrote:
> > hi SCLUGgers,
> >
> > I've necessarily become acquainted with sudo since switching from
> > gentoo to *ubuntu, but there's something I'm unclear on with it.
> >
> > If I try to do "sudo echo 1 > /proc/whatever" it fails with
> > permission denied errors. It only works if I "sudo su -" and then
> > change the value. Could someone kindly explain why?
> >
> > Many thanks :)
> Because of the way sudo and/or bash works with redirection, you're
> basically trying to output the result of "sudo echo 1" to
> /proc/whatever. I forget the way to get around this, but I'm sure
> someone with more knowledge than I will figure it out.
I've not tested this, but you could try wrapping the command in brackets:
sudo (echo 1 > /proc/whatever)
This should run the command in a subshell.
S>
--
<<< Eagles may soar, but weasels don't get sucked into jet engines >>>
7:16am up 64 days 15:55, 13 users, load average: 0.18, 0.13, 0.07
Registered Linux User #232457 | LFS ID 11703
More information about the Sclug
mailing list