Home > Help Files > Email > Alias

Alias


                         The Mail Alias Command

                              May 27, 1984


    Often you may find yourself sending mail to a friend, but you don't
want to have to remember his login-name, such as "me132-ak".  Or you may
find yourself trying to co-ordinate a project of several people, and
you'd like to be able to send mail to all of them, but you don't want to
have to type all of their names every time you want to send something to
them.

    It is at this point that aliases come in.  The "mail" program has a
command which can go into a file called ".mailrc" in your home
directory.  The alias command allows you to tell "mail" that one name
stands for another person or group of people.

    If you were to edit your ".mailrc" file and add the following line,

         alias fred me132-al

you would be telling "mail" that the name "fred" corresponds to the real
life account "me132-al".  Thereafter, any time you want to send mail to
the account "me132-al", you could simply type:

         % mail fred
         message
         

GROUPS OF PEOPLE

    Sending mail to a group of people under one name is done the same
way, with the login-names of all the people, separated by commas,
after the alias name.  For example, the faculty accounts, "fac-01" to
"fac-06" could be aliased with the following line in your ".mailrc"
file:

         alias faculty fac-01 fac-02 fac-03 fac-04 fac-05 fac-06

and to send to all the faculty accounts, you could then type

         % mail faculty

LONG LINES

    If an alias line is very long, you can do one of two things.  First,
you can just have a very long line which exceeds the physical length of
a screen line (80 characters), or you can have the line continued with
the character "\".  For example, both of the following are valid:

         alias list bob carol ted alice dave jeff jeremy \
              fred steve eric john edward

or

    	alias list bob carol ted alice dave jeff jeremy fred steve eric john edward

FINDING OUT WHO IS ALIASED

    When you are in the "mail" program at the "&" prompt, you can type

	alias

to find out who you have aliased to whom.  This can be useful when you
can't remember if you have aliased someone or not.

    You should probably type "help mail mailrc" at this point to get an
idea of some of the other things the ".mailrc" file can do.

 


Comments to consult@newton.berkeley.edu
© 1998-2009 UC Regents