mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-09 03:30:48 +02:00
new `patsub_replacement' shell option
This commit is contained in:
+136
-102
@@ -2,9 +2,9 @@ This is bashref.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.1, 15 October 2021).
|
||||
Bash shell (version 5.1, 25 October 2021).
|
||||
|
||||
This is Edition 5.1, last updated 15 October 2021, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 25 October 2021, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
Copyright (C) 1988-2021 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.1, 15 October 2021). The Bash home page is
|
||||
Bash shell (version 5.1, 25 October 2021). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.1, last updated 15 October 2021, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 25 October 2021, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -2076,7 +2076,8 @@ omitted, the operator tests only for existence.
|
||||
of PATTERN are deleted and the '/' following PATTERN may be
|
||||
omitted.
|
||||
|
||||
Any unquoted instances of '&' in STRING are replaced with the
|
||||
If the 'patsub_replacement' shell option is enabled using 'shopt',
|
||||
any unquoted instances of '&' in STRING are replaced with the
|
||||
matching portion of PATTERN. This is intended to duplicate a
|
||||
common 'sed' idiom. Backslash is used to quote '&' in STRING; the
|
||||
backslash is removed in order to permit a literal '&' in the
|
||||
@@ -3022,6 +3023,33 @@ the 'wait' builtin, the reception of a signal for which a trap has been
|
||||
set will cause the 'wait' builtin to return immediately with an exit
|
||||
status greater than 128, immediately after which the trap is executed.
|
||||
|
||||
When job control is not enabled, and Bash is waiting for a foreground
|
||||
command to complete, the shell receives keyboard-generated signals such
|
||||
as 'SIGINT' (usually generated by '^C') that users commonly intend to
|
||||
send to that command. This happens because the shell and the command
|
||||
are in the same process group as the terminal, and '^C' sends 'SIGINT'
|
||||
to all processes in that process group. See *note Job Control::, for a
|
||||
more in-depth discussion of process groups.
|
||||
|
||||
When Bash is running without job control enabled and receives
|
||||
'SIGINT' while waiting for a foreground command, it waits until that
|
||||
foreground command terminates and then decides what to do about the
|
||||
'SIGINT':
|
||||
|
||||
1. If the command terminates due to the 'SIGINT', Bash concludes that
|
||||
the user meant to end the entire script, and acts on the 'SIGINT'
|
||||
(e.g., by running a 'SIGINT' trap or exiting itself);
|
||||
|
||||
2. If the pipeline does not terminate due to 'SIGINT', the program
|
||||
handled the 'SIGINT' itself and did not treat it as a fatal signal.
|
||||
In that case, Bash does not treat 'SIGINT' as a fatal signal,
|
||||
either, instead assuming that the 'SIGINT' was used as part of the
|
||||
program's normal operation (e.g., 'emacs' uses it to abort editing
|
||||
commands) or deliberately discarded. However, Bash will run any
|
||||
trap set on 'SIGINT', as it does with any other trapped signal it
|
||||
receives while it is waiting for the foreground command to
|
||||
complete, for compatibility.
|
||||
|
||||
|
||||
File: bashref.info, Node: Shell Scripts, Prev: Executing Commands, Up: Basic Shell Features
|
||||
|
||||
@@ -4932,6 +4960,12 @@ This builtin allows you to change additional shell optional behavior.
|
||||
If set, Bash allows filename patterns which match no files to
|
||||
expand to a null string, rather than themselves.
|
||||
|
||||
'patsub_replacement'
|
||||
If set, Bash expands occurrences of '&' in the replacement
|
||||
string of pattern substitution to the text matched by the
|
||||
pattern, as described above (*note Shell Parameter
|
||||
Expansion::). This option is enabled by default.
|
||||
|
||||
'progcomp'
|
||||
If set, the programmable completion facilities (*note
|
||||
Programmable Completion::) are enabled. This option is
|
||||
@@ -12373,103 +12407,103 @@ Node: Shell Expansions69747
|
||||
Node: Brace Expansion71874
|
||||
Node: Tilde Expansion74608
|
||||
Node: Shell Parameter Expansion77229
|
||||
Node: Command Substitution95023
|
||||
Node: Arithmetic Expansion96378
|
||||
Node: Process Substitution97346
|
||||
Node: Word Splitting98466
|
||||
Node: Filename Expansion100410
|
||||
Node: Pattern Matching103010
|
||||
Node: Quote Removal107618
|
||||
Node: Redirections107913
|
||||
Node: Executing Commands117573
|
||||
Node: Simple Command Expansion118243
|
||||
Node: Command Search and Execution120353
|
||||
Node: Command Execution Environment122731
|
||||
Node: Environment125766
|
||||
Node: Exit Status127429
|
||||
Node: Signals129213
|
||||
Node: Shell Scripts131180
|
||||
Node: Shell Builtin Commands134207
|
||||
Node: Bourne Shell Builtins136245
|
||||
Node: Bash Builtins157706
|
||||
Node: Modifying Shell Behavior188523
|
||||
Node: The Set Builtin188868
|
||||
Node: The Shopt Builtin199281
|
||||
Node: Special Builtins214710
|
||||
Node: Shell Variables215689
|
||||
Node: Bourne Shell Variables216126
|
||||
Node: Bash Variables218230
|
||||
Node: Bash Features251045
|
||||
Node: Invoking Bash252058
|
||||
Node: Bash Startup Files258071
|
||||
Node: Interactive Shells263174
|
||||
Node: What is an Interactive Shell?263584
|
||||
Node: Is this Shell Interactive?264233
|
||||
Node: Interactive Shell Behavior265048
|
||||
Node: Bash Conditional Expressions268561
|
||||
Node: Shell Arithmetic273203
|
||||
Node: Aliases276147
|
||||
Node: Arrays278760
|
||||
Node: The Directory Stack284769
|
||||
Node: Directory Stack Builtins285553
|
||||
Node: Controlling the Prompt289813
|
||||
Node: The Restricted Shell292778
|
||||
Node: Bash POSIX Mode295375
|
||||
Node: Shell Compatibility Mode306648
|
||||
Node: Job Control313304
|
||||
Node: Job Control Basics313764
|
||||
Node: Job Control Builtins318766
|
||||
Node: Job Control Variables324166
|
||||
Node: Command Line Editing325322
|
||||
Node: Introduction and Notation326993
|
||||
Node: Readline Interaction328616
|
||||
Node: Readline Bare Essentials329807
|
||||
Node: Readline Movement Commands331590
|
||||
Node: Readline Killing Commands332550
|
||||
Node: Readline Arguments334468
|
||||
Node: Searching335512
|
||||
Node: Readline Init File337698
|
||||
Node: Readline Init File Syntax338959
|
||||
Node: Conditional Init Constructs360239
|
||||
Node: Sample Init File364435
|
||||
Node: Bindable Readline Commands367559
|
||||
Node: Commands For Moving368763
|
||||
Node: Commands For History370814
|
||||
Node: Commands For Text375808
|
||||
Node: Commands For Killing379457
|
||||
Node: Numeric Arguments382490
|
||||
Node: Commands For Completion383629
|
||||
Node: Keyboard Macros387820
|
||||
Node: Miscellaneous Commands388507
|
||||
Node: Readline vi Mode394446
|
||||
Node: Programmable Completion395353
|
||||
Node: Programmable Completion Builtins403133
|
||||
Node: A Programmable Completion Example413828
|
||||
Node: Using History Interactively419075
|
||||
Node: Bash History Facilities419759
|
||||
Node: Bash History Builtins422764
|
||||
Node: History Interaction427772
|
||||
Node: Event Designators431392
|
||||
Node: Word Designators432746
|
||||
Node: Modifiers434506
|
||||
Node: Installing Bash436317
|
||||
Node: Basic Installation437454
|
||||
Node: Compilers and Options441176
|
||||
Node: Compiling For Multiple Architectures441917
|
||||
Node: Installation Names443610
|
||||
Node: Specifying the System Type445719
|
||||
Node: Sharing Defaults446435
|
||||
Node: Operation Controls447108
|
||||
Node: Optional Features448066
|
||||
Node: Reporting Bugs459159
|
||||
Node: Major Differences From The Bourne Shell460434
|
||||
Node: GNU Free Documentation License477284
|
||||
Node: Indexes502461
|
||||
Node: Builtin Index502915
|
||||
Node: Reserved Word Index509742
|
||||
Node: Variable Index512190
|
||||
Node: Function Index528682
|
||||
Node: Concept Index542466
|
||||
Node: Command Substitution95095
|
||||
Node: Arithmetic Expansion96450
|
||||
Node: Process Substitution97418
|
||||
Node: Word Splitting98538
|
||||
Node: Filename Expansion100482
|
||||
Node: Pattern Matching103082
|
||||
Node: Quote Removal107690
|
||||
Node: Redirections107985
|
||||
Node: Executing Commands117645
|
||||
Node: Simple Command Expansion118315
|
||||
Node: Command Search and Execution120425
|
||||
Node: Command Execution Environment122803
|
||||
Node: Environment125838
|
||||
Node: Exit Status127501
|
||||
Node: Signals129285
|
||||
Node: Shell Scripts132734
|
||||
Node: Shell Builtin Commands135761
|
||||
Node: Bourne Shell Builtins137799
|
||||
Node: Bash Builtins159260
|
||||
Node: Modifying Shell Behavior190077
|
||||
Node: The Set Builtin190422
|
||||
Node: The Shopt Builtin200835
|
||||
Node: Special Builtins216549
|
||||
Node: Shell Variables217528
|
||||
Node: Bourne Shell Variables217965
|
||||
Node: Bash Variables220069
|
||||
Node: Bash Features252884
|
||||
Node: Invoking Bash253897
|
||||
Node: Bash Startup Files259910
|
||||
Node: Interactive Shells265013
|
||||
Node: What is an Interactive Shell?265423
|
||||
Node: Is this Shell Interactive?266072
|
||||
Node: Interactive Shell Behavior266887
|
||||
Node: Bash Conditional Expressions270400
|
||||
Node: Shell Arithmetic275042
|
||||
Node: Aliases277986
|
||||
Node: Arrays280599
|
||||
Node: The Directory Stack286608
|
||||
Node: Directory Stack Builtins287392
|
||||
Node: Controlling the Prompt291652
|
||||
Node: The Restricted Shell294617
|
||||
Node: Bash POSIX Mode297214
|
||||
Node: Shell Compatibility Mode308487
|
||||
Node: Job Control315143
|
||||
Node: Job Control Basics315603
|
||||
Node: Job Control Builtins320605
|
||||
Node: Job Control Variables326005
|
||||
Node: Command Line Editing327161
|
||||
Node: Introduction and Notation328832
|
||||
Node: Readline Interaction330455
|
||||
Node: Readline Bare Essentials331646
|
||||
Node: Readline Movement Commands333429
|
||||
Node: Readline Killing Commands334389
|
||||
Node: Readline Arguments336307
|
||||
Node: Searching337351
|
||||
Node: Readline Init File339537
|
||||
Node: Readline Init File Syntax340798
|
||||
Node: Conditional Init Constructs362078
|
||||
Node: Sample Init File366274
|
||||
Node: Bindable Readline Commands369398
|
||||
Node: Commands For Moving370602
|
||||
Node: Commands For History372653
|
||||
Node: Commands For Text377647
|
||||
Node: Commands For Killing381296
|
||||
Node: Numeric Arguments384329
|
||||
Node: Commands For Completion385468
|
||||
Node: Keyboard Macros389659
|
||||
Node: Miscellaneous Commands390346
|
||||
Node: Readline vi Mode396285
|
||||
Node: Programmable Completion397192
|
||||
Node: Programmable Completion Builtins404972
|
||||
Node: A Programmable Completion Example415667
|
||||
Node: Using History Interactively420914
|
||||
Node: Bash History Facilities421598
|
||||
Node: Bash History Builtins424603
|
||||
Node: History Interaction429611
|
||||
Node: Event Designators433231
|
||||
Node: Word Designators434585
|
||||
Node: Modifiers436345
|
||||
Node: Installing Bash438156
|
||||
Node: Basic Installation439293
|
||||
Node: Compilers and Options443015
|
||||
Node: Compiling For Multiple Architectures443756
|
||||
Node: Installation Names445449
|
||||
Node: Specifying the System Type447558
|
||||
Node: Sharing Defaults448274
|
||||
Node: Operation Controls448947
|
||||
Node: Optional Features449905
|
||||
Node: Reporting Bugs460998
|
||||
Node: Major Differences From The Bourne Shell462273
|
||||
Node: GNU Free Documentation License479123
|
||||
Node: Indexes504300
|
||||
Node: Builtin Index504754
|
||||
Node: Reserved Word Index511581
|
||||
Node: Variable Index514029
|
||||
Node: Function Index530521
|
||||
Node: Concept Index544305
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user