How would I validate that a program exists, in a way that will either return an error and exit, or continue with the script?
It seems like it should be easy, but it\
Expanding on @lhunath's and @GregV's answers, here's the code for the people who want to easily put that check inside an if statement:
if
exists() { command -v "$1" >/dev/null 2>&1 }
Here's how to use it:
if exists bash; then echo 'Bash exists!' else echo 'Your system does not have Bash' fi