diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-05-16 21:31:12 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-05-16 21:31:12 +0200 |
commit | 17fe13a95feccd83c4900be1f603618d22f980ae (patch) | |
tree | 2762bab889a1fab7efd7a527f1fc5097a0660205 /contrib/mcount | |
parent | 41a9a6b40d45939cd98e72c76a8c16dabcd84318 (diff) | |
download | mblaze-17fe13a95feccd83c4900be1f603618d22f980ae.tar.gz mblaze-17fe13a95feccd83c4900be1f603618d22f980ae.tar.xz mblaze-17fe13a95feccd83c4900be1f603618d22f980ae.zip |
add contrib/mcount, a tool to count mails (possibly between pipes)
Diffstat (limited to 'contrib/mcount')
-rwxr-xr-x | contrib/mcount | 10 |
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" } +' |