站长论坛

标题: linux下用for循环卸载openoffice [打印本页]

作者: dingjianping    时间: 2008-8-24 17:11
标题: linux下用for循环卸载openoffice
当需要安装高版本openoffice或openoffice出问题的时候,就需要卸载openoffice,但是openoffice的包相当多,如果一个一个地卸载,那就不知道要何年何月才能卸载完,所以写了一个脚本来卸载openoffice,脚本很简单,实际上就是一个for循环,大家可以举一反三,用同样的方法卸载其它包。

QUOTE:
shell> vi uninstallopenoffice.sh

for file in `rpm -qa|grep openoffice`
do
rpm -e --nodeps $file
done

shell> chmod +x uninstallopenoffice.sh


完成后运行uninstallopenoffice.sh就可以轻松地卸载掉openoffice了。




欢迎光临 站长论坛 (http://tzlink.com/bbs/) Powered by Discuz! X3.2