symbol count in a text file [iptables log]

Andrew Mathews andrew_mathews
Mon May 17 11:37:59 PDT 2004


M.W. Chang wrote:
> I could figure this one out. but how to list all possible combinations 
> of DPT=9999 in a text file? There should be an existing shell util that 
> will do something like this:
> 
> select distinct DPT=* from textfile
> 
> then I need to direct each combination into a file and apply wc on it to 
> produce a distribution
> 
>> grep DPT=9999 /var/log/messages | wc
> 
> 

That's an SQL statement which would require all files be stored within a 
database. It might be possible, but that's a *LOT* of overhead just to 
do the same things that grep, awk and sed can do.

-- 
Andrew Mathews
---------------------------------------------------------------------
  10:25am  up 8 min,  2 users,  load average: 2.39, 1.41, 0.63
---------------------------------------------------------------------
Majorities, of course, start with minorities.
		-- Robert Moses



More information about the Linux-users mailing list