CODE
#!/usr/bin/perl
$output = ">/rootIPs";
open (INV, $input);
open (OUTFILE, $output);
open(FILEHANDLE,"/root/BigEvil/evil_sort");
while(<FILEHANDLE>){
s/^[s]*//g; ($cnt,$ip) = split(/s/); if ($cnt > 9) { print OUTFILE "$cntt$ipn"; }
}
I'd like to do that withing a bash shell script, but I'm not sure how to do it. That file it's opening, rootIPs, has a list of IPs from a "uniq -c" so it looks something like this
CODE
12 123.34.456.677
13 123.46.789.123
11 123.456.789.910
9 123.456.789.111
It's just a list of IPs, and each IP has a # before it indicating the # of hits it's given to a server. I'd like to pull out only those IPs with more than 10 hits.
So my goal is to
open file with IPs
find all with a count of greater than 10
write them to another file
I can do it with that perl, but I'd like to do it using SH