1. Time Calculation
Starttime= 'Date+'%y-%m-%d%h:%m:%s''; Endtime=`Date+'%y-%m-%d%h:%m:%s''; Start_seconds=$(Date--Date="$starttime"+%s); End_seconds=$(Date--Date="$endtime"+%s);EchoEnd_seconds-start_seconds
2. Get the status code returned by the link
Checkurl='http://www.baidu.com'1 -S-w"%{http _code}" -o temp ${checkurl}
3.while...do,for cycle; condition to determine if; Exit program exit
while(' Curl--connect-timeout1-S-W "%{http_code}"-O temp ${checkurl} '! =' $' )) Do forIinch$(seq 1 -); Do Echo 'sleep countdown to wait URL is ok:'$(( --$i));Sleep 1; Done;//Countdown Endtime=`Date+'%y-%m-%d%h:%m:%s'`; Start_seconds=$(Date--Date="$starttime"+%s); End_seconds=$(Date--Date="$endtime"+%s); if[[$ (end_seconds-start_seconds)] > -]]; ThenExit1 fi
Done
4. String interception and substitution
checkurl=${line#*=} // intercept variable line, reserved checkurl=${checkurl/\$\{esmhost\}/sss to the right of equal sign } // Replace ${esmhost} in Checkurl with SSS
5. String substitution for text files
All ABC in the file is replaced by AAAAA
sed ' s#abc#aaaaa#g ' ./docker-compose.yml
6. Fuzzy Matching
If the variable contains the string ' Register.node.checkurl '
if ' Register.node.checkurl [ ]]; Then fi
Shell commands used in a development