![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help in hour grep | ali560045 | Shell Programming and Scripting | 0 | 01-31-2008 03:03 AM |
| AIX 5.3 12 Hour System Clock | RTwitchell | AIX | 2 | 04-10-2007 05:02 PM |
| finding duplicate files by size and finding pattern matching and its count | jerome Sukumar | Shell Programming and Scripting | 2 | 12-01-2006 04:20 AM |
| an hour less in 24 hour system | bobo | UNIX for Dummies Questions & Answers | 3 | 10-23-2006 12:55 PM |
| 1 Hour less | bobo | UNIX for Dummies Questions & Answers | 6 | 05-16-2006 01:07 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi,
i have a logfile of a mail server it looks like this: d k 1004210238.380677500 1004210238.454490500 1004210238.679567500 3621 <VOLENDAM@Malawi.com> local.EDAM@Frankrijk.com 6053 81 I have got the following script to set the time in normal gmt time and to filter de failed messages, but i want that the script asks me what date and what time i want to filter at the beginning of the script. BEGIN{{print "list of failed mails:"} {print "---------------------------------------------"}} {if ($1 ~ /d/ && $2 ~ /z/) {nr =nr+1 ; printf $7" ""%s\n%s\n",(""), strftime("%c", $3) }} END {{print "---------------------------------------------"} {print "there are:",nr " failed mails"}} Can anybody help me ? Greetz Joost Last edited by Prince2; 05-22-2008 at 06:47 AM.. |
|
||||
|
okay i have the input part its like :
Code:
BEGIN {
printf "Date ?? (YYYY MM DD HH MM SS) "
getline date < "-"
start = mktime(date)
print "list of failed emails", date
print "-----------------------------------------------"
}
$1 == "d" && $2 == "d" && $3 >= start {
nr++
printf $7 "%s\n%s\n",(""), strftime("%c", $3)
}
END {
print "-----------------------------------------------"
print "there are:", nr, "failed emails"
}
But if i type my date at the beginning i have to put all info in there, YYYY,MM,DD,HH,MM,SS I want that i only have to say the year, month,day Can some body help me ? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|