fix minor mem leaks; fix problem with parser state during a DEBUG trap with -T enabled in a shell function; fix crash with propagating array variables; fix overflow in compound array appending

This commit is contained in:
Chet Ramey
2023-06-28 14:48:09 -04:00
parent 829aad36db
commit fa98070927
15 changed files with 557 additions and 399 deletions
+55
View File
@@ -6918,3 +6918,58 @@ print_cmd.c
for characters that need $'...' printing over shell metacharacters
so that strings containing both get the $'...' treatment
From a report by Grisha Levit <grishalevit@gmail.com>
6/27
----
subst.c
- skip_double_quoted: make sure to call extract_function_subst with
the SX_NOALLOC flag
From a report by Grisha Levit <grishalevit@gmail.com>
trap.c
- _run_trap_internal: if we're running a trap but shell_eof_token is
set, this means we're somehow running a trap while parsing a
command substitution (weird set of circumstances). Call
reset_parser and unset shell_eof_token if shell_eof_token is set
From a report by Wiley Young <wyeth2485@gmail.com>
builtins/setattr.def
- set_var_attribute: don't set the att_propagate attribute unless the
variable whose attribute is being modified is in the temporary
environment for this builtin, not any previous temporary environments
(like the temp env for a function call, or a special builtin like
`.')
variables.c
- push_posix_temp_var: if we have an array variable we're trying to
push up here, use arrayvar_copyval to copy the value correctly
arrayfunc.c
- arrayvar_copyval: make sure that V2 ends up being the same type of
array as V1 (att_array or att_assoc), since we're copying the value.
Fixes issue reported by Grisha Levit <grishalevit@gmail.com>, but
with the previous fix to set_var_attribute, it's not needed
- assign_compound_array_list: check for integer overflow if the max
index of the array is already INT_MAX.
From a report from Emanuele Torre <torreemanuele6@gmail.com>
6/28
----
pcomplete.c,bashline.c
- uw_restore_parser_state,uw_rl_set_signals: move to bashline.c so the
general readline support can use them
bashline.h
- uw_restore_parser_state,uw_rl_set_signals: extern declarations
bashline.c
- unset_readline_variables,uw_unset_readline_variables: function to
unset READLINE_{LINE,POINT,MARK,ARGUMENT} and its unwind-protect
counterpart
- bash_execute_unix_command: add unwind-protect to free up allocated
memory
Report and patch by Grisha Levit <grishalevit@gmail.com>
doc/bash.1,doc/bashref.texi
- BASH_ARGC,BASH_ARGV,BASH_SOURCE,BASH_LINENO: note that these variables
may not be assigned to or unset
+18 -2
View File
@@ -148,10 +148,17 @@ SHELL_VAR *
arrayvar_copyval (SHELL_VAR *v1, SHELL_VAR *v2)
{
FREE (value_cell (v2));
VUNSETATTR (v2, (att_array | att_assoc));
if (array_p (v1))
var_setarray (v2, array_copy (array_cell (v1)));
{
var_setarray (v2, array_copy (array_cell (v1)));
VSETATTR (v2, att_array);
}
else if (assoc_p (v1))
var_setassoc (v2, assoc_copy (assoc_cell (v1)));
{
var_setassoc (v2, assoc_copy (assoc_cell (v1)));
VSETATTR (v2, att_assoc);
}
return v2;
}
@@ -698,7 +705,16 @@ assign_compound_array_list (SHELL_VAR *var, WORD_LIST *nlist, int flags)
}
last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0;
if (a && last_ind < 0) /* overflow */
{
char *num;
num = itos (last_ind);
report_error ("%s[%s]: %s", var->name, num, bash_badsub_errmsg);
free (num);
return;
}
#if ASSOC_KVPAIR_ASSIGNMENT
if (assoc_p (var) && kvpair_assignment_p (nlist))
{
+34 -5
View File
@@ -4428,6 +4428,34 @@ readline_set_char_offset (int ind, int *varp)
}
}
void
uw_restore_parser_state (void *ps)
{
restore_parser_state (ps);
}
void
uw_rl_set_signals (void *ignore)
{
rl_set_signals ();
}
static void
unbind_readline_variables (void)
{
check_unbind_variable ("READLINE_LINE");
check_unbind_variable ("READLINE_POINT");
check_unbind_variable ("READLINE_MARK");
check_unbind_variable ("READLINE_ARGUMENT");
array_needs_making = 1;
}
static void
uw_unbind_readline_variables (void *ignore)
{
unbind_readline_variables ();
}
int
bash_execute_unix_command (int count, int key)
{
@@ -4507,8 +4535,12 @@ bash_execute_unix_command (int count, int key)
}
array_needs_making = 1;
begin_unwind_frame ("execute-unix-command");
save_parser_state (&ps);
rl_clear_signals ();
add_unwind_protect (uw_unbind_readline_variables, 0);
add_unwind_protect (uw_restore_parser_state, &ps);
add_unwind_protect (uw_rl_set_signals, 0);
r = parse_and_execute (savestring (cmd), "bash_execute_unix_command", SEVAL_NOHIST);
rl_set_signals ();
restore_parser_state (&ps);
@@ -4524,11 +4556,8 @@ bash_execute_unix_command (int count, int key)
if (v && legal_number (value_cell (v), &mi))
readline_set_char_offset (mi, &rl_mark);
check_unbind_variable ("READLINE_LINE");
check_unbind_variable ("READLINE_POINT");
check_unbind_variable ("READLINE_MARK");
check_unbind_variable ("READLINE_ARGUMENT");
array_needs_making = 1;
unbind_readline_variables ();
discard_unwind_frame ("execute-unix-command");
/* and restore the readline buffer and display after command execution. */
/* If we clear the last line of the prompt above, redraw only that last
+3
View File
@@ -46,6 +46,9 @@ extern int bash_re_edit (const char *);
extern void bashline_set_event_hook (void);
extern void bashline_reset_event_hook (void);
extern void uw_restore_parser_state (void *);
extern void uw_rl_set_signals (void *);
extern int bind_keyseq_to_unix_command (char *);
extern int bash_execute_unix_command (int, int);
extern int print_unix_command_map (void);
+10 -4
View File
@@ -1,7 +1,7 @@
This file is setattr.def, from which is created setattr.c.
It implements the builtins "export" and "readonly", in Bash.
Copyright (C) 1987-2022 Free Software Foundation, Inc.
Copyright (C) 1987-2023 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -588,9 +588,6 @@ set_var_attribute (char *name, int attribute, int undo)
{
/* var=value readonly var */
tv = find_tempenv_variable (name);
/* XXX -- need to handle case where tv is a temp variable in a
function-scope context, since function_env has been merged into
the local variables table. */
if (tv && tempvar_p (tv))
{
tvalue = var_isset (tv) ? savestring (value_cell (tv)) : savestring ("");
@@ -629,6 +626,9 @@ set_var_attribute (char *name, int attribute, int undo)
}
else
{
/* Handle case where var is a temp variable in a function-scope
context, since function_env has been merged into the local
variables table (see below). */
var = find_variable_notempenv (name);
if (var == 0)
{
@@ -648,7 +648,13 @@ set_var_attribute (char *name, int attribute, int undo)
if (var)
VSETATTR (var, att_invisible);
}
/* We don't want to do this for local variables or variables we found
in previous temporary environment contexts. */
#if 0
else if (var->context != 0 && local_p (var) == 0)
#else
else if (var->context != 0 && local_p (var) == 0 && tempvar_p (var) == 0)
#endif
VSETATTR (var, att_propagate);
}
}
+27 -23
View File
@@ -856,18 +856,20 @@ PPAARRAAMMEETTEERRSS
tion to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the
shell has started to execute a script, or referencing this vari-
able when eexxttddeebbuugg is not set, may result in inconsistent val-
ues.
ues. Assignments to BBAASSHH__AARRGGCC have no effect, and it may not be
unset.
BBAASSHH__AARRGGVV
An array variable containing all of the parameters in the cur-
An array variable containing all of the parameters in the cur-
rent bbaasshh execution call stack. The final parameter of the last
subroutine call is at the top of the stack; the first parameter
subroutine call is at the top of the stack; the first parameter
of the initial call is at the bottom. When a subroutine is exe-
cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The
shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see
the description of the eexxttddeebbuugg option to the sshhoopptt builtin be-
cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The
shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see
the description of the eexxttddeebbuugg option to the sshhoopptt builtin be-
low). Setting eexxttddeebbuugg after the shell has started to execute a
script, or referencing this variable when eexxttddeebbuugg is not set,
may result in inconsistent values.
script, or referencing this variable when eexxttddeebbuugg is not set,
may result in inconsistent values. Assignments to BBAASSHH__AARRGGVV
have no effect, and it may not be unset.
BBAASSHH__AARRGGVV00
When referenced, this variable expands to the name of the shell
or shell script (identical to $$00; see the description of special
@@ -896,29 +898,31 @@ PPAARRAAMMEETTEERRSS
$${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file
($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or
$${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func-
tion). Use LLIINNEENNOO to obtain the current line number.
tion). Use LLIINNEENNOO to obtain the current line number. Assign-
ments to BBAASSHH__LLIINNEENNOO have no effect, and it may not be unset.
BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH
A colon-separated list of directories in which the shell looks
for dynamically loadable builtins specified by the eennaabbllee com-
A colon-separated list of directories in which the shell looks
for dynamically loadable builtins specified by the eennaabbllee com-
mand.
BBAASSHH__RREEMMAATTCCHH
An array variable whose members are assigned by the ==~~ binary
operator to the [[[[ conditional command. The element with index
0 is the portion of the string matching the entire regular ex-
An array variable whose members are assigned by the ==~~ binary
operator to the [[[[ conditional command. The element with index
0 is the portion of the string matching the entire regular ex-
pression. The element with index _n is the portion of the string
matching the _nth parenthesized subexpression.
BBAASSHH__MMOONNOOSSEECCOONNDDSS
Each time this variable is referenced, it expands to the value
returned by the system's monotonic clock, if one is available.
If there is no monotonic clock, this is equivalent to EEPPOOCCHHSSEECC--
OONNDDSS. If BBAASSHH__MMOONNOOSSEECCOONNDDSS is unset, it loses its special prop-
Each time this variable is referenced, it expands to the value
returned by the system's monotonic clock, if one is available.
If there is no monotonic clock, this is equivalent to EEPPOOCCHHSSEECC--
OONNDDSS. If BBAASSHH__MMOONNOOSSEECCOONNDDSS is unset, it loses its special prop-
erties, even if it is subsequently reset.
BBAASSHH__SSOOUURRCCEE
An array variable whose members are the source filenames where
the corresponding shell function names in the FFUUNNCCNNAAMMEE array
An array variable whose members are the source filenames where
the corresponding shell function names in the FFUUNNCCNNAAMMEE array
variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is de-
fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from
$${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}.
fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from
$${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. Assignments to BBAASSHH__SSOOUURRCCEE have no ef-
fect, and it may not be unset.
BBAASSHH__SSUUBBSSHHEELLLL
Incremented by one within each subshell or subshell environment
when the shell begins executing in that environment. The ini-
@@ -6795,4 +6799,4 @@ BBUUGGSS
GNU Bash 5.3 2023 June 16 BASH(1)
GNU Bash 5.3 2023 June 28 BASH(1)
+18 -2
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Fri Jun 16 11:36:28 EDT 2023
.\" Last Change: Wed Jun 28 14:06:27 EDT 2023
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2023 June 16" "GNU Bash 5.3"
.TH BASH 1 "2023 June 28" "GNU Bash 5.3"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -1569,6 +1569,10 @@ builtin below).
Setting \fBextdebug\fP after the shell has started to execute a script,
or referencing this variable when \fBextdebug\fP is not set,
may result in inconsistent values.
Assignments to
.SM
.B BASH_ARGC
have no effect, and it may not be unset.
.TP
.B BASH_ARGV
An array variable containing all of the parameters in the current \fBbash\fP
@@ -1590,6 +1594,10 @@ builtin below).
Setting \fBextdebug\fP after the shell has started to execute a script,
or referencing this variable when \fBextdebug\fP is not set,
may result in inconsistent values.
Assignments to
.SM
.B BASH_ARGV
have no effect, and it may not be unset.
.TP
.B BASH_ARGV0
When referenced, this variable expands to the name of the shell or shell
@@ -1642,6 +1650,10 @@ Use
.SM
.B LINENO
to obtain the current line number.
Assignments to
.SM
.B BASH_LINENO
have no effect, and it may not be unset.
.TP
.B BASH_LOADABLES_PATH
A colon-separated list of directories in which the shell looks for
@@ -1676,6 +1688,10 @@ The shell function
\fB${FUNCNAME[\fP\fI$i\fP\fB]}\fP is defined in the file
\fB${BASH_SOURCE[\fP\fI$i\fP\fB]}\fP and called from
\fB${BASH_SOURCE[\fP\fI$i+1\fP\fB]}\fP.
Assignments to
.SM
.B BASH_SOURCE
have no effect, and it may not be unset.
.TP
.B BASH_SUBSHELL
Incremented by one within each subshell or subshell environment when
+24 -4
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 June 16<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 June 28<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -2004,6 +2004,11 @@ builtin below).
Setting <B>extdebug</B> after the shell has started to execute a script,
or referencing this variable when <B>extdebug</B> is not set,
may result in inconsistent values.
Assignments to
<FONT SIZE=-1><B>BASH_ARGC</B>
</FONT>
have no effect, and it may not be unset.
<DT><B>BASH_ARGV</B>
<DD>
@@ -2030,6 +2035,11 @@ builtin below).
Setting <B>extdebug</B> after the shell has started to execute a script,
or referencing this variable when <B>extdebug</B> is not set,
may result in inconsistent values.
Assignments to
<FONT SIZE=-1><B>BASH_ARGV</B>
</FONT>
have no effect, and it may not be unset.
<DT><B>BASH_ARGV0</B>
<DD>
@@ -2094,6 +2104,11 @@ Use
</FONT>
to obtain the current line number.
Assignments to
<FONT SIZE=-1><B>BASH_LINENO</B>
</FONT>
have no effect, and it may not be unset.
<DT><B>BASH_LOADABLES_PATH</B>
<DD>
@@ -2135,6 +2150,11 @@ The shell function
<B>${FUNCNAME[</B><I>$i</I><B>]}</B> is defined in the file
<B>${BASH_SOURCE[</B><I>$i</I><B>]}</B> and called from
<B>${BASH_SOURCE[</B><I>$i+1</I><B>]}</B>.
Assignments to
<FONT SIZE=-1><B>BASH_SOURCE</B>
</FONT>
have no effect, and it may not be unset.
<DT><B>BASH_SUBSHELL</B>
<DD>
@@ -15030,7 +15050,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2023 June 16<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2023 June 28<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -15136,7 +15156,7 @@ There may be only one active coprocess at a time.
<DT><A HREF="#lbDI">BUGS</A><DD>
</DL>
<HR>
This document was created by man2html from /usr/local/src/bash/bash-20230616/doc/bash.1.<BR>
Time: 16 June 2023 12:13:33 EDT
This document was created by man2html from /usr/local/src/bash/bash-20230626/doc/bash.1.<BR>
Time: 28 June 2023 14:10:33 EDT
</BODY>
</HTML>
+177 -172
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, 16 June 2023).
Bash shell (version 5.3, 28 June 2023).
This is Edition 5.3, last updated 16 June 2023, of 'The GNU Bash
This is Edition 5.3, last updated 28 June 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, 16 June 2023). The Bash home page is
Bash shell (version 5.3, 28 June 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 16 June 2023, of 'The GNU Bash
This is Edition 5.3, last updated 28 June 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -5331,7 +5331,8 @@ Variables::).
the 'extdebug' option to the 'shopt' builtin). Setting 'extdebug'
after the shell has started to execute a script, or referencing
this variable when 'extdebug' is not set, may result in
inconsistent values.
inconsistent values. Assignments to 'BASH_ARGC' have no effect,
and it may not be unset.
'BASH_ARGV'
An array variable containing all of the parameters in the current
@@ -5344,6 +5345,7 @@ Variables::).
the 'shopt' builtin). Setting 'extdebug' after the shell has
started to execute a script, or referencing this variable when
'extdebug' is not set, may result in inconsistent values.
Assignments to 'BASH_ARGV' have no effect, and it may not be unset.
'BASH_ARGV0'
When referenced, this variable expands to the name of the shell or
@@ -5401,6 +5403,8 @@ Variables::).
('${BASH_SOURCE[$i+1]}') where '${FUNCNAME[$i]}' was called (or
'${BASH_LINENO[$i-1]}' if referenced within another shell
function). Use 'LINENO' to obtain the current line number.
Assignments to 'BASH_LINENO' have no effect, and it may not be
unset.
'BASH_LOADABLES_PATH'
A colon-separated list of directories in which the shell looks for
@@ -5426,7 +5430,8 @@ Variables::).
corresponding shell function names in the 'FUNCNAME' array variable
are defined. The shell function '${FUNCNAME[$i]}' is defined in
the file '${BASH_SOURCE[$i]}' and called from
'${BASH_SOURCE[$i+1]}'
'${BASH_SOURCE[$i+1]}' Assignments to 'BASH_SOURCE' have no effect,
and it may not be unset.
'BASH_SUBSHELL'
Incremented by one within each subshell or subshell environment
@@ -12200,23 +12205,23 @@ D.3 Parameter and Variable Index
* BASHPID: Bash Variables. (line 35)
* BASH_ALIASES: Bash Variables. (line 42)
* BASH_ARGC: Bash Variables. (line 51)
* BASH_ARGV: Bash Variables. (line 64)
* BASH_ARGV0: Bash Variables. (line 76)
* BASH_CMDS: Bash Variables. (line 84)
* BASH_COMMAND: Bash Variables. (line 93)
* BASH_COMPAT: Bash Variables. (line 100)
* BASH_ENV: Bash Variables. (line 116)
* BASH_EXECUTION_STRING: Bash Variables. (line 122)
* BASH_LINENO: Bash Variables. (line 125)
* BASH_LOADABLES_PATH: Bash Variables. (line 133)
* BASH_MONOSECONDS: Bash Variables. (line 137)
* BASH_REMATCH: Bash Variables. (line 144)
* BASH_SOURCE: Bash Variables. (line 152)
* BASH_SUBSHELL: Bash Variables. (line 159)
* BASH_TRAPSIG: Bash Variables. (line 165)
* BASH_VERSINFO: Bash Variables. (line 171)
* BASH_VERSION: Bash Variables. (line 194)
* BASH_XTRACEFD: Bash Variables. (line 197)
* BASH_ARGV: Bash Variables. (line 65)
* BASH_ARGV0: Bash Variables. (line 78)
* BASH_CMDS: Bash Variables. (line 86)
* BASH_COMMAND: Bash Variables. (line 95)
* BASH_COMPAT: Bash Variables. (line 102)
* BASH_ENV: Bash Variables. (line 118)
* BASH_EXECUTION_STRING: Bash Variables. (line 124)
* BASH_LINENO: Bash Variables. (line 127)
* BASH_LOADABLES_PATH: Bash Variables. (line 137)
* BASH_MONOSECONDS: Bash Variables. (line 141)
* BASH_REMATCH: Bash Variables. (line 148)
* BASH_SOURCE: Bash Variables. (line 156)
* BASH_SUBSHELL: Bash Variables. (line 164)
* BASH_TRAPSIG: Bash Variables. (line 170)
* BASH_VERSINFO: Bash Variables. (line 176)
* BASH_VERSION: Bash Variables. (line 199)
* BASH_XTRACEFD: Bash Variables. (line 202)
* bell-style: Readline Init File Syntax.
(line 64)
* bind-tty-special-chars: Readline Init File Syntax.
@@ -12225,12 +12230,12 @@ D.3 Parameter and Variable Index
(line 76)
* CDPATH: Bourne Shell Variables.
(line 9)
* CHILD_MAX: Bash Variables. (line 208)
* CHILD_MAX: Bash Variables. (line 213)
* colored-completion-prefix: Readline Init File Syntax.
(line 81)
* colored-stats: Readline Init File Syntax.
(line 91)
* COLUMNS: Bash Variables. (line 215)
* COLUMNS: Bash Variables. (line 220)
* comment-begin: Readline Init File Syntax.
(line 97)
* completion-display-width: Readline Init File Syntax.
@@ -12243,25 +12248,25 @@ D.3 Parameter and Variable Index
(line 120)
* completion-query-items: Readline Init File Syntax.
(line 127)
* COMPREPLY: Bash Variables. (line 267)
* COMP_CWORD: Bash Variables. (line 221)
* COMP_KEY: Bash Variables. (line 250)
* COMP_LINE: Bash Variables. (line 227)
* COMP_POINT: Bash Variables. (line 232)
* COMP_TYPE: Bash Variables. (line 240)
* COMP_WORDBREAKS: Bash Variables. (line 254)
* COMP_WORDS: Bash Variables. (line 260)
* COMPREPLY: Bash Variables. (line 272)
* COMP_CWORD: Bash Variables. (line 226)
* COMP_KEY: Bash Variables. (line 255)
* COMP_LINE: Bash Variables. (line 232)
* COMP_POINT: Bash Variables. (line 237)
* COMP_TYPE: Bash Variables. (line 245)
* COMP_WORDBREAKS: Bash Variables. (line 259)
* COMP_WORDS: Bash Variables. (line 265)
* convert-meta: Readline Init File Syntax.
(line 138)
* COPROC: Bash Variables. (line 273)
* DIRSTACK: Bash Variables. (line 277)
* COPROC: Bash Variables. (line 278)
* DIRSTACK: Bash Variables. (line 282)
* disable-completion: Readline Init File Syntax.
(line 148)
* echo-control-characters: Readline Init File Syntax.
(line 153)
* editing-mode: Readline Init File Syntax.
(line 158)
* EMACS: Bash Variables. (line 287)
* EMACS: Bash Variables. (line 292)
* emacs-mode-string: Readline Init File Syntax.
(line 164)
* enable-active-region: Readline Init File Syntax.
@@ -12270,70 +12275,70 @@ D.3 Parameter and Variable Index
(line 187)
* enable-keypad: Readline Init File Syntax.
(line 196)
* ENV: Bash Variables. (line 292)
* EPOCHREALTIME: Bash Variables. (line 297)
* EPOCHSECONDS: Bash Variables. (line 305)
* EUID: Bash Variables. (line 312)
* EXECIGNORE: Bash Variables. (line 316)
* ENV: Bash Variables. (line 297)
* EPOCHREALTIME: Bash Variables. (line 302)
* EPOCHSECONDS: Bash Variables. (line 310)
* EUID: Bash Variables. (line 317)
* EXECIGNORE: Bash Variables. (line 321)
* expand-tilde: Readline Init File Syntax.
(line 207)
* FCEDIT: Bash Variables. (line 329)
* FIGNORE: Bash Variables. (line 333)
* FUNCNAME: Bash Variables. (line 339)
* FUNCNEST: Bash Variables. (line 356)
* GLOBIGNORE: Bash Variables. (line 361)
* GLOBSORT: Bash Variables. (line 368)
* GROUPS: Bash Variables. (line 394)
* histchars: Bash Variables. (line 400)
* HISTCMD: Bash Variables. (line 415)
* HISTCONTROL: Bash Variables. (line 421)
* HISTFILE: Bash Variables. (line 437)
* HISTFILESIZE: Bash Variables. (line 441)
* HISTIGNORE: Bash Variables. (line 452)
* FCEDIT: Bash Variables. (line 334)
* FIGNORE: Bash Variables. (line 338)
* FUNCNAME: Bash Variables. (line 344)
* FUNCNEST: Bash Variables. (line 361)
* GLOBIGNORE: Bash Variables. (line 366)
* GLOBSORT: Bash Variables. (line 373)
* GROUPS: Bash Variables. (line 399)
* histchars: Bash Variables. (line 405)
* HISTCMD: Bash Variables. (line 420)
* HISTCONTROL: Bash Variables. (line 426)
* HISTFILE: Bash Variables. (line 442)
* HISTFILESIZE: Bash Variables. (line 446)
* HISTIGNORE: Bash Variables. (line 457)
* history-preserve-point: Readline Init File Syntax.
(line 211)
* history-size: Readline Init File Syntax.
(line 217)
* HISTSIZE: Bash Variables. (line 472)
* HISTTIMEFORMAT: Bash Variables. (line 479)
* HISTSIZE: Bash Variables. (line 477)
* HISTTIMEFORMAT: Bash Variables. (line 484)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 226)
* HOSTFILE: Bash Variables. (line 487)
* HOSTNAME: Bash Variables. (line 498)
* HOSTTYPE: Bash Variables. (line 501)
* HOSTFILE: Bash Variables. (line 492)
* HOSTNAME: Bash Variables. (line 503)
* HOSTTYPE: Bash Variables. (line 506)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 504)
* IGNOREEOF: Bash Variables. (line 509)
* input-meta: Readline Init File Syntax.
(line 235)
* INPUTRC: Bash Variables. (line 514)
* INSIDE_EMACS: Bash Variables. (line 518)
* INPUTRC: Bash Variables. (line 519)
* INSIDE_EMACS: Bash Variables. (line 523)
* isearch-terminators: Readline Init File Syntax.
(line 245)
* keymap: Readline Init File Syntax.
(line 252)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 524)
* LC_ALL: Bash Variables. (line 528)
* LC_COLLATE: Bash Variables. (line 532)
* LC_CTYPE: Bash Variables. (line 539)
* LANG <1>: Bash Variables. (line 529)
* LC_ALL: Bash Variables. (line 533)
* LC_COLLATE: Bash Variables. (line 537)
* LC_CTYPE: Bash Variables. (line 544)
* LC_MESSAGES: Creating Internationalized Scripts.
(line 51)
* LC_MESSAGES <1>: Bash Variables. (line 544)
* LC_NUMERIC: Bash Variables. (line 548)
* LC_TIME: Bash Variables. (line 552)
* LINENO: Bash Variables. (line 556)
* LINES: Bash Variables. (line 561)
* MACHTYPE: Bash Variables. (line 567)
* LC_MESSAGES <1>: Bash Variables. (line 549)
* LC_NUMERIC: Bash Variables. (line 553)
* LC_TIME: Bash Variables. (line 557)
* LINENO: Bash Variables. (line 561)
* LINES: Bash Variables. (line 566)
* MACHTYPE: Bash Variables. (line 572)
* MAIL: Bourne Shell Variables.
(line 22)
* MAILCHECK: Bash Variables. (line 571)
* MAILCHECK: Bash Variables. (line 576)
* MAILPATH: Bourne Shell Variables.
(line 27)
* MAPFILE: Bash Variables. (line 579)
* MAPFILE: Bash Variables. (line 584)
* mark-modified-lines: Readline Init File Syntax.
(line 282)
* mark-symlinked-directories: Readline Init File Syntax.
@@ -12344,46 +12349,46 @@ D.3 Parameter and Variable Index
(line 299)
* meta-flag: Readline Init File Syntax.
(line 235)
* OLDPWD: Bash Variables. (line 583)
* OLDPWD: Bash Variables. (line 588)
* OPTARG: Bourne Shell Variables.
(line 34)
* OPTERR: Bash Variables. (line 586)
* OPTERR: Bash Variables. (line 591)
* OPTIND: Bourne Shell Variables.
(line 38)
* OSTYPE: Bash Variables. (line 590)
* OSTYPE: Bash Variables. (line 595)
* output-meta: Readline Init File Syntax.
(line 304)
* page-completions: Readline Init File Syntax.
(line 312)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 593)
* POSIXLY_CORRECT: Bash Variables. (line 598)
* PPID: Bash Variables. (line 608)
* PROMPT_COMMAND: Bash Variables. (line 612)
* PROMPT_DIRTRIM: Bash Variables. (line 618)
* PS0: Bash Variables. (line 624)
* PIPESTATUS: Bash Variables. (line 598)
* POSIXLY_CORRECT: Bash Variables. (line 603)
* PPID: Bash Variables. (line 613)
* PROMPT_COMMAND: Bash Variables. (line 617)
* PROMPT_DIRTRIM: Bash Variables. (line 623)
* PS0: Bash Variables. (line 629)
* PS1: Bourne Shell Variables.
(line 48)
* PS2: Bourne Shell Variables.
(line 53)
* PS3: Bash Variables. (line 629)
* PS4: Bash Variables. (line 634)
* PWD: Bash Variables. (line 642)
* RANDOM: Bash Variables. (line 645)
* READLINE_ARGUMENT: Bash Variables. (line 651)
* READLINE_LINE: Bash Variables. (line 655)
* READLINE_MARK: Bash Variables. (line 659)
* READLINE_POINT: Bash Variables. (line 665)
* REPLY: Bash Variables. (line 669)
* PS3: Bash Variables. (line 634)
* PS4: Bash Variables. (line 639)
* PWD: Bash Variables. (line 647)
* RANDOM: Bash Variables. (line 650)
* READLINE_ARGUMENT: Bash Variables. (line 656)
* READLINE_LINE: Bash Variables. (line 660)
* READLINE_MARK: Bash Variables. (line 664)
* READLINE_POINT: Bash Variables. (line 670)
* REPLY: Bash Variables. (line 674)
* revert-all-at-newline: Readline Init File Syntax.
(line 322)
* search-ignore-case: Readline Init File Syntax.
(line 329)
* SECONDS: Bash Variables. (line 672)
* SHELL: Bash Variables. (line 681)
* SHELLOPTS: Bash Variables. (line 686)
* SHLVL: Bash Variables. (line 695)
* SECONDS: Bash Variables. (line 677)
* SHELL: Bash Variables. (line 686)
* SHELLOPTS: Bash Variables. (line 691)
* SHLVL: Bash Variables. (line 700)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 334)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -12392,15 +12397,15 @@ D.3 Parameter and Variable Index
(line 349)
* skip-completed-text: Readline Init File Syntax.
(line 355)
* SRANDOM: Bash Variables. (line 700)
* SRANDOM: Bash Variables. (line 705)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 709)
* TMOUT: Bash Variables. (line 747)
* TMPDIR: Bash Variables. (line 759)
* UID: Bash Variables. (line 763)
* TIMEFORMAT: Bash Variables. (line 714)
* TMOUT: Bash Variables. (line 752)
* TMPDIR: Bash Variables. (line 764)
* UID: Bash Variables. (line 768)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 368)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -12852,77 +12857,77 @@ Node: Special Builtins223181
Node: Shell Variables224157
Node: Bourne Shell Variables224591
Node: Bash Variables226692
Node: Bash Features261344
Node: Invoking Bash262354
Node: Bash Startup Files268364
Node: Interactive Shells273492
Node: What is an Interactive Shell?273900
Node: Is this Shell Interactive?274546
Node: Interactive Shell Behavior275358
Node: Bash Conditional Expressions278984
Node: Shell Arithmetic283623
Node: Aliases286581
Node: Arrays289472
Node: The Directory Stack296032
Node: Directory Stack Builtins296813
Node: Controlling the Prompt301070
Node: The Restricted Shell304032
Node: Bash POSIX Mode306639
Node: Shell Compatibility Mode322552
Node: Job Control330793
Node: Job Control Basics331250
Node: Job Control Builtins336249
Node: Job Control Variables342041
Node: Command Line Editing343194
Node: Introduction and Notation344862
Node: Readline Interaction346482
Node: Readline Bare Essentials347670
Node: Readline Movement Commands349456
Node: Readline Killing Commands350413
Node: Readline Arguments352331
Node: Searching353372
Node: Readline Init File355555
Node: Readline Init File Syntax356813
Node: Conditional Init Constructs380601
Node: Sample Init File384794
Node: Bindable Readline Commands387915
Node: Commands For Moving389116
Node: Commands For History391164
Node: Commands For Text396155
Node: Commands For Killing399801
Node: Numeric Arguments402831
Node: Commands For Completion403967
Node: Keyboard Macros408155
Node: Miscellaneous Commands408840
Node: Readline vi Mode414875
Node: Programmable Completion415779
Node: Programmable Completion Builtins423556
Node: A Programmable Completion Example434673
Node: Using History Interactively439918
Node: Bash History Facilities440599
Node: Bash History Builtins443601
Node: History Interaction448622
Node: Event Designators452239
Node: Word Designators453590
Node: Modifiers455347
Node: Installing Bash457152
Node: Basic Installation458286
Node: Compilers and Options462005
Node: Compiling For Multiple Architectures462743
Node: Installation Names464432
Node: Specifying the System Type466538
Node: Sharing Defaults467252
Node: Operation Controls467922
Node: Optional Features468877
Node: Reporting Bugs480093
Node: Major Differences From The Bourne Shell481424
Node: GNU Free Documentation License498270
Node: Indexes523444
Node: Builtin Index523895
Node: Reserved Word Index530993
Node: Variable Index533438
Node: Function Index550569
Node: Concept Index564350
Node: Bash Features261646
Node: Invoking Bash262656
Node: Bash Startup Files268666
Node: Interactive Shells273794
Node: What is an Interactive Shell?274202
Node: Is this Shell Interactive?274848
Node: Interactive Shell Behavior275660
Node: Bash Conditional Expressions279286
Node: Shell Arithmetic283925
Node: Aliases286883
Node: Arrays289774
Node: The Directory Stack296334
Node: Directory Stack Builtins297115
Node: Controlling the Prompt301372
Node: The Restricted Shell304334
Node: Bash POSIX Mode306941
Node: Shell Compatibility Mode322854
Node: Job Control331095
Node: Job Control Basics331552
Node: Job Control Builtins336551
Node: Job Control Variables342343
Node: Command Line Editing343496
Node: Introduction and Notation345164
Node: Readline Interaction346784
Node: Readline Bare Essentials347972
Node: Readline Movement Commands349758
Node: Readline Killing Commands350715
Node: Readline Arguments352633
Node: Searching353674
Node: Readline Init File355857
Node: Readline Init File Syntax357115
Node: Conditional Init Constructs380903
Node: Sample Init File385096
Node: Bindable Readline Commands388217
Node: Commands For Moving389418
Node: Commands For History391466
Node: Commands For Text396457
Node: Commands For Killing400103
Node: Numeric Arguments403133
Node: Commands For Completion404269
Node: Keyboard Macros408457
Node: Miscellaneous Commands409142
Node: Readline vi Mode415177
Node: Programmable Completion416081
Node: Programmable Completion Builtins423858
Node: A Programmable Completion Example434975
Node: Using History Interactively440220
Node: Bash History Facilities440901
Node: Bash History Builtins443903
Node: History Interaction448924
Node: Event Designators452541
Node: Word Designators453892
Node: Modifiers455649
Node: Installing Bash457454
Node: Basic Installation458588
Node: Compilers and Options462307
Node: Compiling For Multiple Architectures463045
Node: Installation Names464734
Node: Specifying the System Type466840
Node: Sharing Defaults467554
Node: Operation Controls468224
Node: Optional Features469179
Node: Reporting Bugs480395
Node: Major Differences From The Bourne Shell481726
Node: GNU Free Documentation License498572
Node: Indexes523746
Node: Builtin Index524197
Node: Reserved Word Index531295
Node: Variable Index533740
Node: Function Index550871
Node: Concept Index564652

End Tag Table
+177 -172
View File
@@ -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.3, 16 June 2023).
Bash shell (version 5.3, 28 June 2023).
This is Edition 5.3, last updated 16 June 2023, of 'The GNU Bash
This is Edition 5.3, last updated 28 June 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Copyright (C) 1988-2023 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.3, 16 June 2023). The Bash home page is
Bash shell (version 5.3, 28 June 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 16 June 2023, of 'The GNU Bash
This is Edition 5.3, last updated 28 June 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -5332,7 +5332,8 @@ Variables::).
the 'extdebug' option to the 'shopt' builtin). Setting 'extdebug'
after the shell has started to execute a script, or referencing
this variable when 'extdebug' is not set, may result in
inconsistent values.
inconsistent values. Assignments to 'BASH_ARGC' have no effect,
and it may not be unset.
'BASH_ARGV'
An array variable containing all of the parameters in the current
@@ -5345,6 +5346,7 @@ Variables::).
the 'shopt' builtin). Setting 'extdebug' after the shell has
started to execute a script, or referencing this variable when
'extdebug' is not set, may result in inconsistent values.
Assignments to 'BASH_ARGV' have no effect, and it may not be unset.
'BASH_ARGV0'
When referenced, this variable expands to the name of the shell or
@@ -5402,6 +5404,8 @@ Variables::).
('${BASH_SOURCE[$i+1]}') where '${FUNCNAME[$i]}' was called (or
'${BASH_LINENO[$i-1]}' if referenced within another shell
function). Use 'LINENO' to obtain the current line number.
Assignments to 'BASH_LINENO' have no effect, and it may not be
unset.
'BASH_LOADABLES_PATH'
A colon-separated list of directories in which the shell looks for
@@ -5427,7 +5431,8 @@ Variables::).
corresponding shell function names in the 'FUNCNAME' array variable
are defined. The shell function '${FUNCNAME[$i]}' is defined in
the file '${BASH_SOURCE[$i]}' and called from
'${BASH_SOURCE[$i+1]}'
'${BASH_SOURCE[$i+1]}' Assignments to 'BASH_SOURCE' have no effect,
and it may not be unset.
'BASH_SUBSHELL'
Incremented by one within each subshell or subshell environment
@@ -12201,23 +12206,23 @@ D.3 Parameter and Variable Index
* BASHPID: Bash Variables. (line 35)
* BASH_ALIASES: Bash Variables. (line 42)
* BASH_ARGC: Bash Variables. (line 51)
* BASH_ARGV: Bash Variables. (line 64)
* BASH_ARGV0: Bash Variables. (line 76)
* BASH_CMDS: Bash Variables. (line 84)
* BASH_COMMAND: Bash Variables. (line 93)
* BASH_COMPAT: Bash Variables. (line 100)
* BASH_ENV: Bash Variables. (line 116)
* BASH_EXECUTION_STRING: Bash Variables. (line 122)
* BASH_LINENO: Bash Variables. (line 125)
* BASH_LOADABLES_PATH: Bash Variables. (line 133)
* BASH_MONOSECONDS: Bash Variables. (line 137)
* BASH_REMATCH: Bash Variables. (line 144)
* BASH_SOURCE: Bash Variables. (line 152)
* BASH_SUBSHELL: Bash Variables. (line 159)
* BASH_TRAPSIG: Bash Variables. (line 165)
* BASH_VERSINFO: Bash Variables. (line 171)
* BASH_VERSION: Bash Variables. (line 194)
* BASH_XTRACEFD: Bash Variables. (line 197)
* BASH_ARGV: Bash Variables. (line 65)
* BASH_ARGV0: Bash Variables. (line 78)
* BASH_CMDS: Bash Variables. (line 86)
* BASH_COMMAND: Bash Variables. (line 95)
* BASH_COMPAT: Bash Variables. (line 102)
* BASH_ENV: Bash Variables. (line 118)
* BASH_EXECUTION_STRING: Bash Variables. (line 124)
* BASH_LINENO: Bash Variables. (line 127)
* BASH_LOADABLES_PATH: Bash Variables. (line 137)
* BASH_MONOSECONDS: Bash Variables. (line 141)
* BASH_REMATCH: Bash Variables. (line 148)
* BASH_SOURCE: Bash Variables. (line 156)
* BASH_SUBSHELL: Bash Variables. (line 164)
* BASH_TRAPSIG: Bash Variables. (line 170)
* BASH_VERSINFO: Bash Variables. (line 176)
* BASH_VERSION: Bash Variables. (line 199)
* BASH_XTRACEFD: Bash Variables. (line 202)
* bell-style: Readline Init File Syntax.
(line 64)
* bind-tty-special-chars: Readline Init File Syntax.
@@ -12226,12 +12231,12 @@ D.3 Parameter and Variable Index
(line 76)
* CDPATH: Bourne Shell Variables.
(line 9)
* CHILD_MAX: Bash Variables. (line 208)
* CHILD_MAX: Bash Variables. (line 213)
* colored-completion-prefix: Readline Init File Syntax.
(line 81)
* colored-stats: Readline Init File Syntax.
(line 91)
* COLUMNS: Bash Variables. (line 215)
* COLUMNS: Bash Variables. (line 220)
* comment-begin: Readline Init File Syntax.
(line 97)
* completion-display-width: Readline Init File Syntax.
@@ -12244,25 +12249,25 @@ D.3 Parameter and Variable Index
(line 120)
* completion-query-items: Readline Init File Syntax.
(line 127)
* COMPREPLY: Bash Variables. (line 267)
* COMP_CWORD: Bash Variables. (line 221)
* COMP_KEY: Bash Variables. (line 250)
* COMP_LINE: Bash Variables. (line 227)
* COMP_POINT: Bash Variables. (line 232)
* COMP_TYPE: Bash Variables. (line 240)
* COMP_WORDBREAKS: Bash Variables. (line 254)
* COMP_WORDS: Bash Variables. (line 260)
* COMPREPLY: Bash Variables. (line 272)
* COMP_CWORD: Bash Variables. (line 226)
* COMP_KEY: Bash Variables. (line 255)
* COMP_LINE: Bash Variables. (line 232)
* COMP_POINT: Bash Variables. (line 237)
* COMP_TYPE: Bash Variables. (line 245)
* COMP_WORDBREAKS: Bash Variables. (line 259)
* COMP_WORDS: Bash Variables. (line 265)
* convert-meta: Readline Init File Syntax.
(line 138)
* COPROC: Bash Variables. (line 273)
* DIRSTACK: Bash Variables. (line 277)
* COPROC: Bash Variables. (line 278)
* DIRSTACK: Bash Variables. (line 282)
* disable-completion: Readline Init File Syntax.
(line 148)
* echo-control-characters: Readline Init File Syntax.
(line 153)
* editing-mode: Readline Init File Syntax.
(line 158)
* EMACS: Bash Variables. (line 287)
* EMACS: Bash Variables. (line 292)
* emacs-mode-string: Readline Init File Syntax.
(line 164)
* enable-active-region: Readline Init File Syntax.
@@ -12271,70 +12276,70 @@ D.3 Parameter and Variable Index
(line 187)
* enable-keypad: Readline Init File Syntax.
(line 196)
* ENV: Bash Variables. (line 292)
* EPOCHREALTIME: Bash Variables. (line 297)
* EPOCHSECONDS: Bash Variables. (line 305)
* EUID: Bash Variables. (line 312)
* EXECIGNORE: Bash Variables. (line 316)
* ENV: Bash Variables. (line 297)
* EPOCHREALTIME: Bash Variables. (line 302)
* EPOCHSECONDS: Bash Variables. (line 310)
* EUID: Bash Variables. (line 317)
* EXECIGNORE: Bash Variables. (line 321)
* expand-tilde: Readline Init File Syntax.
(line 207)
* FCEDIT: Bash Variables. (line 329)
* FIGNORE: Bash Variables. (line 333)
* FUNCNAME: Bash Variables. (line 339)
* FUNCNEST: Bash Variables. (line 356)
* GLOBIGNORE: Bash Variables. (line 361)
* GLOBSORT: Bash Variables. (line 368)
* GROUPS: Bash Variables. (line 394)
* histchars: Bash Variables. (line 400)
* HISTCMD: Bash Variables. (line 415)
* HISTCONTROL: Bash Variables. (line 421)
* HISTFILE: Bash Variables. (line 437)
* HISTFILESIZE: Bash Variables. (line 441)
* HISTIGNORE: Bash Variables. (line 452)
* FCEDIT: Bash Variables. (line 334)
* FIGNORE: Bash Variables. (line 338)
* FUNCNAME: Bash Variables. (line 344)
* FUNCNEST: Bash Variables. (line 361)
* GLOBIGNORE: Bash Variables. (line 366)
* GLOBSORT: Bash Variables. (line 373)
* GROUPS: Bash Variables. (line 399)
* histchars: Bash Variables. (line 405)
* HISTCMD: Bash Variables. (line 420)
* HISTCONTROL: Bash Variables. (line 426)
* HISTFILE: Bash Variables. (line 442)
* HISTFILESIZE: Bash Variables. (line 446)
* HISTIGNORE: Bash Variables. (line 457)
* history-preserve-point: Readline Init File Syntax.
(line 211)
* history-size: Readline Init File Syntax.
(line 217)
* HISTSIZE: Bash Variables. (line 472)
* HISTTIMEFORMAT: Bash Variables. (line 479)
* HISTSIZE: Bash Variables. (line 477)
* HISTTIMEFORMAT: Bash Variables. (line 484)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 226)
* HOSTFILE: Bash Variables. (line 487)
* HOSTNAME: Bash Variables. (line 498)
* HOSTTYPE: Bash Variables. (line 501)
* HOSTFILE: Bash Variables. (line 492)
* HOSTNAME: Bash Variables. (line 503)
* HOSTTYPE: Bash Variables. (line 506)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 504)
* IGNOREEOF: Bash Variables. (line 509)
* input-meta: Readline Init File Syntax.
(line 235)
* INPUTRC: Bash Variables. (line 514)
* INSIDE_EMACS: Bash Variables. (line 518)
* INPUTRC: Bash Variables. (line 519)
* INSIDE_EMACS: Bash Variables. (line 523)
* isearch-terminators: Readline Init File Syntax.
(line 245)
* keymap: Readline Init File Syntax.
(line 252)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 524)
* LC_ALL: Bash Variables. (line 528)
* LC_COLLATE: Bash Variables. (line 532)
* LC_CTYPE: Bash Variables. (line 539)
* LANG <1>: Bash Variables. (line 529)
* LC_ALL: Bash Variables. (line 533)
* LC_COLLATE: Bash Variables. (line 537)
* LC_CTYPE: Bash Variables. (line 544)
* LC_MESSAGES: Creating Internationalized Scripts.
(line 51)
* LC_MESSAGES <1>: Bash Variables. (line 544)
* LC_NUMERIC: Bash Variables. (line 548)
* LC_TIME: Bash Variables. (line 552)
* LINENO: Bash Variables. (line 556)
* LINES: Bash Variables. (line 561)
* MACHTYPE: Bash Variables. (line 567)
* LC_MESSAGES <1>: Bash Variables. (line 549)
* LC_NUMERIC: Bash Variables. (line 553)
* LC_TIME: Bash Variables. (line 557)
* LINENO: Bash Variables. (line 561)
* LINES: Bash Variables. (line 566)
* MACHTYPE: Bash Variables. (line 572)
* MAIL: Bourne Shell Variables.
(line 22)
* MAILCHECK: Bash Variables. (line 571)
* MAILCHECK: Bash Variables. (line 576)
* MAILPATH: Bourne Shell Variables.
(line 27)
* MAPFILE: Bash Variables. (line 579)
* MAPFILE: Bash Variables. (line 584)
* mark-modified-lines: Readline Init File Syntax.
(line 282)
* mark-symlinked-directories: Readline Init File Syntax.
@@ -12345,46 +12350,46 @@ D.3 Parameter and Variable Index
(line 299)
* meta-flag: Readline Init File Syntax.
(line 235)
* OLDPWD: Bash Variables. (line 583)
* OLDPWD: Bash Variables. (line 588)
* OPTARG: Bourne Shell Variables.
(line 34)
* OPTERR: Bash Variables. (line 586)
* OPTERR: Bash Variables. (line 591)
* OPTIND: Bourne Shell Variables.
(line 38)
* OSTYPE: Bash Variables. (line 590)
* OSTYPE: Bash Variables. (line 595)
* output-meta: Readline Init File Syntax.
(line 304)
* page-completions: Readline Init File Syntax.
(line 312)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 593)
* POSIXLY_CORRECT: Bash Variables. (line 598)
* PPID: Bash Variables. (line 608)
* PROMPT_COMMAND: Bash Variables. (line 612)
* PROMPT_DIRTRIM: Bash Variables. (line 618)
* PS0: Bash Variables. (line 624)
* PIPESTATUS: Bash Variables. (line 598)
* POSIXLY_CORRECT: Bash Variables. (line 603)
* PPID: Bash Variables. (line 613)
* PROMPT_COMMAND: Bash Variables. (line 617)
* PROMPT_DIRTRIM: Bash Variables. (line 623)
* PS0: Bash Variables. (line 629)
* PS1: Bourne Shell Variables.
(line 48)
* PS2: Bourne Shell Variables.
(line 53)
* PS3: Bash Variables. (line 629)
* PS4: Bash Variables. (line 634)
* PWD: Bash Variables. (line 642)
* RANDOM: Bash Variables. (line 645)
* READLINE_ARGUMENT: Bash Variables. (line 651)
* READLINE_LINE: Bash Variables. (line 655)
* READLINE_MARK: Bash Variables. (line 659)
* READLINE_POINT: Bash Variables. (line 665)
* REPLY: Bash Variables. (line 669)
* PS3: Bash Variables. (line 634)
* PS4: Bash Variables. (line 639)
* PWD: Bash Variables. (line 647)
* RANDOM: Bash Variables. (line 650)
* READLINE_ARGUMENT: Bash Variables. (line 656)
* READLINE_LINE: Bash Variables. (line 660)
* READLINE_MARK: Bash Variables. (line 664)
* READLINE_POINT: Bash Variables. (line 670)
* REPLY: Bash Variables. (line 674)
* revert-all-at-newline: Readline Init File Syntax.
(line 322)
* search-ignore-case: Readline Init File Syntax.
(line 329)
* SECONDS: Bash Variables. (line 672)
* SHELL: Bash Variables. (line 681)
* SHELLOPTS: Bash Variables. (line 686)
* SHLVL: Bash Variables. (line 695)
* SECONDS: Bash Variables. (line 677)
* SHELL: Bash Variables. (line 686)
* SHELLOPTS: Bash Variables. (line 691)
* SHLVL: Bash Variables. (line 700)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 334)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -12393,15 +12398,15 @@ D.3 Parameter and Variable Index
(line 349)
* skip-completed-text: Readline Init File Syntax.
(line 355)
* SRANDOM: Bash Variables. (line 700)
* SRANDOM: Bash Variables. (line 705)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 709)
* TMOUT: Bash Variables. (line 747)
* TMPDIR: Bash Variables. (line 759)
* UID: Bash Variables. (line 763)
* TIMEFORMAT: Bash Variables. (line 714)
* TMOUT: Bash Variables. (line 752)
* TMPDIR: Bash Variables. (line 764)
* UID: Bash Variables. (line 768)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 368)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -12853,77 +12858,77 @@ Node: Special Builtins223355
Node: Shell Variables224334
Node: Bourne Shell Variables224771
Node: Bash Variables226875
Node: Bash Features261530
Node: Invoking Bash262543
Node: Bash Startup Files268556
Node: Interactive Shells273687
Node: What is an Interactive Shell?274098
Node: Is this Shell Interactive?274747
Node: Interactive Shell Behavior275562
Node: Bash Conditional Expressions279191
Node: Shell Arithmetic283833
Node: Aliases286794
Node: Arrays289688
Node: The Directory Stack296251
Node: Directory Stack Builtins297035
Node: Controlling the Prompt301295
Node: The Restricted Shell304260
Node: Bash POSIX Mode306870
Node: Shell Compatibility Mode322786
Node: Job Control331030
Node: Job Control Basics331490
Node: Job Control Builtins336492
Node: Job Control Variables342287
Node: Command Line Editing343443
Node: Introduction and Notation345114
Node: Readline Interaction346737
Node: Readline Bare Essentials347928
Node: Readline Movement Commands349717
Node: Readline Killing Commands350677
Node: Readline Arguments352598
Node: Searching353642
Node: Readline Init File355828
Node: Readline Init File Syntax357089
Node: Conditional Init Constructs380880
Node: Sample Init File385076
Node: Bindable Readline Commands388200
Node: Commands For Moving389404
Node: Commands For History391455
Node: Commands For Text396449
Node: Commands For Killing400098
Node: Numeric Arguments403131
Node: Commands For Completion404270
Node: Keyboard Macros408461
Node: Miscellaneous Commands409149
Node: Readline vi Mode415187
Node: Programmable Completion416094
Node: Programmable Completion Builtins423874
Node: A Programmable Completion Example434994
Node: Using History Interactively440242
Node: Bash History Facilities440926
Node: Bash History Builtins443931
Node: History Interaction448955
Node: Event Designators452575
Node: Word Designators453929
Node: Modifiers455689
Node: Installing Bash457497
Node: Basic Installation458634
Node: Compilers and Options462356
Node: Compiling For Multiple Architectures463097
Node: Installation Names464789
Node: Specifying the System Type466898
Node: Sharing Defaults467615
Node: Operation Controls468288
Node: Optional Features469246
Node: Reporting Bugs480465
Node: Major Differences From The Bourne Shell481799
Node: GNU Free Documentation License498648
Node: Indexes523825
Node: Builtin Index524279
Node: Reserved Word Index531380
Node: Variable Index533828
Node: Function Index550962
Node: Concept Index564746
Node: Bash Features261832
Node: Invoking Bash262845
Node: Bash Startup Files268858
Node: Interactive Shells273989
Node: What is an Interactive Shell?274400
Node: Is this Shell Interactive?275049
Node: Interactive Shell Behavior275864
Node: Bash Conditional Expressions279493
Node: Shell Arithmetic284135
Node: Aliases287096
Node: Arrays289990
Node: The Directory Stack296553
Node: Directory Stack Builtins297337
Node: Controlling the Prompt301597
Node: The Restricted Shell304562
Node: Bash POSIX Mode307172
Node: Shell Compatibility Mode323088
Node: Job Control331332
Node: Job Control Basics331792
Node: Job Control Builtins336794
Node: Job Control Variables342589
Node: Command Line Editing343745
Node: Introduction and Notation345416
Node: Readline Interaction347039
Node: Readline Bare Essentials348230
Node: Readline Movement Commands350019
Node: Readline Killing Commands350979
Node: Readline Arguments352900
Node: Searching353944
Node: Readline Init File356130
Node: Readline Init File Syntax357391
Node: Conditional Init Constructs381182
Node: Sample Init File385378
Node: Bindable Readline Commands388502
Node: Commands For Moving389706
Node: Commands For History391757
Node: Commands For Text396751
Node: Commands For Killing400400
Node: Numeric Arguments403433
Node: Commands For Completion404572
Node: Keyboard Macros408763
Node: Miscellaneous Commands409451
Node: Readline vi Mode415489
Node: Programmable Completion416396
Node: Programmable Completion Builtins424176
Node: A Programmable Completion Example435296
Node: Using History Interactively440544
Node: Bash History Facilities441228
Node: Bash History Builtins444233
Node: History Interaction449257
Node: Event Designators452877
Node: Word Designators454231
Node: Modifiers455991
Node: Installing Bash457799
Node: Basic Installation458936
Node: Compilers and Options462658
Node: Compiling For Multiple Architectures463399
Node: Installation Names465091
Node: Specifying the System Type467200
Node: Sharing Defaults467917
Node: Operation Controls468590
Node: Optional Features469548
Node: Reporting Bugs480767
Node: Major Differences From The Bourne Shell482101
Node: GNU Free Documentation License498950
Node: Indexes524127
Node: Builtin Index524581
Node: Reserved Word Index531682
Node: Variable Index534130
Node: Function Index551264
Node: Concept Index565048

End Tag Table
+4
View File
@@ -6217,6 +6217,7 @@ builtin).
Setting @code{extdebug} after the shell has started to execute a script,
or referencing this variable when @code{extdebug} is not set,
may result in inconsistent values.
Assignments to @env{BASH_ARGC} have no effect, and it may not be unset.
@item BASH_ARGV
An array variable containing all of the parameters in the current Bash
@@ -6231,6 +6232,7 @@ builtin).
Setting @code{extdebug} after the shell has started to execute a script,
or referencing this variable when @code{extdebug} is not set,
may result in inconsistent values.
Assignments to @env{BASH_ARGV} have no effect, and it may not be unset.
@item BASH_ARGV0
When referenced, this variable expands to the name of the shell or shell
@@ -6295,6 +6297,7 @@ where each corresponding member of @env{FUNCNAME} was invoked.
@code{$@{FUNCNAME[$i]@}} was called (or @code{$@{BASH_LINENO[$i-1]@}} if
referenced within another shell function).
Use @code{LINENO} to obtain the current line number.
Assignments to @env{BASH_LINENO} have no effect, and it may not be unset.
@item BASH_LOADABLES_PATH
A colon-separated list of directories in which the shell looks for
@@ -6324,6 +6327,7 @@ corresponding shell function names in the @code{FUNCNAME} array
variable are defined.
The shell function @code{$@{FUNCNAME[$i]@}} is defined in the file
@code{$@{BASH_SOURCE[$i]@}} and called from @code{$@{BASH_SOURCE[$i+1]@}}
Assignments to @env{BASH_SOURCE} have no effect, and it may not be unset.
@item BASH_SUBSHELL
Incremented by one within each subshell or subshell environment when
+2 -2
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Fri Jun 16 11:35:19 EDT 2023
@set LASTCHANGE Wed Jun 28 14:06:44 EDT 2023
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 16 June 2023
@set UPDATED 28 June 2023
@set UPDATED-MONTH June 2023
-12
View File
@@ -1030,18 +1030,6 @@ build_arg_list (const char *cmd, const char *cname, const char *text, WORD_LIST
return ret;
}
static void
uw_restore_parser_state (void *ps)
{
restore_parser_state (ps);
}
static void
uw_rl_set_signals (void *ignore)
{
rl_set_signals ();
}
/* Build a command string with
$0 == cs->funcname (function to execute for completion list)
$1 == command name (command being completed)
+1 -1
View File
@@ -1042,7 +1042,7 @@ skip_double_quoted (const char *string, size_t slen, int sind, int flags)
if (string[i + 1] == LPAREN)
ret = extract_command_subst (string, &si, SX_NOALLOC|(flags&SX_COMPLETE));
else if (string[i + 1] == LBRACE && FUNSUB_CHAR (string[si]))
ret = extract_function_subst (string, &si, Q_DOUBLE_QUOTES, (flags & SX_COMPLETE));
ret = extract_function_subst (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC|(flags & SX_COMPLETE));
else
ret = extract_dollar_brace_string (string, &si, Q_DOUBLE_QUOTES, SX_NOALLOC|(flags&SX_COMPLETE));
+7
View File
@@ -1148,6 +1148,13 @@ _run_trap_internal (int sig, char *tag)
save_tempenv = temporary_env;
temporary_env = 0; /* traps should not run with temporary env */
/* Will be restored by restore_parser_state */
if (shell_eof_token)
{
reset_parser (); /* resets parser-private state */
shell_eof_token = 0;
}
#if defined (JOB_CONTROL)
if (sig != DEBUG_TRAP) /* run_debug_trap does this */
save_pipeline (1); /* XXX only provides one save level */