#!/bin/sh
#
# simple script to extract "Folder" lines from log and summarize
#
if [ -z "$1" ]
then
    echo usage `basename $0` logfile
    exit 1
fi
if [ ! -f "$1" ]
then
    echo "$1" not found
    exit 2
fi
# first try didn't work because sed doesn't recognize \s and \d in regex!
#grep "Folder:" procmail.log | sed -e 's/\s\+\d\+//'
grep "Folder:" "$1" | sed -e 's/[ \t]\+[0-9]\+//' | sort | uniq -c
