fix history expansion to not perform quick substitution on a new line that's part of a quoted string; save the value of $_ around prompt string decoding

This commit is contained in:
Chet Ramey
2023-12-19 09:56:34 -05:00
parent 9d51df7546
commit aa2d23cfac
24 changed files with 1973 additions and 1779 deletions
+173 -163
View File
@@ -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.3, 6 November 2023).
Bash shell (version 5.3, 14 December 2023).
This is Edition 5.3, last updated 6 November 2023, of 'The GNU Bash
This is Edition 5.3, last updated 14 December 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
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.3, 6 November 2023). The Bash home page is
Bash shell (version 5.3, 14 December 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 6 November 2023, of 'The GNU Bash
This is Edition 5.3, last updated 14 December 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -3805,24 +3805,25 @@ standard.
'-p'
Display Readline function names and bindings in such a way
that they can be used as input or in a Readline initialization
file.
that they can be used as an argument to a subsequent 'bind'
command or in a Readline initialization file.
'-P'
List current Readline function names and bindings.
'-v'
Display Readline variable names and values in such a way that
they can be used as input or in a Readline initialization
file.
they can be used as an argument to a subsequent 'bind' command
or in a Readline initialization file.
'-V'
List current Readline variable names and values.
'-s'
Display Readline key sequences bound to macros and the strings
they output in such a way that they can be used as input or in
a Readline initialization file.
they output in such a way that they can be used as an argument
to a subsequent 'bind' command or in a Readline initialization
file.
'-S'
Display Readline key sequences bound to macros and the strings
@@ -3865,7 +3866,8 @@ standard.
'-X'
List all key sequences bound to shell commands and the
associated commands in a format that can be reused as input.
associated commands in a format that can be reused as an
argument to a subsequent 'bind' command.
The return status is zero unless an invalid option is supplied or
an error occurs.
@@ -5735,7 +5737,7 @@ Variables::).
first character is the "history expansion" character, that is, the
character which signifies the start of a history expansion,
normally '!'. The second character is the character which
signifies 'quick substitution' when seen as the first character on
signifies "quick substitution" when seen as the first character on
a line, normally '^'. The optional third character is the
character which indicates that the remainder of the line is a
comment when found as the first character of a word, usually '#'.
@@ -10479,6 +10481,14 @@ history expansion character, but the history expansion character is also
treated as quoted if it immediately precedes the closing double quote in
a double-quoted string.
There is a special abbreviation for substitution, active when the
QUICK SUBSTITUTION character (default '^') is the first character on the
line. It selects the previous history list entry, using an event
designator equivalent to '!!', and substitutes one string for another in
that line. It is described below (*note Event Designators::). This is
the only history expansion that does not begin with the history
expansion character.
Several shell options settable with the 'shopt' builtin (*note The
Shopt Builtin::) may be used to tailor the behavior of history
expansion. If the 'histverify' shell option is enabled, and Readline is
@@ -12138,11 +12148,11 @@ D.1 Index of Shell Builtin Commands
* bind: Bash Builtins. (line 21)
* break: Bourne Shell Builtins.
(line 37)
* builtin: Bash Builtins. (line 117)
* caller: Bash Builtins. (line 126)
* builtin: Bash Builtins. (line 119)
* caller: Bash Builtins. (line 128)
* cd: Bourne Shell Builtins.
(line 45)
* command: Bash Builtins. (line 143)
* command: Bash Builtins. (line 145)
* compgen: Programmable Completion Builtins.
(line 12)
* complete: Programmable Completion Builtins.
@@ -12151,13 +12161,13 @@ D.1 Index of Shell Builtin Commands
(line 248)
* continue: Bourne Shell Builtins.
(line 90)
* declare: Bash Builtins. (line 163)
* declare: Bash Builtins. (line 165)
* dirs: Directory Stack Builtins.
(line 7)
* disown: Job Control Builtins.
(line 104)
* echo: Bash Builtins. (line 266)
* enable: Bash Builtins. (line 315)
* echo: Bash Builtins. (line 268)
* enable: Bash Builtins. (line 317)
* eval: Bourne Shell Builtins.
(line 99)
* exec: Bourne Shell Builtins.
@@ -12176,26 +12186,26 @@ D.1 Index of Shell Builtin Commands
(line 153)
* hash: Bourne Shell Builtins.
(line 197)
* help: Bash Builtins. (line 353)
* help: Bash Builtins. (line 355)
* history: Bash History Builtins.
(line 46)
* jobs: Job Control Builtins.
(line 27)
* kill: Job Control Builtins.
(line 58)
* let: Bash Builtins. (line 372)
* local: Bash Builtins. (line 380)
* logout: Bash Builtins. (line 397)
* mapfile: Bash Builtins. (line 402)
* let: Bash Builtins. (line 374)
* local: Bash Builtins. (line 382)
* logout: Bash Builtins. (line 399)
* mapfile: Bash Builtins. (line 404)
* popd: Directory Stack Builtins.
(line 35)
* printf: Bash Builtins. (line 448)
* printf: Bash Builtins. (line 450)
* pushd: Directory Stack Builtins.
(line 69)
* pwd: Bourne Shell Builtins.
(line 222)
* read: Bash Builtins. (line 516)
* readarray: Bash Builtins. (line 619)
* read: Bash Builtins. (line 518)
* readarray: Bash Builtins. (line 621)
* readonly: Bourne Shell Builtins.
(line 232)
* return: Bourne Shell Builtins.
@@ -12204,7 +12214,7 @@ D.1 Index of Shell Builtin Commands
* shift: Bourne Shell Builtins.
(line 272)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 628)
* source: Bash Builtins. (line 630)
* suspend: Job Control Builtins.
(line 116)
* test: Bourne Shell Builtins.
@@ -12215,12 +12225,12 @@ D.1 Index of Shell Builtin Commands
(line 393)
* true: Bourne Shell Builtins.
(line 455)
* type: Bash Builtins. (line 633)
* typeset: Bash Builtins. (line 671)
* ulimit: Bash Builtins. (line 677)
* type: Bash Builtins. (line 635)
* typeset: Bash Builtins. (line 673)
* ulimit: Bash Builtins. (line 679)
* umask: Bourne Shell Builtins.
(line 460)
* unalias: Bash Builtins. (line 783)
* unalias: Bash Builtins. (line 785)
* unset: Bourne Shell Builtins.
(line 478)
* wait: Job Control Builtins.
@@ -12898,138 +12908,138 @@ D.5 Concept Index

