版权声明:墨痕诉清风 https://blog.csdn.net/u012206617/article/details/85074949
if [ ! `rpm -qa | grep -n ^$i-[0-9].` ] ; then
yum install -y $i
[ $? -ne 0 ] && echo 'yum cannot install '$i && yum_right=3
fi
if [ ! `rpm -qa | grep -n ^$i-[0-9].` ] ; then
yum install -y $i
[ $? -ne 0 ] && echo 'yum cannot install '$i && yum_right=3
fi