The ALIAS and UNALIAS commands are used to define and delete synonyms
(``aliases'') for commands, respectively. The aliasing mechanism can save
you typing if you have several commands that have to be used repeatedly.
ALIAS (with no arguments) shows a list of synonyms of your terminal. The
list can be loaded into a file or sent to the printer with the output
redirection mechanism.
To define an alias, use the full syntax:
If you give only the new alias and no not give the command, the program
will ask for it. You can redefine a synonym at any time.
To execute the command that you have defined with ALIAS, type the synonym
just as you would type any other command. You can add keywords to the
command at the time of execution by typing them after the synonym. Using
the example above, the command
The aliases that you define need not be commands that would actually run;
they MUST contain a command name and MAY contain keywords, but these are
the only restrictions. For example:
To delete an alias, use the UNALIAS command. Type UNALIAS followed by the
name of the synonym that you want to remove from the list. As an example,
UNALIAS T will remove the definition of T that was defined above.
It is not possible to define a alias that includes other aliases. For
example, the sequence
Similarly, you cannot define a single alias made up of several commands
chained together by a semicolon (;). For example:
You can have aliases defined automatically on startup by putting ALIAS
commands in the startup procedure. See the sections FILES and PROCEDURE
for information about the startup procedure.
For example:
defines a new command, T, which executes 'TV 1 ...' . As is usual, if the
command for which you are defining an alias is composed of more than one
word, the entire command must be enclosed in quotes.
executes TV 1 1234.0 CF=NEWTHREE BOX=1. The command 'T' goes on the
history list.
is a perfectly valid alias. Typing H by itself as a command would not
work, since HISTOGRAM is not a complete command (it needs an image number).
You can, however, add arguments to an alias exactly the same as with
commands, hence:
will execute the HISTOGRAM command on image 3.
correctly defines the command alias 'A', but AA will be invalid because it
contains the alias 'A'.
is not allowed: one command per alias.