它也许是外壳处理这些字符的一种特殊的方法(只有在C语言兼容模式才有用)。 子外壳(subshell) 第七章中“复合命令”提到的一组命令可以使用大括号组合在一起。这些命令就像被分配给了一个组,而且只返回一个状态码。
基于60个网页-相关网页
例如,在清单9中,如果第一个rsync失败,则子外壳将继续运行下一个命令。
In Listing 9, for example, if the first rsync failed, then the subshell would just continue and run the next command.
通过使用子外壳,可以对整个块(而不是单个命令)的标准和错误输出进行集体重定向。
Using the subshell, you can collectively redirect their standard and error output for the entire block instead of for each individual command.
如果没有使用exec,那么jvm会作为执行run脚本的外壳的一个子进程启动。
If you did not use exec, the JVM would start as a child process of the shell that is executing the run script.
应用推荐