summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-31 08:22:00 +0200
committerErich Eckner <git@eckner.net>2018-07-31 08:22:00 +0200
commit11ab2070d0ec1ca7f9f0fdb4a23367014654efbb (patch)
tree1dab076d2d81d8886e21d62537bdd7055dfa607a
parentfcddafc7c802eb89671ff6df57ad231a8557caf1 (diff)
downloaddigest-mailer-11ab2070d0ec1ca7f9f0fdb4a23367014654efbb.tar.xz
digest-mailer.in: print summary of all subjects on digest mail
-rw-r--r--digest-mailer.in14
1 files changed, 14 insertions, 0 deletions
diff --git a/digest-mailer.in b/digest-mailer.in
index 43197d6..8d585f7 100644
--- a/digest-mailer.in
+++ b/digest-mailer.in
@@ -178,6 +178,20 @@ fi
counter=1
printf '%s\n' "${to_send}" | \
while read -r file; do
+ sed -n '
+ s/^Subject:\s*//
+ T
+ p
+ ' "${file}"
+ done | \
+ sort | \
+ uniq -c | \
+ sort -k1nr,1 -k2,2 | \
+ sed '
+ s/^\s*\([0-9]\+\)\s\+/\1: /
+ '
+ printf '%s\n' "${to_send}" | \
+ while read -r file; do
date=$(
printf '%s\n' "${file##*/}" | \
cut -d. -f3