grep in Shell script

Hello
I do want to write a script which will check any errors say "-error" in the log file then have to send email to the concern person . And the concern person will correct the error .

Next time if the script runs eventhough the error has been corrected it will send the email .

Also one more thing when ever transactions haappened system writes date as well in the log file

How do I write a script ? . I am using

LINE_FOUND=`grep '"error"' /$LOGNAME/logdir/socket.log | grep -v "grep" | grep - "sh -c"

Thanks
Krishna

Can we see a mockup of the the line of the logfile? When I see grep -v grep and grep - it seems like you have been at this too long.