if ! type "$foobar_command_name" > /dev/null; then # install foobar here,or poping up some warning messages fi
references:
http://stackoverflow.com/questions/7522712/how-to-check-if-command-exists-in-a-shell-script
http://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script