首页 linux shell bash shell bash shell 判断软件是否安装 bash shell 判断软件是否安装2021年3月18日bash shell, linux, shell 最近写bash shell脚本 需要判断软件是否安装 去网上查了一下 有以下两种方式: 第一种方式: if [ ! "$(command -v git)" ]; then echo "git 没有安装" >&2 exit 1 fi 第二种方式: if ! [ -x "$(command -v git)" ]; then echo "git 没有安装" >&2 exit 1 fi 标签# bash 分享你的喜爱 上一页 文章 国内 wordpress Gravatar 头像无法显示/标签颜色/运行时间 下一页 文章 shell 语言注意事项 相关文章 centos 开机在读进度条卡死 2020年4月30日 Linux shell 中$() ` `,${},$[] $(()),[ ] (( )) [[ ]]作用与区别 2024年1月19日 linux 搭建ftp 2022年8月15日 MySQL数据库实时数据同步:方法与实践 2024年6月6日