How to Trap Errors in Bash Scripts on Linux
Quick Links By default, a Bash script on Linux will report an error but keep running. Error Handling in Scripts Handling errors is part of programming. Even if you write flawless code, you might still run into error conditions. fatmawati achmad zaenuri/Shutterstock.com The default action of the Bash shell is to print an fault signal and continue to execute the script. This is a dangerous default. How disastrous that turns out to be, depends on what your script is trying to do....