From: Bill Lijewski (bill@eccie.com)
Date: Wed Mar 10 2004 - 19:00:46 GMT-3
Try this:
show run | exclude alias exec|ip host
Here is the normal show run:
Router#show run
Building configuration...
Current configuration : 990 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
logging queue-limit 100
!
memory-size iomem 10
ip subnet-zero
!
!
ip host r1 1.1.1.1
!
ip audit notify log
ip audit po max-events 100
mpls ldp logging neighbor-changes
!
!
!
!
!
!
!
!
!
!
!
!
no voice hpi capture buffer
no voice hpi capture destination
!
!
mta receive maximum-recipients 0
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Ethernet1/0
no ip address
shutdown
half-duplex
!
interface Serial1/0
no ip address
shutdown
!
interface Serial1/1
no ip address
shutdown
!
interface ATM2/0
no ip address
shutdown
no atm ilmi-keepalive
!
ip http server
no ip http secure-server
ip classless
!
!
!
!
!
call rsvp-sync
!
voice-port 3/0/0
!
voice-port 3/0/1
!
!
mgcp profile default
!
!
!
dial-peer cor custom
!
!
!
!
alias exec TEST show run
!
line con 0
line aux 0
line vty 0 4
!
!
end
And here is the show run that excludes lines that start with 'alias
exec' and 'ip host':
Router# show run | exclude alias exec|ip host
Building configuration...
Current configuration : 990 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
logging queue-limit 100
!
memory-size iomem 10
ip subnet-zero
!
!
!
ip audit notify log
ip audit po max-events 100
mpls ldp logging neighbor-changes
!
!
!
!
!
!
!
!
!
!
!
!
no voice hpi capture buffer
no voice hpi capture destination
!
!
mta receive maximum-recipients 0
!
!
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface Ethernet1/0
no ip address
shutdown
half-duplex
!
interface Serial1/0
no ip address
shutdown
!
interface Serial1/1
no ip address
shutdown
!
interface ATM2/0
no ip address
shutdown
no atm ilmi-keepalive
!
ip http server
no ip http secure-server
ip classless
!
!
!
!
!
call rsvp-sync
!
voice-port 3/0/0
!
voice-port 3/0/1
!
!
mgcp profile default
!
!
!
dial-peer cor custom
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
- Bill Lijewski
CCIE#8642
Network Learning Inc
5 Day R&S CCIE Bootcamp Instructor
bill@eccie.com
-----Original Message-----
From: nobody@groupstudy.com [mailto:nobody@groupstudy.com] On Behalf Of
Joseph D. Phillips
Sent: Wednesday, March 10, 2004 1:48 PM
To: Group Study (E-mail)
Subject: Using reg expressions doing show run [bcc][faked-from][bayes]
Importance: Low
How would I do a show running-config that excludes all lines with the
string "alias exec" *and* all lines that include "ip host" as well?
I can't find this anywhere. Is it do-able?
This archive was generated by hypermail 2.1.4 : Thu Apr 01 2004 - 08:15:17 GMT-3