need help in detecting errors

Hi All ,

I need a script to find errors in a particular and in a particular path

Actually in my logs i`ve so many kinds of errors(i can even say as 100 types also).if i run the script i need to know the error (some errors can aviod )

so finally the script o/p should be a numeric (0,1,2...)

that numeric is equal to number of errors.

can you please provide me in detail with an example script.

thx in adv

We can't make a script to find errors until we have some idea what the errors look like.

we can do that by using Databse.
normally we can't do for that 100 types of errors.
if you want stil then you have to use switch case.

regards
rajesh

Hm. You may be able to do what you want with

grep -f errorlist logfile

grep will match every regex in errorlist against logfile and print lines that match. It will expect the strings in errorlist to be regular expressions, one per line.

You can make it use errorlist as a list of fixed strings instead with

grep -F -f errorlist logfile

Beware: If you leave any blank lines in the error list, it will interpret that blank line as an empty regex which will always match anything and everything.

Unfortunately, I can't fulfill your exact requirements until I have some idea what the log and the errors look like.