[j-nsp] How to see contatining section ?

Bala Subrahmanyam Venkata balavenkata at aim.com
Fri Sep 21 00:34:15 EDT 2012


Thanks all. Looks like "display set" is the closest to what I wanted. Would
be nice if JunOS has a

show config | match <pattern> | display *container*



On Thu, Sep 20, 2012 at 7:00 PM, Atif Saleem <malik.atif.saleem at gmail.com>wrote:

> Just my 2cents. You can also do the following.
>
> show configuration | match super-user | display inheritance | except ##
>
> or
>
> show configuration | match super-user | display set
>
> or just
>
>
> show configuration | match "user marge" | display set
>
> show configuration | match "user marge" | display inheritance | except ##
>
> Best
>
> On Thu, Sep 20, 2012 at 5:40 PM, Per Granath <per.granath at gcc.com.cy>
> wrote:
> > I would typically do:
> >
> > show | display set | match super-user
> >
> > Which would give you:
> >
> > set system login user marge class super-user
> >
> > Then I would copy/paste part of that line, and do:
> >
> > show system login user marge
> >
> >
> > Perhaps there's a smarter way, or perhaps someone has written an
> op-script for it....
> > BTW, the '| display set' is typed with 3 keys only '|ds', and command
> completion does the rest...
> >
> >
> >> -----Original Message-----
> >> From: juniper-nsp-bounces at puck.nether.net [mailto:juniper-nsp-
> >> bounces at puck.nether.net] On Behalf Of Bala Subrahmanyam Venkata
> >> Sent: Thursday, September 20, 2012 3:21 PM
> >> To: juniper-nsp at puck.nether.net
> >> Subject: [j-nsp] How to see contatining section ?
> >>
> >> Novice Junos CLI query:
> >>
> >> How can I find a section of config given a line which is 'inside' the
> section. For
> >> instance given the following
> >>
> >>
> >> user marge {
> >>             uid 2012;
> >>             class super-user;
> >>             authentication {
> >>                 encrypted-password
> >> "$1$Q5wrLnUs$zwwewew30U6/O1sWMP0yziY.ysh1"; ## SECRET-DATA
> >>             }
> >>         }
> >>
> >> I'd like to do something like the below but see the whole "user"
> section.
> >> Here "find" finds the line and prints all after it. Is there somethign
> like "find
> >> and print containing section" ?
> >>
> >>
> >> test# show | find super-user
> >>             class super-user;
> >>             authentication {
> >>                 encrypted-password
> >> "$1$Q5wrLnUs$zwwewew30U6/O1sWMP0yziY.ysh1"; ## SECRET-DATA
> >>             }
> >>         }
> >> _______________________________________________
> >> juniper-nsp mailing list juniper-nsp at puck.nether.net
> >> https://puck.nether.net/mailman/listinfo/juniper-nsp
> >
> > _______________________________________________
> > juniper-nsp mailing list juniper-nsp at puck.nether.net
> > https://puck.nether.net/mailman/listinfo/juniper-nsp
>
>
>
> --
> Atif
>


More information about the juniper-nsp mailing list