Korn shell or POSIX shell built-in commands
Special commands are built in to the Korn shell and POSIX shell and executed in the shell process.
Unless otherwise indicated, the output is written to file descriptor 1 and the exit status is zero (0) if the command does not contain any syntax errors. Input and output redirection is permitted. There are two types of built-in commands: special built-in commands and regular built-in commands.
Special built-in commands differ from regular built-in commands in the
following ways:
- A syntax error in a special built-in command might cause the shell executing the command to end. This does not happen if you have a syntax error in a regular built-in command. If a syntax error in a special built-in command does not end the shell program, the exit value is nonzero.
- Variable assignments specified with special built-in commands remain in effect after the command completes.
- I/O redirections are processed after parameter assignments.
In addition, words that are in the form of a parameter assignment following
the export, readonly, and typeset special
commands are expanded with the same rules as a parameter assignment. Tilde
substitution is performed after the =
, and word-splitting
and file name substitution are not performed.