From ee72c869e865d41fcd100f61d164f3068416f8d5 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 30 Mar 2012 12:27:24 -0400 Subject: [PATCH] script to count items in Maildir folders. --- scripts/email/count_maildir.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/email/count_maildir.sh diff --git a/scripts/email/count_maildir.sh b/scripts/email/count_maildir.sh new file mode 100644 index 00000000..d9273831 --- /dev/null +++ b/scripts/email/count_maildir.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# counts up the files in each maildir 'cur' folder to find out how many messages are +# held in each subdirectory. + +pushd "$HOME/Maildir" &>/dev/null + +folderlist=$TMP/zz_folder_list.txt + +find . -name "cur" >$folderlist + +while read line; do echo -n "$line -- " ; find "$line" -type f | wc -l ; done < $folderlist + +popd &>/dev/null + +# how to sum the totals... +# another command perhaps. +# bash ~/count_maildir.sh | sed -e 's/.* -- \(.*\)$/\1/' | paste -sd+ | bc + -- 2.34.1