repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
usr.sbin
/
traceroute
/
mean.awk
blob
f6827f23f751954b39cca4dd1257ed6e7997f57f
1
#!/bin/awk -f
2
# $NetBSD: mean.awk,v 1.1.1.3 1997/10/03 22:25:25 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
}