# Print an error message in red and exit if this program returns an error
and have it print out if ! some_program
then
echo -e "\e[31msome_program failed\e[0m"
exit 1
fi
makes it so much quicker to cobble together something that works without having to context switch and go Google something. That being said, I've found when writing more complex code it has a real tendency to introduce subtle bugs that can really catch you out if you're not paying attention.