I have a Bash parent script that on unexpected input calls an error logging child script that logs the error. I also want the execution to halt when the error occurs and th
Depending on your needs, using
set -e
at the top of your script might be a good solution. This will automatically cause the script to exit if any commands (e.g., your error checking script) exit with a non-zero exit code (https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/)
Note that there are some common commands that have non zero exit codes under normal circumstance.