I have a log file in which I need to check if there are any error messages, if there are, extract the error message to another file.
Like this I may have error file for the different file have different log patterns. So how can I search matching pattern using a variable?
As I want to create one generic
.sh file for all log files. Suppose I have one file in which I want to search to pattern and print in another file
$pat2="RAISE_ERROR_SEEN". I want all lines from file b/w these two patterns.
Using variable only.