mblaze/contrib/mcount

11 lines
206 B
Bash
Executable File

#!/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" }
'