Using Cli Session Variables; Defining Command Aliases - Cisco Nexus 9000 Series Configuration Manual

Nx-os fundamentals configuration guide
Hide thumbs Also See for Nexus 9000 Series:
Table of Contents

Advertisement

Understanding the Command-Line Interface
Usage for bootflash://sup-local
8192 bytes used
20963328 bytes free
20971520 bytes total

Using CLI Session Variables

You can reference a variable using the syntax $(variable-name).
This example shows how to reference a user-defined CLI session variable:
switch# show interface $(testinterface)
Ethernet2/1 is down (Administratively down)
Hardware is 10/100/1000 Ethernet, address is 0000.0000.0000 (bia 0019.076c.4dac)
MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
Encapsulation ARPA
auto-duplex, auto-speed
Beacon is turned off
Auto-Negotiation is turned on
Input flow-control is off, output flow-control is off
Auto-mdix is turned on
Switchport monitor is off
Last clearing of "show interface" counters never
5 minute input rate 0 bytes/sec, 0 packets/sec
5 minute output rate 0 bytes/sec, 0 packets/sec
L3 in Switched:
L3 out Switched:
Rx
Tx

Defining Command Aliases

This example shows how to define command aliases:
cli alias name ethint interface ethernet
cli alias name shintbr show interface brief
cli alias name shintupbr shintbr | include up | include ethernet
This example shows how to use a command alias:
switch# configure terminal
switch(config)# ethint 2/3
12667
May 01 12:27:59 2013
reliability 255/255, txload 1/255, rxload 1/255
ucast: 0 pkts, 0 bytes - mcast: 0 pkts, 0 bytes
ucast: 0 pkts, 0 bytes - mcast: 0 pkts, 0 bytes
0 input packets 0 unicast packets 0 multicast packets
0 broadcast packets 0 jumbo packets 0 storm suppression packets
0 bytes
0 output packets 0 multicast packets
0 broadcast packets 0 jumbo packets
0 bytes
0 input error 0 short frame 0 watchdog
0 no buffer 0 runt 0 CRC 0 ecc
0 overrun
0 underrun 0 ignored 0 bad etype drop
0 bad proto drop 0 if down drop 0 input with dribble
0 input discard
0 output error 0 collision 0 deferred
0 late collision 0 lost carrier 0 no carrier
0 babble
0 Rx pause 0 Tx pause 0 reset
Cisco Nexus 9000 Series NX-OS Fundamentals Configuration Guide, Release 7.x
rcfg.2013-05-01-12.27.59
Using CLI Session Variables
75

Advertisement

Table of Contents
loading

Table of Contents