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 code> can (or
set -e code>)
To be closed when the set + o errexit code> (or
set code>) + e
Read More:
- Shell script: syntax error: bad for loop variable error resolution
- source, ~/.bashrc, ~/.bash_ Profile details
- Solve the problem of shell script “syntax error near unexpected token `fi'”.
- syntax error near unexpected token `then’ problem solution
- The Linux terminal appears bash: setup.bash : no such file or directory, and. Bashrc file
- Syntax error near unexpected token `newline’script cannot be executed
- Solve syntax error: unexpected end of file or /bin/bash^m: bad interpeneter: no match file or directory
- use cin.get () instead of system (“pause”) to avoid the flash of C + + programs
- Condition judgment and error handling in ansible playbook (fail module failed_when changed_when keyword)
- Linux shell gets the file name under the folder
- Solution to shell script invocation error during Xcode real machine test
- You are not allowed to upload merges in Git push
- 2017 vs can’t reference problem solution
- [tools] vscode debug report G + +. Exe no such file or directory fatal error no input files
- Shell script syntax error near unexpected token ‘$’Do
- Hive view execution plan
- standard_init_linux.go:211: exec user process caused “exec format error”
- Differences between shell script variable assignment and C language variable assignment
- Solution to shell script error “expr: syntax error”
- Boot / etc/ rc.local What about invalidity? resolvent