Tag Archives: + Operation/operations

The shell script exits after an error is reported

When you’re doing DevOps or Continuous Integration or Continuous Delivery, you sometimes write shell scripts.
However, in the sequential execution of the shell script, there may be an intermediate stage that will report an error, and the execution will continue.
So how do you avoid the problem of quitting later execution when something goes wrong?
Reference code:

#!/bin/bash
set -o errexit

Add at the beginning of the set -o errexit can (or set -e )
To be closed when the set + o errexit (or set ) + e