首页 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 语言注意事项 相关文章 Installing PHP 5.6 on CentOS 7 2020年2月3日 Ubuntu修改DNS方法 2023年12月28日 Python在字符串中引用变量 2022年7月17日 linux nfs 服务安装配置和使用 2022年5月7日