6-15
Cisco IOS XR Getting Started Guide
OL-10957-02
Chapter6 CLI Tips, Techniques, and Shortcuts
Wildcards, Templates, and Aliases
After a template is applied, the show configuration command displays the target configuration
changes. The target configuration must be committed (with the commit command) to become part
of the running configuration.
Examples
In the following example, a simple template is defined. The template contents are then displayed with
the show running-config template template-name command:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# apply-template jbtest
RP/0/RP0/CPU0:router(config) show configuration
Building configuration...
hostname test
end
In the next example, a template with one parameter is applied and the show configuration command
displays the result:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# apply-template test2 (router)
RP/0/RP0/CPU0:router(config)# show configuration
Building configuration...
hostname router
end
Aliases
Cisco IOS XR software lets you define command line aliases for any physical or logical entity in a
router. After you define the alias, it can be used in the CLI to reference the real entity.
To create a command alias, enter the alias command in global configuration or administration
configuration mode:
alias alias-name [(parameter1 parameter2...)] command-syntax [$parameter1] [command-syntax
[$parameter2]}
Table 6 -5 defines the alias command syntax.
Table6-5 alias Command Syntax
Syntax Specifies that the Alias Is Created for
alias-name Name of the command alias. An alias name can be a single word or
multiple words joined by a dash (–).
command-syntax Original command syntax. Valid abbreviations of the original
command syntax can be entered for the co mmand-syntax argument.
(parameterx) Argument or keyword that belongs to the command you specified for
the command-syntax argument. When the parameter is entered in
parenthesis after the alias name, the alias requires a parameter name.
To associate the parameter with a command within the alias, enter the
$ character preceding the parameter name.