0
SIZ=100
imap_cmd="""
curl -s -X GET --insecure -u xxx https://xxxxx/_search?pretty=true -d '{
"from":0,
"size":%SIZ,
"query":{ "match_all": {} },
"_source":["userEmail"]
}' | grep -i userEmail|awk {'print $3'} | cut -d ',' -f1
"""
def run_cmd(cmd):
p = Popen(cmd, shell=True, stdout=PIPE)
output = (p.communicate()[0])
return output
我試圖將SIZ(python)變量傳遞給curl命令,但它在執行命令時沒有解釋值。什麼,我在這裏失蹤將Python變量傳遞給三重引用的curl命令