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-12
Cisco Nexus 5000 Series Switch CLI Software Configuration Guide
OL-16597-01
Chapter 2 Using the Command-Line Interface
Command Scripts
This example displays the CLI commands specified in a test file that resides in the bootflash: directory.
switch#
show file bootflash:testfile
configure terminal
interface fc 3/1
no shutdown
end
show interface fc 3/1
This file output is in response to the
run-script
command executing the contents in the test file:
switch#
run-script bootflash:testfile
'configure terminal'
Enter configuration commands, one per line. End with CNTL/Z.
'interface fc 3/1'
'no shutdown'
'end'
'show interface fc 3/1'
fc3/1 is trunking
Hardware is Fibre Channel, SFP is short wave laser w/o OFC (SN)
Port WWN is 20:81:00:0d:ec:6b:cd:c0
Peer port WWN is 20:01:00:0d:ec:0d:d0:00
Admin port mode is auto, trunk mode is on
snmp link state traps are enabled
Port mode is TE
Port vsan is 1
Speed is 2 Gbps
Transmit B2B Credit is 255
Receive B2B Credit is 16
Receive data field Size is 2112
Beacon is turned off
Trunk vsans (admin allowed and active) (1)
Trunk vsans (up)
(1)
Trunk vsans (isolated)
()
Trunk vsans (initializing)
()
5 minutes input rate 96 bits/sec, 12 bytes/sec, 0 frames/sec
5 minutes output rate 64 bits/sec, 8 bytes/sec, 0 frames/sec
77423 frames input, 6708868 bytes
0 discards, 0 errors
0 CRC,
0 unknown class
0 too long, 0 too short
77302 frames output, 4184976 bytes
0 discards, 0 errors
1 input OLS, 2 LRR, 0 NOS, 0 loop inits
1 output OLS, 0 LRR, 1 NOS, 0 loop inits
16 receive B2B credit remaining
255 transmit B2B credit remaining
Using CLI Variables in Scripts
You can use CLI variables defined by the
cli var
command (see the
“Using CLI Variables” section on
page 2-9
) or passed as arguments in the
run-script
command.
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)`
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 ...