您好我必须执行一个shell命令:diff <(ssh -n [email protected] cat /vms/cloudburst.qcow2.*)<(ssh -n [email protected] cat /虚拟机/ cloudburst.qcow2) 我试图Python执行复杂shell命令
cmd="diff <(ssh -n [email protected] cat /vms/cloudburst.qcow2.*) <(ssh -n [email protected] cat /vms/cloudburst.qcow2)"
args = shlex.split(cmd)
output,error = subprocess.Popen(args,stdout = subprocess.PIPE, stderr= subprocess.PIPE).communicate()
但是我收到一个错误DIFF:额外的操作猫
我很新的蟒蛇。任何帮助,将不胜感激
您正在将参数“<(ssh”,“-n”,“root @ ...”,“cat”字面地传递给diff工具。在shell中输入时,“<(...) “部分首先得到评估,并且生成的(文件)作为参数传递给diff命令。您使用的是什么shell? – niko
我正在使用bash – neorg