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中,如何判断某个命令是否存在?
最新推荐文章于 2023-10-11 09:42:59 发布