我在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工作流程。
答案 0 :(得分:1)
使用-W
的{{1}}标志来等待应用退出:
open