Hello,
I am using the following script to read some log and then contruct my email for notification.
When I run this on my test server, i am getting the output as below,
Quote:
Divison Name: International Private Banking Solutions
Divison Number: 13
Suspended Rule Code + Rule Name: P123 High wire count personal
Time of Suspension: 2008-12-15 08:42:30.549502
Disclaimer: THIS IS AN AUTOMATED E-MAIL. PLEASE DO NOT REPLY TO THIS ADDRESS.
But when I move to another server, the EOL seems to not affect,
Quote:
Divison Name: International Private Banking Solutions Divison Number: 13 Suspended Rule Code + Rule Name: P123 High wire count personal Time of Suspension: 2008-12-15 08:42:30.549502
Disclaimer: THIS IS AN AUTOMATED E-MAIL. PLEASE DO NOT REPLY TO THIS ADDRESS.
should I use some setting so the output is consistent across servers?
while true; do
sleep 30
if [ -a $FILE_NAME ]; then
curr_rec_cnt=`grep '^AML Rule' $FILE_NAME | wc -l`
else
curr_rec_cnt=0
fi
#echo $curr_rec_cnt
while [ $prev_rec_cnt -lt $curr_rec_cnt ]
do
#echo $prev_rec_cnt , $curr_rec_cnt
#Check if there are more than one records to notify
i=`expr ${line_count} + 1`
j=`expr ${line_count} + 9`
sed -n $i,"$j"p $FILE_NAME > $LOG_DIR/mailBuffer
prev_rec_cnt=`expr $prev_rec_cnt + 1`
line_count=$j
SUBJECT=`grep 'AML Rule' $LOG_DIR/mailBuffer`
echo "$MAIL_DIS_TO" >> $LOG_DIR/mailContent.dat
echo "$MAIL_FROM" >> $LOG_DIR/mailContent.dat
echo "$MAIL_PRIORITY" >> $LOG_DIR/mailContent.dat
echo "Subject: $SUBJECT" >> $LOG_DIR/mailContent.dat
awk '/AML Rule/{c=5;next}c{c--;print}' $LOG_DIR/mailBuffer >> $LOG_DIR/mailContent.dat
echo "$MAIL_DISCLAIMER " >> $LOG_DIR/mailContent.dat
cat $LOG_DIR/mailContent.dat | sendmail $MAIL_DIS_TO
rm $LOG_DIR/mailContent.dat $LOG_DIR/mailBuffer
sleep 30
done
done
Thanks!