home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / traceroute / vj_traceroute / mean.awk < prev    next >
Text File  |  1988-12-26  |  221b  |  13 lines

  1. /^ *[0-9]/    {
  2.     # print out the average time to each hop along a route.
  3.     tottime = 0; n = 0;
  4.     for (f = 5; f <= NF; ++f) {
  5.         if ($f == "ms") {
  6.             tottime += $(f - 1)
  7.             ++n
  8.         }
  9.     }
  10.     if (n > 0)
  11.         print $1, tottime/n, median
  12. }
  13.