on-internet
← Community

Shell script to check a log file and print the errors that are found in it

Stack Overflow ·

I am pretty new to shell scripting . I am trying to write a script to check for logfile for errors (error strings are hardcoded), and i have to print the lines containing the error . i am able to write the logic but need pointers to read a file from user input. Appreciate the help thanks. Logic: Accept the logfile patch from user Check if the logfile is present or not If present search the file for lines containing the error string (eg. Error, ORA) Print the lines containing error strings , also write the output to a logfile Read the log file from user Set error strings search="ERROR" set a pa

Comments

Sign in or sign up to comment and upvote.

No comments yet.