mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-06 10:12:38 +02:00
commit bash-20180608 snapshot
This commit is contained in:
+66
-33
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- This text is a brief description of the features that are present in
|
||||
the Bash shell (version 5.0, 15 March 2018).
|
||||
the Bash shell (version 5.0, 8 June 2018).
|
||||
|
||||
This is Edition 5.0, last updated 15 March 2018,
|
||||
This is Edition 5.0, last updated 8 June 2018,
|
||||
of The GNU Bash Reference Manual,
|
||||
for Bash, Version 5.0.
|
||||
|
||||
@@ -284,10 +284,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
|
||||
<h1 class="top">Bash Features</h1>
|
||||
|
||||
<p>This text is a brief description of the features that are present in
|
||||
the Bash shell (version 5.0, 15 March 2018).
|
||||
the Bash shell (version 5.0, 8 June 2018).
|
||||
The Bash home page is <a href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
|
||||
</p>
|
||||
<p>This is Edition 5.0, last updated 15 March 2018,
|
||||
<p>This is Edition 5.0, last updated 8 June 2018,
|
||||
of <cite>The GNU Bash Reference Manual</cite>,
|
||||
for <code>Bash</code>, Version 5.0.
|
||||
</p>
|
||||
@@ -1297,7 +1297,9 @@ zero if no condition tested true.
|
||||
<p>The syntax of the <code>case</code> command is:
|
||||
</p>
|
||||
<div class="example">
|
||||
<pre class="example">case <var>word</var> in [ [(] <var>pattern</var> [| <var>pattern</var>]…) <var>command-list</var> ;;]… esac
|
||||
<pre class="example">case <var>word</var> in
|
||||
[ [(] <var>pattern</var> [| <var>pattern</var>]…) <var>command-list</var> ;;]…
|
||||
esac
|
||||
</pre></div>
|
||||
|
||||
<p><code>case</code> will selectively execute the <var>command-list</var> corresponding to
|
||||
@@ -1443,7 +1445,7 @@ If the <code>nocasematch</code> shell option
|
||||
is enabled, the match is performed without regard to the case
|
||||
of alphabetic characters.
|
||||
The return value is 0 if the string matches (‘<samp>==</samp>’) or does not
|
||||
match (‘<samp>!=</samp>’)the pattern, and 1 otherwise.
|
||||
match (‘<samp>!=</samp>’) the pattern, and 1 otherwise.
|
||||
Any part of the pattern may be quoted to force the quoted portion
|
||||
to be matched as a string.
|
||||
</p>
|
||||
@@ -1722,7 +1724,8 @@ from a file (in this case, filenames listed one per line):
|
||||
|
||||
<p>with a more compact syntax reminiscent of lambdas:
|
||||
</p><div class="example">
|
||||
<pre class="example">cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output
|
||||
<pre class="example">cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" |
|
||||
process-output
|
||||
</pre></div>
|
||||
|
||||
<p>Parallel provides a built-in mechanism to remove filename extensions, which
|
||||
@@ -1744,12 +1747,20 @@ written as
|
||||
<p>If a command generates output, you may want to preserve the input order in
|
||||
the output. For instance, the following command
|
||||
</p><div class="example">
|
||||
<pre class="example">{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
|
||||
<pre class="example">{
|
||||
echo foss.org.my ;
|
||||
echo debian.org ;
|
||||
echo freenetproject.org ;
|
||||
} | parallel traceroute
|
||||
</pre></div>
|
||||
<p>will display as output the traceroute invocation that finishes first.
|
||||
Adding the <samp>-k</samp> option
|
||||
</p><div class="example">
|
||||
<pre class="example">{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
|
||||
<pre class="example">{
|
||||
echo foss.org.my ;
|
||||
echo debian.org ;
|
||||
echo freenetproject.org ;
|
||||
} | parallel -k traceroute
|
||||
</pre></div>
|
||||
<p>will ensure that the output of <code>traceroute foss.org.my</code> is displayed first.
|
||||
</p>
|
||||
@@ -2126,8 +2137,16 @@ separators.
|
||||
<a name="index-_0040"></a>
|
||||
</dt>
|
||||
<dd><a name="index-_0024_0040"></a>
|
||||
<p>($@) Expands to the positional parameters, starting from one. When the
|
||||
expansion occurs within double quotes, each parameter expands to a
|
||||
<p>($@) Expands to the positional parameters, starting from one.
|
||||
In contexts where word splitting is performed, this expands each
|
||||
positional parameter to a separate word; if not within double
|
||||
quotes, these words are subject to word splitting.
|
||||
In contexts where word splitting is not performed,
|
||||
this expands to a single word
|
||||
with each positional parameter separated by a space.
|
||||
When the
|
||||
expansion occurs within double quotes, and word splitting is performed,
|
||||
each parameter expands to a
|
||||
separate word. That is, <code>"$@"</code> is equivalent to
|
||||
<code>"$1" "$2" …</code>.
|
||||
If the double-quoted expansion occurs within a word, the expansion of
|
||||
@@ -5078,8 +5097,8 @@ parent.
|
||||
<dt><code>mapfile</code></dt>
|
||||
<dd><a name="index-mapfile"></a>
|
||||
<div class="example">
|
||||
<pre class="example">mapfile [-d <var>delim</var>] [-n <var>count</var>] [-O <var>origin</var>] [-s <var>count</var>] [-t] [-u <var>fd</var>]
|
||||
[-C <var>callback</var>] [-c <var>quantum</var>] [<var>array</var>]
|
||||
<pre class="example">mapfile [-d <var>delim</var>] [-n <var>count</var>] [-O <var>origin</var>] [-s <var>count</var>]
|
||||
[-t] [-u <var>fd</var>] [-C <var>callback</var>] [-c <var>quantum</var>] [<var>array</var>]
|
||||
</pre></div>
|
||||
|
||||
<p>Read lines from the standard input into the indexed array variable <var>array</var>,
|
||||
@@ -5309,8 +5328,8 @@ The exit status is greater than 128 if the timeout is exceeded.
|
||||
<dt><code>readarray</code></dt>
|
||||
<dd><a name="index-readarray"></a>
|
||||
<div class="example">
|
||||
<pre class="example">readarray [-d <var>delim</var>] [-n <var>count</var>] [-O <var>origin</var>] [-s <var>count</var>] [-t] [-u <var>fd</var>]
|
||||
[-C <var>callback</var>] [-c <var>quantum</var>] [<var>array</var>]
|
||||
<pre class="example">readarray [-d <var>delim</var>] [-n <var>count</var>] [-O <var>origin</var>] [-s <var>count</var>]
|
||||
[-t] [-u <var>fd</var>] [-C <var>callback</var>] [-c <var>quantum</var>] [<var>array</var>]
|
||||
</pre></div>
|
||||
|
||||
<p>Read lines from the standard input into the indexed array variable <var>array</var>,
|
||||
@@ -7180,7 +7199,7 @@ as the sole input. If set, the value denotes the number
|
||||
of consecutive <code>EOF</code> characters that can be read as the
|
||||
first character on an input line
|
||||
before the shell will exit. If the variable exists but does not
|
||||
have a numeric value (or has no value) then the default is 10.
|
||||
have a numeric value, or has no value, then the default is 10.
|
||||
If the variable does not exist, then <code>EOF</code> signifies the end of
|
||||
input to the shell. This is only in effect for interactive shells.
|
||||
</p>
|
||||
@@ -7583,9 +7602,12 @@ Next: <a href="#Bash-Startup-Files" accesskey="n" rel="next">Bash Startup Files<
|
||||
<h3 class="section">6.1 Invoking Bash</h3>
|
||||
|
||||
<div class="example">
|
||||
<pre class="example">bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <var>option</var>] [-O <var>shopt_option</var>] [<var>argument</var> …]
|
||||
bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <var>option</var>] [-O <var>shopt_option</var>] -c <var>string</var> [<var>argument</var> …]
|
||||
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <var>option</var>] [-O <var>shopt_option</var>] [<var>argument</var> …]
|
||||
<pre class="example">bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o <var>option</var>]
|
||||
[-O <var>shopt_option</var>] [<var>argument</var> …]
|
||||
bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o <var>option</var>]
|
||||
[-O <var>shopt_option</var>] -c <var>string</var> [<var>argument</var> …]
|
||||
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o <var>option</var>]
|
||||
[-O <var>shopt_option</var>] [<var>argument</var> …]
|
||||
</pre></div>
|
||||
|
||||
<p>All of the single-character options used with the <code>set</code> builtin
|
||||
@@ -8014,7 +8036,7 @@ when a shell with history enabled exits.
|
||||
(see <a href="#Signals">Signals</a>).
|
||||
|
||||
</li><li> In the absence of any traps, <code>SIGINT</code> is caught and handled
|
||||
((see <a href="#Signals">Signals</a>).
|
||||
(see <a href="#Signals">Signals</a>).
|
||||
<code>SIGINT</code> will interrupt some shell builtins.
|
||||
|
||||
</li><li> An interactive login shell sends a <code>SIGHUP</code> to all jobs on exit
|
||||
@@ -8843,7 +8865,7 @@ shell session.
|
||||
<p>After the string is decoded, it is expanded via
|
||||
parameter expansion, command substitution, arithmetic
|
||||
expansion, and quote removal, subject to the value of the
|
||||
<code>promptvars</code> shell option (see <a href="#Bash-Builtins">Bash Builtins</a>).
|
||||
<code>promptvars</code> shell option (see <a href="#The-Shopt-Builtin">The Shopt Builtin</a>).
|
||||
</p>
|
||||
<hr>
|
||||
<a name="The-Restricted-Shell"></a>
|
||||
@@ -10004,6 +10026,7 @@ The default value is ‘<samp>off</samp>’.
|
||||
<p>If set to ‘<samp>on</samp>’, and <var>completion-ignore-case</var> is enabled, Readline
|
||||
treats hyphens (‘<samp>-</samp>’) and underscores (‘<samp>_</samp>’) as equivalent when
|
||||
performing case-insensitive filename matching and completion.
|
||||
The default value is ‘<samp>off</samp>’.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>completion-prefix-display-length</code></dt>
|
||||
@@ -10365,7 +10388,7 @@ Meta-Rubout: backward-kill-word
|
||||
Control-o: "> output"
|
||||
</pre></div>
|
||||
|
||||
<p>In the above example, <kbd>C-u</kbd> is bound to the function
|
||||
<p>In the example above, <kbd>C-u</kbd> is bound to the function
|
||||
<code>universal-argument</code>,
|
||||
<kbd>M-DEL</kbd> is bound to the function <code>backward-kill-word</code>, and
|
||||
<kbd>C-o</kbd> is bound to run the macro
|
||||
@@ -11068,7 +11091,7 @@ how to insert key sequences like <kbd>C-q</kbd>, for example.
|
||||
sequence sent by some terminals, and such a binding is assigned by default.
|
||||
It allows Readline to insert the pasted text as a single unit without treating
|
||||
each character as if it had been read from the keyboard. The characters
|
||||
are inserted as if each one was bound to <code>self-insert</code>) instead of
|
||||
are inserted as if each one was bound to <code>self-insert</code> instead of
|
||||
executing any editing commands.
|
||||
</p>
|
||||
</dd>
|
||||
@@ -11973,10 +11996,10 @@ matches were generated.
|
||||
<dt><code>complete</code></dt>
|
||||
<dd><a name="index-complete"></a>
|
||||
<div class="example">
|
||||
<pre class="example"><code>complete [-abcdefgjksuv] [-o <var>comp-option</var>] [-DE] [-A <var>action</var>] [-G <var>globpat</var>] [-W <var>wordlist</var>]
|
||||
[-F <var>function</var>] [-C <var>command</var>] [-X <var>filterpat</var>]
|
||||
<pre class="example"><code>complete [-abcdefgjksuv] [-o <var>comp-option</var>] [-DEI] [-A <var>action</var>] [-G <var>globpat</var>]
|
||||
[-W <var>wordlist</var>] [-F <var>function</var>] [-C <var>command</var>] [-X <var>filterpat</var>]
|
||||
[-P <var>prefix</var>] [-S <var>suffix</var>] <var>name</var> [<var>name</var> …]</code>
|
||||
<code>complete -pr [-DE] [<var>name</var> …]</code>
|
||||
<code>complete -pr [-DEI] [<var>name</var> …]</code>
|
||||
</pre></div>
|
||||
|
||||
<p>Specify how arguments to each <var>name</var> should be completed.
|
||||
@@ -11992,10 +12015,15 @@ on a command for which no completion has previously been defined.
|
||||
The <samp>-E</samp> option indicates that the remaining options and actions should
|
||||
apply to “empty” command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
The <samp>-I</samp> option indicates that the remaining options and actions should
|
||||
apply to completion on the inital non-assignment word on the line, or after a
|
||||
command delimiter such as ‘<samp>;</samp>’ or ‘<samp>|</samp>’, which is usually command
|
||||
name completion.
|
||||
If multiple options are supplied, the <samp>-D</samp> option takes precedence
|
||||
over <samp>-E</samp>, and both take precedence over <samp>-I</samp>.
|
||||
</p>
|
||||
<p>The process of applying these completion specifications when word completion
|
||||
is attempted is described above (see <a href="#Programmable-Completion">Programmable Completion</a>). The
|
||||
<samp>-D</samp> option takes precedence over <samp>-E</samp>.
|
||||
is attempted is described above (see <a href="#Programmable-Completion">Programmable Completion</a>).
|
||||
</p>
|
||||
<p>Other options, if specified, have the following meanings.
|
||||
The arguments to the <samp>-G</samp>, <samp>-W</samp>, and <samp>-X</samp> options
|
||||
@@ -12027,7 +12055,7 @@ no matches.
|
||||
</dd>
|
||||
<dt><code>filenames</code></dt>
|
||||
<dd><p>Tell Readline that the compspec generates filenames, so it can perform any
|
||||
filename-specific processing (like adding a slash to directory names
|
||||
filename-specific processing (like adding a slash to directory names,
|
||||
quoting special characters, or suppressing trailing spaces).
|
||||
This option is intended to be used with shell functions specified
|
||||
with <samp>-F</samp>.
|
||||
@@ -12221,7 +12249,7 @@ an error occurs adding a completion specification.
|
||||
<dt><code>compopt</code></dt>
|
||||
<dd><a name="index-compopt"></a>
|
||||
<div class="example">
|
||||
<pre class="example"><code>compopt</code> [-o <var>option</var>] [-DE] [+o <var>option</var>] [<var>name</var>]
|
||||
<pre class="example"><code>compopt</code> [-o <var>option</var>] [-DEI] [+o <var>option</var>] [<var>name</var>]
|
||||
</pre></div>
|
||||
<p>Modify completion options for each <var>name</var> according to the
|
||||
<var>option</var>s, or for the currently-executing completion if no <var>name</var>s
|
||||
@@ -12236,8 +12264,13 @@ on a command for which no completion has previously been defined.
|
||||
The <samp>-E</samp> option indicates that the remaining options should
|
||||
apply to “empty” command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
The <samp>-I</samp> option indicates that the remaining options should
|
||||
apply to completion on the inital non-assignment word on the line, or after a
|
||||
command delimiter such as ‘<samp>;</samp>’ or ‘<samp>|</samp>’, which is usually command
|
||||
name completion.
|
||||
</p>
|
||||
<p>The <samp>-D</samp> option takes precedence over <samp>-E</samp>.
|
||||
<p>If multiple options are supplied, the <samp>-D</samp> option takes precedence
|
||||
over <samp>-E</samp>, and both take precedence over <samp>-I</samp>
|
||||
</p>
|
||||
<p>The return value is true unless an invalid option is supplied, an attempt
|
||||
is made to modify the options for a <var>name</var> for which no completion
|
||||
@@ -12291,7 +12324,7 @@ _comp_cd()
|
||||
local cur _skipdot _cdpath
|
||||
local i j k
|
||||
|
||||
# Tilde expansion, with side effect of expanding tilde to full pathname
|
||||
# Tilde expansion, which also expands tilde to full pathname
|
||||
case "$2" in
|
||||
\~*) eval cur="$2" ;;
|
||||
*) cur=$2 ;;
|
||||
@@ -13285,7 +13318,7 @@ compiled and linked, rather than changing run-time features.
|
||||
</p>
|
||||
<dl compact="compact">
|
||||
<dt><code>--enable-largefile</code></dt>
|
||||
<dd><p>Enable support for <a href="http://www.sas.com/standards/large_file/x_open.20Mar96.html">large files</a> if the operating system requires special compiler options
|
||||
<dd><p>Enable support for <a href="http://www.unix.org/version2/whatsnew/lfs20mar.html">large files</a> if the operating system requires special compiler options
|
||||
to build programs which can access large files. This is enabled by
|
||||
default, if the operating system provides large file support.
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user