如何在shell脚本中启动程序并使shell脚本继续,即使程序保持打开状态

Jak*_*ake 6 bash shell

我在Ubuntu上使用bash.我想有一个shell脚本打开一个程序并继续执行shell脚本的下一行,即使该程序尚未终止.

Fre*_*ihl 7

添加&到命令会将其置于后台.

例:

/path/to/foo    
/path/to/bar     # not executed untill foo is done


/path/to/foo &    # in background
/path/to/bar &    # executes as soon as foo is started
Run Code Online (Sandbox Code Playgroud)

在这里这里阅读更多关于工作控制的信息