"Najamuddin, Junaid" wrote:

> 1. How to go thru a log.txt file to check for an error string thru perl script

Show me how does the typical error message look like and I'll show you
how to find such messages using Perl. If you just want to see lines
which contain "error" string anywhere, use from the command line:

  perl -ne 'print if /error/' log.txt

or without using perl (I know, I know, not a politically correct
advice), you can just:

  grep error log.txt

if there is a grep command in NT. It should be, as it's one of the most
important commands for text processing.

If you don't have grep, get it from:
http://www.gnu.org/software/grep/grep.html

Install also the GNU textutils:
http://www.gnu.org/software/textutils/textutils.html

With grep, textutils and perl, you'll be able to do just anything you
want with any text you like. (Well, now that IS politically correct)

Generally when I get any not GNU-based Unix system in my hands, I start
from installing the GNU tools, which is probably even a better idea
under NT which AFAIK lacks such tools for command-line text processing
(correct me if I'm wrong).

- RaFaL Pocztarski, [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to