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\
I have a function defined in my .bashrc that makes this easier.
command_exists () { type "$1" &> /dev/null ; }
Here's an example of how it's used (from my .bash_profile.)
.bash_profile
if command_exists mvim ; then export VISUAL="mvim --nofork" fi