在Bash中,如何判断某个命令是否存在?

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

你可能感兴趣的:(在Bash中,如何判断某个命令是否存在?)