Shell builtin

Source: Wikipedia, the free encyclopedia.

In computing, a shell builtin is a

function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute.[1][2][3][4]

Shell builtins work significantly faster than external programs, because there is no program loading overhead. However, their code is inherently present in the shell, and thus modifying or updating them requires modifications to the shell. Therefore, shell builtins are usually used for simple, almost trivial, functions, such as text output. Because of the nature of some operating systems, some functions of the systems must necessarily be implemented as shell builtins. The most notable example is the cd command, which changes the working directory of the shell. Since each executable program runs in a separate process, and working directories are specific to each process, loading cd as an external program would not affect the working directory of the shell that loaded it.[5]

See also

References

  1. ^ POSIX standard: Shell Commands
  2. .
  3. ^ Sobell, Mark G. (2003). "Built-ins". A Practical Guide to Red Hat Linux 8. pp. 161–162.
  4. .
  5. .

External links