Command Scripts; Running A Command Script; Echoing Information To The Terminal - Cisco Nexus 9000 Series Configuration Manual

Nx-os fundamentals configuration guide
Hide thumbs Also See for Nexus 9000 Series:
Table of Contents

Command Scripts

Procedure
Step 1
Command Scripts
This section describes how you can create scripts of commands to perform multiple tasks.

Running a Command Script

You can create a list of commands in a file and execute them from the CLI. You can use CLI variables in the
command script.
You cannot create the script files at the CLI prompt. You can create the script file on a remote device and
Note
copy it to the bootflash: or volatile: directory on the Cisco NX-OS device.
Procedure
Step 1

Echoing Information to the Terminal

You can echo information to the terminal, which is particularly useful from a command script. You can
reference CLI variables and use formatting options in the echoed text.
This table lists the formatting options that you can insert in the text.
Cisco Nexus 9000 Series NX-OS Fundamentals Configuration Guide, Release 7.x
58
Command or Action
terminal alias [persist] alias-name
command-string
Example:
switch# terminal alias shintbr show
interface brief
Command or Action
run-script [bootflash: | volatile:] filename
Example:
switch# run-script testfile
Understanding the Command-Line Interface
Purpose
Configures a command alias for the current user
session. Use the persist keyword to save the alias for
future use by the user account.
Do not abbreviate the persist
Note
keyword.
Purpose
Executes the commands in the file on the
default directory.
Table of Contents
loading

Table of Contents