mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-13 23:20:49 +02:00
fix for programmable completion functions setting traps on signals that readline handles
This commit is contained in:
+16
-12
@@ -22,31 +22,35 @@ $PRODUCES trap.c
|
||||
|
||||
$BUILTIN trap
|
||||
$FUNCTION trap_builtin
|
||||
$SHORT_DOC trap [-lp] [[arg] signal_spec ...]
|
||||
$SHORT_DOC trap [-lp] [[action] signal_spec ...]
|
||||
Trap signals and other events.
|
||||
|
||||
Defines and activates handlers to be run when the shell receives signals
|
||||
or other conditions.
|
||||
|
||||
ARG is a command to be read and executed when the shell receives the
|
||||
signal(s) SIGNAL_SPEC. If ARG is absent (and a single SIGNAL_SPEC
|
||||
ACTION is a command to be read and executed when the shell receives the
|
||||
signal(s) SIGNAL_SPEC. If ACTION is absent (and a single SIGNAL_SPEC
|
||||
is supplied) or `-', each specified signal is reset to its original
|
||||
value. If ARG is the null string each SIGNAL_SPEC is ignored by the
|
||||
value. If ACTION is the null string each SIGNAL_SPEC is ignored by the
|
||||
shell and by the commands it invokes.
|
||||
|
||||
If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell. If
|
||||
a SIGNAL_SPEC is DEBUG, ARG is executed before every simple command. If
|
||||
a SIGNAL_SPEC is RETURN, ARG is executed each time a shell function or a
|
||||
script run by the . or source builtins finishes executing. A SIGNAL_SPEC
|
||||
of ERR means to execute ARG each time a command's failure would cause the
|
||||
shell to exit when the -e option is enabled.
|
||||
If a SIGNAL_SPEC is EXIT (0) ACTION is executed on exit from the shell.
|
||||
If a SIGNAL_SPEC is DEBUG, ACTION is executed before every simple command
|
||||
and selected other commands. If a SIGNAL_SPEC is RETURN, ACTION is
|
||||
executed each time a shell function or a script run by the . or source
|
||||
builtins finishes executing. A SIGNAL_SPEC of ERR means to execute ACTION
|
||||
each time a command's failure would cause the shell to exit when the -e
|
||||
option is enabled.
|
||||
|
||||
If no arguments are supplied, trap prints the list of commands associated
|
||||
with each signal.
|
||||
with each trapped signal in a form that may be reused as shell input to
|
||||
restore the same signal dispositions.
|
||||
|
||||
Options:
|
||||
-l print a list of signal names and their corresponding numbers
|
||||
-p display the trap commands associated with each SIGNAL_SPEC
|
||||
-p display the trap commands associated with each SIGNAL_SPEC in a
|
||||
form that may be reused as shell input; or for all trapped
|
||||
signals if no arguments are supplied
|
||||
|
||||
Each SIGNAL_SPEC is either a signal name in <signal.h> or a signal number.
|
||||
Signal names are case insensitive and the SIG prefix is optional. A
|
||||
|
||||
Reference in New Issue
Block a user