#!/bin/ksh
EMAIL_SUBJECT="Exceptions-Log"
EMAIL_TO="xyz@yahoo.com"
`grep "xception" Out.log >> /home/xyz/test1`
`cat /home/xyz/test1 | sed -n 's/.* ([^ ]*xception[^ ]*) .*/1/p' | awk '!x[$0]++' >> /home/xyz/test2`
`rm test3`
while read line
do
lineNum=`sed -n "/$line/,/EST/{=;q;}" Out.log`
let bl=$lineNum-5
let el=$lineNum+15
echo "*************************************************
$line
**************************************************
" >> test3
`sed -n "$bl,$el p" Out.log >> test3`
echo "
" >> test3
done < "/home/xyz/test2"
`cat test3 | /bin/mail -s $EMAIL_SUBJECT $EMAIL_TO`
|