📑 Table of Contents

In computing, a shell builtin is a command or a function, exposed by a shell, that is implemented in the shell itself, instead of an external program which the shell would load and execute.[1][2][3][4]

A shell builtin starts faster than an external program because there is no program loading overhead. However, its implementation code is in the shell program, and thus modifying it requires modifying the shell. Therefore, a shell builtin is usually only used for simple, almost trivial, commands, such as text output.

Some commands must be implemented as builtins due to the nature of the operating system. Notably, the cd command, which changes the working directory of the shell is often a builtin since a program runs in a separate process and working directory is specific to each process. Running cd as an external program would not affect the working directory of the shell that loaded it.[5]

See also

edit

References

edit
  1. ^ "POSIX standard: Shell Commands". Archived from the original on 2016-10-29. Retrieved 2016-11-01.
  2. ^ Tansley, David (2000). "24. Shell built-in commands". Linux and Unix shell programming. Harlow: Addison-Wesley. ISBN 9780201674729.
  3. ^ Sobell, Mark G. (2003). "Built-ins". A Practical Guide to Red Hat Linux 8. pp. 161–162.
  4. ^ Albing, Carl; Vossen, JP; Newham, Cameron. "1.7. Using or Replacing Built-ins and External Commands". Bash Cookbook. O'Reilly Media. pp. 13–15. ISBN 9780596554705.
  5. ^ Kuhn, Darl; Kim, Charles; Lopuz, Bernard (2015). Linux and Solaris Recipes for Oracle DBAs (2nd ed.). Berkeley, CA: Apress. p. 47. ISBN 9781484212547.
edit


📚 Artikel Terkait di Wikipedia

Bash (Unix shell)

Bash Variables: Shell Builtin set: Shell Builtin shopt: Shell Builtin trap: While POSIX does specify certain uses of the trap builtin, the following signal

Shell (computing)

Internet Explorer shell – Programs based on the Internet Explorer browser engine Shell account – User account on a remote server Shell builtin – Computer function

NOP (code)

expressed as pass when it should be empty. The ':' [colon] command is a shell builtin that has similar effect to a "NOP" (a do-nothing operation). It is not

Nohup

on a lower priority. $ nohup nice abcd & $ exit Some shells (e.g. bash) provide a shell builtin that may be used to prevent SIGHUP being sent or propagated

Built-in

dictionary. Built-in, builtin, or built in may refer to: Shell builtin, a command or a function executed directly in the shell itself Builtin function, in computer

Unix shell

to all the later Unix shells, including here documents, command substitution, more generic variables and more extensive builtin control structures. The

Dot (command)

23 May 2016. "Bash Reference Manual § Bourne Shell Builtins". Retrieved 23 May 2016. "ZSH Shell Builtin Commands". Retrieved 23 May 2016. "ksh man page"

Test (Unix)

systems that evaluates conditional expressions. test was turned into a shell builtin command in 1981 with UNIX System III and at the same time made available