#!/bin/sh
touch /var/log/messages.old
grep -v -f /var/log/messages.old /var/log/messages | grep PATTERN | mail -s "report" my@email.com
cp -p /var/log/messages /var/log/messages.old
tail -f logFileName | egrep "$errorList" | /usr/sbin/sendmail -s $EMAIL_SUBJECT $EMAIL_TO