ringa_lee2017-04-17 11:53:11
$ set -e
If any code after this line of code returns a non-zero value, the entire script will exit immediately. The official explanation is to prevent errors from snowballing
$ set -o pipefail
The original explanation is as follows:
If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status,or zero if all commands in the pipeline exit successfully. This option is disabled by default.
can be understood as:
Tells bash to return the return value of the first pipe command from right to left that exits with a non-zero status, or 0 if all commands are executed successfully