Syntax
Bash Stop on Errors Syntax
In Bash, stop on errors: exits the script when any command fails — set -e
Quick Answer
- Syntax
set -e
BashSyntax
Stop on Errors
Exits the script when any command fails.
How to stop on errors in Bash
- Open your Bash file or editor.
- Copy the example, then replace its sample names and values for your code.
Bash Stop on Errors Syntax
Use set -e.
Related Syntax References
Frequently asked questions
What is the Bash syntax for stop on errors?
Use this pattern: set -e
Can I copy this Bash code example?
Yes. Use Copy code and adapt the example to your program.
Is this Bash syntax different on Mac or Windows?
No. The language syntax is the same across operating systems.
Official source · How we verify