我想使用 python 子进程模块的子shell 和重定向的魔力,但它似乎不起作用,抱怨意外标记是括号。例如,命令
cat <(head tmp)
当传递给子进程时给出了这个
>>> subprocess.Popen("cat <(head tmp)", shell=True)
<subprocess.Popen object at 0x2b9bfef30350>
>>> /bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `cat <(head tmp)'