Go to the first, previous, next, last section, table of contents.
An alias is similar to a variable in that it is a named string. Its use, however, is very different. If the first word of a simple command (i.e. the name of the command to be executed) is the name of an alias and contains no quoted characters, the value of that alias is interpreted as commands to be executed. During the execution of this alias, the positional parameters are set to the arguments in the original simple command.
If the value of the alias does not contain any variable substitution (no
unquoted dollar sign) and does not contain a newline, then a
$@
is appended to the alias so that it appears as though the value of the alias
textually replaces its name. (example)
Aliases are exported and imported in a similar fashion to variables. The actual appearance of an alias in an environment is quite different though. Each alias exported creates a string in the environment of the form:
ALIAS_magic=name~value
where magic is some meaningless string used to keep the apparent name of the entries distinct.
Go to the first, previous, next, last section, table of contents.