首页 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 语言注意事项 相关文章 linux 给新添加的硬盘创建分区 2022年5月7日 Find 使用 2022年6月22日 使用canal监听binlog将数据发送到RocketMQ同步到es 2024年6月6日 linux ssh篇 2021年11月13日