生成realplay卸载脚本的脚本

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
qqttdh
帖子: 896
注册时间: 2007-07-20 22:15

生成realplay卸载脚本的脚本

#1

帖子 qqttdh » 2008-08-06 6:50

抛砖引玉........

代码: 全选

#!/bin/bash
#$1=install.log
echo "#!/bin/bash" >real_uninstall
echo rm -f `cat $1| grep "install -m"| awk '{print $5}'` >>real_uninstall
echo "`cat $1| grep novendor |grep -v "su root"| sed 's/install/uninstall/g'`" >>real_uninstall
echo "xdg-icon-resource forceupdate" >>real_uninstall
echo "`cat $1| grep "su root -c"| sed 's/su root -c -- //g'| sed 's/ "realplay %s"//g'| sed 's/ false//g'| sed 's/ true//g'| sed 's/ --type=bool//g'| sed 's/ --type=string//g'|sed 's/set/unset/g'|sed 's/install/uninstall/g'`" >>real_uninstall
a=`cat $1| grep "ln -sf"| sed -n '1p;1q'| awk '{print $4}'| sed 's/nphelix.so//g'`
echo "rm -f $a/nphelix.so" >>real_uninstall
echo "rm -f $a/nphelix.xpt" >>real_uninstall
a=`cat $1| grep "ln -sf"| sed -n '3p;3q'| awk '{print $4}'| sed 's/nphelix.so//g'`
echo "rm -f $a/nphelix.so" >>real_uninstall
echo "rm -f $a/nphelix.xpt" >>real_uninstall
a=`cat $1| grep "ln -sf"| sed -n '5p;5q'| awk '{print $4}'| sed 's/nphelix.so//g'`
echo "rm -f $a/nphelix.so" >>real_uninstall
echo "rm -f $a/nphelix.xpt" >>real_uninstall
echo rm -f `cat $1| grep "ln -s "|awk '{print $4}'` >>real_uninstall

dirc=`cat $1|grep "files extracted to"|awk '{print $4}'|sed 's/://g'`
echo rm -fr "$dirc" >>real_uninstall

chmod 755 real_uninstall
头像
Stupid kid
帖子: 416
注册时间: 2006-10-18 12:57

#2

帖子 Stupid kid » 2008-08-06 8:40

这个比较有创意,呵呵,
http://twitter.com/nothining
Mail: [email protected]
南京的开源活动几乎是0,希望能有人组织下(也可以拉我入伙^_^)
最近在从零开始学习Linux程序设计,加油……
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

#3

帖子 bones7456 » 2008-08-06 8:53

:shock:
关注我的blog: ε==3
aBiNg
帖子: 1331
注册时间: 2006-07-09 12:22
来自: 南京

#4

帖子 aBiNg » 2008-08-06 16:49

不懂脚本,葱白一下。
头像
eagle5678
帖子: 1900
注册时间: 2006-07-08 14:07

Re: 生成realplay卸载脚本的脚本

#5

帖子 eagle5678 » 2008-10-20 10:52

生成空文件 :em06
头像
qqttdh
帖子: 896
注册时间: 2007-07-20 22:15

Re: 生成realplay卸载脚本的脚本

#6

帖子 qqttdh » 2008-10-20 18:31

eagle5678 写了:生成空文件 :em06
#$1=install.log

没那么自动化需要 realplay 目录下 的 install.log 文件作为参数
头像
eagle5678
帖子: 1900
注册时间: 2006-07-08 14:07

Re: 生成realplay卸载脚本的脚本

#7

帖子 eagle5678 » 2008-10-21 14:16

是啊,我就放在realplay的目录下

64的,装了这个,经常出错,又不想手动去del :em04

奇怪,过很久才生成文件……
回复