Tag Table:
Node: Top892
Node: Introduction2807
Node: What is Bash?3020
Node: What is a shell?4131
Node: Definitions6666
Node: Basic Shell Features9614
Node: Shell Syntax10830
Node: Shell Operation11853
Node: Quoting13143
Node: Escape Character14444
Node: Single Quotes14926
Node: Double Quotes15271
Node: ANSI-C Quoting16546
Node: Locale Translation17855
Node: Creating Internationalized Scripts19163
Node: Comments23277
Node: Shell Commands23892
Node: Reserved Words24827
Node: Simple Commands25580
Node: Pipelines26231
Node: Lists29214
Node: Compound Commands31006
Node: Looping Constructs32015
Node: Conditional Constructs34507
Node: Command Grouping48992
Node: Coprocesses50467
Node: GNU Parallel53127
Node: Shell Functions54041
Node: Shell Parameters61923
Node: Positional Parameters66308
Node: Special Parameters67207
Node: Shell Expansions70418
Node: Brace Expansion72503
Node: Tilde Expansion75234
Node: Shell Parameter Expansion77852
Node: Command Substitution96442
Node: Arithmetic Expansion99903
Node: Process Substitution100868
Node: Word Splitting101985
Node: Filename Expansion104030
Node: Pattern Matching106960
Node: Quote Removal111959
Node: Redirections112251
Node: Executing Commands121942
Node: Simple Command Expansion122609
Node: Command Search and Execution124716
Node: Command Execution Environment127100
Node: Environment130132
Node: Exit Status131792
Node: Signals133573
Node: Shell Scripts137019
Node: Shell Builtin Commands140043
Node: Bourne Shell Builtins142078
Node: Bash Builtins165467
Node: Modifying Shell Behavior198516
Node: The Set Builtin198858
Node: The Shopt Builtin209829
Node: Special Builtins226021
Node: Shell Variables227010
Node: Bourne Shell Variables227444
Node: Bash Variables229545
Node: Bash Features264611
Node: Invoking Bash265621
Node: Bash Startup Files271752
Node: Interactive Shells276880
Node: What is an Interactive Shell?277288
Node: Is this Shell Interactive?277934
Node: Interactive Shell Behavior278746
Node: Bash Conditional Expressions282372
Node: Shell Arithmetic287282
Node: Aliases290240
Node: Arrays293131
Node: The Directory Stack299762
Node: Directory Stack Builtins300543
Node: Controlling the Prompt304800
Node: The Restricted Shell307762
Node: Bash POSIX Mode310369
Node: Shell Compatibility Mode327011
Node: Job Control335256
Node: Job Control Basics335713
Node: Job Control Builtins340712
Node: Job Control Variables346504
Node: Command Line Editing347657
Node: Introduction and Notation349325
Node: Readline Interaction350945
Node: Readline Bare Essentials352133
Node: Readline Movement Commands353919
Node: Readline Killing Commands354876
Node: Readline Arguments356794
Node: Searching357835
Node: Readline Init File360018
Node: Readline Init File Syntax361276
Node: Conditional Init Constructs385298
Node: Sample Init File389491
Node: Bindable Readline Commands392612
Node: Commands For Moving393813
Node: Commands For History395861
Node: Commands For Text400852
Node: Commands For Killing404827
Node: Numeric Arguments407528
Node: Commands For Completion408664
Node: Keyboard Macros412852
Node: Miscellaneous Commands413537
Node: Readline vi Mode419903
Node: Programmable Completion420807
Node: Programmable Completion Builtins428584
Node: A Programmable Completion Example439701
Node: Using History Interactively444946
Node: Bash History Facilities445627
Node: Bash History Builtins448635
Node: History Interaction453723
Node: Event Designators457533
Node: Word Designators459068
Node: Modifiers460930
Node: Installing Bash462735
Node: Basic Installation463869
Node: Compilers and Options467588
Node: Compiling For Multiple Architectures468326
Node: Installation Names470015
Node: Specifying the System Type472121
Node: Sharing Defaults472835
Node: Operation Controls473505
Node: Optional Features474460
Node: Reporting Bugs485677
Node: Major Differences From The Bourne Shell487008
Node: GNU Free Documentation License503863
Node: Indexes529037
Node: Builtin Index529488
Node: Reserved Word Index536586
Node: Variable Index539031
Node: Function Index556162
Node: Concept Index570018
Node: Top894
Node: Introduction2811
Node: What is Bash?3024
Node: What is a shell?4135
Node: Definitions6670
Node: Basic Shell Features9618
Node: Shell Syntax10834
Node: Shell Operation11857
Node: Quoting13147
Node: Escape Character14448
Node: Single Quotes14930
Node: Double Quotes15275
Node: ANSI-C Quoting16550
Node: Locale Translation17859
Node: Creating Internationalized Scripts19167
Node: Comments23281
Node: Shell Commands23896
Node: Reserved Words24831
Node: Simple Commands25584
Node: Pipelines26235
Node: Lists29218
Node: Compound Commands31010
Node: Looping Constructs32019
Node: Conditional Constructs34511
Node: Command Grouping48996
Node: Coprocesses50471
Node: GNU Parallel53131
Node: Shell Functions54045
Node: Shell Parameters61927
Node: Positional Parameters66312
Node: Special Parameters67211
Node: Shell Expansions70422
Node: Brace Expansion72507
Node: Tilde Expansion75238
Node: Shell Parameter Expansion77856
Node: Command Substitution96446
Node: Arithmetic Expansion99907
Node: Process Substitution100872
Node: Word Splitting101989
Node: Filename Expansion104034
Node: Pattern Matching106964
Node: Quote Removal111963
Node: Redirections112255
Node: Executing Commands121946
Node: Simple Command Expansion122613
Node: Command Search and Execution124720
Node: Command Execution Environment127104
Node: Environment130136
Node: Exit Status131796
Node: Signals133577
Node: Shell Scripts137023
Node: Shell Builtin Commands140047
Node: Bourne Shell Builtins142082
Node: Bash Builtins165471
Node: Modifying Shell Behavior198688
Node: The Set Builtin199030
Node: The Shopt Builtin210001
Node: Special Builtins226193
Node: Shell Variables227182
Node: Bourne Shell Variables227616
Node: Bash Variables229717
Node: Bash Features264783
Node: Invoking Bash265793
Node: Bash Startup Files271924
Node: Interactive Shells277052
Node: What is an Interactive Shell?277460
Node: Is this Shell Interactive?278106
Node: Interactive Shell Behavior278918
Node: Bash Conditional Expressions282544
Node: Shell Arithmetic287454
Node: Aliases290412
Node: Arrays293303
Node: The Directory Stack299934
Node: Directory Stack Builtins300715
Node: Controlling the Prompt304972
Node: The Restricted Shell307934
Node: Bash POSIX Mode310541
Node: Shell Compatibility Mode327183
Node: Job Control335428
Node: Job Control Basics335885
Node: Job Control Builtins340884
Node: Job Control Variables346676
Node: Command Line Editing347829
Node: Introduction and Notation349497
Node: Readline Interaction351117
Node: Readline Bare Essentials352305
Node: Readline Movement Commands354091
Node: Readline Killing Commands355048
Node: Readline Arguments356966
Node: Searching358007
Node: Readline Init File360190
Node: Readline Init File Syntax361448
Node: Conditional Init Constructs385470
Node: Sample Init File389663
Node: Bindable Readline Commands392784
Node: Commands For Moving393985
Node: Commands For History396033
Node: Commands For Text401024
Node: Commands For Killing404999
Node: Numeric Arguments407700
Node: Commands For Completion408836
Node: Keyboard Macros413024
Node: Miscellaneous Commands413709
Node: Readline vi Mode420075
Node: Programmable Completion420979
Node: Programmable Completion Builtins428756
Node: A Programmable Completion Example439873
Node: Using History Interactively445118
Node: Bash History Facilities445799
Node: Bash History Builtins448807
Node: History Interaction453895
Node: Event Designators458144
Node: Word Designators459679
Node: Modifiers461541
Node: Installing Bash463346
Node: Basic Installation464480
Node: Compilers and Options468199
Node: Compiling For Multiple Architectures468937
Node: Installation Names470626
Node: Specifying the System Type472732
Node: Sharing Defaults473446
Node: Operation Controls474116
Node: Optional Features475071
Node: Reporting Bugs486288
Node: Major Differences From The Bourne Shell487619
Node: GNU Free Documentation License504474
Node: Indexes529648
Node: Builtin Index530099
Node: Reserved Word Index537197
Node: Variable Index539642
Node: Function Index556773
Node: Concept Index570629

End Tag Table