Referring to other command aliases

Referring to other command aliases

You can use an existing command alias within another command alias. Define a first alias:

   alias print lpr

This creates the alias print for the lpr command used to print files to your default printer.

This alias can now be used within another alias. For example:

   alias tree 'cd; ls -R | print'

The alias tree will list the complete directory tree below the users home directory on the default printer. Multiple commands within an alias can be separated by a semicolon; just as they are on the command line.


[Home] [Search] [Index] This site maintained by unixhelp@math.rutgers.edu
This page was last updated on September 05, 2006 at 10:30 am and is maintained by webmaster@math.rutgers.edu.
For questions regarding courses and/or special permission, please contact mclausen@math.rutgers.edu.
For questions or comments about this site, please contact help@math.rutgers.edu.
© 2012 Rutgers, The State University of New Jersey. All rights reserved.