OGG运维优化脚本(六)-信息修改类--批量取消注释-创新互联
文件名:recomment.sh
成都创新互联公司是一家专注于网站制作、成都网站制作与策划设计,通化网站建设哪家好?成都创新互联公司做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:通化等地区。通化做网站价格咨询:18980820575路径: $HOME/ggscript/ggcomment
功能:该脚本用于批量取消注释,配合批量注释脚本使用,基本功能相反,操作步骤完全一致。通过edit脚本选择使用
日志路径:$HOME/gglog/ggcomment
#!/bin/bash backuptime=`date +%Y%m%d-%H%M` echo "This script is used to reannotate the specified table!(created by renyi)" echo $backuptime > ''$HOME'/gglog/ggcomment/reannoLog-'$backuptime'.log' read -n 1 ls -lrt $HOME/ggserver/dirprm/*.prm read -p "Please enter the prm file name:" val echo "Please Enter the table you need to reannotate" read -n 1 vi annotmp echo "---reannotate table --------" > ''$HOME'/gglog/ggcomment/reannoLog-'$backuptime'.log' cat annotmp >> ''$HOME'/gglog/ggcomment/annoLog-'$backuptime'.log' cp $HOME/ggserver/dirprm/$val $HOME/ggserver/dirprm/bak/$val.$backuptime.bak echo "backup the '$val' to the '$HOME/ggserver/dirprm/bak/$val.$backuptime.bak'" >> ''$HOME'/gglog/ggcomment/reannoLog-'$backuptime'.log' echo ch echo "Operating table you want to belong to what state?" select ch in "parameter" "noparameter" "REPLICAT" "exit" do case $ch in "parameter") sed 's/^/TABLE /' annotmp > table1 sed 's/$/,/' table1 > table2 break; ;; "noparameter") sed 's/^/TABLE /' annotmp > table1 sed 's/$/;/' table1 > table2 break; ;; "REPLICAT") sed 's/^/MAP /' annotmp > table1 sed 's/$/,/' table1 > table2 break; ;; "exit") echo "process complete" break; ;; *) echo "Please select your choice :"1.parameter" "2.noparameter" "3.REPLICAT" "exit"" ;; esac done; echo $TAL i=1 num=`sed -n '$=' table2` while [ "$i" -le "$num" ] do TAL=`sed -n $i'p' table2` echo $TAL echo --$TAL sed "s/--$TAL/$TAL/g" $HOME/ggserver/dirprm/$val > tmp2 cat tmp2 > $HOME/ggserver/dirprm/$val ((i++)); done echo "process complete" >> ''$HOME'/gglog/ggcomment/reannoLog-'$backuptime'.log'另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
当前名称:OGG运维优化脚本(六)-信息修改类--批量取消注释-创新互联
URL链接:http://cdiso.cn/article/dhhoeo.html