Hi All,
My code,
awk '/:/{
if($3>20)
{
DATE1="date +'%Y%m%d-%T'"
DATE1 | getline DT
close("DATE1")
name=substr($2,1,7)
Date=substr(DATE1,1,8)
Da_T=substr($2,8,11)
VOL="/data/Gaps/"Da_T".txt"
{if((name~/eplz/ && Da_T~/ds09/) || (name~/epdo/ && Da_T~/ds09/))
{
next
}
else
{
printf "(%s) %s has a Gap of %s\n" ,DT,$2,$3 >> VOL
}
}
}
}' TimeGap.Rep
What I am trying to achive is that if there are no $3 greater than 20,
print "DT has no Gap\n" >> VOL at the END.
Many Thanks
Chris
My code,
awk '/:/{
if($3>20)
{
DATE1="date +'%Y%m%d-%T'"
DATE1 | getline DT
close("DATE1")
name=substr($2,1,7)
Date=substr(DATE1,1,8)
Da_T=substr($2,8,11)
VOL="/data/Gaps/"Da_T".txt"
{if((name~/eplz/ && Da_T~/ds09/) || (name~/epdo/ && Da_T~/ds09/))
{
next
}
else
{
printf "(%s) %s has a Gap of %s\n" ,DT,$2,$3 >> VOL
}
}
}
}' TimeGap.Rep
What I am trying to achive is that if there are no $3 greater than 20,
print "DT has no Gap\n" >> VOL at the END.
Many Thanks
Chris