blob: 7cfc6feb6a63ce152ceeecc5abc89580c9190edd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/sh
# avg -- print averages for multiple typ result files
awk '
{
v[FNR] += $1
$1 = ""
sub(/^ /, "", $0)
t[FNR] = $0
}
END {
for (i = 1; i<=5; i++)
printf("%.4f\t%s\n", v[i] / (ARGC-1), t[i])
}' "$@"
|