[ale] Redirection using sudo...?

KingBahamut gwosbahamut at gmail.com
Tue Jun 13 13:24:51 EDT 2006


Stepping out on a limb but

could you not do a

sudo sh -c {blah blah blah}?

or use

sudo -i (setting everything to root?)


On 6/13/06, Michael B. Trausch <fd0man at gmail.com> wrote:
>
> Okay, so I know that the shell itself implements redirection.  This is not
> a
> problem for me, as I use various forms of redirection and piping and such
> all the time.  However, I have wondered if there is a way to change how
> that works.
>
> Sometimes, I want to change something in /proc or /sys.  Doing something
> like:
>
> $ sudo echo "newvalue" > /sys/something
>
> Will never work, because it says "permission denied" because the
> redirection
> is done as my local user (in this case, fd0man).
>
> There are other solutions -- write a shell script that does it and execute
> the entire thing under sudo, or do "sudo su" and then perform the task
> using that.  Or, even, write a shell script that takes two arguments, the
> thing to echo, and the (presumably file) to echo it to.  However, I was
> wondering if there was some sort of shell construct that can be used on
> the
> command line to be something like:
>
> $ sudo { do something in a subshell as the sudo (root) user; }
>
> I tried simply using a block and that doesn't work, either.  Interesting.
>
> Does anybody know if there is such a thing that can be done such that
> redirection takes the elevated permissions by default, instead of
> redirection as the user running sudo (without creating scripts or using
> su)?
>
>         Thanks!
>         Mike
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
>
>


-- 
KingBahamut
Founder of the GWoS
All Around Geek
"I could tell you the probability, but you wouldnt like it."
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list