Quotation Ugliness

Chris Angelico rosuav at gmail.com
Wed Nov 26 02:10:09 EST 2014


On Wed, Nov 26, 2014 at 5:04 PM, Tim Daneliuk <tundra at tundraware.com> wrote:
> Here's a usecase - I want to know whether I need
> to use a sudo password when the user passes a command on the command line
> of a program:
>
> someprog.py uname && sudo cat /etc/sudoers
>
> vs.
>
> someprog.py uname && echo "sudo cat /etc/suoders"
>
>
> In the first instance, I need the sudo passoword, in the second I don't.

This is actually needing the nesting concern that I raised. Compare:

someprog.py uname " ' " && sudo cat /etc/sudoers

But frankly, you have much MUCH bigger problems than quote characters.
Why not set up sudo to not require a password, rather than fiddling
with this?

ChrisA



More information about the Python-list mailing list