内容简介:The first statement is a Mac, GNU/Linux, and BSD portable way of finding the location of the bash interpreter. The second statement combinesReferences:
#!/usr/bin/env bash set -euo pipefail
The first statement is a Mac, GNU/Linux, and BSD portable way of finding the location of the bash interpreter. The second statement combines
- “set -e” which ensures that your script stops on first command failure. By default, when a command fails, bash executes the next command. Looking at the logs, you might feel that the script executed successfully while some commands might have failed.
- “set -u” which ensures that your script exits on first unset variable encountered. Otherwise, bash replaces the unset variables with empty default values.
- “set -o pipefail” which ensures that if any command in a set of piped commands failed, the overall exit status is the status of the failed command. Otherwise, the exit status is the status of the last command.
References:
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
JS 压缩/解压工具
在线压缩/解压 JS 代码
HSV CMYK 转换工具
HSV CMYK互换工具