Using Cli Variables In Scripts; Setting The Delay Time - 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

Command Scripts
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 in Scripts

You can use CLI variables defined by the cli var command (see the
page
The following example shows how to use CLI session variables in a script file used by the run-script
command.
switch# cli var name testinterface fc 1/1
switch# show file bootflash:test1.vsh
show interface $(testvar)
switch# run-script bootflash:test1.vsh
`show interface $(testvar)`
fc1/1 is down (SFP not present)
Hardware is Fibre Channel
Port WWN is 20:01:00:05:30:00:8e:1e
Admin port mode is auto, trunk mode is on
Port vsan is 1
Receive data field Size is 2112
Beacon is turned off
5 minutes input rate 0 bits/sec, 0 bytes/sec, 0 frames/sec
5 minutes output rate 0 bits/sec, 0 bytes/sec, 0 frames/sec
1 frames input, 128 bytes
0 discards, 0 errors
0 CRC, 0 unknown class
0 too long, 0 too short
1 frames output, 128 bytes
0 discards, 0 errors
0 input OLS, 0 LRR, 0 NOS, 0 loop inits
0 output OLS, 0 LRR, 0 NOS, 0 loop inits
0 receive B2B credit remaining
0 transmit B2B credit remaining
The following example shows how you can pass CLI session variable as arguments to a child run-script
command process.
switch# show file bootflash:test1.vsh
show interface $(var1) $(var2)
switch# run bootflash:test2.vsh var1="fc1/1" var2="brief"
`show interface $(var1) $(var2)`
-------------------------------------------------------------------------------
Interface
-------------------------------------------------------------------------------
fc1/1

Setting the Delay Time

The sleep command delays an action by a specified number of seconds.
The syntax for this command is sleep seconds.
switch# sleep 30
You will see the switch prompt return after 30 seconds.
Cisco MDS 9000 Family CLI Configuration Guide
2-34
2-21) or passed as arguments in the run-script command.
Vsan
Admin
Admin
Mode
Trunk
Mode
1
auto on
sfpAbsent
Status
SFP
--
--
--
Chapter 2
Before You Begin
"Using CLI Variables" section on
Oper
Oper
Port
Mode
Speed
Channel
(Gbps)
OL-16184-01, Cisco MDS SAN-OS Release 3.x

Advertisement

Table of Contents
loading

Table of Contents