shell builtin

From NetBSD Wiki

Jump to: navigation, search
This article is a stub. You can help by editing it.

The Unix shell is generally used to start external programs, which is the Unix spirit: many programs to perform their own specific task. But sometimes the shell absolutely needs to implement a command directly for technical reasons.

Because in Unix processes are not allowed to modify other processes directly, there are things a shell can't delegate to another process. Changing the current working directory is one of those tasks. A parent process cannot have its current working directory changed by its children, so it must do it directly and by itself. For this reason, the cd command is builtin. For the same reason the process environment can only be modified directly from the shell itself.

Some extremely simple commands (mostly those that are but thin wrappers for syscalls) or very heavily used commands are often built-in for efficiency reasons.

A list of common builtins

See also

Personal tools