The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 07-17-2008
SAMZ SAMZ is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 18
Quote:
Originally Posted by phemanth24 View Post
BTW, you could also bypass putting this into a script.


Code:
awk '/(^A)|(^B)/ {num++} END {if(num > 0);printf("%d instances of A,B exist\n", num);}' column

'column' is the file where I have the format you specified.
Ok the above only tell me how many times A or B where in there. I require it to send an error message if a C exist or otherwise its fine to continue processing file.. hope that makes more sense