User-Defined Cli Persistent Variables - Cisco AP776A - Nexus Converged Network Switch 5020 Configuration Manual

Cisco mds 9000 family cli configuration guide - release 4.x (ol-18084-01, february 2009)
Hide thumbs Also See for AP776A - Nexus Converged Network Switch 5020:
Table of Contents

Advertisement

Using CLI Variables
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
CLI variables have the following characteristics:

User-Defined CLI Persistent Variables

You can define CLI variables that persist across CLI sessions and switch reloads using the cli var name
command in configuration mode. These CLI persistent variables are configured in configuration mode
and are saved in the running configuration file.
As of MDS NX-OS Release 4.1(1a), CLI session variables are not supported.
Note
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 variables command to display user-defined CLI persistent variables.
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"
Use the no cli var name command in configuration mode to remove user-defined CLI persistent
variables.
The following example removes a user-defined CLI persistent variable:
Cisco MDS 9000 Family CLI Configuration Guide
2-22
Passed to the child script initiated using the run-script command. The variables defined in the
parent shell are available for use in the child run-script command process (see the
Commands Specified in a Script" section on page
Passed as command line arguments to the run-script command (see the
Specified in a Script" section on page
You cannot reference a variable through another variable using nested references.
You can define persistent variables that are available across switch reloads.
You can reference only one predefined system variable, the TIMESTAMP variable.
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
2-33).
2-33).
OL-18084-01, Cisco MDS NX-OS Release 4.x
Chapter 2
Before You Begin
"Executing
"Executing Commands

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents