Command Alias - Allied Telesis SwitchBlade x3100 Series Manual

Release 14.2 - issue 2
Table of Contents

Advertisement

Introduction

1.4.5 Command Alias

Command alias functionality allows Allied Telesis Network Access product users to define shortcuts to com-
mand strings to simplify the use of the CLI. It allows users to create shortcut strings which can be typed in
place of commonly used (longer) commands. With alias command strings, the user is able to quickly perform
operations without having to type the full command line.
1.4.5.1 Creating a Simple Command Alias
CREATE ALIAS=ge1prof STRING="SHOW PROFILE NAMES GE1"
When the user inputs this alias, the user will type at the prompt:
officer SEC>>ge1prof
However, the alias may NOT be part of a command. For instance:
CREATE ALIAS=ge1prof STRING="PROFILE NAMES GE24POE"
is not acceptable. If the user attempts to input it as:
officer SEC>>SHOW ge1prof
the CLI responds with an error indicating that the command did not function correctly.
With this in mind, alias names must not exactly match any of the CLI command root keywords, such as
DELETE, CREATE, SET, SHOW
This prevents the user from creating an alias string that overrides an existing command.
1.4.5.2 Creating a Command Alias that Takes Input Values
officer SEC>>CREATE ALIAS=makecard STRING="CREATE CARD=$1 $2"
takes two input values. These values are typed in the order indicated by the
rated by a space. If the user types:
officer SEC>>makecard 1 GE24POE
a GE24POE card is created in slot 1, as if the user typed:
officer SEC>>CREATE CARD=1 GE24POE
Alias command strings are made available to all users in the system. Since the alias command is mapped to
actual CLI commands, the substituted CLI command is verified to be valid for the privilege level of the user
using the alias. For instance, if there is an alias string "reboot" to substitute the command "
CARD=ACTCFC CODE FORCE
privileges attempts to use it, the response is an error indicating that the command is not available for the
current user privilege.
Alias command strings persist over system reboots. Because of this, there are limits on the number of
aliases stored and the maximum size of the alias name and the substitution string. As mentioned earlier, a
1-12
Software Reference for SwitchBlade x3100 Series Switches (Setting Up the Switch)
, etc. The
CREATE ALIAS
" (
CREATE ALIAS=reboot STRING="restart card=actcfc force"
command validates this and rejects any attempts to do so.
Command Alias
part of the string, and sepa-
$
n
RESTART
) and a user with USER
ADD,

Advertisement

Table of Contents
loading

Table of Contents