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
+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