If you try to sudo your way through a command with pipes and/or redirects, part of the sequence of commands may be producing sudo-read/writeable streams of data or data objects, which the other parts of the sequence can't use because they were spawned by your shell and not root.
The solution is to embed the appropriate part of the command in quotes. Like this.
And here is the latest LJ video: The Find Command.








Comments
I love find -- but then again, I liked APL, too. They have a lot in common.
Posted by: D. C. Sessions | March 31, 2009 8:21 PM
I have always wanted to know how to make sudo do that. Great link.
Posted by: Wayne Conrad | April 1, 2009 3:34 PM
I find that the easiest way to get around issues with sudo is sudo passwd root. I'm old school like that. :)
Posted by: egaeus | April 4, 2009 12:32 AM