summaryrefslogtreecommitdiff
path: root/doc/bash.info
diff options
context:
space:
mode:
Diffstat (limited to 'doc/bash.info')
-rw-r--r--doc/bash.info341
1 files changed, 194 insertions, 147 deletions
diff --git a/doc/bash.info b/doc/bash.info
index 67fb0cb6..4c9909dc 100644
--- a/doc/bash.info
+++ b/doc/bash.info
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
This text is a brief description of the features that are present in the
-Bash shell (version 5.2, 20 April 2023).
+Bash shell (version 5.2, 14 May 2023).
- This is Edition 5.2, last updated 20 April 2023, of 'The GNU Bash
+ This is Edition 5.2, last updated 14 May 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Copyright (C) 1988-2023 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.2, 20 April 2023). The Bash home page is
+Bash shell (version 5.2, 14 May 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
- This is Edition 5.2, last updated 20 April 2023, of 'The GNU Bash
+ This is Edition 5.2, last updated 14 May 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.2.
Bash contains features that appear in other popular shells, and some
@@ -418,8 +418,8 @@ File: bash.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Double
3.1.2.4 ANSI-C Quoting
......................
-Character sequences of the form $'STRING' are treated as a special kind
-of single quotes. The sequence expands to STRING, with
+Character sequences of the form '$'STRING'' are treated as a special
+kind of single quotes. The sequence expands to STRING, with
backslash-escaped characters in STRING replaced as specified by the ANSI
C standard. Backslash escape sequences, if present, are decoded as
follows:
@@ -2239,11 +2239,11 @@ File: bash.info, Node: Command Substitution, Next: Arithmetic Expansion, Prev
--------------------------
Command substitution allows the output of a command to replace the
-command itself. Command substitution occurs when a command is enclosed
-as follows:
+command itself. The standard form of command substitution occurs when a
+command is enclosed as follows:
$(COMMAND)
-or
- `COMMAND`
+or (deprecated)
+ `COMMAND`.
Bash performs the expansion by executing COMMAND in a subshell
environment and replacing the command substitution with the standard
@@ -2252,17 +2252,64 @@ newlines are not deleted, but they may be removed during word splitting.
The command substitution '$(cat FILE)' can be replaced by the equivalent
but faster '$(< FILE)'.
- When the old-style backquote form of substitution is used, backslash
-retains its literal meaning except when followed by '$', '`', or '\'.
-The first backquote not preceded by a backslash terminates the command
+ With the old-style backquote form of substitution, backslash retains
+its literal meaning except when followed by '$', '`', or '\'. The first
+backquote not preceded by a backslash terminates the command
substitution. When using the '$(COMMAND)' form, all characters between
the parentheses make up the command; none are treated specially.
+ There is an alternate form of command substitution:
+
+ ${C COMMAND; }
+
+which executes COMMAND in the current execution environment. This means
+that side effects of COMMAND take effect immediately in the current
+execution environment and persist in the current environment after the
+command completes (e.g., the 'exit' builtin will exit the shell).
+
+ The character C following the open brace must be a space, tab,
+newline, '(', or '|', and the close brace must be in a position where a
+reserved word may appear (i.e., preceded by a command terminator such as
+semicolon). Bash allows the close brace to be joined to the remaining
+characters in the word without being followed by a shell metacharacter
+as a reserved word would usually require.
+
+ This type of command substitution superficially resembles executing
+an unnamed shell function: local variables are created as when a shell
+function is executing, and the 'return' builtin forces COMMAND to
+complete; however, the rest of the execution environment, including the
+positional parameters, is shared with the caller.
+
+ If the first character following the open brace is a '(', COMMAND is
+executed in a subshell, and COMMAND must be terminated by a ')'. This
+is similar to the '(' compound command (*note Command Grouping::). If
+the first character is a '|', the construct expands to the value of the
+'REPLY' shell variable after COMMAND executes, without removing any
+trailing newlines, and the standard output of COMMAND remains the same
+as in the calling shell. Bash creates 'REPLY' as an initially-unset
+local variable when COMMAND executes, and restores 'REPLY' to the value
+it had before the command substitution after COMMAND completes, as with
+any local variable.
+
+ For example, this construct expands to '12345', and leaves the shell
+variable 'X' unchanged in the current execution environment:
+
+ ${ local X=12345 ; echo $X; }
+
+(not declaring 'X' as local would modify its value in the current
+environment, as with normal shell function execution), while this
+construct does not require any output to expand to '12345':
+
+ ${| REPLY=12345; }
+
+and restores 'REPLY' to the value it had before the command
+substitution.
+
Command substitutions may be nested. To nest when using the
backquoted form, escape the inner backquotes with backslashes.
- If the substitution appears within double quotes, word splitting and
-filename expansion are not performed on the results.
+ If the substitution appears within double quotes, Bash does not
+perform word splitting and filename expansion on the results.

File: bash.info, Node: Arithmetic Expansion, Next: Process Substitution, Prev: Command Substitution, Up: Shell Expansions
@@ -12706,138 +12753,138 @@ D.5 Concept Index

Tag Table:
-Node: Top888
-Node: Introduction2799
-Node: What is Bash?3012
-Node: What is a shell?4123
-Node: Definitions6658
-Node: Basic Shell Features9606
-Node: Shell Syntax10822
-Node: Shell Operation11845
-Node: Quoting13135
-Node: Escape Character14436
-Node: Single Quotes14918
-Node: Double Quotes15263
-Node: ANSI-C Quoting16538
-Node: Locale Translation17845
-Node: Creating Internationalized Scripts19153
-Node: Comments23267
-Node: Shell Commands23882
-Node: Reserved Words24817
-Node: Simple Commands25570
-Node: Pipelines26221
-Node: Lists29217
-Node: Compound Commands31009
-Node: Looping Constructs32018
-Node: Conditional Constructs34510
-Node: Command Grouping48995
-Node: Coprocesses50470
-Node: GNU Parallel53130
-Node: Shell Functions54044
-Node: Shell Parameters61926
-Node: Positional Parameters66311
-Node: Special Parameters67210
-Node: Shell Expansions70421
-Node: Brace Expansion72545
-Node: Tilde Expansion75276
-Node: Shell Parameter Expansion77894
-Node: Command Substitution96293
-Node: Arithmetic Expansion97645
-Node: Process Substitution98610
-Node: Word Splitting99727
-Node: Filename Expansion101772
-Node: Pattern Matching104702
-Node: Quote Removal109701
-Node: Redirections109993
-Node: Executing Commands119683
-Node: Simple Command Expansion120350
-Node: Command Search and Execution122457
-Node: Command Execution Environment124841
-Node: Environment127873
-Node: Exit Status129533
-Node: Signals131314
-Node: Shell Scripts134760
-Node: Shell Builtin Commands137784
-Node: Bourne Shell Builtins139819
-Node: Bash Builtins162015
-Node: Modifying Shell Behavior194011
-Node: The Set Builtin194353
-Node: The Shopt Builtin204948
-Node: Special Builtins220857
-Node: Shell Variables221833
-Node: Bourne Shell Variables222267
-Node: Bash Variables224368
-Node: Bash Features258430
-Node: Invoking Bash259440
-Node: Bash Startup Files265450
-Node: Interactive Shells270578
-Node: What is an Interactive Shell?270986
-Node: Is this Shell Interactive?271632
-Node: Interactive Shell Behavior272444
-Node: Bash Conditional Expressions276070
-Node: Shell Arithmetic280709
-Node: Aliases283667
-Node: Arrays286558
-Node: The Directory Stack293118
-Node: Directory Stack Builtins293899
-Node: Controlling the Prompt298156
-Node: The Restricted Shell301118
-Node: Bash POSIX Mode303725
-Node: Shell Compatibility Mode319515
-Node: Job Control327756
-Node: Job Control Basics328213
-Node: Job Control Builtins333212
-Node: Job Control Variables339004
-Node: Command Line Editing340157
-Node: Introduction and Notation341825
-Node: Readline Interaction343445
-Node: Readline Bare Essentials344633
-Node: Readline Movement Commands346419
-Node: Readline Killing Commands347376
-Node: Readline Arguments349294
-Node: Searching350335
-Node: Readline Init File352518
-Node: Readline Init File Syntax353776
-Node: Conditional Init Constructs377564
-Node: Sample Init File381757
-Node: Bindable Readline Commands384878
-Node: Commands For Moving386079
-Node: Commands For History388127
-Node: Commands For Text393118
-Node: Commands For Killing396764
-Node: Numeric Arguments399794
-Node: Commands For Completion400930
-Node: Keyboard Macros405118
-Node: Miscellaneous Commands405803
-Node: Readline vi Mode411838
-Node: Programmable Completion412742
-Node: Programmable Completion Builtins420519
-Node: A Programmable Completion Example431504
-Node: Using History Interactively436749
-Node: Bash History Facilities437430
-Node: Bash History Builtins440432
-Node: History Interaction445453
-Node: Event Designators449070
-Node: Word Designators450421
-Node: Modifiers452178
-Node: Installing Bash453983
-Node: Basic Installation455117
-Node: Compilers and Options458836
-Node: Compiling For Multiple Architectures459574
-Node: Installation Names461263
-Node: Specifying the System Type463369
-Node: Sharing Defaults464083
-Node: Operation Controls464753
-Node: Optional Features465708
-Node: Reporting Bugs476924
-Node: Major Differences From The Bourne Shell478255
-Node: GNU Free Documentation License495101
-Node: Indexes520275
-Node: Builtin Index520726
-Node: Reserved Word Index527550
-Node: Variable Index529995
-Node: Function Index546980
-Node: Concept Index560761
+Node: Top884
+Node: Introduction2791
+Node: What is Bash?3004
+Node: What is a shell?4115
+Node: Definitions6650
+Node: Basic Shell Features9598
+Node: Shell Syntax10814
+Node: Shell Operation11837
+Node: Quoting13127
+Node: Escape Character14428
+Node: Single Quotes14910
+Node: Double Quotes15255
+Node: ANSI-C Quoting16530
+Node: Locale Translation17839
+Node: Creating Internationalized Scripts19147
+Node: Comments23261
+Node: Shell Commands23876
+Node: Reserved Words24811
+Node: Simple Commands25564
+Node: Pipelines26215
+Node: Lists29211
+Node: Compound Commands31003
+Node: Looping Constructs32012
+Node: Conditional Constructs34504
+Node: Command Grouping48989
+Node: Coprocesses50464
+Node: GNU Parallel53124
+Node: Shell Functions54038
+Node: Shell Parameters61920
+Node: Positional Parameters66305
+Node: Special Parameters67204
+Node: Shell Expansions70415
+Node: Brace Expansion72539
+Node: Tilde Expansion75270
+Node: Shell Parameter Expansion77888
+Node: Command Substitution96287
+Node: Arithmetic Expansion99876
+Node: Process Substitution100841
+Node: Word Splitting101958
+Node: Filename Expansion104003
+Node: Pattern Matching106933
+Node: Quote Removal111932
+Node: Redirections112224
+Node: Executing Commands121914
+Node: Simple Command Expansion122581
+Node: Command Search and Execution124688
+Node: Command Execution Environment127072
+Node: Environment130104
+Node: Exit Status131764
+Node: Signals133545
+Node: Shell Scripts136991
+Node: Shell Builtin Commands140015
+Node: Bourne Shell Builtins142050
+Node: Bash Builtins164246
+Node: Modifying Shell Behavior196242
+Node: The Set Builtin196584
+Node: The Shopt Builtin207179
+Node: Special Builtins223088
+Node: Shell Variables224064
+Node: Bourne Shell Variables224498
+Node: Bash Variables226599
+Node: Bash Features260661
+Node: Invoking Bash261671
+Node: Bash Startup Files267681
+Node: Interactive Shells272809
+Node: What is an Interactive Shell?273217
+Node: Is this Shell Interactive?273863
+Node: Interactive Shell Behavior274675
+Node: Bash Conditional Expressions278301
+Node: Shell Arithmetic282940
+Node: Aliases285898
+Node: Arrays288789
+Node: The Directory Stack295349
+Node: Directory Stack Builtins296130
+Node: Controlling the Prompt300387
+Node: The Restricted Shell303349
+Node: Bash POSIX Mode305956
+Node: Shell Compatibility Mode321746
+Node: Job Control329987
+Node: Job Control Basics330444
+Node: Job Control Builtins335443
+Node: Job Control Variables341235
+Node: Command Line Editing342388
+Node: Introduction and Notation344056
+Node: Readline Interaction345676
+Node: Readline Bare Essentials346864
+Node: Readline Movement Commands348650
+Node: Readline Killing Commands349607
+Node: Readline Arguments351525
+Node: Searching352566
+Node: Readline Init File354749
+Node: Readline Init File Syntax356007
+Node: Conditional Init Constructs379795
+Node: Sample Init File383988
+Node: Bindable Readline Commands387109
+Node: Commands For Moving388310
+Node: Commands For History390358
+Node: Commands For Text395349
+Node: Commands For Killing398995
+Node: Numeric Arguments402025
+Node: Commands For Completion403161
+Node: Keyboard Macros407349
+Node: Miscellaneous Commands408034
+Node: Readline vi Mode414069
+Node: Programmable Completion414973
+Node: Programmable Completion Builtins422750
+Node: A Programmable Completion Example433735
+Node: Using History Interactively438980
+Node: Bash History Facilities439661
+Node: Bash History Builtins442663
+Node: History Interaction447684
+Node: Event Designators451301
+Node: Word Designators452652
+Node: Modifiers454409
+Node: Installing Bash456214
+Node: Basic Installation457348
+Node: Compilers and Options461067
+Node: Compiling For Multiple Architectures461805
+Node: Installation Names463494
+Node: Specifying the System Type465600
+Node: Sharing Defaults466314
+Node: Operation Controls466984
+Node: Optional Features467939
+Node: Reporting Bugs479155
+Node: Major Differences From The Bourne Shell480486
+Node: GNU Free Documentation License497332
+Node: Indexes522506
+Node: Builtin Index522957
+Node: Reserved Word Index529781
+Node: Variable Index532226
+Node: Function Index549211
+Node: Concept Index562992

End Tag Table