Get the App
SLTechnology News&Howtos  ›  Database  › 

OGG Operation and maintenance Optimization script (6)-Information Modification Class-batch uncomment

Shulou Source: shulou.com Published: 2022-06-01 06:57:17 11月16日 Update

File name: recomment.sh

Path: $HOME/ggscript/ggcomment

Function: this script is used to cancel comments in batches, and it is used with batch comment scripts. The basic function is opposite, and the operation procedure is exactly the same. Select to use through the edit script

Log path: $HOME/gglog/ggcomment

#! / bin/bashbackuptime= `date +% Y% m% dvalecho% 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 1ls-lrt $HOME/ggserver/dirprm/*.prmread-p "Please enter the prm file name:" valecho "Please Enter the table you need to reannotate" read-n 1vi annotmpecho "--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.bakecho "backup the'$val' to the'$HOME/ggserver/dirprm/bak/$val.$backuptime.bak'" >'$HOME'/gglog/ggcomment/reannoLog-'$backuptime'.log'echo checho "Operating table you want to belong to what state?" select ch in "parameter"noparameter" "REPLICAT"exit" docase $ch in "parameter") sed's / ^ / TABLE / 'annotmp > table1 sed's Compact accounts / / 'table1 > table2break ; "noparameter") sed's / ^ / TABLE / 'annotmp > table1 sed's sed' table1 > table2break;;; "REPLICAT") sed's / ^ / MAP / 'annotmp > table1 sed's MAP' table1 > table2break;;; "exit") echo "process complete" break *) echo "Please select your choice:" 1.parameter "2.noparameter"3.REPLICAT"exit";; esacdone;echo $TALi=1num= `sed-n'$= 'table2`while ["$I"-le "$num"] do TAL= `sed-n $ifolp`table2` echo $TAL echo-- $TAL sed "s/--$TAL/$TAL/g" $HOME/ggserver/dirprm/$val > tmp2 cat tmp2 > $HOME/ggserver/dirprm/$val ((iTable+)) Done echo "process complete" > >'$HOME'/gglog/ggcomment/reannoLog-'$backuptime'.log'

Tags: Scripts comments functions paths consistency files file names logs steps selections information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Microsoft Apple Redmi macOS