[Gllug] sudo and more interesting commands

Stig Brautaset stig at brautaset.org
Fri Jul 2 11:39:31 UTC 2004


On Fri, Jul 02, 2004 at 12:33:01PM +0100, Tom Taylor wrote:
> $ sudo echo foo > bar
> 
> but that wouldn't work as only echo is being run as root, nor can I use
> a sub shell ... what can I do to sudo a command that is more complicated
> that <command> [args]??

 % sudo sh -c "echo foo > bar"

would do, but I guess that is disqualified by using a subshell?

Stig
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list