Tips For Gracefully Handling Errors In Sed Scripts
Catching Errors in sed Detecting errors is the first step towards handling them gracefully in sed scripts. The exit code of the last command executed is stored in the $? variable. Checking this variable after running sed allows detecting errors via non-zero exit codes. Using Exit Codes to Detect Errors A simple way to check…