better parser error messages; add -p option to source builtin

This commit is contained in:
Chet Ramey
2024-06-21 10:38:39 -04:00
parent dbb48b9786
commit 886e4e68be
17 changed files with 2057 additions and 1912 deletions
+222 -213
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 7.1 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 23 April 2024).
Bash shell (version 5.3, 12 June 2024).
This is Edition 5.3, last updated 23 April 2024, of The GNU Bash
This is Edition 5.3, last updated 12 June 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Copyright © 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, 23 April 2024). The Bash home page is
Bash shell (version 5.3, 12 June 2024). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 23 April 2024, of The GNU Bash
This is Edition 5.3, last updated 12 June 2024, of The GNU Bash
Reference Manual, for Bash, Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -991,9 +991,8 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev:
and filename expansion. The shell performs tilde expansion,
parameter and variable expansion, arithmetic expansion, command
substitution, process substitution, and quote removal on those
words (the expansions that would occur if the words were enclosed
in double quotes). Conditional operators such as -f must be
unquoted to be recognized as primaries.
words. Conditional operators such as -f must be unquoted to be
recognized as primaries.
When used with [[, the < and > operators sort
lexicographically using the current locale.
@@ -3280,24 +3279,28 @@ standard.
The return status is zero.
. (a period)
. FILENAME [ARGUMENTS]
. [-p PATH] FILENAME [ARGUMENTS]
Read and execute commands from the FILENAME argument in the current
shell context. If FILENAME does not contain a slash, the PATH
variable is used to find FILENAME, but FILENAME does not need to be
executable. When Bash is not in POSIX mode, it searches the
current directory if FILENAME is not found in $PATH. If any
ARGUMENTS are supplied, they become the positional parameters when
FILENAME is executed. Otherwise the positional parameters are
unchanged. If the -T option is enabled, . inherits any trap on
DEBUG; if it is not, any DEBUG trap string is saved and
restored around the call to ., and . unsets the DEBUG trap
while it executes. If -T is not set, and the sourced file
changes the DEBUG trap, the new value is retained when .
completes. The return status is the exit status of the last
command executed, or zero if no commands are executed. If FILENAME
is not found, or cannot be read, the return status is non-zero.
This builtin is equivalent to source.
shell context. If FILENAME does not contain a slash, . searches
for it. If -p is supplied, . treats PATH as a colon-separated
list of directories in which to find FILENAME; otherwise, . uses
the directories in PATH to find FILENAME. FILENAME does not need
to be executable. When Bash is not in POSIX mode, it searches the
current directory if FILENAME is not found in $PATH, but does not
search the current directory if -p is supplied. If the
sourcepath option (*note The Shopt Builtin::) is turned off .
does not search PATH. If any ARGUMENTS are supplied, they become
the positional parameters when FILENAME is executed. Otherwise the
positional parameters are unchanged. If the -T option is
enabled, . inherits any trap on DEBUG; if it is not, any
DEBUG trap string is saved and restored around the call to .,
and . unsets the DEBUG trap while it executes. If -T is not
set, and the sourced file changes the DEBUG trap, the new value
is retained when . completes. The return status is the exit
status of the last command executed, or zero if no commands are
executed. If FILENAME is not found, or cannot be read, the return
status is non-zero. This builtin is equivalent to source.
break
break [N]
@@ -4396,7 +4399,7 @@ standard.
A synonym for mapfile.
source
source FILENAME
source [-p PATH] FILENAME [ARGUMENTS]
A synonym for . (*note Bourne Shell Builtins::).
@@ -5223,8 +5226,9 @@ This builtin allows you to change additional shell optional behavior.
sourcepath
If set, the . (source) builtin uses the value of PATH to
find the directory containing the file supplied as an
argument. This option is enabled by default.
find the directory containing the file supplied as an argument
when the -p option is not supplied. This option is enabled
by default.
varredir_close
If set, the shell automatically closes file descriptors
@@ -5729,7 +5733,7 @@ Variables::).
A sort specifier of nosort disables sorting completely; the
results are returned in the order they are read from the file
system,.
system, and any leading - is ignored.
If the sort specifier is missing, it defaults to NAME, so a value
of + is equivalent to the null string, and a value of - sorts
@@ -9096,10 +9100,12 @@ File: bash.info, Node: Commands For Moving, Next: Commands For History, Up: B
-------------------------
beginning-of-line (C-a)
Move to the start of the current line.
Move to the start of the current line. This may also be bound to
the Home key on some keyboards.
end-of-line (C-e)
Move to the end of the line.
Move to the end of the line. This may also be bound to the End key
on some keyboards.
forward-char (C-f)
Move forward a character.
@@ -9200,26 +9206,28 @@ File: bash.info, Node: Commands For History, Next: Commands For Text, Prev: C
a string supplied by the user. The search string may match
anywhere in a history line.
history-search-forward ()
Search forward through the history for the string of characters
between the start of the current line and the point. The search
string must match at the beginning of a history line. This is a
non-incremental search. By default, this command is unbound.
history-search-backward ()
Search backward through the history for the string of characters
between the start of the current line and the point. The search
string must match at the beginning of a history line. This is a
non-incremental search. By default, this command is unbound.
non-incremental search. By default, this command is unbound, but
may be bound to the Page Down key on some keyboards.
history-substring-search-forward ()
history-search-forward ()
Search forward through the history for the string of characters
between the start of the current line and the point. The search
string must match at the beginning of a history line. This is a
non-incremental search. By default, this command is unbound, but
may be bound to the Page Up key on some keyboards.
history-substring-search-backward ()
Search backward through the history for the string of characters
between the start of the current line and the point. The search
string may match anywhere in a history line. This is a
non-incremental search. By default, this command is unbound.
history-substring-search-backward ()
Search backward through the history for the string of characters
history-substring-search-forward ()
Search forward through the history for the string of characters
between the start of the current line and the point. The search
string may match anywhere in a history line. This is a
non-incremental search. By default, this command is unbound.
@@ -9346,7 +9354,8 @@ File: bash.info, Node: Commands For Text, Next: Commands For Killing, Prev: C
Characters bound to backward-delete-char replace the character
before point with a space.
By default, this command is unbound.
By default, this command is unbound, but may be bound to the Insert
key on some keyboards.

File: bash.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: Commands For Text, Up: Bindable Readline Commands
@@ -12213,17 +12222,17 @@ D.1 Index of Shell Builtin Commands
* .: Bourne Shell Builtins.
(line 17)
* [: Bourne Shell Builtins.
(line 285)
(line 289)
* alias: Bash Builtins. (line 11)
* bg: Job Control Builtins.
(line 7)
* bind: Bash Builtins. (line 21)
* break: Bourne Shell Builtins.
(line 37)
(line 41)
* builtin: Bash Builtins. (line 124)
* caller: Bash Builtins. (line 133)
* cd: Bourne Shell Builtins.
(line 45)
(line 49)
* command: Bash Builtins. (line 150)
* compgen: Programmable Completion Builtins.
(line 12)
@@ -12232,7 +12241,7 @@ D.1 Index of Shell Builtin Commands
* compopt: Programmable Completion Builtins.
(line 248)
* continue: Bourne Shell Builtins.
(line 90)
(line 94)
* declare: Bash Builtins. (line 170)
* dirs: Directory Stack Builtins.
(line 7)
@@ -12241,23 +12250,23 @@ D.1 Index of Shell Builtin Commands
* echo: Bash Builtins. (line 273)
* enable: Bash Builtins. (line 322)
* eval: Bourne Shell Builtins.
(line 99)
(line 103)
* exec: Bourne Shell Builtins.
(line 107)
(line 111)
* exit: Bourne Shell Builtins.
(line 125)
(line 129)
* export: Bourne Shell Builtins.
(line 132)
(line 136)
* false: Bourne Shell Builtins.
(line 148)
(line 152)
* fc: Bash History Builtins.
(line 10)
* fg: Job Control Builtins.
(line 17)
* getopts: Bourne Shell Builtins.
(line 153)
(line 157)
* hash: Bourne Shell Builtins.
(line 197)
(line 201)
* help: Bash Builtins. (line 360)
* history: Bash History Builtins.
(line 46)
@@ -12275,36 +12284,36 @@ D.1 Index of Shell Builtin Commands
* pushd: Directory Stack Builtins.
(line 69)
* pwd: Bourne Shell Builtins.
(line 222)
(line 226)
* read: Bash Builtins. (line 523)
* readarray: Bash Builtins. (line 629)
* readonly: Bourne Shell Builtins.
(line 232)
(line 236)
* return: Bourne Shell Builtins.
(line 251)
(line 255)
* set: The Set Builtin. (line 11)
* shift: Bourne Shell Builtins.
(line 272)
(line 276)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 638)
* suspend: Job Control Builtins.
(line 116)
* test: Bourne Shell Builtins.
(line 285)
(line 289)
* times: Bourne Shell Builtins.
(line 387)
(line 391)
* trap: Bourne Shell Builtins.
(line 393)
(line 397)
* true: Bourne Shell Builtins.
(line 455)
(line 459)
* type: Bash Builtins. (line 643)
* typeset: Bash Builtins. (line 681)
* ulimit: Bash Builtins. (line 687)
* umask: Bourne Shell Builtins.
(line 460)
(line 464)
* unalias: Bash Builtins. (line 793)
* unset: Bourne Shell Builtins.
(line 478)
(line 482)
* wait: Job Control Builtins.
(line 76)
@@ -12611,13 +12620,13 @@ D.4 Function Index
(line 6)
* alias-expand-line (): Miscellaneous Commands.
(line 133)
* backward-char (C-b): Commands For Moving. (line 15)
* backward-char (C-b): Commands For Moving. (line 17)
* backward-delete-char (Rubout): Commands For Text. (line 17)
* backward-kill-line (C-x Rubout): Commands For Killing.
(line 11)
* backward-kill-word (M-<DEL>): Commands For Killing.
(line 28)
* backward-word (M-b): Commands For Moving. (line 22)
* backward-word (M-b): Commands For Moving. (line 24)
* beginning-of-history (M-<): Commands For History.
(line 20)
* beginning-of-line (C-a): Commands For Moving. (line 6)
@@ -12628,8 +12637,8 @@ D.4 Function Index
(line 42)
* character-search-backward (M-C-]): Miscellaneous Commands.
(line 47)
* clear-display (M-C-l): Commands For Moving. (line 48)
* clear-screen (C-l): Commands For Moving. (line 53)
* clear-display (M-C-l): Commands For Moving. (line 50)
* clear-screen (C-l): Commands For Moving. (line 55)
* complete (<TAB>): Commands For Completion.
(line 6)
* complete-command (M-!): Commands For Completion.
@@ -12677,18 +12686,18 @@ D.4 Function Index
* end-of-file (usually C-d): Commands For Text. (line 6)
* end-of-history (M->): Commands For History.
(line 23)
* end-of-line (C-e): Commands For Moving. (line 9)
* end-of-line (C-e): Commands For Moving. (line 10)
* exchange-point-and-mark (C-x C-x): Miscellaneous Commands.
(line 37)
* execute-named-command (M-x): Miscellaneous Commands.
(line 147)
* fetch-history (): Commands For History.
(line 103)
(line 105)
* forward-backward-delete-char (): Commands For Text. (line 21)
* forward-char (C-f): Commands For Moving. (line 12)
* forward-char (C-f): Commands For Moving. (line 14)
* forward-search-history (C-s): Commands For History.
(line 33)
* forward-word (M-f): Commands For Moving. (line 18)
* forward-word (M-f): Commands For Moving. (line 20)
* glob-complete-word (M-g): Miscellaneous Commands.
(line 98)
* glob-expand-word (C-x *): Miscellaneous Commands.
@@ -12700,13 +12709,13 @@ D.4 Function Index
* history-expand-line (M-^): Miscellaneous Commands.
(line 126)
* history-search-backward (): Commands For History.
(line 57)
* history-search-forward (): Commands For History.
(line 51)
* history-search-forward (): Commands For History.
(line 58)
* history-substring-search-backward (): Commands For History.
(line 69)
(line 65)
* history-substring-search-forward (): Commands For History.
(line 63)
(line 71)
* insert-comment (M-#): Miscellaneous Commands.
(line 61)
* insert-completions (M-*): Commands For Completion.
@@ -12729,13 +12738,13 @@ D.4 Function Index
(line 38)
* next-history (C-n): Commands For History.
(line 17)
* next-screen-line (): Commands For Moving. (line 41)
* next-screen-line (): Commands For Moving. (line 43)
* non-incremental-forward-search-history (M-n): Commands For History.
(line 45)
* non-incremental-reverse-search-history (M-p): Commands For History.
(line 39)
* operate-and-get-next (C-o): Commands For History.
(line 96)
(line 98)
* overwrite-mode (): Commands For Text. (line 77)
* possible-command-completions (C-x !): Commands For Completion.
(line 86)
@@ -12753,12 +12762,12 @@ D.4 Function Index
(line 19)
* previous-history (C-p): Commands For History.
(line 13)
* previous-screen-line (): Commands For Moving. (line 34)
* previous-screen-line (): Commands For Moving. (line 36)
* print-last-kbd-macro (): Keyboard Macros. (line 17)
* quoted-insert (C-q or C-v): Commands For Text. (line 26)
* re-read-init-file (C-x C-r): Miscellaneous Commands.
(line 6)
* redraw-current-line (): Commands For Moving. (line 57)
* redraw-current-line (): Commands For Moving. (line 59)
* reverse-search-history (C-r): Commands For History.
(line 27)
* revert-line (M-r): Miscellaneous Commands.
@@ -12768,10 +12777,10 @@ D.4 Function Index
(line 33)
* shell-backward-kill-word (): Commands For Killing.
(line 37)
* shell-backward-word (M-C-b): Commands For Moving. (line 30)
* shell-backward-word (M-C-b): Commands For Moving. (line 32)
* shell-expand-line (M-C-e): Miscellaneous Commands.
(line 119)
* shell-forward-word (M-C-f): Commands For Moving. (line 26)
* shell-forward-word (M-C-f): Commands For Moving. (line 28)
* shell-kill-word (M-C-d): Commands For Killing.
(line 32)
* shell-transpose-words (M-C-t): Commands For Text. (line 58)
@@ -12797,9 +12806,9 @@ D.4 Function Index
* yank (C-y): Commands For Killing.
(line 72)
* yank-last-arg (M-. or M-_): Commands For History.
(line 84)
(line 86)
* yank-nth-arg (M-C-y): Commands For History.
(line 75)
(line 77)
* yank-pop (M-y): Commands For Killing.
(line 75)
@@ -12980,138 +12989,138 @@ D.5 Concept Index

Tag Table:
Node: Top895
Node: Introduction2830
Node: What is Bash?3043
Node: What is a shell?4184
Node: Definitions6763
Node: Basic Shell Features9939
Node: Shell Syntax11159
Node: Shell Operation12186
Node: Quoting13484
Node: Escape Character14797
Node: Single Quotes15295
Node: Double Quotes15644
Node: ANSI-C Quoting16987
Node: Locale Translation18372
Node: Creating Internationalized Scripts19716
Node: Comments23914
Node: Shell Commands24549
Node: Reserved Words25488
Node: Simple Commands26353
Node: Pipelines27012
Node: Lists30075
Node: Compound Commands31947
Node: Looping Constructs32956
Node: Conditional Constructs35500
Node: Command Grouping50404
Node: Coprocesses51891
Node: GNU Parallel54587
Node: Shell Functions55505
Node: Shell Parameters63611
Node: Positional Parameters68144
Node: Special Parameters69079
Node: Shell Expansions72385
Node: Brace Expansion74574
Node: Tilde Expansion77237
Node: Shell Parameter Expansion80003
Node: Command Substitution99110
Node: Arithmetic Expansion102643
Node: Process Substitution103608
Node: Word Splitting104745
Node: Filename Expansion106886
Node: Pattern Matching109982
Node: Quote Removal115215
Node: Redirections115519
Node: Executing Commands125328
Node: Simple Command Expansion125995
Node: Command Search and Execution128106
Node: Command Execution Environment130514
Node: Environment133823
Node: Exit Status135527
Node: Signals137312
Node: Shell Scripts140926
Node: Shell Builtin Commands144018
Node: Bourne Shell Builtins146129
Node: Bash Builtins170533
Node: Modifying Shell Behavior205492
Node: The Set Builtin205834
Node: The Shopt Builtin217349
Node: Special Builtins234085
Node: Shell Variables235074
Node: Bourne Shell Variables235508
Node: Bash Variables237701
Node: Bash Features274283
Node: Invoking Bash275297
Node: Bash Startup Files281696
Node: Interactive Shells287008
Node: What is an Interactive Shell?287416
Node: Is this Shell Interactive?288082
Node: Interactive Shell Behavior288906
Node: Bash Conditional Expressions292660
Node: Shell Arithmetic297834
Node: Aliases300916
Node: Arrays303871
Node: The Directory Stack310670
Node: Directory Stack Builtins311467
Node: Controlling the Prompt315916
Node: The Restricted Shell319054
Node: Bash POSIX Mode321841
Node: Shell Compatibility Mode339352
Node: Job Control348371
Node: Job Control Basics348828
Node: Job Control Builtins354002
Node: Job Control Variables359962
Node: Command Line Editing361139
Node: Introduction and Notation362843
Node: Readline Interaction364487
Node: Readline Bare Essentials365675
Node: Readline Movement Commands367493
Node: Readline Killing Commands368490
Node: Readline Arguments370468
Node: Searching371525
Node: Readline Init File373754
Node: Readline Init File Syntax375036
Node: Conditional Init Constructs399974
Node: Sample Init File404339
Node: Bindable Readline Commands407460
Node: Commands For Moving408685
Node: Commands For History410785
Node: Commands For Text415868
Node: Commands For Killing419943
Node: Numeric Arguments422744
Node: Commands For Completion423896
Node: Keyboard Macros428212
Node: Miscellaneous Commands428913
Node: Readline vi Mode435567
Node: Programmable Completion436519
Node: Programmable Completion Builtins444476
Node: A Programmable Completion Example456042
Node: Using History Interactively461387
Node: Bash History Facilities462068
Node: Bash History Builtins465180
Node: History Interaction470423
Node: Event Designators474748
Node: Word Designators476331
Node: Modifiers478317
Node: Installing Bash480226
Node: Basic Installation481360
Node: Compilers and Options485239
Node: Compiling For Multiple Architectures485989
Node: Installation Names487738
Node: Specifying the System Type489972
Node: Sharing Defaults490718
Node: Operation Controls491432
Node: Optional Features492451
Node: Reporting Bugs504253
Node: Major Differences From The Bourne Shell505602
Node: GNU Free Documentation License525337
Node: Indexes550514
Node: Builtin Index550965
Node: Reserved Word Index558063
Node: Variable Index560508
Node: Function Index577639
Node: Concept Index591495
Node: Top893
Node: Introduction2826
Node: What is Bash?3039
Node: What is a shell?4180
Node: Definitions6759
Node: Basic Shell Features9935
Node: Shell Syntax11155
Node: Shell Operation12182
Node: Quoting13480
Node: Escape Character14793
Node: Single Quotes15291
Node: Double Quotes15640
Node: ANSI-C Quoting16983
Node: Locale Translation18368
Node: Creating Internationalized Scripts19712
Node: Comments23910
Node: Shell Commands24545
Node: Reserved Words25484
Node: Simple Commands26349
Node: Pipelines27008
Node: Lists30071
Node: Compound Commands31943
Node: Looping Constructs32952
Node: Conditional Constructs35496
Node: Command Grouping50317
Node: Coprocesses51804
Node: GNU Parallel54500
Node: Shell Functions55418
Node: Shell Parameters63524
Node: Positional Parameters68057
Node: Special Parameters68992
Node: Shell Expansions72298
Node: Brace Expansion74487
Node: Tilde Expansion77150
Node: Shell Parameter Expansion79916
Node: Command Substitution99023
Node: Arithmetic Expansion102556
Node: Process Substitution103521
Node: Word Splitting104658
Node: Filename Expansion106799
Node: Pattern Matching109895
Node: Quote Removal115128
Node: Redirections115432
Node: Executing Commands125241
Node: Simple Command Expansion125908
Node: Command Search and Execution128019
Node: Command Execution Environment130427
Node: Environment133736
Node: Exit Status135440
Node: Signals137225
Node: Shell Scripts140839
Node: Shell Builtin Commands143931
Node: Bourne Shell Builtins146042
Node: Bash Builtins170812
Node: Modifying Shell Behavior205793
Node: The Set Builtin206135
Node: The Shopt Builtin217650
Node: Special Builtins234437
Node: Shell Variables235426
Node: Bourne Shell Variables235860
Node: Bash Variables238053
Node: Bash Features274670
Node: Invoking Bash275684
Node: Bash Startup Files282083
Node: Interactive Shells287395
Node: What is an Interactive Shell?287803
Node: Is this Shell Interactive?288469
Node: Interactive Shell Behavior289293
Node: Bash Conditional Expressions293047
Node: Shell Arithmetic298221
Node: Aliases301303
Node: Arrays304258
Node: The Directory Stack311057
Node: Directory Stack Builtins311854
Node: Controlling the Prompt316303
Node: The Restricted Shell319441
Node: Bash POSIX Mode322228
Node: Shell Compatibility Mode339739
Node: Job Control348758
Node: Job Control Basics349215
Node: Job Control Builtins354389
Node: Job Control Variables360349
Node: Command Line Editing361526
Node: Introduction and Notation363230
Node: Readline Interaction364874
Node: Readline Bare Essentials366062
Node: Readline Movement Commands367880
Node: Readline Killing Commands368877
Node: Readline Arguments370855
Node: Searching371912
Node: Readline Init File374141
Node: Readline Init File Syntax375423
Node: Conditional Init Constructs400361
Node: Sample Init File404726
Node: Bindable Readline Commands407847
Node: Commands For Moving409072
Node: Commands For History411299
Node: Commands For Text416504
Node: Commands For Killing420638
Node: Numeric Arguments423439
Node: Commands For Completion424591
Node: Keyboard Macros428907
Node: Miscellaneous Commands429608
Node: Readline vi Mode436262
Node: Programmable Completion437214
Node: Programmable Completion Builtins445171
Node: A Programmable Completion Example456737
Node: Using History Interactively462082
Node: Bash History Facilities462763
Node: Bash History Builtins465875
Node: History Interaction471118
Node: Event Designators475443
Node: Word Designators477026
Node: Modifiers479012
Node: Installing Bash480921
Node: Basic Installation482055
Node: Compilers and Options485934
Node: Compiling For Multiple Architectures486684
Node: Installation Names488433
Node: Specifying the System Type490667
Node: Sharing Defaults491413
Node: Operation Controls492127
Node: Optional Features493146
Node: Reporting Bugs504948
Node: Major Differences From The Bourne Shell506297
Node: GNU Free Documentation License526032
Node: Indexes551209
Node: Builtin Index551660
Node: Reserved Word Index558758
Node: Variable Index561203
Node: Function Index578334
Node: Concept Index592190

End Tag Table