File: chlog-stats

package info (click to toggle)
kannel 1.4.5-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 15,816 kB
  • sloc: ansic: 105,621; sh: 32,061; xml: 20,360; php: 1,103; perl: 711; makefile: 560; yacc: 548; awk: 133; python: 122; javascript: 27; pascal: 3
file content (29 lines) | stat: -rwxr-xr-x 596 bytes parent folder | download | duplicates (8)
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
}