Enlightened ones,
I'm a perl beginner and have a need to write a script that takes the output from a cisco router that looks like this:
permit ip 7.0.0.0 0.255.255.255 10.31.224.0 0.0.3.255 (55164 matches)
permit ip 8.159.0.0 0.0.255.255 any (4908356 matches)
permit ip any host 10.202.11.250
permit tcp any 172.16.96.200 0.0.0.7 established (10421619 matches)
permit udp any host 172.16.68.225 eq tftp (8 matches)
I need to look at each line and if it doesn't have matches log the line to a file. I was thinking I could split the array by spaces and look at the last $line[] but the last $line[] (greping "matches on it) would be variable. Therein lies my question. Sorry if it's a simple one but I'm quite stuck.
If you're interested in what I'm trying to do here:
This access-list is quite (outrageously) long and nobody has kept up on removing unneeded lines. This script will eventually check each line for matches for a period of time and remove any lines that do not generate matches after said period of time.
Thanks in Advance!
edited: Sun Mar 9 14:38:05 2003
by jeffa - title change (was: Perl n00b help)