script for finding an error from a log file

Hi ,

I have a doubt about a shell script to find an ERROR from the log file. But I need to specify a the scan from a particular date and time in the log. Till now I have developed the following script. Please suggest what shall I add in this for date and time. If the script finds a particular error it should throw 1 or else 0.

#!/bin/sh
# Script to find the error in the log file
ERROR="SCHD0061E"
read ERROR
if [ $ERROR="SCHD0061E" ] ;then
echo "1";
else echo "0"
fi

Kindly suggest what else is missing from this script. And how to specify the path for the log file .

Thanks & Regards

Post a sample log file

Kindly have a look at the sample of the log and suggest

Regards

Just have a look at below code. I assume that the Errors are logged in log.txt

grep -w "ERROR" log.txt | cut -d" " -f1,2,3 > ErrLog.txt

if [ -s ErrLog.txt ]
then
echo "Has Errors"
else
echo "No Errors"
fi

You posted the error file as a Word document. Is it truly a Word document?
Can you simply cut/paste a section of the log into your response. Make sure to use th Code Tag. [Highlight the section of your message, then press the \# icon button -- this will maintain formatting and spacing.]

Finally, if I understand you request, you are try to search from a particular data & time forward only. Please verify on this.

yes I need to develop a script that will look for an error only in the current date logs and will throw an alert mail to the mail ID

thanks