Displaying The Last Line In A File; Executing Commands Specified In A Script - Cisco AJ732A - MDS 9134 Fabric Switch Command Reference Manual

Cisco mds 9000 family command reference guide - release 4.x (ol-18089-01, february 2009)
Hide thumbs Also See for AJ732A - Cisco MDS 9134 Fabric Switch:
Table of Contents

Advertisement

Chapter 1
CLI Overview
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
The gunzip command uncompresses (unzips) LZ77 coded files.
This example unzips the file that was compressed in the previous example:
switch# gunzip samplefile
/volatile/samplefile.gz: No such file or directory
switch# gunzip Samplefile
switch# dir
Usage for volatile://

Displaying the Last Line in a File

The tail command displays the last lines (tail end) of a specified file.
The syntax for this command is tail file name [number of lines]
switch# tail mylog 10
You see the last 10 lines of the mylog file.

Executing Commands Specified in a Script

The run-script command executes the commands specified in a file. To use this command, be sure to
create the file and specify commands in the required order.
Note
You cannot create the script files at the switch prompt. You can create the script file on an external
machine and copy it the bootflash: directory. This section assumes that the script file resides in the
bootflash: directory.
The syntax for this command is run-script file_name
This example displays the CLI commands specified in the testfile that resides in the slot0 directory.
switch# show file slot0:testfile
conf t
interface fc 1/1
no shutdown
end
sh interface fc1/1
This file output is in response to the run-script command executing the contents in the testfile file:
switch# run-script slot0:testfile
'conf t'
Enter configuration commands, one per line. End with CNTL/Z.
'interface fc1/1'
'no shutdown'
'end'
'sh interface fc1/1'
fc1/1 is down (Fcot not present)
OL-18089-01, Cisco MDS NX-OS Release 4.x
1525859
Jul 04 00:51:03 2003 Samplefile
1527808 bytes used
19443712 bytes free
20971520 bytes total
Hardware is Fibre Channel
Cisco MDS 9000 Family Command Reference
Using the File System
1-37

Advertisement

Table of Contents
loading

Table of Contents