first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / email / scavenge_emails_from_ldif.sh
1 #!/bin/bash
2 if [ $# -lt 1 ]; then
3   echo "$(basename $0) usage: the first parameter should be an"
4   echo "LDIF file that this script will extract email addresses from."
5   exit 1
6 fi
7 if [ ! -f "$1" ]; then
8   echo "$(basename $0): the file $1 does not seem to exist"
9   exit 1
10 fi
11 grep -i mail: "$1" | sed -e "s/^.*[Mm][aA][Ii][Ll]: *\(.*\)$/\1/" | tr A-Z a-z | sort | uniq | sort