Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cisco: NSP

Frustration with XR "show interface" and pipe commands

 

 

Cisco nsp RSS feed   Index | Next | Previous | View Threaded


jneiberger at gmail

May 24, 2012, 7:19 AM

Post #1 of 5 (751 views)
Permalink
Frustration with XR "show interface" and pipe commands

Someone asked me how to do something very simple and I'm finding it
very difficult! He wants to do a "show interface" command and show
only lines with "up" or "rate" in it. In IOS, this was simply "show
int | i up|rate". That second pipe for OR does not seem to work in XR
and we can't figure out how to do something this simple. I even tried
piping the command to egrep and frgrep, but couldn't figure out how to
do an OR in a way that XR understands.

Any ideas how to pipe the output of a command through an "include"
that has an OR operator?
_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/


lists at hojmark

May 24, 2012, 7:29 AM

Post #2 of 5 (721 views)
Permalink
Re: Frustration with XR "show interface" and pipe commands [In reply to]

On Thu, 24 May 2012 08:19:40 -0600, you wrote:

> Someone asked me how to do something very simple and I'm finding it
> very difficult! He wants to do a "show interface" command and show
> only lines with "up" or "rate" in it.

Put your regex in quotes:

sh int | i "up|rate"

-A

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


fredrik.vocks at bredband2

May 24, 2012, 7:32 AM

Post #3 of 5 (718 views)
Permalink
Re: Frustration with XR "show interface" and pipe commands [In reply to]

show interfaces | include "(up|down)"

/F

On 24 May 2012 16:19, John Neiberger <jneiberger [at] gmail> wrote:

> Someone asked me how to do something very simple and I'm finding it
> very difficult! He wants to do a "show interface" command and show
> only lines with "up" or "rate" in it. In IOS, this was simply "show
> int | i up|rate". That second pipe for OR does not seem to work in XR
> and we can't figure out how to do something this simple. I even tried
> piping the command to egrep and frgrep, but couldn't figure out how to
> do an OR in a way that XR understands.
>
> Any ideas how to pipe the output of a command through an "include"
> that has an OR operator?
> _______________________________________________
> cisco-nsp mailing list cisco-nsp [at] puck
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/
>
_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/


ronan at iol

May 24, 2012, 7:37 AM

Post #4 of 5 (715 views)
Permalink
Re: Frustration with XR "show interface" and pipe commands [In reply to]

Hi John,

On Thu, 24 May 2012, John Neiberger wrote:

> Someone asked me how to do something very simple and I'm finding it
> very difficult! He wants to do a "show interface" command and show
> only lines with "up" or "rate" in it. In IOS, this was simply "show
> int | i up|rate". That second pipe for OR does not seem to work in XR
> and we can't figure out how to do something this simple. I even tried
> piping the command to egrep and frgrep, but couldn't figure out how to
> do an OR in a way that XR understands.
>
> Any ideas how to pipe the output of a command through an "include"
> that has an OR operator?

sh interface | i "up|rate"


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


ttauber at 1-4-5

May 24, 2012, 7:48 AM

Post #5 of 5 (717 views)
Permalink
Re: Frustration with XR "show interface" and pipe commands [In reply to]

Seems like improved lexical parsing to me actually. Both these worked the
same way:
sh int | include "up|rate"
sh int | utility egrep "up|rate"

Where everything enclosed in the quotes is passed to the command.
You could also add a trailing space to "up" so that you don't match words
like "supressed"

sh int | utility egrep "up |rate"
^^^^^

Tony

On Thu, May 24, 2012 at 10:19 AM, John Neiberger <jneiberger [at] gmail>wrote:

> Someone asked me how to do something very simple and I'm finding it
> very difficult! He wants to do a "show interface" command and show
> only lines with "up" or "rate" in it. In IOS, this was simply "show
> int | i up|rate". That second pipe for OR does not seem to work in XR
> and we can't figure out how to do something this simple. I even tried
> piping the command to egrep and frgrep, but couldn't figure out how to
> do an OR in a way that XR understands.
>
> Any ideas how to pipe the output of a command through an "include"
> that has an OR operator?
>
_______________________________________________
cisco-nsp mailing list cisco-nsp [at] puck
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/

Cisco nsp RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.