RE: Limit output

From: Tyson Scott <tscott_at_ipexpert.com>
Date: Sun, 15 Aug 2010 22:55:14 -0400

If you are not sure on spaces always fall back to regular expressions as
well. For instance you can match what you mention below in one line.

show run | s eph.*30
or
show run | s ephone.*[ ]+30

or

show run | s ephone[-dn]?[ ]+30

to be even more precise. Although if I was doing this in the CCIE exam I
would use the first one as it is the shortest.

I personally find the section command the most helpful as I personally don't
remember the exact line numbers for each output but I can always remember
what the command structure is.

On the catalyst that doesn't have the section command you can be more
inventive with the include Using the pipe multiple times.

show run | incl

Regards,
 
Tyson Scott - CCIE #13513 R&S, Security, and SP
Managing Partner / Sr. Instructor - IPexpert, Inc.
Mailto: tscott_at_ipexpert.com

-----Original Message-----
From: nobody_at_groupstudy.com [mailto:nobody_at_groupstudy.com] On Behalf Of Nick
Matthews
Sent: Sunday, August 15, 2010 1:50 PM
To: Kambiz Agahian
Cc: SIVA; Muzammil Malick; Ryan West; garry baker; Cisco certification
Subject: Re: Limit output

For instance, on a CME, if you want to display a particular ephone or
ephone-dn, you can use:

show run | s ephone 30
show run | s ephone-dn 30

what you have to realize is that the CME developers put two spaces between
the ephone/ephone-dn and the number. As well, the regular expressions are
case-sensitive so you have to watch out for that. If you're still doing a
'show run' you're a sucker. Get good with include and section commands and
you'll fly.

-nick

On Sat, Aug 14, 2010 at 9:19 PM, Kambiz Agahian <aussiecert_at_gmail.com>wrote:

> Guys,
>
> This sounds pretty cool but you can not use this as a general golden
> formula for everything.
>
> Please bear in mind that the output of some IOS commands may need some
> modifications in this string. In many cases even a single "space" in the
> output should be taken into consideration and can easily change the way
you
> develop your regexp.
>
> Kambiz Agahian
>
> CCIE Instructor/Consultant
> M.Eng Telecom, CCIE# 25341, CCSI# 33326, MCSE, MCSA
>
>
>
>
>
> On Fri, Aug 13, 2010 at 1:21 AM, SIVA <siva0111_at_gmail.com> wrote:
>
>> This is really gr8 information.
>>
>> Siva
>> IT Analyst
>> TCS
>> 9553551054
>>
>>
>> On Fri, Aug 13, 2010 at 12:51 AM, Muzammil Malick <malickmuz_at_gmail.com
>> >wrote:
>>
>> > Thanks guys
>> >
>> > I had never seen the linenum command!
>> >
>> > On 12 August 2010 20:17, Nick Matthews <matthn_at_gmail.com> wrote:
>> > > True, mistake on my part. I just get so excited around regular
>> > expressions.
>> > >
>> > > If you really wanted to nickpick it would look like:
>> > > sh run linenum | include ( [1-5]?[0-9] : )
>> > >
>> > >
>> > > -nick
>> > >
>> > > On Thu, Aug 12, 2010 at 11:57 AM, Ryan West <rwest_at_zyedge.com> wrote:
>> > >>
>> > >> Nick,
>> > >>
>> > >> > -----Original Message-----
>> > >> > From: nobody_at_groupstudy.com [mailto:nobody_at_groupstudy.com] On
>> > >> > Behalf Of Nick Matthews
>> > >> > Sent: Thursday, August 12, 2010 11:37 AM
>> > >> >
>> > >> > This is a little more scalable:
>> > >> >
>> > >> > R1#sh run linenum | include ( [1-2] : )
>> > >> >
>> > >> > for example this would be 50 lines:
>> > >> >
>> > >> > R1#sh run linenum | include ( 5. : )
>> > >> >
>> > >>
>> > >> Not to nitpick too much, but the second example will show lines
>> 50-59,
>> > if
>> > >> you want to show 1-59 I think you would need an ? statement.
>> > >>
>> > >> sh run linenum | include ( [1-5]?. : )
>> > >>
>> > >> -ryan
>> >
>> >
>> > Blogs and organic groups at http://www.ccie.net
>> >
>> > _______________________________________________________________________
>> > Subscription information may be found at:
>> > http://www.groupstudy.com/list/CCIELab.html
>>
>>
>> Blogs and organic groups at http://www.ccie.net
>>
>> _______________________________________________________________________
>> Subscription information may be found at:
>> http://www.groupstudy.com/list/CCIELab.html

Blogs and organic groups at http://www.ccie.net
Received on Sun Aug 15 2010 - 22:55:14 ART

This archive was generated by hypermail 2.2.0 : Wed Sep 01 2010 - 11:20:52 ART