in reply to Capturing route details
First thing: your post is unreadable. Try putting <code></code> tags around the route summary text. The other thing: post your solution to this and let us review it. It's not fair if we're doing all the work :)
You can match the desired text in many different ways as long as they're unique for the data lines you want matched. A simple regexp can match these active lines:
while (defined(my $line = <STDIN>)) { if ($line =~ /^inet\((\d+) active/) { print $line; } }
Output:
inet.0: 498154 destinations, 3436699 routes (498150 active, 0 holddown +, 5 hidden) inet.3: 10103 destinations, 10107 routes (10103 active, 0 holddown, 0 +hidden) inet6.0: 25299 destinations, 115803 routes (25299 active, 0 holddown, +0 hidden)
|
|---|