bash等待打开的应用程序完成,然后继续
我对BASH脚本中的计时有问题bash等待打开的应用程序完成,然后继续,bash,macos,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。 如果
#!/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工作流,已转换为应用程序。使用
打开的-W
标志等待该应用程序退出:
#!/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