GNU Info

Info Node: (zsh.info)Aliasing

(zsh.info)Aliasing


Next: Quoting Prev: Comments Up: Shell Grammar
Enter node , (file) or (file)node

Aliasing
========

Every token in the shell input is checked to see if there is an alias
defined for it.  If so, it is replaced by the text of the alias if it
is in command position (if it could be the first word of a simple
command), or if the alias is global.  If the text ends with a space,
the next word in the shell input is treated as though it were in
command position for purposes of alias expansion.  An alias is defined
using the alias builtin; global aliases may be defined using the -g
option to that builtin.

Alias expansion is done on the shell input before any other expansion
except history expansion.  Therefore, if an alias is defined for the
word foo, alias expansion may be avoided by quoting part of the word,
e.g. \foo.  But there is nothing to prevent an alias being defined for
\foo as well.


automatically generated by info2www version 1.2.2.9