Command Interpretation Sequence

Understanding the way the shell interprets a command is an important debugging tool. The following sequence describes the order in which the shell interprets a line of your script:

1.
Process the following reserved words:
{} esac select
case fi then
do for time
done function until
elif if while
else in [[ ]]
2.
Process built-in commands:
alias exit bg
export return fg
readonly trap kill
typeset echo wait
unalias print :
unset read fc
set cd getopts
shift pwd let
break times newgrp
continue ulimit test
eval umask whence
exec jobs  
3.
Search for functions on the command line.
4.
Search for aliases on the command line.
5.
Use the PATH variable to identify directories in which to look up programs/ scripts. ...

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.