S e n d d o c u m e n t a t i o n c o m m e n t s t o m d s f e e d b a c k - d o c @ c i s c o . c o m
2-23
Cisco MDS 9000 Family CLI Configuration Guide
OL-16184-01, Cisco MDS SAN-OS Release 3.x
Chapter 2 Before You Begin
Using Command Aliases
System-Defined Variables
Cisco MDS SAN-OS supports one predefined variable: TIMESTAMP. This variable refers to the time of
execution of the command in the format YYYY-MM-DD-HH.MM.SS.
Note
The TIMESTAMP variable name is case sensitive. All letters must be uppercase.
The following example uses $(TIMESTAMP) when periodically gathering statistics into files using the
command scheduler.
switch#
config t
l
switch(config)#
scheduler enable
switch(config)#
scheduler logfile size 16
switch(config)#
scheduler job name j1
switch(config-job)#
show interface mgmt0 | include mgmt > file
switch(config-job)#
copy volatile:file bootflash:file.$(TIMESTAMP)
switch(config-job)#
end
switch(config)#
The following example uses $(TIMESTAMP) when redirecting
show
command output to a file
.
switch#
show running-config > rcfg.$(TIMESTAMP)
Preparing to copy....done
switch#
dir volatile:
7231 Oct 03 20:20:42 2005 rcfg.2005-10-03-20.20.42
Usage for volatile://sup-local
8192 bytes used
20963328 bytes free
20971520 bytes total
Using Command Aliases
Command alias support has the following characteristics:
•
Command aliases are global for all user sessions.
•
Command aliases are persist across reboots.
•
Commands being aliased must be typed in full without abbreviation.
•
Command alias translation always
takes precedence over any keyword in any configuration mode or
submode.
•
Command alias support is only
available on the supervisor module, not the switching modules.
•
Command alias configuration takes effect for other user sessions immediately.
•
You cannot override the default command alias
alias,
which aliases the
show cli alias
.
•
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.