
k
ksh(1) | ksh(1) |
command in the replaced text, other than any that are in the process of being replaced, is tested for additional aliases. If the last character of the alias value is a blank, the word following the alias is also checked for alias substitution. Aliases can be used to rede®ne special
Aliasing is performed when scripts are read, not while they are executed. Therefore, for it to take effect, alias must be executed before the command referring to the alias is read.
Aliases are frequently used as a shorthand for full path names. An option to the aliasing facility allows the value of the alias to be automatically set to the full path name of the corresponding command. These aliases are called tracked aliases. The value of a tracked alias is de®ned the ®rst time the identi®er is read and becomes unde®ned each time the PATH variable is reset. These aliases remain tracked so that the next reference rede®nes the value. Several tracked aliases are compiled into the shell. The
The following exported aliases are compiled into the shell but can be unset or rede®ned:
autoload='typeset
r='fc
Tilde Substitution
After alias substitution is performed, each word is checked to see if it begins with an unquoted Ä. If it does, the word up to a / is checked to see if it matches a user name in the /etc/passwd ®le. If a match is found, the Ä and the matched login name are replaced by the login directory of the matched user. This is called a tilde substitution. If no match is found, the original text is left unchanged. A Ä, alone or before a /, is replaced by the value of the HOME parameter. A Ä followed by a + or - is replaced by the value of the parameter PWD and OLDPWD, respectively. In addition, tilde substitution is attempted when the value of a parameter assignment begins with a Ä.
Command Substitution
The standard output from a command enclosed in parenthesis preceded by a dollar sign ( $(command) ) or a pair of back single quotes (accent grave) ( ÁcommandÁ ) can be used as part or all of a word; trailing
An arithmetic expression enclosed in double parenthesis preceded by a dollar sign ($((expression))) is replaced by the value of the arithmetic expression within the double parenthesis (see Arithmetic Evaluation below for a description of arithmetic expressions).
Parameter Substitution
A parameter is an identi®er, one or more digits, or any of the characters *, @, #, ?,
The shell supports a limited
Section 1−398 | − 3 − |