The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
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 06-30-2009
TonyFullerMalv's Avatar
TonyFullerMalv TonyFullerMalv is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Location: Malvern, Worcs. U.K.
Posts: 748
If all you want is the count for apache then you could do:

Code:
$ tr "\011" "\012\012"<foo1 | tr -cd "[a-zA-z\012]" | grep "^apache$" | wc -l

Update I had assumed the tr bits were working but they aren't...

Here is something that works:

Code:
$ tr "\011\040" "\012\012"<foo1 | grep -ic "^apache$"


Last edited by TonyFullerMalv; 06-30-2009 at 05:04 PM.. Reason: Workinh version!