linux - Execute curl with parameters- Python 2.6.6 -


i have following command executed in linux shell:

$ curl -s -k <\(echo user = "$auth") "${uri%/}" 

where auth , uri environment variables. have tried execute command python program in several ways:

1.

import os b = os.popen('curl -s -k <(echo user = $auth) $uri').readlines() 

2.

import subprocess subprocess.call(     ['curl -s -k <(echo user = $auth) $uri'],     shell=true,stderr=subprocess.stdout ) 

but receive error of kind

"sh: 1: cannot open (echo: no such file" 

or

"sh: 1: syntax error: "(" unexpected". 

it seem me there problem escaping of special symbols. can me one?

run command in:

cmd = "curl -s -k<conf_file> -u 'username:password' 'www.something.com'"  os.system(cmd) 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -