Hi
Thanks a lot man...its nice to see the result...
I need one more info. actually am using sqlloader to insert the result in to a table. Here i want to print the previous date as well in dd-mon-yyyy format
i tried in this way
Code:
#!/bin/ksh
dat=$(./datecalc -a $(date +"%Y %m %d") - 1)
da_te=$(date +'%d')
da=$(($da_te-1))
mon=$(date +'%b')
year=$(date +'%Y')
host=$(hostname)
day=$(/usr/xpg4/bin/awk -v d="$dat" 'BEGIN {split(d,a," ");day=sprintf("%s%02s%02s",a[1],a[2],a[3]);print day}')
/usr/xpg4/bin/awk -v d="$day" -v serv="BSNLSERVICE1" -v val="2128" -v daet="$(($da)-($mon)-($year))" -v ho="$host"'
$1~day && $4==serv && $6==val {
s1++
}
END{
print daet, host,s1
}' $day*