about summary refs log tree commit diff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/mcount10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/mcount b/contrib/mcount
new file mode 100755
index 0000000..a6d1d5f
--- /dev/null
+++ b/contrib/mcount
@@ -0,0 +1,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" }
+'