start with something like this maybe:
Code:
#!/bin/sh
#
# email a message
# $1 = action
# $2 = count
# $3= user@myplace.com
email_it()
{
echo "Action: $1 count: $2" | \
/usr/bin/mailx -s "Action notification" "$3"
}
if [ $action = "A" ] ; then
email_it "ACTION WAS A" 42 "john.smith@some.com"
else
email_it "ACTION WAS B" 42 "john.smith@some.com"
fi