sed in shell variable reference

  

! # / bin / the bash
ZipName /data/office_services/*.zip -LT-LS = `| head -1 | awk -F" / " 'of NF} {Print $'`
DATE DATE + = `the Y% m% D% `
FILEDATE /data/office_services/*.zip -LT-LS =` | head -1 | awk -F "/" 'of NF} {Print $' | * STAT .zip | awk -F "[- :.] +" '/ Change / {2 Print $ $ $. 3. 4}' `
Read -p" the Enter your LastVersion: "LastVer
Read -p" the Enter your NewVerVersion: "NewVer
CP LastVer -a $ {}} $ {NewVer
SLEEP 10
Sed -i" S / $ LastVer} / $ NewVer / G "the start.sh
IF [[FILEDATE == $ DATE $]]
the then
echo -e" Please wait decompressed ........... "
the unzip -qo ZipName} {$
SLEEP 5
SH ./start.sh
the else
echo -e "current file is not equal to the time of day, exit."
exit 0
fi

Guess you like

Origin www.cnblogs.com/cheyunhua/p/12068236.html