sudo issue

blind Pete 0123peter at gmail.com
Wed Aug 3 04:32:44 UTC 2016


Karl Auer wrote:

> On Tue, 2016-08-02 at 21:24 +0200, Ralf Mardorf wrote:
>> The only workaround for wild card usage seems to be the shell.
> 
> Or something else that interprets the wildcard characters - a script in
> python, perl, awk etc. But regardless, you would be starting an
> additional program.
> 
> Regards, K.

OK I've had a look at the man pages; from the examples section of /man sudo/ 

     To make a usage listing of the directories in the /home partition.
     Note that this runs the commands in a sub-shell to make the cd and
     file redirection work.

           $ sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"

The command passed to sudo is "sh".  Sh executes the command after 
the "-c", that command includes a wild card, "*", which is expanded 
by the (sub)shell.  

-- 
blind Pete
Sig goes here...  





More information about the ubuntu-users mailing list