如何验证程序是否存在,以返回错误并退出或继续脚本的方式?
看起来应该很容易,但它一直在困扰我.
bash
我正在编写我的第一个shell脚本.在我的脚本中,我想检查是否存在某个命令,如果不存在,则安装可执行文件.我该如何检查此命令是否存在?
if #check that foobar command doesnt exist then #now install foobar fi
shell
bash ×1
shell ×1