What is the meaning of set -o pipefail
in the beginning of the shell script ?
man bash
says
pipefail
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.
Where "pipeline" is
command1 | command2 | command3
Without pipefail
, the return value of a pipeline is the exit status of the last command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With