首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >bash等待打开的应用程序完成后再继续

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

Stack Overflow用户
提问于 2018-06-27 07:12:32
回答 1查看 828关注 0票数 2

我对BASH脚本中的时间设置有问题。

代码语言:javascript
运行
复制
#!/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自动工作流转换成一个应用程序。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-27 07:27:03

使用-W标志open等待应用程序退出:

代码语言:javascript
运行
复制
#!/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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51056630

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档