Bash Scripting - Error Handling
You want to write a script that stops immediately if any command in a pipeline fails. Which combination of bash options should you use?
set -e behaviorset -e makes the script exit immediately if any command returns a non-zero status.set -o pipefail rolepipefail, set -e ignores failures in earlier pipeline commands because the pipeline exit status is from the last command.set -e and set -o pipefail ensures the script exits on any failure inside pipelines.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions