mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-03 02:10:50 +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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user