Share on Facebook Share on Twitter Email
Answers.com

Shell builtin

 
Wikipedia: Shell builtin

In computing, a shell builtin is a command or 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.

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 operating systems, some functions of the systems have to be implemented as shell builtins. The most notable example is the cd command, which changes the working directory of the shell. Because 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.

Examples

A widely used shell-builtin is the logout function, which terminates the session. This function has different names depending on the shell.

Some examples from bash include

$ cd ..
Loops (if, while, for and such)
$ echo

The help bash-builtin command will list all builtins.


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
 
 

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Shell builtin" Read more