Defining Command Aliases; Command Scripts; Executing Commands Specified In A Script - Cisco N5010P-N2K-BE Software Configuration Manual

Nx-os software configuration guide
Table of Contents

Advertisement

Chapter 2
Using the Command-Line Interface
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

Defining Command Aliases

You can define command aliases using the cli alias name command in configuration mode.
This following example shows how to define command aliases:
switch# configure terminal
switch(config)# cli alias name eth interface ethernet
switch(config)# cli alias name shintbr show interface brief
switch(config)# cli alias name shfcintup shintbr | include up | include fc
You can display the command aliases defined on the switch using the alias default command alias.
The following example shows how to display the command aliases defined on the switch:
switch# alias
CLI alias commands
==================
alias
gigint
shintbr
shfcintup

Command Scripts

This section includes the following topics:

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.
You cannot create the script file at the switch prompt. You can create the script file on an external
Note
machine and copy it to the bootflash: directory. This section assumes that the script file resides in the
bootflash: directory.
The syntax for this command is run-script filename.
OL-16597-01
Nesting of command aliases is permitted to a maximum depth of 1. One command alias can refer to
another command alias that must refer to a valid command, not to another command alias.
A command alias always replaces the first command keyword on the command line.
You can define command aliases for commands in any configuration submode or the EXEC mode.
:show cli alias
:interface gigabitethernet
:show interface brief
:shintbr | include up | include fc
Executing Commands Specified in a Script, page 2-11
Using CLI Variables in Scripts, page 2-12
Setting the Delay Time, page 2-13
Cisco Nexus 5000 Series Switch CLI Software Configuration Guide

Defining Command Aliases

2-11

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nexus 5000 series

Table of Contents