[nsp] Reg Exp help please

Ed Ravin eravin at panix.com
Fri Nov 21 00:19:45 EST 2003


On Tue, Nov 18, 2003 at 11:20:05AM -0800, Jim Devane wrote:
> 
> Is there a way to get a line count of output in IOS.
> 
> Meaning, I would love to be able to run sh ip bgp regexp ^70. wc -l
> And find out how many UUnet routes I have... is there an easy way to do
> this? 

If you're using a Unix-ish box, try using aclmaker.  Even if you never
edit ACLs with it, you'll still be able to do things like this:

  Router# [send telnet escape character to get to Unix prompt]
  Unixbox$ aclmaker cmd show ip bpg regexp ^70 | wc -l

Aclmaker lives at:

  http://sourceforge.net/project/showfiles.php?group_id=25401

Hmm, you just got me thinking.  I could probably hack up a "filtered
router prompt" mode with aclmaker so that | characters get caught and
run local Unix commands instead of being sent to the router.  But it
would ruin your typing habits for the next time you end up on a router
without any smart intervening utilities like aclmaker.



More information about the cisco-nsp mailing list