简体   繁体   English

等待进程完成的shell脚本,该脚本将在新终端中运行

[英]shell script waiting for process to finish which run in new terminal

I am trying to write shell script file for compiling refactorerl this is my code : 我正在尝试编写用于编译refactorerl的shell脚本文件,这是我的代码:

#!/bin/sh osascript -e 'tell application "terminal"' -e 'do script "cd /Users/MacBookAir/Desktop/refactorerl-0.9.14.09 && sudo bin/referl -build tool && exit "' -e 'end tell' code is runing ,but my problem is that I want terminal to wait till the build proccess is finishing then continue in this code Terminal is not waiting for the process to complite...I am using os x Yosetime 10.10.5 .....any idea...!?? #!/bin/sh osascript -e 'tell application "terminal"' -e 'do script "cd /Users/MacBookAir/Desktop/refactorerl-0.9.14.09 && sudo bin/referl -build tool && exit "' -e 'end tell'代码正在运行,但是我的问题是我要终端等待构建过程完成,然后继续执行此代码终端不等待进程完成...我正在使用os x Yosetime 10.10.5。 ....任何想法...!?? tnx n

Instead of letting osascript parse your && logic, maybe you can change it bit like that: 不用让osascript解析您的&&逻辑,也许您可​​以像这样更改它:

osascript -e 'tell application "terminal"' -e 'do script "cd /Users/MacBookAir/Desktop/refactorerl-0.9.14.09"' -e 'end tell' && sudo bin/referl -build tool 

If script 如果脚本

cd /Users/MacBookAir/Desktop/refactorerl-0.9.14.09

succeeds, run 成功,跑

sudo bin/referl -build tool

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM