ALIAS/UNALIAS: Define/Delete Command Aliases


\begin{command}
\item[\textbf{Form: }ALIAS {[synonym]} {[command]} {[output
re...
...ion]}\hfill]{}
\item[\textbf{Form: }UNALIAS {[synonym]}\hfill]{}
\end{command}

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:

  ALIAS SYNONYM COMMAND
For example:
\begin{hanging}
\item{ALIAS T 'TV 1 1234.0 CF=NEWTHREE'}
\end{hanging}
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.

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

executes TV 1 1234.0 CF=NEWTHREE BOX=1. The command 'T' goes on the history list.

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:

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.

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

  ALIAS A  'TV 1 1234.0 CF=NEWTHREE'
  ALIAS AA 'A BOX=1'
correctly defines the command alias 'A', but AA will be invalid because it contains the alias 'A'.

Similarly, you cannot define a single alias made up of several commands chained together by a semicolon (;). For example:

is not allowed: one command per alias.

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.