首页 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 语言注意事项 相关文章 wordpress修改模板php文件更新出错 2019年6月11日 Flarum 安装 2021年5月28日 unraid 系统安装和读写速度问题 2021年3月12日 安装Kubernetes 2020年4月26日