1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/usr/bin/awk -f
#
# Compute some simple statistics from a ChangeLog file. Output has several
# columns:
#
# 1) number of changelog entries
# 2) total lines in changelog entries
# 3) average lines per entry
# 4) username
#
# Output is not sorted. Use "sort -n" to sort.
#
# Lars Wirzenius
/^[a-zA-Z0-9]/ {
match($NF, /<.*@/)
who = substr($NF, RSTART+1, RLENGTH-2)
if (who == "") who = $NF
entries[who]++
next
}
/[^ ]/ { lines[who]++ }
END {
for (who in entries)
printf "%4d %4d %.1f %s\n", entries[who], lines[who],
lines[who]/entries[who], who
}
|