summary refs log tree commit diff
path: root/contrib/mcount
blob: a6d1d5fd97dee4de69a5c61c6e0004fb87db9c66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
# mcount - count mails from sequence on stdin

[ -t 1 ] && stdout=1

awk -v stdout=$stdout '
  !/^ *</ { n++ }
  !stdout { print }
  END { fflush(); print n " mails processed" > "/dev/stderr" }
'