S e n d f e e d b a c k t o n x 5 0 0 0 - d o c f e e d b a c k @ c i s c o . c o m
2-9
Cisco Nexus 5000 Series Switch CLI Software Configuration Guide
OL-16597-01
Chapter 2 Using the Command-Line Interface
Using CLI Variables
Using CLI Variables
The Cisco Nexus 5000 Series CLI parser supports the definition and use of variables in CLI commands.
CLI variables can be used as follows:
•
Entered directly on the command line.
•
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
“Executing Commands Specified in a Script” section on page 2-11
).
•
Passed as command line arguments to the
run-script
command (see the
“Executing Commands
Specified in a Script” section on page 2-11
).
CLI variables have the following characteristics:
•
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, which is the TIMESTAMP variable.
User-Defined Persistent CLI Variables
You can define CLI session variables to persist only for the duration of your CLI session using the
cli
var name
command in EXEC mode. CLI session variables are useful for scripts that you execute
periodically.
The following example shows how to create a user-defined CLI session variable:
switch#
cli var name testinterface fc 1/1
FCS Registration
fcs register
switch(config-fcs-register)#
From FCS registration submode:
platform name
name
vsan
vsan-id
switch(config-fcs-register-attrib)#
Fibre Channel alias
fcalias name
name
vsan
vsan-id
switch(congif-fcalias)#
FSPF
fspf config vsan
vsan-id
switch(config-(fspf-config))#
Interface
configuration
interface
type slot/port
switch(config-if)#
Line console
line console
switch(config-console)
Virtual terminal line
line vty
switch(config-line)#
Role
role name
switch(config-role)#
VLAN
vlan
switch(config-vlan)#
VSAN database
vsan database
switch(config-vsan-db)#
Zone
zone name
string
vsan
vsan-id
switch(config-zone)#
Zone set
zoneset name
name
vsan
vsan-id
switch(config-zoneset)#
Table 2-3
Common Configuration Submodes (continued)
Submode Name
From Configuration Mode, Enter:
Submode Prompt
Summary of Contents for N5010P-N2K-BE
Page 50: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 102: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 240: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 312: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 400: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 418: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 436: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...
Page 658: ...Se n d f e e d b a ck t o n x 5 0 0 0 d o c f e e d b a ck c i s c o c o m ...