OS: SuSE Linux Enterprise Server 10
Hello All,
We wrote script as below to track error in our log file.
But getting error:
SrchKey="SRVE0133E: An error occurred while parsing parameters. java.io.IOException"
LogFile=/opt/dn/tst/PortalServer/log/SystemOut.log
MailTo="DN@mail.com"
[ ! -f /var/tmp/alert.last ] && touch /var/tmp/alert.last
egrep '$SrchKey' $LogFile > /var/tmp/alert.new
if [ -s /var/tmp/alert.new ] ;then
diff /var/tmp/alert.new /var/tmp/alert.last > /var/tmp/alert.msg
cp /var/tmp/alert.new /var/tmp/alert.last
{ -s /var/tmp/alert.msg ] &&
mailx -s "$SrchKey Alert" $MailTo < /var/tmp/alert.msg
fi
./err_tarck.sh
./err_tarck.sh: line 11: syntax error near unexpected token `fi'
./err_tarck.sh: line 11: `fi'
Any help will be appriciated. thx
D