http://docs.python.org/2/library/subprocess.html
On Unix with shell=True, the shell defaults to /bin/sh
请注意,/ bin / sh通常与不同的符号链接,例如在ubuntu上:
$ ls -la /bin/shlrwxrwxrwx 1 root root 4 Mar 29 2012 /bin/sh -> dash
您可以使用
executable参数替换默认值:
…如果shell = True,则在Unix上,可执行参数为默认的/ bin / sh指定替换shell。
subprocess.call("if [ ! -d '{output}' ]; then mkdir -p {output}; fi", shell=True, executable="/bin/bash")


