#!/bin/bash
#文件uninstall
#用法./uninstall kde
ip=`rpm -qa |grep $1`
i=0
for X in $ip; do
echo $X
i=`expr $i "+" 1`
done
echo ""
echo "count:"$i
i=0
for X in $ip; do
echo ""
i=`expr $i "+" 1`
echo "$i.uninstall "$X
select var in "yes" "no" ; do
break
done
if [ $var = "yes" ]; then
echo $X | gawk '{printf "yes ...";id="rpm -e "$0;system(id);print "ok"}'
else
echo "no ..."
fi
var="no"
done
#!/bin/bash
#文件uninstall
#用法./uninstall kde
ip=`rpm -qa |grep $1`
i=0
for X in $ip; do
echo $X
i=`expr $i "+" 1`
done
echo ""
echo "count:"$i
i=0
for X in $ip; do
echo ""
i=`expr $i "+" 1`
echo "$i.uninstall "$X
select var in "yes" "no" ; do
break
done
#用if有点问题,改用case
case $var in
"yes")
echo $X| gawk '{printf "yes ...";id="rpm -e "$0;system(id);print "ok"}'
;;
*)
echo "no ..."
;;
esac
done
i=0
for X in $ip; do
echo $X
i=`expr $i "+" 1`
done
echo ""
echo "count:"$i
i=0
for X in $ip; do
echo ""
i=`expr $i "+" 1`
echo "$i.install "$X
select var in "yes" "no" ; do
break
done
case $var in
"yes")
echo $X| gawk '{printf "yes ...";id="rpm -Uvh "$0;system(id);print "ok"}'
;;
*)
echo "no ..."
;;
esac
done