updated to clean up compiler issues with how functions were used from basis namespace;
[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 line; do echo -n "$line  -- " ; find "$line" -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