gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 08:59:28 24 4
gpt4 key购买 nike

我在 Ubuntu 上使用 bash。我想让一个 shell 脚本打开一个程序并继续到 shell 脚本的下一行,即使程序没有终止。

最佳答案

向命令添加 & 将其置于后台。

例子:

/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

阅读更多关于作业控制的信息 herehere

关于bash - 如何在 shell 脚本中启动程序并让 shell 脚本继续,即使程序保持打开状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6948565/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com