mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-01 09:29:51 +02:00
fix for programmable completion functions setting traps on signals that readline handles
This commit is contained in:
+186
-177
@@ -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.2, 19 September 2022).
|
||||
Bash shell (version 5.2, 2 December 2022).
|
||||
|
||||
This is Edition 5.2, last updated 19 September 2022, of 'The GNU Bash
|
||||
This is Edition 5.2, last updated 2 December 2022, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.2.
|
||||
|
||||
Copyright (C) 1988-2022 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.2, 19 September 2022). The Bash home page is
|
||||
Bash shell (version 5.2, 2 December 2022). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.2, last updated 19 September 2022, of 'The GNU Bash
|
||||
This is Edition 5.2, last updated 2 December 2022, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.2.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -1833,7 +1833,7 @@ immediately follow the left brace in order to introduce indirection.
|
||||
In each of the cases below, WORD is subject to tilde expansion,
|
||||
parameter expansion, command substitution, and arithmetic expansion.
|
||||
|
||||
When not performing substring expansion, using the form described
|
||||
When not performing substring expansion, using the forms described
|
||||
below (e.g., ':-'), Bash tests for a parameter that is unset or null.
|
||||
Omitting the colon results in a test only for a parameter that is unset.
|
||||
Put another way, if the colon is included, the operator tests for both
|
||||
@@ -3564,37 +3564,43 @@ standard.
|
||||
children. The return status is zero.
|
||||
|
||||
'trap'
|
||||
trap [-lp] [ARG] [SIGSPEC ...]
|
||||
trap [-lp] [ACTION] [SIGSPEC ...]
|
||||
|
||||
The commands in ARG are to be read and executed when the shell
|
||||
receives signal SIGSPEC. If ARG is absent (and there is a single
|
||||
SIGSPEC) or equal to '-', each specified signal's disposition is
|
||||
reset to the value it had when the shell was started. If ARG is
|
||||
the null string, then the signal specified by each SIGSPEC is
|
||||
ignored by the shell and commands it invokes. If ARG is not
|
||||
present and '-p' has been supplied, the shell displays the trap
|
||||
commands associated with each SIGSPEC. If no arguments are
|
||||
supplied, or only '-p' is given, 'trap' prints the list of commands
|
||||
associated with each signal number in a form that may be reused as
|
||||
shell input. The '-l' option causes the shell to print a list of
|
||||
signal names and their corresponding numbers. Each SIGSPEC is
|
||||
either a signal name or a signal number. Signal names are case
|
||||
insensitive and the 'SIG' prefix is optional.
|
||||
The ACTION is a command that is read and executed when the shell
|
||||
receives signal SIGSPEC. If ACTION is absent (and there is a
|
||||
single SIGSPEC) or equal to '-', each specified signal's
|
||||
disposition is reset to the value it had when the shell was
|
||||
started. If ACTION is the null string, then the signal specified
|
||||
by each SIGSPEC is ignored by the shell and commands it invokes.
|
||||
|
||||
If a SIGSPEC is '0' or 'EXIT', ARG is executed when the shell
|
||||
exits. If a SIGSPEC is 'DEBUG', the command ARG is executed before
|
||||
every simple command, 'for' command, 'case' command, 'select'
|
||||
command, every arithmetic 'for' command, and before the first
|
||||
command executes in a shell function. Refer to the description of
|
||||
the 'extdebug' option to the 'shopt' builtin (*note The Shopt
|
||||
Builtin::) for details of its effect on the 'DEBUG' trap. If a
|
||||
SIGSPEC is 'RETURN', the command ARG is executed each time a shell
|
||||
function or a script executed with the '.' or 'source' builtins
|
||||
finishes executing.
|
||||
If no arguments are supplied, 'trap' prints the actions associated
|
||||
with each trapped signal as a set of 'trap' commands that can be
|
||||
reused as shell input to restore the current signal dispositions.
|
||||
If ACTION is not present and '-p' has been supplied, 'trap'
|
||||
displays the trap commands associated with each SIGSPEC, or, if no
|
||||
SIGSPECs are supplied, for all trapped signals, as a set of 'trap'
|
||||
commands that can be reused as shell input to restore the current
|
||||
signal dispositions.
|
||||
|
||||
If a SIGSPEC is 'ERR', the command ARG is executed whenever a
|
||||
pipeline (which may consist of a single simple command), a list, or
|
||||
a compound command returns a non-zero exit status, subject to the
|
||||
The '-l' option causes 'trap' to print a list of signal names and
|
||||
their corresponding numbers. Each SIGSPEC is either a signal name
|
||||
or a signal number. Signal names are case insensitive and the
|
||||
'SIG' prefix is optional.
|
||||
|
||||
If a SIGSPEC is '0' or 'EXIT', ACTION is executed when the shell
|
||||
exits. If a SIGSPEC is 'DEBUG', ACTION is executed before every
|
||||
simple command, 'for' command, 'case' command, 'select' command, ((
|
||||
arithmetic command, [[ conditional command, arithmetic 'for'
|
||||
command, and before the first command executes in a shell function.
|
||||
Refer to the description of the 'extdebug' option to the 'shopt'
|
||||
builtin (*note The Shopt Builtin::) for details of its effect on
|
||||
the 'DEBUG' trap. If a SIGSPEC is 'RETURN', ACTION is executed
|
||||
each time a shell function or a script executed with the '.' or
|
||||
'source' builtins finishes executing.
|
||||
|
||||
If a SIGSPEC is 'ERR', ACTION is executed whenever a pipeline
|
||||
(which may consist of a single simple command), a list, or a
|
||||
compound command returns a non-zero exit status, subject to the
|
||||
following conditions. The 'ERR' trap is not executed if the failed
|
||||
command is part of the command list immediately following an
|
||||
'until' or 'while' keyword, part of the test following the 'if' or
|
||||
@@ -3604,10 +3610,11 @@ standard.
|
||||
status is being inverted using '!'. These are the same conditions
|
||||
obeyed by the 'errexit' ('-e') option.
|
||||
|
||||
Signals ignored upon entry to the shell cannot be trapped or reset.
|
||||
Trapped signals that are not being ignored are reset to their
|
||||
original values in a subshell or subshell environment when one is
|
||||
created.
|
||||
Signals ignored upon entry to a non-interactive shell cannot be
|
||||
trapped or reset. Interactive shells permit trapping signals
|
||||
ignored on entry. Trapped signals that are not being ignored are
|
||||
reset to their original values in a subshell or subshell
|
||||
environment when one is created.
|
||||
|
||||
The return status is zero unless a SIGSPEC does not specify a valid
|
||||
signal.
|
||||
@@ -7191,8 +7198,9 @@ startup files.
|
||||
handler for a given signal to the original disposition, they should
|
||||
use '-' as the first argument.
|
||||
|
||||
42. 'trap -p' displays signals whose dispositions are set to SIG_DFL
|
||||
and those that were ignored when the shell started.
|
||||
42. 'trap -p' without arguments displays signals whose dispositions
|
||||
are set to SIG_DFL and those that were ignored when the shell
|
||||
started, not just trapped signals.
|
||||
|
||||
43. The '.' and 'source' builtins do not search the current directory
|
||||
for the filename argument if it is not found by searching 'PATH'.
|
||||
@@ -10888,10 +10896,11 @@ of Bash. The latest version of Bash is always available for FTP from
|
||||
<http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz>.
|
||||
|
||||
Once you have determined that a bug actually exists, use the
|
||||
'bashbug' command to submit a bug report. If you have a fix, you are
|
||||
encouraged to mail that as well! Suggestions and 'philosophical' bug
|
||||
reports may be mailed to <bug-bash@gnu.org> or posted to the Usenet
|
||||
newsgroup 'gnu.bash.bug'.
|
||||
'bashbug' command to submit a bug report or use the form at the <a
|
||||
href="https://savannah.gnu.org/projects/bash/">Bash project page</a>.
|
||||
If you have a fix, you are encouraged to submit that as well!
|
||||
Suggestions and 'philosophical' bug reports may be mailed to
|
||||
<bug-bash@gnu.org> or <help-bash@gnu.org>.
|
||||
|
||||
All bug reports should include:
|
||||
* The version number of Bash.
|
||||
@@ -11868,10 +11877,10 @@ D.1 Index of Shell Builtin Commands
|
||||
* typeset: Bash Builtins. (line 631)
|
||||
* ulimit: Bash Builtins. (line 637)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 415)
|
||||
(line 422)
|
||||
* unalias: Bash Builtins. (line 743)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 433)
|
||||
(line 440)
|
||||
* wait: Job Control Builtins.
|
||||
(line 76)
|
||||
|
||||
@@ -12535,138 +12544,138 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top899
|
||||
Node: Introduction2821
|
||||
Node: What is Bash?3037
|
||||
Node: What is a shell?4151
|
||||
Node: Definitions6689
|
||||
Node: Basic Shell Features9640
|
||||
Node: Shell Syntax10859
|
||||
Node: Shell Operation11885
|
||||
Node: Quoting13178
|
||||
Node: Escape Character14482
|
||||
Node: Single Quotes14967
|
||||
Node: Double Quotes15315
|
||||
Node: ANSI-C Quoting16593
|
||||
Node: Locale Translation17903
|
||||
Node: Creating Internationalized Scripts19214
|
||||
Node: Comments23331
|
||||
Node: Shell Commands23949
|
||||
Node: Reserved Words24887
|
||||
Node: Simple Commands25643
|
||||
Node: Pipelines26297
|
||||
Node: Lists29296
|
||||
Node: Compound Commands31091
|
||||
Node: Looping Constructs32103
|
||||
Node: Conditional Constructs34598
|
||||
Node: Command Grouping49086
|
||||
Node: Coprocesses50564
|
||||
Node: GNU Parallel53227
|
||||
Node: Shell Functions54144
|
||||
Node: Shell Parameters62029
|
||||
Node: Positional Parameters66417
|
||||
Node: Special Parameters67319
|
||||
Node: Shell Expansions70533
|
||||
Node: Brace Expansion72660
|
||||
Node: Tilde Expansion75394
|
||||
Node: Shell Parameter Expansion78015
|
||||
Node: Command Substitution96366
|
||||
Node: Arithmetic Expansion97721
|
||||
Node: Process Substitution98689
|
||||
Node: Word Splitting99809
|
||||
Node: Filename Expansion101753
|
||||
Node: Pattern Matching104502
|
||||
Node: Quote Removal109504
|
||||
Node: Redirections109799
|
||||
Node: Executing Commands119459
|
||||
Node: Simple Command Expansion120129
|
||||
Node: Command Search and Execution122239
|
||||
Node: Command Execution Environment124617
|
||||
Node: Environment127652
|
||||
Node: Exit Status129315
|
||||
Node: Signals131099
|
||||
Node: Shell Scripts134548
|
||||
Node: Shell Builtin Commands137575
|
||||
Node: Bourne Shell Builtins139613
|
||||
Node: Bash Builtins161079
|
||||
Node: Modifying Shell Behavior191935
|
||||
Node: The Set Builtin192280
|
||||
Node: The Shopt Builtin202881
|
||||
Node: Special Builtins218793
|
||||
Node: Shell Variables219772
|
||||
Node: Bourne Shell Variables220209
|
||||
Node: Bash Variables222313
|
||||
Node: Bash Features255128
|
||||
Node: Invoking Bash256141
|
||||
Node: Bash Startup Files262154
|
||||
Node: Interactive Shells267285
|
||||
Node: What is an Interactive Shell?267696
|
||||
Node: Is this Shell Interactive?268345
|
||||
Node: Interactive Shell Behavior269160
|
||||
Node: Bash Conditional Expressions272789
|
||||
Node: Shell Arithmetic277431
|
||||
Node: Aliases280375
|
||||
Node: Arrays282988
|
||||
Node: The Directory Stack289379
|
||||
Node: Directory Stack Builtins290163
|
||||
Node: Controlling the Prompt294423
|
||||
Node: The Restricted Shell297388
|
||||
Node: Bash POSIX Mode299998
|
||||
Node: Shell Compatibility Mode311916
|
||||
Node: Job Control320483
|
||||
Node: Job Control Basics320943
|
||||
Node: Job Control Builtins325945
|
||||
Node: Job Control Variables331740
|
||||
Node: Command Line Editing332896
|
||||
Node: Introduction and Notation334567
|
||||
Node: Readline Interaction336190
|
||||
Node: Readline Bare Essentials337381
|
||||
Node: Readline Movement Commands339170
|
||||
Node: Readline Killing Commands340130
|
||||
Node: Readline Arguments342051
|
||||
Node: Searching343095
|
||||
Node: Readline Init File345281
|
||||
Node: Readline Init File Syntax346542
|
||||
Node: Conditional Init Constructs370128
|
||||
Node: Sample Init File374324
|
||||
Node: Bindable Readline Commands377448
|
||||
Node: Commands For Moving378652
|
||||
Node: Commands For History380703
|
||||
Node: Commands For Text385697
|
||||
Node: Commands For Killing389346
|
||||
Node: Numeric Arguments392379
|
||||
Node: Commands For Completion393518
|
||||
Node: Keyboard Macros397709
|
||||
Node: Miscellaneous Commands398397
|
||||
Node: Readline vi Mode404342
|
||||
Node: Programmable Completion405249
|
||||
Node: Programmable Completion Builtins413029
|
||||
Node: A Programmable Completion Example423781
|
||||
Node: Using History Interactively429029
|
||||
Node: Bash History Facilities429713
|
||||
Node: Bash History Builtins432718
|
||||
Node: History Interaction437742
|
||||
Node: Event Designators441362
|
||||
Node: Word Designators442716
|
||||
Node: Modifiers444476
|
||||
Node: Installing Bash446284
|
||||
Node: Basic Installation447421
|
||||
Node: Compilers and Options451143
|
||||
Node: Compiling For Multiple Architectures451884
|
||||
Node: Installation Names453576
|
||||
Node: Specifying the System Type455685
|
||||
Node: Sharing Defaults456402
|
||||
Node: Operation Controls457075
|
||||
Node: Optional Features458033
|
||||
Node: Reporting Bugs469252
|
||||
Node: Major Differences From The Bourne Shell470527
|
||||
Node: GNU Free Documentation License487376
|
||||
Node: Indexes512553
|
||||
Node: Builtin Index513007
|
||||
Node: Reserved Word Index519834
|
||||
Node: Variable Index522282
|
||||
Node: Function Index539056
|
||||
Node: Concept Index552840
|
||||
Node: Top895
|
||||
Node: Introduction2813
|
||||
Node: What is Bash?3029
|
||||
Node: What is a shell?4143
|
||||
Node: Definitions6681
|
||||
Node: Basic Shell Features9632
|
||||
Node: Shell Syntax10851
|
||||
Node: Shell Operation11877
|
||||
Node: Quoting13170
|
||||
Node: Escape Character14474
|
||||
Node: Single Quotes14959
|
||||
Node: Double Quotes15307
|
||||
Node: ANSI-C Quoting16585
|
||||
Node: Locale Translation17895
|
||||
Node: Creating Internationalized Scripts19206
|
||||
Node: Comments23323
|
||||
Node: Shell Commands23941
|
||||
Node: Reserved Words24879
|
||||
Node: Simple Commands25635
|
||||
Node: Pipelines26289
|
||||
Node: Lists29288
|
||||
Node: Compound Commands31083
|
||||
Node: Looping Constructs32095
|
||||
Node: Conditional Constructs34590
|
||||
Node: Command Grouping49078
|
||||
Node: Coprocesses50556
|
||||
Node: GNU Parallel53219
|
||||
Node: Shell Functions54136
|
||||
Node: Shell Parameters62021
|
||||
Node: Positional Parameters66409
|
||||
Node: Special Parameters67311
|
||||
Node: Shell Expansions70525
|
||||
Node: Brace Expansion72652
|
||||
Node: Tilde Expansion75386
|
||||
Node: Shell Parameter Expansion78007
|
||||
Node: Command Substitution96359
|
||||
Node: Arithmetic Expansion97714
|
||||
Node: Process Substitution98682
|
||||
Node: Word Splitting99802
|
||||
Node: Filename Expansion101746
|
||||
Node: Pattern Matching104495
|
||||
Node: Quote Removal109497
|
||||
Node: Redirections109792
|
||||
Node: Executing Commands119452
|
||||
Node: Simple Command Expansion120122
|
||||
Node: Command Search and Execution122232
|
||||
Node: Command Execution Environment124610
|
||||
Node: Environment127645
|
||||
Node: Exit Status129308
|
||||
Node: Signals131092
|
||||
Node: Shell Scripts134541
|
||||
Node: Shell Builtin Commands137568
|
||||
Node: Bourne Shell Builtins139606
|
||||
Node: Bash Builtins161391
|
||||
Node: Modifying Shell Behavior192247
|
||||
Node: The Set Builtin192592
|
||||
Node: The Shopt Builtin203193
|
||||
Node: Special Builtins219105
|
||||
Node: Shell Variables220084
|
||||
Node: Bourne Shell Variables220521
|
||||
Node: Bash Variables222625
|
||||
Node: Bash Features255440
|
||||
Node: Invoking Bash256453
|
||||
Node: Bash Startup Files262466
|
||||
Node: Interactive Shells267597
|
||||
Node: What is an Interactive Shell?268008
|
||||
Node: Is this Shell Interactive?268657
|
||||
Node: Interactive Shell Behavior269472
|
||||
Node: Bash Conditional Expressions273101
|
||||
Node: Shell Arithmetic277743
|
||||
Node: Aliases280687
|
||||
Node: Arrays283300
|
||||
Node: The Directory Stack289691
|
||||
Node: Directory Stack Builtins290475
|
||||
Node: Controlling the Prompt294735
|
||||
Node: The Restricted Shell297700
|
||||
Node: Bash POSIX Mode300310
|
||||
Node: Shell Compatibility Mode312277
|
||||
Node: Job Control320844
|
||||
Node: Job Control Basics321304
|
||||
Node: Job Control Builtins326306
|
||||
Node: Job Control Variables332101
|
||||
Node: Command Line Editing333257
|
||||
Node: Introduction and Notation334928
|
||||
Node: Readline Interaction336551
|
||||
Node: Readline Bare Essentials337742
|
||||
Node: Readline Movement Commands339531
|
||||
Node: Readline Killing Commands340491
|
||||
Node: Readline Arguments342412
|
||||
Node: Searching343456
|
||||
Node: Readline Init File345642
|
||||
Node: Readline Init File Syntax346903
|
||||
Node: Conditional Init Constructs370489
|
||||
Node: Sample Init File374685
|
||||
Node: Bindable Readline Commands377809
|
||||
Node: Commands For Moving379013
|
||||
Node: Commands For History381064
|
||||
Node: Commands For Text386058
|
||||
Node: Commands For Killing389707
|
||||
Node: Numeric Arguments392740
|
||||
Node: Commands For Completion393879
|
||||
Node: Keyboard Macros398070
|
||||
Node: Miscellaneous Commands398758
|
||||
Node: Readline vi Mode404703
|
||||
Node: Programmable Completion405610
|
||||
Node: Programmable Completion Builtins413390
|
||||
Node: A Programmable Completion Example424142
|
||||
Node: Using History Interactively429390
|
||||
Node: Bash History Facilities430074
|
||||
Node: Bash History Builtins433079
|
||||
Node: History Interaction438103
|
||||
Node: Event Designators441723
|
||||
Node: Word Designators443077
|
||||
Node: Modifiers444837
|
||||
Node: Installing Bash446645
|
||||
Node: Basic Installation447782
|
||||
Node: Compilers and Options451504
|
||||
Node: Compiling For Multiple Architectures452245
|
||||
Node: Installation Names453937
|
||||
Node: Specifying the System Type456046
|
||||
Node: Sharing Defaults456763
|
||||
Node: Operation Controls457436
|
||||
Node: Optional Features458394
|
||||
Node: Reporting Bugs469613
|
||||
Node: Major Differences From The Bourne Shell470957
|
||||
Node: GNU Free Documentation License487806
|
||||
Node: Indexes512983
|
||||
Node: Builtin Index513437
|
||||
Node: Reserved Word Index520264
|
||||
Node: Variable Index522712
|
||||
Node: Function Index539486
|
||||
Node: Concept Index553270
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user