Sponsored Content
Full Discussion: Sendmail, EOL not effecting
Top Forums Shell Programming and Scripting Sendmail, EOL not effecting Post 302270627 by cv_pan on Monday 22nd of December 2008 10:31:22 AM
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!
 

7 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

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. 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

6. 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

7. 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
PMDASENDMAIL(1) 					      General Commands Manual						   PMDASENDMAIL(1)

NAME
pmdasendmail - sendmail performance metrics domain agent (PMDA) SYNOPSIS
$PCP_PMDAS_DIR/sendmail/pmdasendmail [-d domain] [-l logfile] [-U username] DESCRIPTION
pmdasendmail is a sendmail Performance Metrics Domain Agent (PMDA) which exports mail traffic statistics as collected by sendmail(1). Before the sendmail PMDA can export any metrics, sendmail(1) must have statistics collection enabled. This involves checking the name of the statistics file, as given by the OS or O StatusFile control lines in /etc/sendmail.cf, and then creating this file if it does not already exist. Removing the file will terminate statistics collection by sendmail(1) and hence the sendmail PMDA. A brief description of the pmdasendmail command line options follows: -d It is absolutely crucial that the performance metrics domain number specified here is unique and consistent. That is, domain should be different for every PMDA on the one host, and the same domain number should be used for the same PMDA on all hosts. -l Location of the log file. By default, a log file named sendmail.log is written in the current directory of pmcd(1) when pmdasendmail is started, i.e. $PCP_LOG_DIR/pmcd. If the log file cannot be created or is not writable, output is written to the standard error instead. -U User account under which to run the agent. The default is the unprivileged "pcp" account in current versions of PCP, but in older versions the superuser account ("root") was used by default. There are no communication options, as the Install script ensures the sendmail PMDA will be connected to PMCD by a pipe. INSTALLATION
If you want access to the names, help text and values for the sendmail performance metrics, do the following as root: # cd $PCP_PMDAS_DIR/sendmail # ./Install If you want to undo the installation, do the following as root: # cd $PCP_PMDAS_DIR/sendmail # ./Remove pmdasendmail is launched by pmcd(1) and should never be executed directly. The Install and Remove scripts notify pmcd(1) when the agent is installed or removed. FILES
$PCP_PMCDCONF_PATH command line options used to launch pmdasendmail $PCP_PMDAS_DIR/sendmail/help default help text file for the sendmail metrics $PCP_PMDAS_DIR/sendmail/Install installation script for the pmdasendmail agent $PCP_PMDAS_DIR/sendmail/Remove undo installation script for the pmdasendmail agent $PCP_LOG_DIR/pmcd/sendmail.log default log file for error messages and other information from pmdasendmail /etc/sendmail.cf sendmail configuration file to identify the name of the statistics file PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura- tion file, as described in pcp.conf(5). SEE ALSO
pmcd(1) and sendmail(1). Performance Co-Pilot PCP PMDASENDMAIL(1)
All times are GMT -4. The time now is 09:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy