repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Drop main() prototype. Syncs with NetBSD-8
[minix.git]
/
usr.sbin
/
traceroute
/
mean.awk
blob
75cc421a60a121c0fcf7a48be5d8c895a79c3d08
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
}