bash等待打开的应用程序完成后再继续

时间:2018-06-27 07:12:33

标签: bash macos

我在BASH脚本中的计时有问题。

#!/usr/local/bash
open /apps/my.app #this generates a text file; may take a few seconds. Then the app closes.
sed 's/....' new_text_file.txt; #this modifies the text file

sed发生之前,我如何最好地等待应用正常完成?当前,open命令设置诸如NOHUP之类的后台任务,脚本立即进入sed。 如果有帮助,则该应用程序是转换为应用程序的OSX Automator工作流程。

1 个答案:

答案 0 :(得分:1)

使用-W的{​​{1}}标志来等待应用退出:

open