shell 检测安装包

检测 wget 是否存在

rpm -q wget >/dev/null
if [ "$?" -ge 1 ];then
    echo "install wget,Please wait..."
    yum -y install wget
    rpm -q wget >/dev/null
    [ $? -ge 1 ] && echo "wget installation failure,exit" && exit
     echo "wget done"
     read
fi

 

posted @ 2018-04-04 15:15  01234567  阅读(197)  评论(0编辑  收藏  举报