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
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 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.
This command is useful within scripts. For example, if you create a command script called test-script.
switch# show file slot0:test-script
discover scsi-target remote
sleep 10
show scsi-target disk
switch# run-script slot0:test-script
When you execute the slot0:test-script command script, the switch software executes the discover
scsi-target remote command, and then waits for 10 seconds before executing the show scsi-target disk
command.
OL-18084-01, Cisco MDS NX-OS Release 4.x
Vsan
Admin
Admin
Mode
Trunk
Mode
1
auto on
sfpAbsent
Status
SFP
--
--
--
Cisco MDS 9000 Family CLI Configuration Guide
Command Scripts
Oper
Oper
Port
Mode
Speed
Channel
(Gbps)
2-35