cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Bookmark
|
Subscribe
|
1874
Views
5
Helpful
6
Replies

how i do a show comand with 2 pipes, like a sh ru with 2 pipes

fanado1982
Level 1
Level 1

good night to everybody,

i wannabe make a show comando with

sh int ra | incl Gig0/1-2

 

i try this comands

*** sh ru | incl GigabitEthernet0/

this is the command but the responde dont get any more information, like ip address, etc.

 

the command is more like this

sh ru | incl GigabitEthernet0/ | incl dupl | incl ip addre

 

1 Accepted Solution

Accepted Solutions

Hello,

unfortunately, you cannot combine multiple exc/inc pipes (such as GREP in Unix).

In your case, if you just want to include Gi0/1 and Gi0/2, you could use something like:

sh interfaces | include GigabitEthernet0/[1-2]

View solution in original post

6 Replies 6

balaji.bandi
Hall of Fame
Hall of Fame

sh int ra - is this command work (without pipe)

Can you post your example output of what you looking to achieve so we can suggest the best suitable command?

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hello,

what information are you after exactly ? The 'section' keyword would render this:

#sh run | section GigabitEthernet0/0
interface GigabitEthernet0/0
ip address 1.1.1.1 255.255.255.252
duplex auto
speed auto
media-type rj45

 

Hi georg, tanks for your reply.
i wanna use a lot of "pipes" inside a show ip command, like this:

# sh ip int br | excl vlan1 | sec inc Gi | exc GigabitEthernet0/0

but when i put 2 exclude in show command, the show dont work.
the show command omit 1 exclude.

in a scenario with 3 Gigabits interface and 1 vlan.
i wanna show just the g0/1 and g0/2, exclude of the exit of show command
the g0/0 and vlan.

but when i use 2 excludes in the same line, dont work.
i attached a image of what im talking about.

Hello,

unfortunately, you cannot combine multiple exc/inc pipes (such as GREP in Unix).

In your case, if you just want to include Gi0/1 and Gi0/2, you could use something like:

sh interfaces | include GigabitEthernet0/[1-2]

Thanks Georg! that's it!

Router#sh ip int br | include GigabitEthernet0/0/[1-2]

GigabitEthernet0/0/1 192.168.1.1 YES manual up down

GigabitEthernet0/0/2 192.168.2.1 YES manual up down


have a very good day!!!!



we do not see any image attached to.

you can mix so many command in one line due to limitation of IOS code.

out of the box with some python code you get what you looking to do.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help