Hamilton LaboratoriesHamilton C shell 2012User guideLanguage reference

Aliases

Oregon Coast

Aliases
Previous | Next

Topics

Syntax
Usage
See also

Syntax

alias name [ = ] ( wordlist ) alias name [ = ] wordlist alias alias name alias pattern unalias namelist unalias pattern

Usage

Aliases provide a way of conveniently recalling frequently used commands with a user-defined shorthand name. The alias statement associates a list of words with an alias name. The = is optional. Parentheses are used around the wordlist if it contains special characters such as i/o redirection operators that should be part of the alias definition.

Inside the wordlist, history references can be used to refer to the words on the command line but the ! history and any wildcard characters have to be escaped or quoted to defer processing. Here's an example.

1 C% alias word0 echo ^!^!:0 2 C% alias word1 echo ^!^!:1 3 C% alias wordargs echo ^!^!:^* 4 C% word0 now is the time word0 5 C% word1 now is the time now 6 C% wordargs now is the time now is the time

alias name prints the definition of that alias; alias pattern prints the definitions of all the aliases whose names match the pattern. alias without any arguments prints the definitions of all the aliases.

unalias namelist discards the specified aliases; unalias pattern discards all the aliases whose names match the pattern.

See also

Builtin procedures
Expression operators
Wildcard characters
Tutorial: Procedures
Tutorial: Programming constructs
Tutorial: Expressions
Tutorial: Wildcarding

Previous | Next

Getting started with Hamilton C shell

Hamilton C shell, as it first wakes up.

Getting started with Hamilton C shell

A first few commands.

You can set the screen colors to your taste.

You can set the screen colors to your taste.