Need Korn script to compare server times
am 12.09.2007 17:55:58 von tweetlbug
I'm looking for help with writing a korn script that will take an
output (either cat or placed into a file) of different times, compare
them, and then report a difference of more than 3 minutes.
Thanks in advance!
Re: Need Korn script to compare server times
am 12.09.2007 18:36:56 von Ed Morton
tweetlbug@gmail.com wrote:
> I'm looking for help with writing a korn script that will take an
> output (either cat or placed into a file) of different times, compare
> them, and then report a difference of more than 3 minutes.
>
> Thanks in advance!
>
Assuming your "time" format is "seconds since the epoch" and they're one
per line, all you need is:
awk '(NR > 1) && ($0 - prev > 180);{prev=$0}' file
If you have different requirements, tell us what they are, provide
sample input and expected output, and show us what you've tried so far.
Ed.