Call a shell command from Python

Grant Edwards grant.b.edwards at gmail.com
Tue Nov 1 09:42:03 EDT 2016


On 2016-11-01, Steve D'Aprano <steve+python at pearwood.info> wrote:
> On Tue, 1 Nov 2016 04:00 pm, Wildman wrote:
>
>> You are correct about that but, in this case grep never "sees" the '$'
>> sign.  Bash expands $USER to the actual user name beforehand.  If you
>> are on a Linux system, enter this into a terminal to illustrate:
>> 
>> sudo grep ^$USER\: /etc/shadow
>
> Bash is not involved here. Python is calling grep directly.

He's already been told this 6 times, and is willfully ignoring it.

Just give up.

-- 
Grant Edwards               grant.b.edwards        Yow! With YOU, I can be
                                  at               MYSELF ...  We don't NEED
                              gmail.com            Dan Rather ...




More information about the Python-list mailing list