Technical Briefs
ROHAN help Files
![]()
aliases
aliases are short names for long commands or lists of commands. You can then type the name of the alias instead of the commands. The alias can contain spaces, pipes, and anything else you can type on a command line. The syntax for alias is:
rohan% alias aliasname commandYou can then type the name of the alias instead of the commands.
aliases can be used in the C and Korn Shells, but not in the Bourne Shell. Usage example for the C Shell:
rohan% alias doit '/usr/jones/bin/programclass'Usage example for the Korn Shell:
rohan% alias doit='/usr/jones/bin/programclass'Each example tells the appropriate shell to run Jones' programclass, when you type doit. The difference in the two command lines is the equal sign in the Korn Shell example.
Notice: In the above usage examples, the single quotes are optional since the commands don't contain any spaces or special characters.
It is also possible to create an alias that stands for a list of commands. Each command should be followed by a semicolon and a space. For example:
rohan% alias aliasname 'command; command; command'This will now create an alias which will execute the listed commands.
Notice: Because certain characters (such as ;) have special significance to the shell, it is recommended that these commands be enclosed in single quotes. This is recommended any time you make an alias for a command or commands that has punctuation.
Other examples of the command:
- alias a alias
- This allows you to use a instead of typing the whole word alias.
- alias doit
- If you want to check the current value of an alias, enter alias followed only with a name previously given to an alias. This would give the value of doit.
If you want a list of all aliases that you have set in your shell, enter the command alias by itself and the system will list all the aliases you have created.
aliases you type directly to the shell are lost when you log out. If you want them to be available permanently, you must put the alias commands in your .login or .profile files.
If you want to remove an alias, use the unalias command. The following command line would remove doit.
rohan% unalias doit
![]()