我不确定这个 bash 脚本中命令后的 &
是做什么的。
python alt_pg ${args} &
此外,我正在修改的脚本的原始版本在命令开头没有使用“python”,这与“&”有关吗?
最佳答案
&
在你的 linux shell 下的“后台”中运行 python alt_pg ${args}
;但是,该脚本仍然与 shell 相关联。因此,如果 shell 停止,脚本也会停止。
旁注:您可以使用 nohup python alt_pg ${args} &
取消脚本与 shell 的关联。如果您像这样生成脚本,则脚本在退出 shell 后仍然存在。
关于python - & 在 bash 命令之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11796791/