<分区>
我尝试调试的第三方 Python 2.5 脚本让我陷入困境。脚本的相关部分是:
proc = subprocess.Popen(
"ls && source houdini_setup",
shell = True,
executable = "/bin/bash",
)
有一个守护进程监听5001端口并运行上面的脚本。当脚本运行时,它失败并出现以下错误:
_cygwin.py
houdini_setup
... (more files) ...
/bin/sh: line 0: source: houdini_setup: file not found
houdini_setup 文件非常多,如 ls 所示,事实上,如果我在上面的脚本中将“source”更改为“cat”,脚本会按预期打印 houdini_setup 的内容。此外,在真正的 bash shell 中运行上述命令也可以毫无怨言地获取文件。
有人知道这里发生了什么吗?