Using Cli Variables; User-Defined Persistent Cli Variables - Cisco N5010P-N2K-BE Software Configuration Manual

Nx-os software configuration guide
Table of Contents

Advertisement

Chapter 2
Using the Command-Line Interface
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
Table 2-3
Submode Name
FCS Registration
Fibre Channel alias
FSPF
Interface
configuration
Line console
Virtual terminal line
Role
VLAN
VSAN database
Zone
Zone set

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

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
OL-16597-01
Common Configuration Submodes (continued)
From Configuration Mode, Enter:
fcs register
From FCS registration submode:
platform name name vsan
vsan-id
fcalias name name vsan vsan-id
fspf config vsan vsan-id
interface type slot/port
line console
line vty
role name
vlan
vsan database
zone name string vsan vsan-id
zoneset name name vsan vsan-id
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
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, which is the TIMESTAMP variable.
Submode Prompt
switch(config-fcs-register)#
switch(config-fcs-register-attrib)#
switch(congif-fcalias)#
switch(config-(fspf-config))#
switch(config-if)#
switch(config-console)
switch(config-line)#
switch(config-role)#
switch(config-vlan)#
switch(config-vsan-db)#
switch(config-zone)#
switch(config-zoneset)#
2-11).
Cisco Nexus 5000 Series Switch CLI Software Configuration Guide

Using CLI Variables

2-11).
"Executing Commands
2-9

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nexus 5000 series

Table of Contents