[nsp] interesting "|include regexp" behaviour

Mark E. Mallett mem at mv.mv.com
Wed May 28 21:10:58 EDT 2003


On Thu, May 29, 2003 at 12:52:14AM +0100, Stephen J. Wilcox wrote:
> Not at all, the bgp regexp command uses the full line as regexp (ie ignores the 
> pipe '|')

Well- now that you say that, I see what it's really doing.

The "|include xxxx" is an "or" in the regexp.  duh.

It doesn't ignore the pipe "|" -- but since the first part matches, it
doesn't have to execute the second part of the "or".

Never mind.  Say good night, gracie.  etc.

mm



> 
> try 
> 
> sh ip bgp q "^32765_" | i ^\*>
> 
> should work for you
> 
> 
> On Wed, 28 May 2003, Mark E. Mallett wrote:
> 
> > Probably everybody knows this already, but what the heck..
> > 
> > I was attempting to do something like:
> > 
> >   show ip bgp regexp ^32765_|include ^\*>
> > 
> > on a 7200 (Version 12.1(5)T12) to find all selected routes for a
> > particular neighbor.  No matter what regexp I tried, all routes were
> > shown.  Even with something like
> > 
> >   show ip bgp regexp ^32765_|include blahblahblah
> > 
> > Evidently you can't use "include regexp" along with "show ip bgp
> > regexp" -- I'm guessing that the compilation of the regexp uses static
> > context and the compilation of one overrides the other.
> > 
> > It was easy enough to do e.g.:
> > 
> >   show ip bgp | include ^\*>.*( 32765 )
> > 
> > once I knew it was necessary.  However I couldn't easily find anything
> > that documented that you couldn't use "|include" with "show ip bgp
> > regexp" -- not to mention the fact that the command is accepted.
> > 
> > Just musing-
> > mm
> > _______________________________________________
> > cisco-nsp mailing list  cisco-nsp at puck.nether.net
> > http://puck.nether.net/mailman/listinfo/cisco-nsp
> > archive at http://puck.nether.net/pipermail/cisco-nsp/
> > 

-- 
Mark E. Mallett                  |    http://www.mv.com/users/mem/
MV Communications, Inc.          |    http://www.mv.com/
NH Internet Access since 1991    |    (603) 629-0000 / FAX: 629-0049


More information about the cisco-nsp mailing list