next set of documentation updates (word splitting), rearrange a test in readline's tilde expansion to avoid touching uninitialized data

This commit is contained in:
Chet Ramey
2024-10-22 15:40:46 -04:00
parent 261c6e8cc6
commit 474743f2da
21 changed files with 4581 additions and 4506 deletions
+18
View File
@@ -10380,3 +10380,21 @@ doc/bash.1,lib/readline/doc/readline.3
-----
sig.c
- fix minix typo
lib/readline/history.c
- history_do_write: for portability, make sure that the offset argument
to mmap is page-aligned, since some systems (linux, macos) require it.
Report and patch from Grisha Levit <grishalevit@gmail.com>
lib/readline/util.c
- rl_tilde_expand: rearrange code to do bounds checking before data
validation when finding the end of the tilde-word to avoid
touching uninitialized data
Report and patch from Grisha Levit <grishalevit@gmail.com>
10/20
-----
doc/bash.1,doc/bashref.texi
- update word splitting section to add what IFS whitespace means and
how word splitting uses it. Based on a bug-bash discussion
+3151 -3138
View File
File diff suppressed because it is too large Load Diff
+47 -58
View File
@@ -5,14 +5,14 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Tue Oct 15 16:53:49 EDT 2024
.\" Last Change: Sun Oct 20 12:31:15 EDT 2024
.\"
.\" bash_builtins, strip all but Built-Ins section
.\" avoid a warning about an undefined register
.\" .if !rzY .nr zY 0
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2024 October 15" "GNU Bash 5.3"
.TH BASH 1 "2024 October 20" "GNU Bash 5.3"
.\"
.ie \n(.g \{\
.ds ' \(aq
@@ -483,6 +483,10 @@ document.
.B blank
A space or tab.
.TP
.B whitespace
A character belonging to the \fBspace\fP character class in the
current locale, or for which \fIisspace\fP(3) returns true.
.TP
.B word
A sequence of characters considered as a single unit by the shell.
Also known as a
@@ -4015,92 +4019,77 @@ and
arithmetic expansion
that did not occur within double quotes for
.IR "word splitting" .
Words that were not expanded are not split.
.PP
The shell treats each character of
.SM
.B IFS
as a delimiter, and splits the results of the other
expansions into words using these characters as field terminators.
as a delimiter,
and splits the results of the other expansions into words
using these characters as field terminators.
.PP
An \fIIFS whitespace\fP character is whitespace as defined above
(see \fBDefinitions\fP) that appears in the value of
.SM
.BR IFS .
Space, tab, and newline are always considered IFS whitespace, even
if they don't appear in the locale's \fBspace\fP category.
.PP
If
.SM
.B IFS
is unset, or its
value is exactly
is unset, field splitting acts as if its value were
.BR <space><tab><newline> ,
the default, then
sequences of
.BR space ,
.BR tab ,
and
.B newline
at the beginning and end of the results of the previous
expansions are ignored, and
any sequence of
and treats these characters as IFS whitespace.
If the value of
.SM
.B IFS
characters not at the beginning or end delimits words.
If
.SM
.B IFS
has a value other than the default, then sequences of
the whitespace characters
.BR space ,
.BR tab ,
and
.B newline
present in the value of
.SM
.B IFS
(an
.SM
.B IFS
whitespace character)
are ignored at the beginning and end of the word.
Any character in
.SM
.B IFS
that is not
.SM
.B IFS
whitespace, along with any adjacent
.SM
.B IFS
whitespace characters, delimits a field.
A sequence of
.SM
.B IFS
whitespace characters is also treated as a delimiter.
is null, no word splitting occurs,
but implicit null arguments (see below) are still removed.
.PP
Word splitting begins by removing sequences of IFS whitespace characters
from the beginning and end of the results of the previous expansions,
then splits the remaining words.
.PP
If the value of
.SM
.B IFS
is null, no word splitting occurs.
consists solely of IFS whitespace,
any sequence of IFS whitespace characters delimits a field,
so a field consists of characters that are not unquoted IFS
whitespace, and null fields result only from quoting.
.PP
If
.SM
.B IFS
is unset, word splitting behaves as if it contained the default value
of
.BR <space><tab><newline> .
contains a non-whitespace character, then any character in
the value of
.SM
.B IFS
that is not IFS whitespace,
along with any adjacent IFS whitespace characters, delimits a field.
This means that adjacent non-IFS-whitespace delimiters produce a
null field.
A sequence of IFS whitespace characters also delimits a field.
.PP
Explicit null arguments (\^\fB\*"\^\*"\fP or
\^\fB\*'\^\*'\fP\^) are retained
and passed to commands as empty strings.
Unquoted implicit null arguments, resulting from the expansion of
parameters that have no values, are removed.
If a parameter with no value is expanded within double quotes, a
null argument results and is retained
and passed to a command as an empty string.
Expanding a parameter with no value within double quotes
produces a null field,
which is retained and passed to a command as an empty string.
.PP
When a quoted null argument appears as part of a word whose expansion is
non-null, the null argument is removed.
non-null, word splitting removes the null argument portion,
leaving the non-null expansion.
That is, the word
.Q "\-d\*'\^\*'"
becomes
.Q \-d
after word splitting and null argument removal.
.PP
Note that if no expansion occurs, no splitting is performed.
.SS Pathname Expansion
.SS "Pathname Expansion"
After word splitting,
unless the
.B \-f
+53 -72
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 October 15<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2024 October 20<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -643,6 +643,11 @@ document.
<DD>
A space or tab.
<DT><B>whitespace</B>
<DD>
A character belonging to the <B>space</B> character class in the
current locale, or for which <I>isspace</I>(3) returns true.
<DT><B>word</B>
<DD>
@@ -5010,96 +5015,72 @@ arithmetic expansion
that did not occur within double quotes for
<I>word splitting</I>.
Words that were not expanded are not split.
<P>
The shell treats each character of
<FONT SIZE=-1><B>IFS</B>
</FONT>
as a delimiter, and splits the results of the other
expansions into words using these characters as field terminators.
as a delimiter,
and splits the results of the other expansions into words
using these characters as field terminators.
<P>
An <I>IFS whitespace</I> character is whitespace as defined above
(see <B>Definitions</B>) that appears in the value of
<FONT SIZE=-1><B>IFS</B>.
</FONT>
Space, tab, and newline are always considered IFS whitespace, even
if they don't appear in the locale's <B>space</B> category.
<P>
If
<FONT SIZE=-1><B>IFS</B>
</FONT>
is unset, or its
value is exactly
is unset, field splitting acts as if its value were
<B>&lt;space&gt;&lt;tab&gt;&lt;newline&gt;</B>,
the default, then
sequences of
<B>space</B>,
<B>tab</B>,
and
<B>newline</B>
at the beginning and end of the results of the previous
expansions are ignored, and
any sequence of
and treats these characters as IFS whitespace.
If the value of
<FONT SIZE=-1><B>IFS</B>
</FONT>
characters not at the beginning or end delimits words.
If
<FONT SIZE=-1><B>IFS</B>
is null, no word splitting occurs,
but implicit null arguments (see below) are still removed.
<P>
</FONT>
has a value other than the default, then sequences of
the whitespace characters
<B>space</B>,
<B>tab</B>,
and
<B>newline</B>
present in the value of
<FONT SIZE=-1><B>IFS</B>
</FONT>
(an
<FONT SIZE=-1><B>IFS</B>
</FONT>
whitespace character)
are ignored at the beginning and end of the word.
Any character in
<FONT SIZE=-1><B>IFS</B>
</FONT>
that is not
<FONT SIZE=-1><B>IFS</B>
</FONT>
whitespace, along with any adjacent
<FONT SIZE=-1><B>IFS</B>
</FONT>
whitespace characters, delimits a field.
A sequence of
<FONT SIZE=-1><B>IFS</B>
</FONT>
whitespace characters is also treated as a delimiter.
Word splitting begins by removing sequences of IFS whitespace characters
from the beginning and end of the results of the previous expansions,
then splits the remaining words.
<P>
If the value of
<FONT SIZE=-1><B>IFS</B>
</FONT>
is null, no word splitting occurs.
consists solely of IFS whitespace,
any sequence of IFS whitespace characters delimits a field,
so a field consists of characters that are not unquoted IFS
whitespace, and null fields result only from quoting.
<P>
If
<FONT SIZE=-1><B>IFS</B>
</FONT>
is unset, word splitting behaves as if it contained the default value
of
<B>&lt;space&gt;&lt;tab&gt;&lt;newline&gt;</B>.
contains a non-whitespace character, then any character in
the value of
<FONT SIZE=-1><B>IFS</B>
</FONT>
that is not IFS whitespace,
along with any adjacent IFS whitespace characters, delimits a field.
This means that adjacent non-IFS-whitespace delimiters produce a
null field.
A sequence of IFS whitespace characters also delimits a field.
<P>
Explicit null arguments (<B>&quot;
@@ -5109,19 +5090,19 @@ Explicit null arguments (<B>&quot;
and passed to commands as empty strings.
Unquoted implicit null arguments, resulting from the expansion of
parameters that have no values, are removed.
If a parameter with no value is expanded within double quotes, a
null argument results and is retained
and passed to a command as an empty string.
Expanding a parameter with no value within double quotes
produces a null field,
which is retained and passed to a command as an empty string.
<P>
When a quoted null argument appears as part of a word whose expansion is
non-null, the null argument is removed.
non-null, word splitting removes the null argument portion,
leaving the non-null expansion.
That is, the word
becomes
after word splitting and null argument removal.
<P>
Note that if no expansion occurs, no splitting is performed.
<A NAME="lbBH">&nbsp;</A>
<H4>Pathname Expansion</H4>
@@ -16376,7 +16357,7 @@ Array variables may not (yet) be exported.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 October 15<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2024 October 20<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -16485,7 +16466,7 @@ Array variables may not (yet) be exported.
<DT><A HREF="#lbDJ">BUGS</A><DD>
</DL>
<HR>
This document was created by man2html from /usr/local/src/bash/bash-20241015/doc/bash.1.<BR>
Time: 18 October 2024 12:02:45 EDT
This document was created by man2html from /usr/local/src/bash/bash-20241018/doc/bash.1.<BR>
Time: 20 October 2024 12:37:36 EDT
</BODY>
</HTML>
+187 -174
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 7.1 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 15 October 2024).
Bash shell (version 5.3, 20 October 2024).
This is Edition 5.3, last updated 15 October 2024, of The GNU Bash
This is Edition 5.3, last updated 20 October 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2024 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 15 October 2024). The Bash home page is
Bash shell (version 5.3, 20 October 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 15 October 2024, of The GNU Bash
This is Edition 5.3, last updated 20 October 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -168,6 +168,10 @@ These definitions are used throughout the remainder of this manual.
blank
A space or tab character.
whitespace
A character belonging to the space character class in the current
locale, or for which isspace() returns true.
builtin
A command that is implemented internally by the shell itself,
rather than by an executable program somewhere in the file system.
@@ -2428,38 +2432,47 @@ File: bash.info, Node: Word Splitting, Next: Filename Expansion, Prev: Proces
The shell scans the results of parameter expansion, command
substitution, and arithmetic expansion that did not occur within double
quotes for word splitting.
quotes for word splitting. Words that were not expanded are not split.
The shell treats each character of $IFS as a delimiter, and splits
the results of the other expansions into words using these characters as
field terminators.
the results of the other expansions into fields using these characters
as field terminators.
If IFS is unset, or its value is exactly <space><tab><newline>,
the default, then sequences of space, tab, and newline at the
beginning and end of the results of the previous expansions are ignored,
and any sequence of IFS characters not at the beginning or end
delimits words. If IFS has a value other than the default, then
sequences of the whitespace characters space, tab, and newline
present the value of IFS (an IFS whitespace character) are ignored
at the beginning and end of the word. Any character in IFS that is
not IFS whitespace, along with any adjacent IFS whitespace
characters, delimits a field. A sequence of IFS whitespace characters
is also treated as a delimiter.
An “IFS whitespace” character is whitespace as defined above (*note
Definitions::) that appears in the value of IFS. Space, tab, and
newline are always considered IFS whitespace, even if they don't appear
in the locale's space category.
If the value of IFS is null, no word splitting occurs. If IFS is
unset, word splitting behaves as if it contained the default value
<space><tab><newline>.
If IFS is unset, word splitting behaves as if its value were
<space><tab><newline>, and treats these characters as IFS whitespace.
If the value of IFS is null, no word splitting occurs, but implicit
null arguments (see below) are still removed.
Word splitting begins by removing sequences of IFS whitespace
characters from the beginning and end of the results of the previous
expansions, then splits the remaining words.
If the value of IFS consists solely of IFS whitespace, any sequence
of IFS whitespace characters delimits a field, so a field consists of
characters that are not unquoted IFS whitespace, and null fields result
only from quoting.
If IFS contains a non-whitespace character, then any character in
the value of IFS that is not IFS whitespace, along with any adjacent
IFS whitespace characters, delimits a field. This means that adjacent
non-IFS-whitespace delimiters produce a null field. A sequence of IFS
whitespace characters also delimits a field.
Explicit null arguments ("" or '') are retained and passed to
commands as empty strings. Unquoted implicit null arguments, resulting
from the expansion of parameters that have no values, are removed. If a
parameter with no value is expanded within double quotes, a null
argument results and is retained and passed to a command as an empty
string. When a quoted null argument appears as part of a word whose
expansion is non-null, the null argument is removed. That is, the word
-d'' becomes -d after word splitting and null argument removal.
from the expansion of parameters that have no values, are removed.
Expanding a parameter with no value within double quotes produces a null
field, which is retained and passed to a command as an empty string.
Note that if no expansion occurs, no splitting is performed.
When a quoted null argument appears as part of a word whose expansion
is non-null, word splitting removes the null argument portion, leaving
the non-null expansion. That is, the word -d'' becomes -d after
word splitting and null argument removal.

File: bash.info, Node: Filename Expansion, Next: Quote Removal, Prev: Word Splitting, Up: Shell Expansions
@@ -13272,7 +13285,7 @@ D.5 Concept Index
* Bourne shell: Basic Shell Features.
(line 6)
* brace expansion: Brace Expansion. (line 6)
* builtin: Definitions. (line 17)
* builtin: Definitions. (line 21)
* command editing: Readline Bare Essentials.
(line 6)
* command execution: Command Search and Execution.
@@ -13304,7 +13317,7 @@ D.5 Concept Index
(line 6)
* conditional arithmetic operator: Shell Arithmetic. (line 18)
* configuration: Basic Installation. (line 6)
* control operator: Definitions. (line 21)
* control operator: Definitions. (line 25)
* coprocess: Coprocesses. (line 6)
* directory stack: The Directory Stack. (line 6)
* dollar-single quote quoting: ANSI-C Quoting. (line 6)
@@ -13315,7 +13328,7 @@ D.5 Concept Index
* event designators: Event Designators. (line 6)
* execution environment: Command Execution Environment.
(line 6)
* exit status: Definitions. (line 26)
* exit status: Definitions. (line 30)
* exit status <1>: Exit Status. (line 6)
* expansion: Shell Expansions. (line 6)
* expansion, arithmetic: Arithmetic Expansion.
@@ -13329,8 +13342,8 @@ D.5 Concept Index
* expressions, arithmetic: Shell Arithmetic. (line 6)
* expressions, conditional: Bash Conditional Expressions.
(line 6)
* field: Definitions. (line 30)
* filename: Definitions. (line 35)
* field: Definitions. (line 34)
* filename: Definitions. (line 39)
* filename expansion: Filename Expansion. (line 9)
* foreground: Job Control Basics. (line 6)
* functions, shell: Shell Functions. (line 6)
@@ -13342,7 +13355,7 @@ D.5 Concept Index
(line 6)
* History, how to use: A Programmable Completion Example.
(line 113)
* identifier: Definitions. (line 51)
* identifier: Definitions. (line 55)
* initialization file, readline: Readline Init File. (line 6)
* installation: Basic Installation. (line 6)
* interaction, readline: Readline Interaction.
@@ -13352,8 +13365,8 @@ D.5 Concept Index
* internationalization: Locale Translation. (line 6)
* internationalized scripts: Creating Internationalized Scripts.
(line 3)
* job: Definitions. (line 38)
* job control: Definitions. (line 42)
* job: Definitions. (line 42)
* job control: Definitions. (line 46)
* job control <1>: Job Control Basics. (line 6)
* kill ring: Readline Killing Commands.
(line 18)
@@ -13362,12 +13375,12 @@ D.5 Concept Index
* localization: Locale Translation. (line 6)
* login shell: Invoking Bash. (line 133)
* matching, pattern: Pattern Matching. (line 6)
* metacharacter: Definitions. (line 46)
* name: Definitions. (line 51)
* metacharacter: Definitions. (line 50)
* name: Definitions. (line 55)
* native languages: Locale Translation. (line 6)
* notation, readline: Readline Bare Essentials.
(line 6)
* operator, shell: Definitions. (line 57)
* operator, shell: Definitions. (line 61)
* parameter expansion: Shell Parameter Expansion.
(line 6)
* parameters: Shell Parameters. (line 6)
@@ -13380,8 +13393,8 @@ D.5 Concept Index
* POSIX: Definitions. (line 9)
* POSIX description: Bash POSIX Mode. (line 9)
* POSIX Mode: Bash POSIX Mode. (line 48)
* process group: Definitions. (line 62)
* process group ID: Definitions. (line 66)
* process group: Definitions. (line 66)
* process group ID: Definitions. (line 70)
* process substitution: Process Substitution.
(line 6)
* programmable completion: Programmable Completion.
@@ -13393,32 +13406,32 @@ D.5 Concept Index
* Readline, how to use: Job Control Variables.
(line 23)
* redirection: Redirections. (line 6)
* reserved word: Definitions. (line 70)
* reserved word: Definitions. (line 74)
* reserved words: Reserved Words. (line 6)
* restricted shell: The Restricted Shell.
(line 6)
* return status: Definitions. (line 75)
* return status: Definitions. (line 79)
* shell arithmetic: Shell Arithmetic. (line 6)
* shell function: Shell Functions. (line 6)
* shell script: Shell Scripts. (line 6)
* shell variable: Shell Parameters. (line 6)
* shell, interactive: Interactive Shells. (line 6)
* signal: Definitions. (line 78)
* signal: Definitions. (line 82)
* signal handling: Signals. (line 6)
* special builtin: Definitions. (line 82)
* special builtin: Definitions. (line 86)
* special builtin <1>: Special Builtins. (line 6)
* startup files: Bash Startup Files. (line 6)
* string translations: Creating Internationalized Scripts.
(line 3)
* suspending jobs: Job Control Basics. (line 6)
* tilde expansion: Tilde Expansion. (line 6)
* token: Definitions. (line 86)
* token: Definitions. (line 90)
* translation, native languages: Locale Translation. (line 6)
* unary arithmetic operators: Shell Arithmetic. (line 18)
* variable, shell: Shell Parameters. (line 6)
* variables, readline: Readline Init File Syntax.
(line 37)
* word: Definitions. (line 90)
* word: Definitions. (line 94)
* word splitting: Word Splitting. (line 6)
* yanking text: Readline Killing Commands.
(line 6)
@@ -13431,133 +13444,133 @@ Node: Introduction2838
Node: What is Bash?3051
Node: What is a shell?4184
Node: Definitions6794
Node: Basic Shell Features9970
Node: Shell Syntax11194
Node: Shell Operation12221
Node: Quoting13512
Node: Escape Character14850
Node: Single Quotes15385
Node: Double Quotes15734
Node: ANSI-C Quoting17079
Node: Locale Translation18473
Node: Creating Internationalized Scripts19880
Node: Comments24078
Node: Shell Commands24845
Node: Reserved Words25784
Node: Simple Commands26649
Node: Pipelines27311
Node: Lists30567
Node: Compound Commands32439
Node: Looping Constructs33448
Node: Conditional Constructs35967
Node: Command Grouping50899
Node: Coprocesses52391
Node: GNU Parallel55077
Node: Shell Functions55995
Node: Shell Parameters64472
Node: Positional Parameters69210
Node: Special Parameters70300
Node: Shell Expansions73761
Node: Brace Expansion75950
Node: Tilde Expansion78678
Node: Shell Parameter Expansion81633
Node: Command Substitution101401
Node: Arithmetic Expansion104934
Node: Process Substitution105947
Node: Word Splitting107063
Node: Filename Expansion109160
Node: Pattern Matching112428
Node: Quote Removal117765
Node: Redirections118069
Node: Executing Commands128278
Node: Simple Command Expansion128945
Node: Command Search and Execution131053
Node: Command Execution Environment133497
Node: Environment136945
Node: Exit Status138848
Node: Signals140906
Node: Shell Scripts144804
Node: Shell Builtin Commands148102
Node: Bourne Shell Builtins150213
Node: Bash Builtins176763
Node: Modifying Shell Behavior213211
Node: The Set Builtin213553
Node: The Shopt Builtin225489
Node: Special Builtins242541
Node: Shell Variables243530
Node: Bourne Shell Variables243964
Node: Bash Variables246472
Node: Bash Features284781
Node: Invoking Bash285795
Node: Bash Startup Files292221
Node: Interactive Shells297513
Node: What is an Interactive Shell?297921
Node: Is this Shell Interactive?298583
Node: Interactive Shell Behavior299407
Node: Bash Conditional Expressions303168
Node: Shell Arithmetic308387
Node: Aliases311716
Node: Arrays314851
Node: The Directory Stack321914
Node: Directory Stack Builtins322711
Node: Controlling the Prompt327156
Node: The Restricted Shell330040
Node: Bash POSIX Mode332922
Node: Shell Compatibility Mode351251
Node: Job Control360258
Node: Job Control Basics360715
Node: Job Control Builtins366993
Node: Job Control Variables373675
Node: Command Line Editing374906
Node: Introduction and Notation376609
Node: Readline Interaction378961
Node: Readline Bare Essentials380149
Node: Readline Movement Commands381957
Node: Readline Killing Commands382953
Node: Readline Arguments384976
Node: Searching386033
Node: Readline Init File388294
Node: Readline Init File Syntax389598
Node: Conditional Init Constructs416346
Node: Sample Init File420731
Node: Bindable Readline Commands423852
Node: Commands For Moving425390
Node: Commands For History427617
Node: Commands For Text432870
Node: Commands For Killing436995
Node: Numeric Arguments439783
Node: Commands For Completion440935
Node: Keyboard Macros445435
Node: Miscellaneous Commands446136
Node: Readline vi Mode452689
Node: Programmable Completion453666
Node: Programmable Completion Builtins461712
Node: A Programmable Completion Example473377
Node: Using History Interactively478722
Node: Bash History Facilities479403
Node: Bash History Builtins483138
Node: History Interaction489609
Node: Event Designators494563
Node: Word Designators496141
Node: Modifiers498449
Node: Installing Bash500390
Node: Basic Installation501506
Node: Compilers and Options505382
Node: Compiling For Multiple Architectures506132
Node: Installation Names507885
Node: Specifying the System Type510119
Node: Sharing Defaults510865
Node: Operation Controls511579
Node: Optional Features512598
Node: Reporting Bugs524978
Node: Major Differences From The Bourne Shell526336
Node: GNU Free Documentation License547756
Node: Indexes572933
Node: Builtin Index573384
Node: Reserved Word Index580482
Node: Variable Index582927
Node: Function Index600340
Node: Concept Index614196
Node: Basic Shell Features10121
Node: Shell Syntax11345
Node: Shell Operation12372
Node: Quoting13663
Node: Escape Character15001
Node: Single Quotes15536
Node: Double Quotes15885
Node: ANSI-C Quoting17230
Node: Locale Translation18624
Node: Creating Internationalized Scripts20031
Node: Comments24229
Node: Shell Commands24996
Node: Reserved Words25935
Node: Simple Commands26800
Node: Pipelines27462
Node: Lists30718
Node: Compound Commands32590
Node: Looping Constructs33599
Node: Conditional Constructs36118
Node: Command Grouping51050
Node: Coprocesses52542
Node: GNU Parallel55228
Node: Shell Functions56146
Node: Shell Parameters64623
Node: Positional Parameters69361
Node: Special Parameters70451
Node: Shell Expansions73912
Node: Brace Expansion76101
Node: Tilde Expansion78829
Node: Shell Parameter Expansion81784
Node: Command Substitution101552
Node: Arithmetic Expansion105085
Node: Process Substitution106098
Node: Word Splitting107214
Node: Filename Expansion109658
Node: Pattern Matching112926
Node: Quote Removal118263
Node: Redirections118567
Node: Executing Commands128776
Node: Simple Command Expansion129443
Node: Command Search and Execution131551
Node: Command Execution Environment133995
Node: Environment137443
Node: Exit Status139346
Node: Signals141404
Node: Shell Scripts145302
Node: Shell Builtin Commands148600
Node: Bourne Shell Builtins150711
Node: Bash Builtins177261
Node: Modifying Shell Behavior213709
Node: The Set Builtin214051
Node: The Shopt Builtin225987
Node: Special Builtins243039
Node: Shell Variables244028
Node: Bourne Shell Variables244462
Node: Bash Variables246970
Node: Bash Features285279
Node: Invoking Bash286293
Node: Bash Startup Files292719
Node: Interactive Shells298011
Node: What is an Interactive Shell?298419
Node: Is this Shell Interactive?299081
Node: Interactive Shell Behavior299905
Node: Bash Conditional Expressions303666
Node: Shell Arithmetic308885
Node: Aliases312214
Node: Arrays315349
Node: The Directory Stack322412
Node: Directory Stack Builtins323209
Node: Controlling the Prompt327654
Node: The Restricted Shell330538
Node: Bash POSIX Mode333420
Node: Shell Compatibility Mode351749
Node: Job Control360756
Node: Job Control Basics361213
Node: Job Control Builtins367491
Node: Job Control Variables374173
Node: Command Line Editing375404
Node: Introduction and Notation377107
Node: Readline Interaction379459
Node: Readline Bare Essentials380647
Node: Readline Movement Commands382455
Node: Readline Killing Commands383451
Node: Readline Arguments385474
Node: Searching386531
Node: Readline Init File388792
Node: Readline Init File Syntax390096
Node: Conditional Init Constructs416844
Node: Sample Init File421229
Node: Bindable Readline Commands424350
Node: Commands For Moving425888
Node: Commands For History428115
Node: Commands For Text433368
Node: Commands For Killing437493
Node: Numeric Arguments440281
Node: Commands For Completion441433
Node: Keyboard Macros445933
Node: Miscellaneous Commands446634
Node: Readline vi Mode453187
Node: Programmable Completion454164
Node: Programmable Completion Builtins462210
Node: A Programmable Completion Example473875
Node: Using History Interactively479220
Node: Bash History Facilities479901
Node: Bash History Builtins483636
Node: History Interaction490107
Node: Event Designators495061
Node: Word Designators496639
Node: Modifiers498947
Node: Installing Bash500888
Node: Basic Installation502004
Node: Compilers and Options505880
Node: Compiling For Multiple Architectures506630
Node: Installation Names508383
Node: Specifying the System Type510617
Node: Sharing Defaults511363
Node: Operation Controls512077
Node: Optional Features513096
Node: Reporting Bugs525476
Node: Major Differences From The Bourne Shell526834
Node: GNU Free Documentation License548254
Node: Indexes573431
Node: Builtin Index573882
Node: Reserved Word Index580980
Node: Variable Index583425
Node: Function Index600838
Node: Concept Index614694

End Tag Table
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -129,9 +129,9 @@
@xrdef{Command Search and Execution-snt}{Section@tie 3.7.2}
@xrdef{Executing Commands-pg}{44}
@xrdef{Simple Command Expansion-pg}{44}
@xrdef{Command Search and Execution-pg}{44}
@xrdef{Command Execution Environment-title}{Command Execution Environment}
@xrdef{Command Execution Environment-snt}{Section@tie 3.7.3}
@xrdef{Command Search and Execution-pg}{45}
@xrdef{Command Execution Environment-pg}{45}
@xrdef{Environment-title}{Environment}
@xrdef{Environment-snt}{Section@tie 3.7.4}
@@ -141,10 +141,10 @@
@xrdef{Signals-title}{Signals}
@xrdef{Signals-snt}{Section@tie 3.7.6}
@xrdef{Exit Status-pg}{47}
@xrdef{Signals-pg}{47}
@xrdef{Signals-pg}{48}
@xrdef{Shell Scripts-title}{Shell Scripts}
@xrdef{Shell Scripts-snt}{Section@tie 3.8}
@xrdef{Shell Scripts-pg}{48}
@xrdef{Shell Scripts-pg}{49}
@xrdef{Shell Builtin Commands-title}{Shell Builtin Commands}
@xrdef{Shell Builtin Commands-snt}{Chapter@tie 4}
@xrdef{Bourne Shell Builtins-title}{Bourne Shell Builtins}
+5 -5
View File
@@ -12,7 +12,7 @@
\entry{operator, shell}{3}{operator, shell}
\entry{process group}{3}{process group}
\entry{process group ID}{3}{process group ID}
\entry{reserved word}{3}{reserved word}
\entry{reserved word}{4}{reserved word}
\entry{return status}{4}{return status}
\entry{signal}{4}{signal}
\entry{special builtin}{4}{special builtin}
@@ -68,13 +68,13 @@
\entry{matching, pattern}{38}{matching, pattern}
\entry{redirection}{40}{redirection}
\entry{command expansion}{44}{command expansion}
\entry{command execution}{44}{command execution}
\entry{command search}{44}{command search}
\entry{command execution}{45}{command execution}
\entry{command search}{45}{command search}
\entry{execution environment}{45}{execution environment}
\entry{environment}{46}{environment}
\entry{exit status}{47}{exit status}
\entry{signal handling}{47}{signal handling}
\entry{shell script}{48}{shell script}
\entry{signal handling}{48}{signal handling}
\entry{shell script}{49}{shell script}
\entry{special builtin}{82}{special builtin}
\entry{login shell}{100}{login shell}
\entry{interactive shell}{100}{interactive shell}
+5 -5
View File
@@ -16,10 +16,10 @@
\entry{builtin}{3}
\initial {C}
\entry{command editing}{129}
\entry{command execution}{44}
\entry{command execution}{45}
\entry{command expansion}{44}
\entry{command history}{165}
\entry{command search}{44}
\entry{command search}{45}
\entry{command substitution}{35}
\entry{command timing}{10}
\entry{commands, compound}{11}
@@ -117,18 +117,18 @@
\initial {R}
\entry{Readline, how to use}{127}
\entry{redirection}{40}
\entry{reserved word}{3}
\entry{reserved word}{4}
\entry{reserved words}{9}
\entry{restricted shell}{113}
\entry{return status}{4}
\initial {S}
\entry{shell arithmetic}{105}
\entry{shell function}{19}
\entry{shell script}{48}
\entry{shell script}{49}
\entry{shell variable}{22}
\entry{shell, interactive}{102}
\entry{signal}{4}
\entry{signal handling}{47}
\entry{signal handling}{48}
\entry{special builtin}{4, 82}
\entry{startup files}{100}
\entry{string translations}{8}
BIN
View File
Binary file not shown.
+45 -31
View File
@@ -4,9 +4,9 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This text is a brief description of the features that are present in
the Bash shell (version 5.3, 15 October 2024).
the Bash shell (version 5.3, 20 October 2024).
This is Edition 5.3, last updated 15 October 2024,
This is Edition 5.3, last updated 20 October 2024,
of The GNU Bash Reference Manual,
for Bash, Version 5.3.
@@ -77,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<h1 class="top" id="Bash-Features-1"><span>Bash Features<a class="copiable-link" href="#Bash-Features-1"> &para;</a></span></h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 5.3, 15 October 2024).
the Bash shell (version 5.3, 20 October 2024).
The Bash home page is <a class="url" href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
</p>
<p>This is Edition 5.3, last updated 15 October 2024,
<p>This is Edition 5.3, last updated 20 October 2024,
of <cite class="cite">The GNU Bash Reference Manual</cite>,
for <code class="code">Bash</code>, Version 5.3.
</p>
@@ -430,6 +430,11 @@ is primarily concerned with the Shell and Utilities portion of the
<dd><p>A space or tab character.
</p>
</dd>
<dt><code class="code">whitespace</code></dt>
<dd><p>A character belonging to the <code class="code">space</code> character class in the
current locale, or for which <code class="code">isspace()</code> returns true.
</p>
</dd>
<dt><a id="index-builtin-1"></a><span><code class="code">builtin</code><a class="copiable-link" href="#index-builtin-1"> &para;</a></span></dt>
<dd><p>A command that is implemented internally by the shell itself, rather
than by an executable program somewhere in the file system.
@@ -3329,45 +3334,54 @@ Next: <a href="#Filename-Expansion" accesskey="n" rel="next">Filename Expansion<
<p>The shell scans the results of parameter expansion, command substitution,
and arithmetic expansion that did not occur within double quotes for
word splitting.
Words that were not expanded are not split.
</p>
<p>The shell treats each character of <code class="env">$IFS</code> as a delimiter, and splits
the results of the other expansions into words using these characters
as field terminators.
<p>The shell treats each character of <code class="env">$IFS</code> as a delimiter,
and splits the results of the other expansions into fields
using these characters as field terminators.
</p>
<p>If <code class="env">IFS</code> is unset, or its value is exactly <code class="code">&lt;space&gt;&lt;tab&gt;&lt;newline&gt;</code>,
the default, then sequences of
<code class="code">space</code>, <code class="code">tab</code>, and <code class="code">newline</code>
at the beginning and end of the results of the previous
expansions are ignored, and any sequence of <code class="env">IFS</code>
characters not at the beginning or end delimits words.
If <code class="env">IFS</code> has a value other than the default, then sequences of
the whitespace characters <code class="code">space</code>, <code class="code">tab</code>, and <code class="code">newline</code>
present the value of <code class="env">IFS</code> (an <code class="env">IFS</code> whitespace character)
are ignored at the beginning and end of the word.
Any character in <code class="env">IFS</code> that is not <code class="env">IFS</code>
whitespace, along with any adjacent <code class="env">IFS</code>
whitespace characters, delimits a field. A sequence of <code class="env">IFS</code>
whitespace characters is also treated as a delimiter.
<p>An <em class="dfn">IFS whitespace</em> character is whitespace as defined above
(see <a class="pxref" href="#Definitions">Definitions</a>) that appears in the value of <code class="env">IFS</code>.
Space, tab, and newline are always considered IFS whitespace, even
if they don&rsquo;t appear in the locale&rsquo;s <code class="code">space</code> category.
</p>
<p>If the value of <code class="env">IFS</code> is null, no word splitting occurs.
If <code class="env">IFS</code> is unset, word splitting behaves as if it contained
the default value <code class="code">&lt;space&gt;&lt;tab&gt;&lt;newline&gt;</code>.
<p>If <code class="env">IFS</code> is unset, word splitting behaves as if its value were
<code class="code">&lt;space&gt;&lt;tab&gt;&lt;newline&gt;</code>,
and treats these characters as IFS whitespace.
If the value of <code class="env">IFS</code> is null, no word splitting occurs,
but implicit null arguments (see below) are still removed.
</p>
<p>Word splitting begins by removing sequences of IFS whitespace characters
from the beginning and end of the results of the previous expansions,
then splits the remaining words.
</p>
<p>If the value of <code class="env">IFS</code> consists solely of IFS whitespace,
any sequence of IFS whitespace characters delimits a field,
so a field consists of characters that are not unquoted IFS
whitespace, and null fields result only from quoting.
</p>
<p>If <code class="env">IFS</code> contains a non-whitespace character, then any
character in the value of <code class="env">IFS</code> that is not IFS whitespace,
along with any adjacent IFS whitespace characters, delimits a field.
This means that adjacent non-IFS-whitespace delimiters produce a
null field.
A sequence of IFS whitespace characters also delimits a field.
</p>
<p>Explicit null arguments (<code class="code">&quot;&quot;</code> or <code class="code">''</code>) are retained
and passed to commands as empty strings.
Unquoted implicit null arguments, resulting from the expansion of
parameters that have no values, are removed.
If a parameter with no value is expanded within double quotes, a
null argument results and is retained
and passed to a command as an empty string.
When a quoted null argument appears as part of a word whose expansion is
non-null, the null argument is removed.
Expanding a parameter with no value within double quotes
produces a null field,
which is retained and passed to a command as an empty string.
</p>
<p>When a quoted null argument appears as part of a word whose expansion
is non-null, word splitting removes the null argument portion,
leaving the non-null expansion.
That is, the word
<code class="code">-d''</code> becomes <code class="code">-d</code> after word splitting and
null argument removal.
</p>
<p>Note that if no expansion occurs, no splitting is performed.
</p>
<hr>
</div>
<div class="subsection-level-extent" id="Filename-Expansion">
+187 -174
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 7.1 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 15 October 2024).
Bash shell (version 5.3, 20 October 2024).
This is Edition 5.3, last updated 15 October 2024, of The GNU Bash
This is Edition 5.3, last updated 20 October 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 1988-2024 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 15 October 2024). The Bash home page is
Bash shell (version 5.3, 20 October 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 15 October 2024, of The GNU Bash
This is Edition 5.3, last updated 20 October 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -169,6 +169,10 @@ These definitions are used throughout the remainder of this manual.
blank
A space or tab character.
whitespace
A character belonging to the space character class in the current
locale, or for which isspace() returns true.
builtin
A command that is implemented internally by the shell itself,
rather than by an executable program somewhere in the file system.
@@ -2429,38 +2433,47 @@ File: bashref.info, Node: Word Splitting, Next: Filename Expansion, Prev: Pro
The shell scans the results of parameter expansion, command
substitution, and arithmetic expansion that did not occur within double
quotes for word splitting.
quotes for word splitting. Words that were not expanded are not split.
The shell treats each character of $IFS as a delimiter, and splits
the results of the other expansions into words using these characters as
field terminators.
the results of the other expansions into fields using these characters
as field terminators.
If IFS is unset, or its value is exactly <space><tab><newline>,
the default, then sequences of space, tab, and newline at the
beginning and end of the results of the previous expansions are ignored,
and any sequence of IFS characters not at the beginning or end
delimits words. If IFS has a value other than the default, then
sequences of the whitespace characters space, tab, and newline
present the value of IFS (an IFS whitespace character) are ignored
at the beginning and end of the word. Any character in IFS that is
not IFS whitespace, along with any adjacent IFS whitespace
characters, delimits a field. A sequence of IFS whitespace characters
is also treated as a delimiter.
An “IFS whitespace” character is whitespace as defined above (*note
Definitions::) that appears in the value of IFS. Space, tab, and
newline are always considered IFS whitespace, even if they don't appear
in the locale's space category.
If the value of IFS is null, no word splitting occurs. If IFS is
unset, word splitting behaves as if it contained the default value
<space><tab><newline>.
If IFS is unset, word splitting behaves as if its value were
<space><tab><newline>, and treats these characters as IFS whitespace.
If the value of IFS is null, no word splitting occurs, but implicit
null arguments (see below) are still removed.
Word splitting begins by removing sequences of IFS whitespace
characters from the beginning and end of the results of the previous
expansions, then splits the remaining words.
If the value of IFS consists solely of IFS whitespace, any sequence
of IFS whitespace characters delimits a field, so a field consists of
characters that are not unquoted IFS whitespace, and null fields result
only from quoting.
If IFS contains a non-whitespace character, then any character in
the value of IFS that is not IFS whitespace, along with any adjacent
IFS whitespace characters, delimits a field. This means that adjacent
non-IFS-whitespace delimiters produce a null field. A sequence of IFS
whitespace characters also delimits a field.
Explicit null arguments ("" or '') are retained and passed to
commands as empty strings. Unquoted implicit null arguments, resulting
from the expansion of parameters that have no values, are removed. If a
parameter with no value is expanded within double quotes, a null
argument results and is retained and passed to a command as an empty
string. When a quoted null argument appears as part of a word whose
expansion is non-null, the null argument is removed. That is, the word
-d'' becomes -d after word splitting and null argument removal.
from the expansion of parameters that have no values, are removed.
Expanding a parameter with no value within double quotes produces a null
field, which is retained and passed to a command as an empty string.
Note that if no expansion occurs, no splitting is performed.
When a quoted null argument appears as part of a word whose expansion
is non-null, word splitting removes the null argument portion, leaving
the non-null expansion. That is, the word -d'' becomes -d after
word splitting and null argument removal.

File: bashref.info, Node: Filename Expansion, Next: Quote Removal, Prev: Word Splitting, Up: Shell Expansions
@@ -13273,7 +13286,7 @@ D.5 Concept Index
* Bourne shell: Basic Shell Features.
(line 6)
* brace expansion: Brace Expansion. (line 6)
* builtin: Definitions. (line 17)
* builtin: Definitions. (line 21)
* command editing: Readline Bare Essentials.
(line 6)
* command execution: Command Search and Execution.
@@ -13305,7 +13318,7 @@ D.5 Concept Index
(line 6)
* conditional arithmetic operator: Shell Arithmetic. (line 18)
* configuration: Basic Installation. (line 6)
* control operator: Definitions. (line 21)
* control operator: Definitions. (line 25)
* coprocess: Coprocesses. (line 6)
* directory stack: The Directory Stack. (line 6)
* dollar-single quote quoting: ANSI-C Quoting. (line 6)
@@ -13316,7 +13329,7 @@ D.5 Concept Index
* event designators: Event Designators. (line 6)
* execution environment: Command Execution Environment.
(line 6)
* exit status: Definitions. (line 26)
* exit status: Definitions. (line 30)
* exit status <1>: Exit Status. (line 6)
* expansion: Shell Expansions. (line 6)
* expansion, arithmetic: Arithmetic Expansion.
@@ -13330,8 +13343,8 @@ D.5 Concept Index
* expressions, arithmetic: Shell Arithmetic. (line 6)
* expressions, conditional: Bash Conditional Expressions.
(line 6)
* field: Definitions. (line 30)
* filename: Definitions. (line 35)
* field: Definitions. (line 34)
* filename: Definitions. (line 39)
* filename expansion: Filename Expansion. (line 9)
* foreground: Job Control Basics. (line 6)
* functions, shell: Shell Functions. (line 6)
@@ -13343,7 +13356,7 @@ D.5 Concept Index
(line 6)
* History, how to use: A Programmable Completion Example.
(line 113)
* identifier: Definitions. (line 51)
* identifier: Definitions. (line 55)
* initialization file, readline: Readline Init File. (line 6)
* installation: Basic Installation. (line 6)
* interaction, readline: Readline Interaction.
@@ -13353,8 +13366,8 @@ D.5 Concept Index
* internationalization: Locale Translation. (line 6)
* internationalized scripts: Creating Internationalized Scripts.
(line 3)
* job: Definitions. (line 38)
* job control: Definitions. (line 42)
* job: Definitions. (line 42)
* job control: Definitions. (line 46)
* job control <1>: Job Control Basics. (line 6)
* kill ring: Readline Killing Commands.
(line 18)
@@ -13363,12 +13376,12 @@ D.5 Concept Index
* localization: Locale Translation. (line 6)
* login shell: Invoking Bash. (line 133)
* matching, pattern: Pattern Matching. (line 6)
* metacharacter: Definitions. (line 46)
* name: Definitions. (line 51)
* metacharacter: Definitions. (line 50)
* name: Definitions. (line 55)
* native languages: Locale Translation. (line 6)
* notation, readline: Readline Bare Essentials.
(line 6)
* operator, shell: Definitions. (line 57)
* operator, shell: Definitions. (line 61)
* parameter expansion: Shell Parameter Expansion.
(line 6)
* parameters: Shell Parameters. (line 6)
@@ -13381,8 +13394,8 @@ D.5 Concept Index
* POSIX: Definitions. (line 9)
* POSIX description: Bash POSIX Mode. (line 9)
* POSIX Mode: Bash POSIX Mode. (line 48)
* process group: Definitions. (line 62)
* process group ID: Definitions. (line 66)
* process group: Definitions. (line 66)
* process group ID: Definitions. (line 70)
* process substitution: Process Substitution.
(line 6)
* programmable completion: Programmable Completion.
@@ -13394,32 +13407,32 @@ D.5 Concept Index
* Readline, how to use: Job Control Variables.
(line 23)
* redirection: Redirections. (line 6)
* reserved word: Definitions. (line 70)
* reserved word: Definitions. (line 74)
* reserved words: Reserved Words. (line 6)
* restricted shell: The Restricted Shell.
(line 6)
* return status: Definitions. (line 75)
* return status: Definitions. (line 79)
* shell arithmetic: Shell Arithmetic. (line 6)
* shell function: Shell Functions. (line 6)
* shell script: Shell Scripts. (line 6)
* shell variable: Shell Parameters. (line 6)
* shell, interactive: Interactive Shells. (line 6)
* signal: Definitions. (line 78)
* signal: Definitions. (line 82)
* signal handling: Signals. (line 6)
* special builtin: Definitions. (line 82)
* special builtin: Definitions. (line 86)
* special builtin <1>: Special Builtins. (line 6)
* startup files: Bash Startup Files. (line 6)
* string translations: Creating Internationalized Scripts.
(line 3)
* suspending jobs: Job Control Basics. (line 6)
* tilde expansion: Tilde Expansion. (line 6)
* token: Definitions. (line 86)
* token: Definitions. (line 90)
* translation, native languages: Locale Translation. (line 6)
* unary arithmetic operators: Shell Arithmetic. (line 18)
* variable, shell: Shell Parameters. (line 6)
* variables, readline: Readline Init File Syntax.
(line 37)
* word: Definitions. (line 90)
* word: Definitions. (line 94)
* word splitting: Word Splitting. (line 6)
* yanking text: Readline Killing Commands.
(line 6)
@@ -13432,133 +13445,133 @@ Node: Introduction2844
Node: What is Bash?3060
Node: What is a shell?4196
Node: Definitions6809
Node: Basic Shell Features9988
Node: Shell Syntax11215
Node: Shell Operation12245
Node: Quoting13539
Node: Escape Character14880
Node: Single Quotes15418
Node: Double Quotes15770
Node: ANSI-C Quoting17118
Node: Locale Translation18515
Node: Creating Internationalized Scripts19925
Node: Comments24126
Node: Shell Commands24896
Node: Reserved Words25838
Node: Simple Commands26706
Node: Pipelines27371
Node: Lists30630
Node: Compound Commands32505
Node: Looping Constructs33517
Node: Conditional Constructs36039
Node: Command Grouping50974
Node: Coprocesses52469
Node: GNU Parallel55158
Node: Shell Functions56079
Node: Shell Parameters64559
Node: Positional Parameters69300
Node: Special Parameters70393
Node: Shell Expansions73857
Node: Brace Expansion76049
Node: Tilde Expansion78780
Node: Shell Parameter Expansion81738
Node: Command Substitution101509
Node: Arithmetic Expansion105045
Node: Process Substitution106061
Node: Word Splitting107180
Node: Filename Expansion109280
Node: Pattern Matching112551
Node: Quote Removal117891
Node: Redirections118198
Node: Executing Commands128410
Node: Simple Command Expansion129080
Node: Command Search and Execution131191
Node: Command Execution Environment133638
Node: Environment137089
Node: Exit Status138995
Node: Signals141056
Node: Shell Scripts144957
Node: Shell Builtin Commands148258
Node: Bourne Shell Builtins150372
Node: Bash Builtins176925
Node: Modifying Shell Behavior213376
Node: The Set Builtin213721
Node: The Shopt Builtin225660
Node: Special Builtins242715
Node: Shell Variables243707
Node: Bourne Shell Variables244144
Node: Bash Variables246655
Node: Bash Features284967
Node: Invoking Bash285984
Node: Bash Startup Files292413
Node: Interactive Shells297708
Node: What is an Interactive Shell?298119
Node: Is this Shell Interactive?298784
Node: Interactive Shell Behavior299611
Node: Bash Conditional Expressions303375
Node: Shell Arithmetic308597
Node: Aliases311929
Node: Arrays315067
Node: The Directory Stack322133
Node: Directory Stack Builtins322933
Node: Controlling the Prompt327381
Node: The Restricted Shell330268
Node: Bash POSIX Mode333153
Node: Shell Compatibility Mode351485
Node: Job Control360495
Node: Job Control Basics360955
Node: Job Control Builtins367236
Node: Job Control Variables373921
Node: Command Line Editing375155
Node: Introduction and Notation376861
Node: Readline Interaction379216
Node: Readline Bare Essentials380407
Node: Readline Movement Commands382218
Node: Readline Killing Commands383217
Node: Readline Arguments385243
Node: Searching386303
Node: Readline Init File388567
Node: Readline Init File Syntax389874
Node: Conditional Init Constructs416625
Node: Sample Init File421013
Node: Bindable Readline Commands424137
Node: Commands For Moving425678
Node: Commands For History427908
Node: Commands For Text433164
Node: Commands For Killing437292
Node: Numeric Arguments440083
Node: Commands For Completion441238
Node: Keyboard Macros445741
Node: Miscellaneous Commands446445
Node: Readline vi Mode453001
Node: Programmable Completion453981
Node: Programmable Completion Builtins462030
Node: A Programmable Completion Example473698
Node: Using History Interactively479046
Node: Bash History Facilities479730
Node: Bash History Builtins483468
Node: History Interaction489942
Node: Event Designators494899
Node: Word Designators496480
Node: Modifiers498791
Node: Installing Bash500735
Node: Basic Installation501854
Node: Compilers and Options505733
Node: Compiling For Multiple Architectures506486
Node: Installation Names508242
Node: Specifying the System Type510479
Node: Sharing Defaults511228
Node: Operation Controls511945
Node: Optional Features512967
Node: Reporting Bugs525350
Node: Major Differences From The Bourne Shell526711
Node: GNU Free Documentation License548134
Node: Indexes573314
Node: Builtin Index573768
Node: Reserved Word Index580869
Node: Variable Index583317
Node: Function Index600733
Node: Concept Index614592
Node: Basic Shell Features10139
Node: Shell Syntax11366
Node: Shell Operation12396
Node: Quoting13690
Node: Escape Character15031
Node: Single Quotes15569
Node: Double Quotes15921
Node: ANSI-C Quoting17269
Node: Locale Translation18666
Node: Creating Internationalized Scripts20076
Node: Comments24277
Node: Shell Commands25047
Node: Reserved Words25989
Node: Simple Commands26857
Node: Pipelines27522
Node: Lists30781
Node: Compound Commands32656
Node: Looping Constructs33668
Node: Conditional Constructs36190
Node: Command Grouping51125
Node: Coprocesses52620
Node: GNU Parallel55309
Node: Shell Functions56230
Node: Shell Parameters64710
Node: Positional Parameters69451
Node: Special Parameters70544
Node: Shell Expansions74008
Node: Brace Expansion76200
Node: Tilde Expansion78931
Node: Shell Parameter Expansion81889
Node: Command Substitution101660
Node: Arithmetic Expansion105196
Node: Process Substitution106212
Node: Word Splitting107331
Node: Filename Expansion109778
Node: Pattern Matching113049
Node: Quote Removal118389
Node: Redirections118696
Node: Executing Commands128908
Node: Simple Command Expansion129578
Node: Command Search and Execution131689
Node: Command Execution Environment134136
Node: Environment137587
Node: Exit Status139493
Node: Signals141554
Node: Shell Scripts145455
Node: Shell Builtin Commands148756
Node: Bourne Shell Builtins150870
Node: Bash Builtins177423
Node: Modifying Shell Behavior213874
Node: The Set Builtin214219
Node: The Shopt Builtin226158
Node: Special Builtins243213
Node: Shell Variables244205
Node: Bourne Shell Variables244642
Node: Bash Variables247153
Node: Bash Features285465
Node: Invoking Bash286482
Node: Bash Startup Files292911
Node: Interactive Shells298206
Node: What is an Interactive Shell?298617
Node: Is this Shell Interactive?299282
Node: Interactive Shell Behavior300109
Node: Bash Conditional Expressions303873
Node: Shell Arithmetic309095
Node: Aliases312427
Node: Arrays315565
Node: The Directory Stack322631
Node: Directory Stack Builtins323431
Node: Controlling the Prompt327879
Node: The Restricted Shell330766
Node: Bash POSIX Mode333651
Node: Shell Compatibility Mode351983
Node: Job Control360993
Node: Job Control Basics361453
Node: Job Control Builtins367734
Node: Job Control Variables374419
Node: Command Line Editing375653
Node: Introduction and Notation377359
Node: Readline Interaction379714
Node: Readline Bare Essentials380905
Node: Readline Movement Commands382716
Node: Readline Killing Commands383715
Node: Readline Arguments385741
Node: Searching386801
Node: Readline Init File389065
Node: Readline Init File Syntax390372
Node: Conditional Init Constructs417123
Node: Sample Init File421511
Node: Bindable Readline Commands424635
Node: Commands For Moving426176
Node: Commands For History428406
Node: Commands For Text433662
Node: Commands For Killing437790
Node: Numeric Arguments440581
Node: Commands For Completion441736
Node: Keyboard Macros446239
Node: Miscellaneous Commands446943
Node: Readline vi Mode453499
Node: Programmable Completion454479
Node: Programmable Completion Builtins462528
Node: A Programmable Completion Example474196
Node: Using History Interactively479544
Node: Bash History Facilities480228
Node: Bash History Builtins483966
Node: History Interaction490440
Node: Event Designators495397
Node: Word Designators496978
Node: Modifiers499289
Node: Installing Bash501233
Node: Basic Installation502352
Node: Compilers and Options506231
Node: Compiling For Multiple Architectures506984
Node: Installation Names508740
Node: Specifying the System Type510977
Node: Sharing Defaults511726
Node: Operation Controls512443
Node: Optional Features513465
Node: Reporting Bugs525848
Node: Major Differences From The Bourne Shell527209
Node: GNU Free Documentation License548632
Node: Indexes573812
Node: Builtin Index574266
Node: Reserved Word Index581367
Node: Variable Index583815
Node: Function Index601231
Node: Concept Index615090

End Tag Table
+23 -23
View File
@@ -1,11 +1,11 @@
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.9) 18 OCT 2024 12:02
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.9) 20 OCT 2024 12:37
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**\input /usr/local/src/bash/bash-20241015/doc/bashref.texi
(/usr/local/src/bash/bash-20241015/doc/bashref.texi
(/usr/local/src/bash/bash-20241015/doc/texinfo.tex
**\input /usr/local/src/bash/bash-20241018/doc/bashref.texi
(/usr/local/src/bash/bash-20241018/doc/bashref.texi
(/usr/local/src/bash/bash-20241018/doc/texinfo.tex
Loading texinfo [version 2015-11-22.14]:
\outerhsize=\dimen16
\outervsize=\dimen17
@@ -161,15 +161,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
texinfo.tex: doing @include of version.texi
(/usr/local/src/bash/bash-20241015/doc/version.texi) [1{/opt/local/var/db/texmf
(/usr/local/src/bash/bash-20241018/doc/version.texi) [1{/opt/local/var/db/texmf
/fonts/map/pdftex/updmap/pdftex.map}] [2]
(/usr/local/build/bash/bash-20241015/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20241015/doc/bashref.toc)
(/usr/local/build/bash/bash-20241015/doc/bashref.toc) Chapter 1
(/usr/local/build/bash/bash-20241018/doc/bashref.toc [-1] [-2] [-3]) [-4]
(/usr/local/build/bash/bash-20241018/doc/bashref.toc)
(/usr/local/build/bash/bash-20241018/doc/bashref.toc) Chapter 1
\openout0 = `bashref.toc'.
(/usr/local/build/bash/bash-20241015/doc/bashref.aux)
(/usr/local/build/bash/bash-20241018/doc/bashref.aux)
\openout1 = `bashref.aux'.
[1] Chapter 2 [2]
@@ -182,7 +182,7 @@ texinfo.tex: doing @include of version.texi
\openout3 = `bashref.vr'.
[8]
Overfull \hbox (3.12749pt too wide) in paragraph at lines 736--737
Overfull \hbox (3.12749pt too wide) in paragraph at lines 740--741
@texttt coproc[]|
@hbox(9.34993+3.85005)x43.36464
@@ -194,7 +194,7 @@ Overfull \hbox (3.12749pt too wide) in paragraph at lines 736--737
.etc.
Overfull \hbox (3.12749pt too wide) in paragraph at lines 737--737
Overfull \hbox (3.12749pt too wide) in paragraph at lines 741--741
@texttt select[]|
@hbox(9.34993+3.85005)x43.36464
@@ -206,7 +206,7 @@ Overfull \hbox (3.12749pt too wide) in paragraph at lines 737--737
.etc.
Overfull \hbox (5.95723pt too wide) in paragraph at lines 737--738
Overfull \hbox (5.95723pt too wide) in paragraph at lines 741--742
@texttt function[]|
@hbox(9.34993+3.85005)x52.03227
@@ -231,7 +231,7 @@ e/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [20] [21] [22] [23] [24]
[50] [51] [52]
[53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67]
[68] [69] [70]
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5710--5710
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5723--5723
[]@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -244,7 +244,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5710--5710
.etc.
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5711--5711
Overfull \hbox (38.26585pt too wide) in paragraph at lines 5724--5724
[]@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
-] [@textttsl ar-gu-ment []@texttt ][]
@@ -264,7 +264,7 @@ Chapter 7 [122] [123] [124] [125] [126]
texinfo.tex: doing @include of rluser.texi
(/usr/local/src/bash/bash-20241015/lib/readline/doc/rluser.texi Chapter 8
(/usr/local/src/bash/bash-20241018/lib/readline/doc/rluser.texi Chapter 8
[127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138]
Underfull \hbox (badness 7540) in paragraph at lines 959--965
[]@textrm In the ex-am-ple above, @textttsl C-u[] @textrm is bound to the func
@@ -313,10 +313,10 @@ gnored[]
texinfo.tex: doing @include of hsuser.texi
(/usr/local/src/bash/bash-20241015/lib/readline/doc/hsuser.texi Chapter 9
(/usr/local/src/bash/bash-20241018/lib/readline/doc/hsuser.texi Chapter 9
[164] [165] [166] [167] [168] [169] [170]) Chapter 10 [171] [172] [173]
[174] [175]
Underfull \hbox (badness 10000) in paragraph at lines 10360--10369
Underfull \hbox (badness 10000) in paragraph at lines 10373--10382
[]@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
entation[]@textrm '[],
@@ -329,7 +329,7 @@ entation[]@textrm '[],
.etc.
Underfull \hbox (badness 10000) in paragraph at lines 10360--10369
Underfull \hbox (badness 10000) in paragraph at lines 10373--10382
@textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
extrm '[], `@texttt strict-posix-default[]@textrm '[], and
@@ -346,13 +346,13 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
texinfo.tex: doing @include of fdl.texi
(/usr/local/src/bash/bash-20241015/doc/fdl.texi [189] [190] [191] [192]
(/usr/local/src/bash/bash-20241018/doc/fdl.texi [189] [190] [191] [192]
[193] [194] [195]) Appendix D [196] [197] [198] [199] [200] [201] [202]
[203] [204] [205] )
Here is how much of TeX's memory you used:
4113 strings out of 495840
47653 string characters out of 6171739
144695 words of memory out of 5000000
144767 words of memory out of 5000000
5048 multiletter control sequences out of 15000+600000
34315 words of font info for 116 fonts, out of 8000000 for 9000
701 hyphenation exceptions out of 8191
@@ -373,10 +373,10 @@ fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/texmf-texlive/fonts
lic/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm
-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm-super
/sfrm1440.pfb>
Output written on bashref.pdf (211 pages, 845003 bytes).
Output written on bashref.pdf (211 pages, 845399 bytes).
PDF statistics:
2924 PDF objects out of 2984 (max. 8388607)
2665 compressed objects within 27 object streams
2927 PDF objects out of 2984 (max. 8388607)
2668 compressed objects within 27 object streams
339 named destinations out of 1000 (max. 500000)
1157 words of extra memory for PDF output out of 10000 (max. 10000000)
BIN
View File
Binary file not shown.
+795 -785
View File
File diff suppressed because it is too large Load Diff
+40 -27
View File
@@ -202,6 +202,10 @@ is primarily concerned with the Shell and Utilities portion of the
@item blank
A space or tab character.
@item whitespace
A character belonging to the @code{space} character class in the
current locale, or for which @code{isspace()} returns true.
@item builtin
@cindex builtin
A command that is implemented internally by the shell itself, rather
@@ -2895,45 +2899,54 @@ expansion.
The shell scans the results of parameter expansion, command substitution,
and arithmetic expansion that did not occur within double quotes for
word splitting.
Words that were not expanded are not split.
The shell treats each character of @env{$IFS} as a delimiter, and splits
the results of the other expansions into words using these characters
as field terminators.
The shell treats each character of @env{$IFS} as a delimiter,
and splits the results of the other expansions into fields
using these characters as field terminators.
If @env{IFS} is unset, or its value is exactly @code{<space><tab><newline>},
the default, then sequences of
@code{space}, @code{tab}, and @code{newline}
at the beginning and end of the results of the previous
expansions are ignored, and any sequence of @env{IFS}
characters not at the beginning or end delimits words.
If @env{IFS} has a value other than the default, then sequences of
the whitespace characters @code{space}, @code{tab}, and @code{newline}
present the value of @env{IFS} (an @env{IFS} whitespace character)
are ignored at the beginning and end of the word.
Any character in @env{IFS} that is not @env{IFS}
whitespace, along with any adjacent @env{IFS}
whitespace characters, delimits a field. A sequence of @env{IFS}
whitespace characters is also treated as a delimiter.
An @dfn{IFS whitespace} character is whitespace as defined above
(@pxref{Definitions}) that appears in the value of @env{IFS}.
Space, tab, and newline are always considered IFS whitespace, even
if they don't appear in the locale's @code{space} category.
If the value of @env{IFS} is null, no word splitting occurs.
If @env{IFS} is unset, word splitting behaves as if it contained
the default value @code{<space><tab><newline>}.
If @env{IFS} is unset, word splitting behaves as if its value were
@code{<space><tab><newline>},
and treats these characters as IFS whitespace.
If the value of @env{IFS} is null, no word splitting occurs,
but implicit null arguments (see below) are still removed.
Word splitting begins by removing sequences of IFS whitespace characters
from the beginning and end of the results of the previous expansions,
then splits the remaining words.
If the value of @env{IFS} consists solely of IFS whitespace,
any sequence of IFS whitespace characters delimits a field,
so a field consists of characters that are not unquoted IFS
whitespace, and null fields result only from quoting.
If @env{IFS} contains a non-whitespace character, then any
character in the value of @env{IFS} that is not IFS whitespace,
along with any adjacent IFS whitespace characters, delimits a field.
This means that adjacent non-IFS-whitespace delimiters produce a
null field.
A sequence of IFS whitespace characters also delimits a field.
Explicit null arguments (@code{""} or @code{''}) are retained
and passed to commands as empty strings.
Unquoted implicit null arguments, resulting from the expansion of
parameters that have no values, are removed.
If a parameter with no value is expanded within double quotes, a
null argument results and is retained
and passed to a command as an empty string.
When a quoted null argument appears as part of a word whose expansion is
non-null, the null argument is removed.
Expanding a parameter with no value within double quotes
produces a null field,
which is retained and passed to a command as an empty string.
When a quoted null argument appears as part of a word whose expansion
is non-null, word splitting removes the null argument portion,
leaving the non-null expansion.
That is, the word
@code{-d''} becomes @code{-d} after word splitting and
null argument removal.
Note that if no expansion occurs, no splitting is performed.
@node Filename Expansion
@subsection Filename Expansion
@menu
+3 -3
View File
@@ -51,12 +51,12 @@
@numsubsecentry{Opening File Descriptors for Reading and Writing}{3.6.10}{}{44}
@numsecentry{Executing Commands}{3.7}{Executing Commands}{44}
@numsubsecentry{Simple Command Expansion}{3.7.1}{Simple Command Expansion}{44}
@numsubsecentry{Command Search and Execution}{3.7.2}{Command Search and Execution}{44}
@numsubsecentry{Command Search and Execution}{3.7.2}{Command Search and Execution}{45}
@numsubsecentry{Command Execution Environment}{3.7.3}{Command Execution Environment}{45}
@numsubsecentry{Environment}{3.7.4}{Environment}{46}
@numsubsecentry{Exit Status}{3.7.5}{Exit Status}{47}
@numsubsecentry{Signals}{3.7.6}{Signals}{47}
@numsecentry{Shell Scripts}{3.8}{Shell Scripts}{48}
@numsubsecentry{Signals}{3.7.6}{Signals}{48}
@numsecentry{Shell Scripts}{3.8}{Shell Scripts}{49}
@numchapentry{Shell Builtin Commands}{4}{Shell Builtin Commands}{50}
@numsecentry{Bourne Shell Builtins}{4.1}{Bourne Shell Builtins}{50}
@numsecentry{Bash Builtin Commands}{4.2}{Bash Builtins}{59}
+2 -2
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2024 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Tue Oct 15 16:54:10 EDT 2024
@set LASTCHANGE Sun Oct 20 12:30:58 EDT 2024
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 15 October 2024
@set UPDATED 20 October 2024
@set UPDATED-MONTH October 2024
+1
View File
@@ -1140,6 +1140,7 @@ internal_realloc (PTR_T mem, size_t n, const char *file, int line, int flags)
if (n == 0)
{
internal_free (mem, file, line, MALLOC_INTERNAL);
/* XXX - return internal_malloc (0, file, line MALLOC_INTERNAL) ? */
return (NULL);
}
if ((p = (union mhead *) mem) == 0)
+14 -4
View File
@@ -742,7 +742,8 @@ history_do_write (const char *filename, int nelements, int overwrite)
int file, mode, rv, exists;
struct stat finfo;
#ifdef HISTORY_USE_MMAP
size_t cursize;
size_t cursize, newsize;
off_t offset;
history_lines_written_to_file = 0;
@@ -798,7 +799,11 @@ history_do_write (const char *filename, int nelements, int overwrite)
#ifdef HISTORY_USE_MMAP
if (ftruncate (file, buffer_size+cursize) == -1)
goto mmap_error;
buffer = (char *)mmap (0, buffer_size, PROT_READ|PROT_WRITE, MAP_WFLAGS, file, cursize);
/* for portability, ensure that we round cursize to a multiple of the
page size. */
offset = cursize & ~(getpagesize () - 1);
newsize = buffer_size + cursize - offset;
buffer = (char *)mmap (0, newsize, PROT_READ|PROT_WRITE, MAP_WFLAGS, file, offset);
if ((void *)buffer == MAP_FAILED)
{
mmap_error:
@@ -812,6 +817,7 @@ mmap_error:
FREE (tempname);
return rv;
}
j = cursize - offset;
#else
buffer = (char *)malloc (buffer_size);
if (buffer == 0)
@@ -826,9 +832,10 @@ mmap_error:
FREE (tempname);
return rv;
}
j = 0;
#endif
for (j = 0, i = history_length - nelements; i < history_length; i++)
for (i = history_length - nelements; i < history_length; i++)
{
if (history_write_timestamps && the_history[i]->timestamp && the_history[i]->timestamp[0])
{
@@ -842,7 +849,10 @@ mmap_error:
}
#ifdef HISTORY_USE_MMAP
if (msync (buffer, buffer_size, MS_ASYNC) != 0 || munmap (buffer, buffer_size) != 0)
/* make sure we unmap the pages even if the sync fails */
if (msync (buffer, newsize, MS_ASYNC) != 0)
rv = errno;
if (munmap (buffer, newsize) != 0 && rv == 0)
rv = errno;
#else
if (write (file, buffer, buffer_size) < 0)
+2 -2
View File
@@ -205,9 +205,9 @@ rl_tilde_expand (int ignore, int key)
end = start;
do
end++;
while (whitespace (rl_line_buffer[end]) == 0 && end < rl_end);
while (end < rl_end && whitespace (rl_line_buffer[end]) == 0);
if (whitespace (rl_line_buffer[end]) || end >= rl_end)
if (end >= rl_end || whitespace (rl_line_buffer[end]))
end--;
/* If the first character of the current word is a tilde, perform