[nsp] Reg Exp help please

Ohnmacht, Steve, WCCO ohnmacht at att.com
Wed Dec 10 18:55:22 EST 2003


He could also do something like  'script' <filename>, telnet to device,
term length 0,  <some_command> , exit 'script' egrep "blah" <filename> |
wc -l

-so




-----Original Message-----
From: Ed Ravin [mailto:eravin at panix.com]
Sent: Thursday, November 20, 2003 10:20 PM
To: Jim Devane
Cc: cisco-nsp at puck.nether.net
Subject: Re: [nsp] Reg Exp help please


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.

_______________________________________________
cisco-nsp mailing list  cisco-nsp at puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/



More information about the cisco-nsp mailing list