Cisco Nexus 5000 Series Command Reference Release 4.0(1a)N2(1) (OL-16599-01, March 2009)

Send comments to nx5000-docfeedback@cisco.com
1-12
Cisco Nexus 5000 Series Command Reference
OL-16599-01
Chapter 1 Basic System Commands
cli var name
cli var name
To define a command-line interface (CLI) variable for a terminal session, use the cli var name
command. To remove the CLI variable, use the no form of this command.
cli var name variable-name variable-text
no cli var name variable-name
Syntax Description
Command Default None
Command Modes EXEC mode
Command History
Usage Guidelines You can reference a CLI variable using the following syntax:
$(variable-name)
Instances where you can use variables include the following:
Command scripts
Filenames
You cannot reference a variable in the definition of another variable.
The Cisco NX-OS software provides a predefined variable, TIMESTAMP, that you can use to insert the
time of day. You cannot change or remove the TIMESTAMP CLI variable.
You cannot change the definition of a CLI variable. You must remove the variable and then create it again
with the new definition.
Examples This example shows how to define a CLI variable:
switch# cli var name testvar interface ethernet 1/3
This example shows how to reference a CLI variable:
switch# show $(testvar)
variable-name Name of the variable. The name is alphanumeric, case sensitive, and has a
maximum of 31 characters.
variable-text Variable text. The text is alphanumeric, can contain spaces, and has a
maximum of 200 characters.
Release Modification
4.0(0)N1(1a) This command was introduced.