2
For example, if you configure the alias
siprt
for
display ip routing-table
, you can enter
siprt
to execute the
display ip routing-table
command. If you configure the alias
ship
for
display ip
, you can use
ship
to
execute all commands starting with
display ip
:
•
Enter
ship
routing-table
to execute the
display ip routing-table
command.
•
Enter
ship interface
to execute the
display ip interface
command.
The command string can include up to nine parameters. Each parameter starts with the dollar sign ($)
and a sequence number in the range of 1 to 9. For example, you can configure the alias
shinc
for the
display ip $1 | include $2
command. Then, to execute the
display ip interface | include
GigabitEthernet0/0/1
command, you only need to enter
shinc interface GigabitEthernet0/0/1
.
Examples
# Configure the alias
shiprt
for the
display ip routing-table
command and verify the configuration.
<Sysname> system-view
[Sysname] alias shiprt display ip routing-table
[Sysname] shiprt
Destinations : 12 Routes : 12
Destination/Mask Proto Pre Cost NextHop Interface
0.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
3.3.3.3/32 Static 60 0 192.168.1.62 GE0/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.0/32 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
169.254.0.0/24 Direct 0 0 169.254.0.188 GE0/0
169.254.0.0/32 Direct 0 0 169.254.0.188 GE0/0
169.254.0.188/32 Direct 0 0 127.0.0.1 InLoop0
169.254.0.255/32 Direct 0 0 169.254.0.188 GE0/0
192.168.57.0/24 RIP 100 1 192.168.1.62 GE0/0
224.0.0.0/4 Direct 0 0 0.0.0.0 NULL0
224.0.0.0/24 Direct 0 0 0.0.0.0 NULL0
255.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
# Configure the alias
shinc
for
display ip $1 | include $2
.
[Sysname] alias shinc display ip $1 | include $2
# Use the alias
shinc
to display all static routes.
[Sysname] shinc routing-table Static
3.3.3.3/32 Static 60 0 192.168.1.62 GE0/0
# Use the alias
shinc
to display all RIP routes.
[Sysname] shinc routing-table RIP
192.168.57.0/24 RIP 100 1 192.168.1.62 GE0/0
Related commands
display alias
display | { begin | exclude | include }
Use
display |
{
begin
|
exclude
|
include
} to filter the output from a
display
command with a regular
expression.