Aliasing

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Appendix E.  Korn Shell Man Page


The first word of each command is replaced by the text of an alias if an alias for this word has been defined. An alias name consists of any number of characters excluding metacharacters, quoting characters, file expansion characters, parameter expansion and command substitution characters, and =. The replacement string can contain any valid shell script including the metacharacters listed above. The first word of each command in the replaced text, other than any that are in the process of being replaced, will be tested for aliases. If the last character of the alias value is a blank then the word following the alias will also be checked for alias substitution. Aliases can be used to redefine built-in commands but cannot be used to redefine the reserved words listed above. Aliases can be created and listed with the alias command and can be removed with the unalias command.

Aliasing is performed when scripts are read, not while they are executed. Therefore, for an alias to take effect, the alias definition command has to be executed before the command which references the alias is read.

The following aliases are compiled into the shell but can be unset or redefined:

autoload='typeset -fu'

command='command '

fc=hist

float='typeset -E'

functions='typeset -f'

hash='alias -t - -'

history='hist -l'

integer='typeset -i'

nameref='typeset -n'

nohup='nohup '

r='hist -s'

redirect='command exec'

stop='kill -s STOP'

suspend='kill -s STOP $$'

times='{{time;} 2>&1;}'

type='whence -v'


       
    Top
     



    Korn Shell. Unix and Linux Programming Manual, Third Edition
    Korn Shell. Unix and Linux Programming Manual, Third Edition
    ISBN: N/A
    EAN: N/A
    Year: 2000
    Pages: 177

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net