AppleScript无需等待即可运行一组终端命令

时间:2013-01-21 22:26:25

标签: macos bash shell terminal applescript

我正在编写一个AppleScript应用程序。我的代码的do shell script部分看起来像这样:

unlink file.file; mv file1.file file2.file; sleep 3; open app.app;

无论如何,我需要在不中断脚本且不打开终端窗口的情况下运行它。我已经知道了> /dev/null 2>&1 &这个东西,但这对我来说不起作用,因为我需要按顺序运行这些,而我无法使用这样的多个命令。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

您可以将整个命令列表作为一个组运行:

{ unlink file.file; mv file1.file file2.file; sleep 3; open app.app; } >/dev/null 2>&1 &
相关问题