![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
awk help please
My source file looks like this :-
These packages installed on the source system are inconsistent with this system: SUNWscsa1394: not installed (11.10.0,REV=2005.01.21.15.53) These patches installed on the source system are inconsistent with this system: 118833: version mismatch (18) (36) 118872: version mismatch (03) (04) I want to get the first block from "These Packages" to the next line that starts with "These" (it may not say "These Patches", but it always starts with the word "These") This works until the word delimiting the block is not patches:- hq5@un128r4904 $ nawk -F' |:|\t' '/packages installed on the source system are inconsistent/,/patches/ { print $0 }' $zoneAttachOutfile.start These packages installed on the source system are inconsistent with this system: SUNWscsa1394: not installed (11.10.0,REV=2005.01.21.15.53) These patches installed on the source system are inconsistent with this system: hq5@un128r4904 $ This doesnt work :- hq5@un128r4904 $ nawk -F' |:|\t' '/packages installed on the source system are inconsistent/,/These/ { print $0 }' $zoneAttachOutfile.start These packages installed on the source system are inconsistent with this system: How can i set the range in awk to get all lines between "packages installed on the source" and the NEXT occurence of the word "These" ??? Thanks in advance Rep |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|