nice new tool to show version of feisty meow
[feisty_meow.git] / scripts / email / count_maildir.sh
1 #!/bin/bash
2
3 # counts up the files in each maildir 'cur' folder to find out how many messages are
4 # held in each subdirectory.
5
6 pushd "$HOME/Maildir" &>/dev/null
7
8 folderlist=$TMP/zz_folder_list.txt
9
10 find . -name "cur" >$folderlist
11
12 while read input_text; do echo -n "$input_text  -- " ; find "$input_text" -type f | wc -l ; done < $folderlist
13
14 popd &>/dev/null
15
16 # how to sum the totals...
17 # another command perhaps.
18 # bash ~/count_maildir.sh | sed -e 's/.* -- \(.*\)$/\1/' | paste -sd+ | bc
19