The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-17-2008
himvat himvat is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 68
Smile 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


Last edited by himvat; 11-17-2008 at 03:25 PM..