some information on error checking

HI all;
I am new to the KSH scripting and i was asked to do some error checking using KSH,in the log file, i donot know how to do error checking ,so please let me know some tips and the vague code if possible.

Thanks in anticipation
vinay

hi vinayrao,

i guess what this person intended was to filter a log file for error messages.
To do this propperly you need to learn regular expressions (see google).

  1. make a copy of a logfile you can use as example
  2. take a look at the file (using less,more) to find a common pattern for error messages
  3. construct a filter for that pattern

lets assume that all error messages start with ERROR.
that you can use the cmd 'grep' to filter for lines starting with ERROR (grep "^ERROR" logfile)
now you need to get some order in the resulting output. you may need to sort it (see: sort) and remove
double lines (see: uniq) or to cut certain fields (see: cut).

If your UNIX box is propper installed you
may take a look into the man pages for these commands. iff you have the gnu coreutils
you can also get a lot of help from 'info coreutils' (note: first read how to use the info reader).