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 03-15-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,556

Code:
awk 'BEGIN { 
     pat="one|two|four|five|six|eight|nine|ten|eleven|twelve"    
}
$0 ~ pat || (/three/ && !/threeException/ ) {print NR":"$0}
$0 ~ pat || (/seven/ && !/(SREE_seven|SRE_seven|VALUE_seven|PRODUCT_seven)/) {print NR":"$0}
$0 ~ pat || (/five/ && !/(fivefile|five:)/) {print NR":"$0}
' file