•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,437 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,642 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1284 | Replies: 0
![]() |
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 ""
=============================================
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 ""
=============================================
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Spyware Check - HiJackthis file included, please check! (Viruses, Spyware and other Nasties)
- Clean out last errors (Viruses, Spyware and other Nasties)
- Can't remove w-find.com. HijackThis log provided (Viruses, Spyware and other Nasties)
- AIM trouble, mad crashes...please help! (Viruses, Spyware and other Nasties)
- Windows Explorer shuts down (HJT log) (Viruses, Spyware and other Nasties)
- Help Pls! I'm hijacked. (Viruses, Spyware and other Nasties)
Other Threads in the Shell Scripting Forum
- Previous Thread: Comparing two files...
- Next Thread: Greping variables from a file


Linear Mode