Introducing UNIX and Linux |
Advanced shell programmingOverview |
AliasesFunctions are general-purpose, and can be arbitrarily long. A mechanism similar to functions, but suitable for naming short commands only, is that of aliasing. The format is
and whenever the alias-name is encountered it is replaced by the
string, whose value is then executed as a command. For instance,
instead of naming
The command When the shell encounters a name, it first of all checks to see
whether it is an alias; if not, the shell sees if there is a
function definition for it. If both of these fail, it examines the
|
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck