944,028 Members | Top Members by Rank

Ad:
Aug 9th, 2007
0

Sendmail Log Watch

Expand Post »
Hi All,

This is my 1st post in this forum, and new to shell scripting too, so to start with I would like to share something I have created today

My Question: I would like to get the output of this script in a html page.
===========================================
#!/bin/bash
echo -n "Enter an Date - Example --> (Aug 9 or Aug 10):"
read dt
echo -n "Enter an Domain:"
read d

rm -rf /tmp/time /tmp/src /tmp/dst /tmp/spt /tmp/dpt

cat /var/log/maillog | grep "$dt"| grep "$d" > /tmp/results

cat /tmp/results | gawk '{print $1,$2,$3,'\t'}' > /tmp/time
cat /tmp/results | gawk -F "ctladdr=" '{print $2}' | gawk '{print $1}' > /tmp/src
cat /tmp/results | gawk -F "stat=" '{print $2}' | gawk '{print $1}' > /tmp/spt
cat /tmp/results | gawk -F "relay" '{print $1}' | awk '{print $7}'| cut -b5-| tr -d '\>,' > /tmp/dspmail
cat /tmp/results | gawk -F "relay" '{print $2}' | gawk '{print $1}' | cut -b2- > /tmp/dst


echo ""
echo "TIME: Source: Stat: Destination Mail ID: Destination Server"
paste /tmp/time /tmp/src /tmp/spt /tmp/dspmail /tmp/dst
echo ""
=============================================
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ajaykajla is offline Offline
1 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Comparing two files...
Next Thread in Shell Scripting Forum Timeline: Greping variables from a file





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC