[Dshield] blacklist parsing help

John Hardin johnh at aproposretail.com
Fri May 24 00:11:56 GMT 2002


> > my ($start, $end, $block, $attacks, $name, $country, $email);
> > while (<F>) {
> >     next if /^#/;
> >     ($start, $end, $block, $attacks, $name, $country, $email)=split("\t");
> >     if ( ( $start =~ /^[\d\.]+$/ ) && ( $block =~ /^\d+/ ) ) {
> >         print O "$start/$block \n";
> >     }
> > }

How about:

sed -e 's/#.*//' < infile | awk '$1 ~ /[0-9]/ {print "$1/$3"}' > outfile

-- 
John Hardin                                   <johnh at aproposretail.com>
Internal Systems Administrator                    voice: (425) 672-1304
Apropos Retail Management Systems, Inc.             fax: (425) 672-0192
-----------------------------------------------------------------------
  In the Lion
  the Mighty Lion
  the Zebra sleeps tonight...
  Dee de-ee-ee-ee-ee de de de we um umma way!
-----------------------------------------------------------------------
 55 days until Apropos Forum 2002




More information about the list mailing list