cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2232
Views
3
Helpful
1
Replies

Using pipe to filter results - advanced -

Carlos190
Level 1
Level 1

Hi,

I´ve had a question for a while, I wanted to find a way to use include and exclude on a command at the same time. The closest I´ve been to it was in a CatOS issuing the command sh run | in (set span | ex set spantree) and the objective was to show only the span sessions and not the spanning tree configurations. Then I tried another ways on the same Catalyst and it didn´t work. On IOS it didn´t work at all. On Nexus there is a way to do a double pipe and reach the intended objective, but I want to know if that can be done on a IOS; and understand why another variants of the command that worked in CatOS are not working.

If someone could explain it at a code level it would be great.

Thanks,

Carlos

just to add something, I just tried sh run | in set span | ex set spantree and gets the same result of sh run | in (set span | ex set spantree), seems like CatOS also allows double piping just as Nexus

1 Reply 1

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The   Author of this posting offers the information contained within this   posting without consideration and with the reader's understanding that   there's no implied or expressed suitability or fitness for any purpose.   Information provided is for informational purposes only and should not   be construed as rendering professional advice of any kind. Usage of  this  posting's information is solely at reader's own risk.

Liability Disclaimer

In   no event shall Author be liable for any damages whatsoever (including,   without limitation, damages for loss of use, data or profit) arising  out  of the use or inability to use the posting's information even if  Author  has been advised of the possibility of such damage.

Posting

I've had similar results on IOS platforms, i.e. unable to effectively double pipe, and similar results on CRS-1, i.e. able to double pipe.  Guess it depends on how close the Cisco IOS is like an UNIX OS.

Review Cisco Networking for a $25 gift card