\subsection{Aliasing ({\tt csh} and {\tt tcsh})}

{\LARGE I believe that the contents of this entire section are covered
in sufficient detail in {\it More Unix: The C Shell}.}

Aliases allow you to rename a command, bundle frequently-used
options with commands, and generally customize your environment.
Aliasing is a feature of the c-shell---the standard command
interpreter.

The syntax of {\tt alias} is:

{\tt alias} {\it symbol command}

Once you've typed this line, typing the {\it symbol} will execute
the {\it command}.

{\tt alias} {\it symbol}

This prints out what {\it symbol} is aliased to.  If {\it symbol}
is not aliased to anything, nothing is printed.

{\tt unalias} {\it symbol}

This removes the alias from the symbol.

{\tt alias *}

This prints out all your aliases.

{\tt alias}

This is the right way to print out all your aliases---``right'' in that it
should work in all versions of csh, whereas {\tt alias *} is
system dependent.

The command {\tt ls} is often aliased.

\begin{verbatim}
% alias ls /bin/ls -FCsq
% alias ls
/bin/ls -FCsq
% unalias ls
\end{verbatim}

It is usually not necessary to provide the full pathname of the command.

{\tt \% alias ls ls -FCsq}

Or, you might decide that you would prefer to say `list' to see your
files.  Execute an \newline
\mbox{\tt alias list /bin/ls -FCsq}

Now {\tt list} will list your files.

More than one command can be put into an alias, just as more than one
command can be put on a single command line.  For instance,

{\tt \% alias c "clear ; fortune"}

creates an alias called {\tt c} which clears the screen and then prints
a fortune.\footnote{There is a program called {\tt fortune} in {\it
/usr/games}, but it doesn't do anything.  A working {\tt fortune}
program may be found in {\it /mit/sipb/vaxbin} or {\it /mit/sipb/rtbin}.
See the section on SIPB for more information.}

Aliases can be chained.  Any alias in the {\it command} part of
the line is expanded when the alias is executed, as this example
shows:

\begin{tt}
\% alias ls /bin/ls -FCsq

\% alias list ls

\% list

1 bin/		1 classes/	2 mail/		10 sleaze/

\% unalias ls

\% list

bin		classes		mail		sleaze
\end{tt}

{\tt alias} is smart enough to avoid infinite loops, printing an
error message if you attempt to use one.

\begin{verbatim}
% alias write "mesg y ; write"
% write jru
Alias loop.
% alias write "mesg y; /bin/write"
\end{verbatim}

Aliases are usually placed in your {\it .cshrc} so that they are
executed every time you start a shell---not just when you log in (which
is what happens to things in your {\it .login}).

% Local Variables:
% mode: TeX
% version-control: t
% make-backup-files: t
% End:
