在Bash中是否有可能从另一个shell脚本调用一个shell脚本,但没有原始脚本等待子脚本完成?
只需用&分叉即可。 如在sh /path/to/script/script.sh &
&
sh /path/to/script/script.sh &
这将打印来自下标的消息,但是可以用&replace& >/dev/null &并禁止输出。
>/dev/null &
您应该使用“nohup”来确保即使您的用户已注销,stream程/脚本也会完成:
nohup /my/script.sh &