summaryrefslogtreecommitdiff
path: root/devdocs/bash/special-builtins.html
blob: 4096a6dc8b9f736340689dd5b34207948686f3bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<h1 class="section">Special Builtins</h1>  <p>For historical reasons, the <small>POSIX</small> standard has classified several builtin commands as <em>special</em>. When Bash is executing in <small>POSIX</small> mode, the special builtins differ from other builtin commands in three respects: </p> <ol> <li> Special builtins are found before shell functions during command lookup. </li>
<li> If a special builtin returns an error status, a non-interactive shell exits. </li>
<li> Assignment statements preceding the command stay in effect in the shell environment after the command completes. </li>
</ol> <p>When Bash is not executing in <small>POSIX</small> mode, these builtins behave no differently than the rest of the Bash builtin commands. The Bash <small>POSIX</small> mode is described in <a href="bash-posix-mode">Bash POSIX Mode</a>. </p> <p>These are the <small>POSIX</small> special builtins: </p>
<div class="example"> <pre class="example">break : . continue eval exec exit export readonly return set
shift trap unset
</pre>
</div><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/Special-Builtins.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Special-Builtins.html</a>
  </p>
</div>