Differences between revisions 1 and 2
Revision 1 as of 2002-10-06 19:42:56
Size: 426
Editor: SimonHuggins
Comment:
Revision 2 as of 2002-10-07 14:25:23
Size: 610
Editor: gate
Comment: Add adverbio
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
Another alternative is to use Adverbio from http://www.greenend.org.uk/rjk/2001/06/adverbio.html which helps avoid shell quoting issues.

{{{
sudo adverbio -o bar -- echo foo
}}}

CategoryComputingTips > SudoCompTips

Sudo Tips

Making redirection work

sudo echo foo >bar

may not work if you don't have write permissions as your user to the current directory as only the "echo foo" bit is passed to sudo.

Instead you can do things like:

sudo sh -c 'echo foo >bar'

It spawns another shell but the redirection will work.

Another alternative is to use Adverbio from http://www.greenend.org.uk/rjk/2001/06/adverbio.html which helps avoid shell quoting issues.

sudo adverbio -o bar -- echo foo

TheEarthWiki: SudoCompTips (last edited 2008-02-19 15:39:13 by localhost)