1#!/bin/awk -f 2# $NetBSD: mean.awk,v 1.5 1997/10/04 16:31:29 christos Exp $ 3/^ *[0-9]/ { 4 # print out the average time to each hop along a route. 5 tottime = 0; n = 0; 6 for (f = 5; f <= NF; ++f) { 7 if ($f == "ms") { 8 tottime += $(f - 1) 9 ++n 10 } 11 } 12 if (n > 0) 13 print $1, tottime/n, median 14} 15