show run | section
liven
Member Posts: 918
in CCNA & CCENT
If the
| section
option is not available
and the only options are:
append Append redirected output to URL (URLs supporting append operation only)
begin Begin with the line that matches
exclude Exclude lines that match
include Include lines that match
redirect Redirect output to URL
tee Copy output to URL
Is there a regex combo that would allow one to call groupings of lines?
For instance I am trying to look through the config of a switch that has thousands of lines of config. I would like to be able to do:
show run | i <all lines for an interface>
But the version of the IOS running on this box doesn't include the "section" regex or modifier.
Does anyone know how to hack or code that up with the commands I have available?
Thanks!
| section
option is not available
and the only options are:
append Append redirected output to URL (URLs supporting append operation only)
begin Begin with the line that matches
exclude Exclude lines that match
include Include lines that match
redirect Redirect output to URL
tee Copy output to URL
Is there a regex combo that would allow one to call groupings of lines?
For instance I am trying to look through the config of a switch that has thousands of lines of config. I would like to be able to do:
show run | i <all lines for an interface>
But the version of the IOS running on this box doesn't include the "section" regex or modifier.
Does anyone know how to hack or code that up with the commands I have available?
Thanks!
encrypt the encryption, never mind my brain hurts.
Comments
-
shednik Member Posts: 2,005liven I think this is what you are looking for:
testswitch#sh run interface FastEthernet 0/7 Building configuration... Current configuration: ! interface FastEthernet0/7 duplex full speed 100 switchport trunk encapsulation dot1q switchport trunk allowed vlan 1,5-10,12 switchport mode trunk end
-
phantasm Member Posts: 995Doesn't "sh run | include int" do it?"No man ever steps in the same river twice, for it's not the same river and he's not the same man." -Heraclitus
-
cisco_trooper Member Posts: 1,441 ■■■■□□□□□□I have only seen the section option on 7613s. Not saying that it doesn't exist otherwise...just saying that is the only place I have actually seen it in production.
-
tiersten Member Posts: 4,505cisco_trooper wrote:I have only seen the section option on 7613s. Not saying that it doesn't exist otherwise...just saying that is the only place I have actually seen it in production.
-
ConstantlyLearning Member Posts: 445tiersten wrote:cisco_trooper wrote:I have only seen the section option on 7613s. Not saying that it doesn't exist otherwise...just saying that is the only place I have actually seen it in production.
Yep, just tried it on my 2611 with 12.4 and it worked."There are 3 types of people in this world, those who can count and those who can't" -
liven Member Posts: 918cisco_trooper wrote:I have only seen the section option on 7613s. Not saying that it doesn't exist otherwise...just saying that is the only place I have actually seen it in production.
It exists on 6509's I know because our lab has 2 of them.encrypt the encryption, never mind my brain hurts. -
liven Member Posts: 918shednik wrote:liven I think this is what you are looking for:
testswitch#sh run interface FastEthernet 0/7 Building configuration... Current configuration: ! interface FastEthernet0/7 duplex full speed 100 switchport trunk encapsulation dot1q switchport trunk allowed vlan 1,5-10,12 switchport mode trunk end
Yes but I don't want just interface information, I want to be able to include any section... When I only have a little bit of information.
I wish you could do a
show run | i <some text> PLUS 5 lines above or 5 lines below etc....encrypt the encryption, never mind my brain hurts. -
Mrock4 Banned Posts: 2,359 ■■■■■■■■□□liven wrote:I wish you could do a
show run | i <some text> PLUS 5 lines above or 5 lines below etc....
Generally if I want to see say something + 5 lines below I do a "Sh run | begin router ospf" or wherever I want to start..has the same effect, but doesn't do much about at looking at the config above. -
mj8mj4 Member Posts: 56 ■■□□□□□□□□Yes but I don't want just interface information, I want to be able to include any section... When I only have a little bit of information.
I wish you could do a
show run | i <some text> PLUS 5 lines above or 5 lines below etc....
Thanks..........