1*41126Sbostic#!/bin/awk -f 2*41126Sbostic# 3*41126Sbostic# Copyright (c) 1990 The Regents of the University of California. 4*41126Sbostic# All rights reserved. 5*41126Sbostic# 6*41126Sbostic# This code is derived from software contributed to Berkeley by 7*41126Sbostic# Van Jacobson. 8*41126Sbostic# 9*41126Sbostic# %sccs.include.redist.sh% 10*41126Sbostic# 11*41126Sbostic# @(#)mean.awk 5.2 (Berkeley) 04/28/90 12*41126Sbostic# 1341122Sbostic/^ *[0-9]/ { 1441122Sbostic # print out the average time to each hop along a route. 1541122Sbostic tottime = 0; n = 0; 1641122Sbostic for (f = 5; f <= NF; ++f) { 1741122Sbostic if ($f == "ms") { 1841122Sbostic tottime += $(f - 1) 1941122Sbostic ++n 2041122Sbostic } 2141122Sbostic } 2241122Sbostic if (n > 0) 2341122Sbostic print $1, tottime/n, median 2441122Sbostic} 25