mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-05 19:30:49 +02:00
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:
+187
-174
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user