The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-27-2009
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,311
sed:

Code:
sed '/^<JOB/,/^\/JOB/!d; /^<\/*JOB/d' infile

awk:

Code:
awk '/^<JOB/,/^\/JOB/ {if ( $0 ~ /^<\/*JOB/ ) {next} else {print}}' infile