I have the following command executed in the linux shell:
$ curl -s -K <\(echo user = "$AUTH") "${URI%/}"
where AUTH and URI are environment variables. I have tried to execute the command with 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 I always receive an error of this kind
"sh: 1: cannot open (echo: No such file"
or
"sh: 1: Syntax error: "(" unexpected".
It seem to me there is a problem with the escaping of the special symbols. Can you help me with this one?