Page 38
6.1.17 Create and Run a Script File (SCRIPT)
The
script
command provides the ability to create, run and save a configuration file to the switch. After a
file has been opened, all typed CLI commands are written to the file. None of the commands typed will be
executed, only written to the open file. After the file is closed, the
-run
command can be used to execute
the saved CLI commands.
To create a script file on the switch, use the
script
command from the CLI prompt. A list of options is
displayed when the
script -h
command is entered.
> script -h
Description:
script - create and execute script files
Syntax:
script [-h]
script -s
script -d scriptName.osf
script -close
script -open scriptName.osf
script -run scriptName.osf
script -type scriptName.osf
Switches:
-close close the currently open script file
-d delete script file, [scriptName.osf]
-h display help information
-open open script file, [scriptName.osf]
-run execute script file, [scriptName.osf]
-s show current script file list
-type type the selected file, [scriptName.osf]
>
The options available using the
script
command are shown below.
The
-close
switch stops the capture of all typed commands and saves the file.
The
-d
switch allows a script file to be deleted.
The
-h
switch displays the help screen presented above. It is static and provides help information for the
specific command.
The
-open
switch starts the capture of all typed commands.
The
-run
switch execute the script file.
The
-s
switch displays the open file status.
The
-type
switch indicates the name of the script file.
To create a script file, use the
-open
command. The filename must have the .osf extension.
> script -open Config.osf
All CLI commands typed after the file has been opened is automatically saved in the file. Once complete
with the configuration, close the file using the
-close
command.
> script -close