Hi,
I need to create a script that does the following:
1. Read the file for the occurrences of "EXECUTE" and "END" strings.
There will be several occurrences of EXECUTE and END strings on the file.
2. The resulting lines in #1, needs to be searched for the word "Error|failed|error|warning", if the word error occurs on the line, prints the specific line and 1 line above it.
Here's a sample input file:
HTML Code:
-------------------------------< EXECUTE >----------------------------
This session consists of: Feature R-state Install-type Upgrade-from
------------------------------------------------------------------------
conf_system R3C01 upgrade R3B03
------------------------------------------------------------------------
------------------< CIF(conf) 2008-04-08 02:31:28 >--------------------
----------------------< END 2008-04-08 02:31:57 >---------------------
-------------------------------< EXECUTE >-----------------------------
---------< FM(fm_core,fmba,fmaa,fmx,fmav) 2008-04-08 03:14:09 >-------
[main] Error installing feature [fmx] - com.er.nm.if.ist.NoMatchingUpgradeClauseFoundException:
--------------------------< END 2008-04-08 03:22:51 >------------------
The output should be:
HTML Code:
---------< FM(fm_core,fmba,fmaa,fmx,fmav) 2008-04-08 03:14:09 >-------
[main] Error installing feature [fmx] - com.er.nm.if.ist.NoMatchingUpgradeClauseFoundException:
I'm not familiar with awk command, and if you can guide me on this please?
Any help is greatly appreciated.
//racbern