我在linux shell中执行了以下命令:
$ curl -s -K <\(echo user = "$AUTH") "${URI%/}"其中AUTH和URI是环境变量。我已经尝试用python程序以几种方式执行该命令:
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
)但是我总是收到这样的错误
"sh: 1: cannot open (echo: No such file"或
"sh: 1: Syntax error: "(" unexpected".在我看来,特殊符号的转义有问题。你能帮我解决这个问题吗?
发布于 2015-07-07 21:29:20
在以下位置运行命令:
cmd = "curl -s -K<conf_file> -u 'username:password' 'www.something.com'"
os.system(cmd)https://stackoverflow.com/questions/31269538
复制相似问题