我对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自动工作流转换成一个应用程序。
发布于 2018-06-27 07:27:03
使用-W
标志open
等待应用程序退出:
#!/usr/local/bash
open -W /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
https://stackoverflow.com/questions/51056630
复制相似问题