subprocess.Popen当 shell=True, shell 默认为 /bin/sh,设置成为以/bin/bash/执行
cmd = "ls -la"
ret = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
executable="/bin/bash")
output = ret.stdout.readlines()
print(output)
subprocess.Popen当 shell=True, shell 默认为 /bin/sh,设置成为以/bin/bash/执行
cmd = "ls -la"
ret = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
executable="/bin/bash")
output = ret.stdout.readlines()
print(output)