Using Cli Variables; User-Defined Cli Session Variables - HP Cisco MDS 9020 - Fabric Switch Configuration Manual

Cisco mds 9000 family cli configuration guide, release 3.x (ol-16184-01, april 2008)
Hide thumbs Also See for Cisco MDS 9020 - Fabric Switch:
Table of Contents

Advertisement

Chapter 2
Before You Begin
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

Using CLI Variables

The SAN-OS 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 CLI Session 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
You can reference a variable using the syntax $(variable).
The following example shows how to reference a user-defined CLI session variable.
switch# show interface $(testinterface)
fc1/1 is up
OL-16184-01, Cisco MDS SAN-OS Release 3.x
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
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 Fibre Channel, SFP is short wave laser w/o OFC (SN)
Port WWN is 20:01:00:0d:ec:0e:1d:00
Admin port mode is auto, trunk mode is on
snmp traps are enabled
Port mode is F, FCID is 0x01000b
Port vsan is 1
Speed is 2 Gbps
Transmit B2B Credit is 7
Receive B2B Credit is 16
Receive data field Size is 2112
Beacon is turned off
5 minutes input rate 256 bits/sec, 32 bytes/sec, 1 frames/sec
5 minutes output rate 256 bits/sec, 32 bytes/sec, 1 frames/sec
232692 frames input, 7447280 bytes
0 discards, 0 errors
0 CRC,
0 unknown class
0 too long, 0 too short
232691 frames output, 7448692 bytes
0 discards, 0 errors
0 input OLS, 0 LRR, 0 NOS, 0 loop inits
1 output OLS, 1 LRR, 0 NOS, 1 loop inits
16 receive B2B credit remaining
7 transmit B2B credit remaining
2-33).
2-33).
Cisco MDS 9000 Family CLI Configuration Guide
Using CLI Variables
"Executing
"Executing Commands
2-21

Advertisement

Table of Contents
loading

Table of Contents