I have a few different bash scripts and want a way to check if any command included in the script had an error. Something like this in python to then check if there was an error or not.
The only thing close to this that I know in bash is $?
but afaik that can only be used to check if the last executed command had an error.
For an example here is one of the scripts.