User-Defined Cli Persistent Variables - Cisco MDS 9000 series Command Reference Manual

Hide thumbs Also See for MDS 9000 series:
Table of Contents

Advertisement

Chapter 1
CLI Overview
S e n d d o c u m e n t a t i o n c o m m e n t s t o m d s f e e d b a c k - d o c @ c i s c o . c o m
Use the show cli var command to display user-defined CLI session variable.
The following example displays user-defined CLI session variables.
switch# show cli variables
VSH Variable List
-----------------
TIMESTAMP="2005-10-24-21.29.33"
testinterface="fc 1/1"
Use the cli no var name command to remove user-defined CLI session variables.
The following example removes a user-defined CLI session variable.
switch# cli no var name testinterface

User-Defined CLI Persistent Variables

You can define CLI variables the persist across CLI sessions and switch reloads using the cli var name
command in configuration mode. These CLI variables are configured in the configuration mode and are
saved in the running configuration file.
The following example shows how to create a user-defined CLI persistent variable.
switch# config t
switch(config)# cli var name mgmtport mgmt 0
switch(config)# exit
switch#
You can reference a variable using the syntax $(variable).
The following example shows how to reference a user-defined CLI persistent variable.
switch# show interface $(mgmtport)
mgmt0 is up
Use the show cli var command to display user-defined CLI persistent variable.
The following example displays user-defined CLI persistent variables.
switch# show cli variables
VSH Variable List
-----------------
TIMESTAMP="2005-10-24-21.37.13"
mgmtport="mgmt 0"
OL-8413-07, Cisco MDS SAN-OS Release 3.x
0 too long, 0 too short
232691 frames output, 7448692 bytes
0 discards, 0 errors
0 input OLS, 0 LRR, 0 NOS, 0 loop inits
1 output OLS, 1 LRR, 0 NOS, 1 loop inits
16 receive B2B credit remaining
7 transmit B2B credit remaining
Hardware is FastEthernet
Address is 000e.38c6.2c6c
Internet address is 10.10.10.1/24
MTU 1500 bytes, BW 100 Mbps full Duplex
288996 packets input, 97746406 bytes
0 multicast frames, 0 compressed
0 input errors, 0 frame, 0 overrun 0 fifo
9089 packets output, 1234786 bytes, 0 underruns
0 output errors, 0 collisions, 0 fifo
0 carrier errors
Cisco MDS 9000 Family Command Reference
Using CLI Variables
1-29

Advertisement

Table of Contents
loading

Table of Contents