summaryrefslogtreecommitdiff
path: root/devdocs/bash/shell-builtin-commands.html
blob: 238985915264896f62bc7490659eb731858f343f (plain)
1
2
3
4
5
6
<h1 class="chapter">Shell Builtin Commands</h1> <p>Builtin commands are contained within the shell itself. When the name of a builtin command is used as the first word of a simple command (see <a href="simple-commands">Simple Commands</a>), the shell executes the command directly, without invoking another program. Builtin commands are necessary to implement functionality impossible or inconvenient to obtain with separate utilities. </p> <p>This section briefly describes the builtins which Bash inherits from the Bourne Shell, as well as the builtin commands which are unique to or have been extended in Bash. </p> <p>Several builtin commands are described in other chapters: builtin commands which provide the Bash interface to the job control facilities (see <a href="job-control-builtins">Job Control Builtins</a>), the directory stack (see <a href="directory-stack-builtins">Directory Stack Builtins</a>), the command history (see <a href="bash-history-builtins">Bash History Builtins</a>), and the programmable completion facilities (see <a href="programmable-completion-builtins">Programmable Completion Builtins</a>). </p> <p>Many of the builtins have been extended by <small>POSIX</small> or Bash. </p> <p>Unless otherwise noted, each builtin command documented as accepting options preceded by ‘<samp>-</samp>’ accepts ‘<samp>--</samp>’ to signify the end of the options. The <code>:</code>, <code>true</code>, <code>false</code>, and <code>test</code>/<code>[</code> builtins do not accept options and do not treat ‘<samp>--</samp>’ specially. The <code>exit</code>, <code>logout</code>, <code>return</code>, <code>break</code>, <code>continue</code>, <code>let</code>, and <code>shift</code> builtins accept and process arguments beginning with ‘<samp>-</samp>’ without requiring ‘<samp>--</samp>’. Other builtins that accept arguments but are not specified as accepting options interpret arguments beginning with ‘<samp>-</samp>’ as invalid options and require ‘<samp>--</samp>’ to prevent this interpretation. </p> <ul class="section-toc"> <li><a href="bourne-shell-builtins" accesskey="1">Bourne Shell Builtins</a></li> <li><a href="bash-builtins" accesskey="2">Bash Builtin Commands</a></li> <li><a href="modifying-shell-behavior" accesskey="3">Modifying Shell Behavior</a></li> <li><a href="special-builtins" accesskey="4">Special Builtins</a></li> </ul><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>Licensed under the GNU Free Documentation License.<br>
    <a href="https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html</a>
  </p>
</div>