Sendmail, EOL not effecting


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sendmail, EOL not effecting
# 1  
Old 12-22-2008
Sendmail, EOL not effecting

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!
# 2  
Old 12-23-2008
try this echo -ne "$VAR \n"
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. What is on Your Mind?

Internet Explorer EOL

Hard to imagine that in the two decades of its existence this product once ruled supreme, but the news is finally there: RIP Internet Explorer: Twitter mourns and mocks death of Microsoft (0 Replies)
Discussion started by: figaro
0 Replies

2. OS X (Apple)

No eol in swap file

I was editing a file with vi and crashed so when I opened the file again I had the .swp file to deal with. I made the wrong choice trying to recover my file and wound up with a file with no eol (end of line) characters. I have forgotten the code to substitute and don't want to make an even... (2 Replies)
Discussion started by: gale
2 Replies

3. AIX

How to remove ^M from the EOL?

The only way I know of is manually as follows: To remove for example ^M from a file: - vi the file name that has ^M at the end of each line. - Hit <Esc> - Type :g/ - Hold the CNTRL key and press V and M then release the CNTRL key At the buttom you should see this by now: ... (3 Replies)
Discussion started by: mrn6430
3 Replies

4. Linux

How to insert EOL?

How can I insert End of line (EOL) in Unix to file. Thanks (5 Replies)
Discussion started by: mrn6430
5 Replies

5. How to Post in the The UNIX and Linux Forums

Delete to eol after PASS with sed

working on script and saving ftp log before log save want to remove the password password appears after constant "PASS" thanks pp (1 Reply)
Discussion started by: ppaprota
1 Replies

6. Shell Programming and Scripting

Remove EOL selectively

Hi, I have a text as below test1 test2 test3\ test4 test5 test6 test7 newtest1 newtest2\ newtest3 newtest4 newtest5 And need this to be replaces to test1 test2 test3 test4 test5 test6 test7 newtest1 newtest2 newtest3 newtest4 newtest5 So my requirement is to remove the EOL... (5 Replies)
Discussion started by: praveenbvarrier
5 Replies

7. Shell Programming and Scripting

Using Unix screen cmd effecting Vi editor

Hello, I enjoy using the unix screen utility, but my vi sessions lose the ability to syntax highlight code and split screen(:vs or :sp). When not using screen, I can do those things within vi. Anybody experience this and know the fix? Thanks (1 Reply)
Discussion started by: geephei
1 Replies
Login or Register to Ask a Question