Send documentation comments to mdsfeedback-doc@cisco.com
4-87
Cisco MDS 9000 Family Command Reference
OL-8413-07, Cisco MDS SAN-OS Release 3.x
Chapter 4 C Commands
cli var name (EXEC)
cli var name (EXEC)
To define a CLI session variable that persists only for the duration of a CLI session, use the cli var name
command in either EXEC mode or configuration submode.
cli var name name value
To remove a user-defined session CLI variable, use the no form of the command as follows:
cli no var name name
Syntax Description
Defaults None.
Command Modes EXEC mode.
Command History
Usage Guidelines CLI session variables can be used as follows:
• Entered directly on the command line.
• Passed to the child script and initiated using the run-script command. The variables defined in the
parent shell are available for use in the child run-script command process.
• Passed as command-line arguments to the run-script command.
• Referenced using the syntax $(variable).
CLI variables have the following limitation:
• You cannot reference a variable through another variable using nested references.
Examples The following example creates a user-defined CLI variable for a session.
switch# cli var name testinterface 3/4
The following example removes a user-defined CLI variable for a session.
switch# cli no var name testinterface 3/4
name Specifies a variable name. The maximum size is 31 characters.
value Specifies a variable value. The maximum size is 80.
Release Modification
3.0(1) This command was introduced.