File: mean.awk

package info (click to toggle)
traceroute 1.4a12-21
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 564 kB
  • ctags: 420
  • sloc: sh: 3,137; ansic: 2,542; makefile: 114; awk: 37
file content (12 lines) | stat: -rw-r--r-- 221 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
/^ *[0-9]/	{
	# print out the average time to each hop along a route.
	tottime = 0; n = 0;
	for (f = 5; f <= NF; ++f) {
		if ($f == "ms") {
			tottime += $(f - 1)
			++n
		}
	}
	if (n > 0)
		print $1, tottime/n, median
}