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:
- An error commandnotfounderror (to initialize your shell) is reported when activating the virtual environment
- The list command in HBase shell reported an error org.apache.hadoop . hbase.PleaseHoldException : Master is initializing
- Shell script: syntax error: bad for loop variable error resolution
- Shell curl command reported an error: (60) SSL certificate problem: self signed certificate
- Solve the problem of shell script “syntax error near unexpected token `fi'”.
- Shell script syntax error near unexpected token ‘$’Do
- Error BC: command not found when git bash runs shell script
- An undetermined call to function ‘shell’: missing ‘. Stop. Problem encountered when using shell command in makefile
- When executing shell script, $’r ‘: command not found appears
- Shell script – EQ – Ne – GT – LT – ge – le
- When the mybatis field contains an expression, an error is reported when it is stored in the database
- Solution to shell script invocation error during Xcode real machine test
- NPM run serve reported an error “NPM err! Missing script: start”
- An error of 500 is reported when an item is assigned to a role
- Shell script running error bash: JPS: command not found
- If elif writing method of shell script
- An error occurs when HBase uses the shell command: pleaseholdexception: Master is initializing solution
- An error is reported when passing data pages using Ajax: Vue is not defined
- The build report plug-in reported an error in importing unit script (BRT_ Util.cs :error CS1525: Unexpected symbol `;’, expecting `)’, or `,’)
- Shell script execution error: “syntax error near unexpected token”