fix for dequoting words in pretty-print mode; posix mode changes for readonly/export invalid identifier errors

This commit is contained in:
Chet Ramey
2024-01-02 10:42:34 -05:00
parent aa2d23cfac
commit fa0b002927
20 changed files with 1531 additions and 1361 deletions
+90 -85
View File
@@ -7470,114 +7470,119 @@ startup files.
42. The 'export' and 'readonly' builtin commands display their output
in the format required by POSIX.
43. The 'trap' builtin displays signal names without the leading
43. If the 'export' and 'readonly' builtin commands get an argument
that is not a valid identifier, and they are not operating on shell
functions, they return an error. This will cause a non-interactive
shell to exit because these are special builtins.
44. The 'trap' builtin displays signal names without the leading
'SIG'.
44. The 'trap' builtin doesn't check the first argument for a possible
45. The 'trap' builtin doesn't check the first argument for a possible
signal specification and revert the signal handling to the original
disposition if it is, unless that argument consists solely of
digits and is a valid signal number. If users want to reset the
handler for a given signal to the original disposition, they should
use '-' as the first argument.
45. 'trap -p' without arguments displays signals whose dispositions
46. 'trap -p' without arguments displays signals whose dispositions
are set to SIG_DFL and those that were ignored when the shell
started, not just trapped signals.
46. The '.' and 'source' builtins do not search the current directory
47. The '.' and 'source' builtins do not search the current directory
for the filename argument if it is not found by searching 'PATH'.
47. Enabling POSIX mode has the effect of setting the
48. Enabling POSIX mode has the effect of setting the
'inherit_errexit' option, so subshells spawned to execute command
substitutions inherit the value of the '-e' option from the parent
shell. When the 'inherit_errexit' option is not enabled, Bash
clears the '-e' option in such subshells.
48. Enabling POSIX mode has the effect of setting the 'shift_verbose'
49. Enabling POSIX mode has the effect of setting the 'shift_verbose'
option, so numeric arguments to 'shift' that exceed the number of
positional parameters will result in an error message.
49. When the 'alias' builtin displays alias definitions, it does not
50. When the 'alias' builtin displays alias definitions, it does not
display them with a leading 'alias ' unless the '-p' option is
supplied.
50. When the 'set' builtin is invoked without options, it does not
51. When the 'set' builtin is invoked without options, it does not
display shell function names and definitions.
51. When the 'set' builtin is invoked without options, it displays
52. When the 'set' builtin is invoked without options, it displays
variable values without quotes, unless they contain shell
metacharacters, even if the result contains nonprinting characters.
52. When the 'cd' builtin is invoked in logical mode, and the pathname
53. When the 'cd' builtin is invoked in logical mode, and the pathname
constructed from '$PWD' and the directory name supplied as an
argument does not refer to an existing directory, 'cd' will fail
instead of falling back to physical mode.
53. When the 'cd' builtin cannot change a directory because the length
54. When the 'cd' builtin cannot change a directory because the length
of the pathname constructed from '$PWD' and the directory name
supplied as an argument exceeds 'PATH_MAX' when all symbolic links
are expanded, 'cd' will fail instead of attempting to use only the
supplied directory name.
54. The 'pwd' builtin verifies that the value it prints is the same as
55. The 'pwd' builtin verifies that the value it prints is the same as
the current directory, even if it is not asked to check the file
system with the '-P' option.
55. When listing the history, the 'fc' builtin does not include an
56. When listing the history, the 'fc' builtin does not include an
indication of whether or not a history entry has been modified.
56. The default editor used by 'fc' is 'ed'.
57. The default editor used by 'fc' is 'ed'.
57. If there are too many arguments supplied to 'fc -s', 'fc' prints
58. If there are too many arguments supplied to 'fc -s', 'fc' prints
an error message and returns failure.
58. The 'type' and 'command' builtins will not report a non-executable
59. The 'type' and 'command' builtins will not report a non-executable
file as having been found, though the shell will attempt to execute
such a file if it is the only so-named file found in '$PATH'.
59. The 'vi' editing mode will invoke the 'vi' editor directly when
60. The 'vi' editing mode will invoke the 'vi' editor directly when
the 'v' command is run, instead of checking '$VISUAL' and
'$EDITOR'.
60. When the 'xpg_echo' option is enabled, Bash does not attempt to
61. When the 'xpg_echo' option is enabled, Bash does not attempt to
interpret any arguments to 'echo' as options. Each argument is
displayed, after escape characters are converted.
61. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
and '-f' options.
62. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not
63. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not
interrupt the 'wait' builtin and cause it to return immediately.
The trap command is run once for each child that exits.
63. The 'read' builtin may be interrupted by a signal for which a trap
64. The 'read' builtin may be interrupted by a signal for which a trap
has been set. If Bash receives a trapped signal while executing
'read', the trap handler executes and 'read' returns an exit status
greater than 128.
64. The 'printf' builtin uses 'double' (via 'strtod') to convert
65. The 'printf' builtin uses 'double' (via 'strtod') to convert
arguments corresponding to floating point conversion specifiers,
instead of 'long double' if it's available. The 'L' length
modifier forces 'printf' to use 'long double' if it's available.
65. Bash removes an exited background process's status from the list
66. Bash removes an exited background process's status from the list
of such statuses after the 'wait' builtin is used to obtain it.
66. A double quote character ('"') is treated specially when it
67. A double quote character ('"') is treated specially when it
appears in a backquoted command substitution in the body of a
here-document that undergoes expansion. That means, for example,
that a backslash preceding a double quote character will escape it
and the backslash will be removed.
67. The 'test' builtin compares strings using the current locale when
68. The 'test' builtin compares strings using the current locale when
processing the '<' and '>' binary operators.
68. The 'test' builtin's '-t' unary primary requires an argument.
69. The 'test' builtin's '-t' unary primary requires an argument.
Historical versions of 'test' made the argument optional in certain
cases, and Bash attempts to accommodate those for backwards
compatibility.
69. Command substitutions don't set the '?' special parameter. The
70. Command substitutions don't set the '?' special parameter. The
exit status of a simple command without a command word is still the
exit status of the last command substitution that occurred while
evaluating the variable assignments and redirections in that
@@ -7643,9 +7648,9 @@ compatibility level.
compatibility levels. Eventually, the options will be removed in favor
of 'BASH_COMPAT'.
Bash-5.0 is the final version for which there will be an individual
shopt option for the previous version. Users should use 'BASH_COMPAT'
on bash-5.0 and later versions.
Bash-5.0 was the final version for which there will be an individual
shopt option for the previous version. Users should control the
compatibility level with 'BASH_COMPAT'.
The following table describes the behavior changes controlled by each
compatibility level setting. The 'compat'NN tag is used as shorthand
@@ -12986,61 +12991,61 @@ Node: Directory Stack Builtins300937
Node: Controlling the Prompt305197
Node: The Restricted Shell308162
Node: Bash POSIX Mode310772
Node: Shell Compatibility Mode327417
Node: Job Control335665
Node: Job Control Basics336125
Node: Job Control Builtins341127
Node: Job Control Variables346922
Node: Command Line Editing348078
Node: Introduction and Notation349749
Node: Readline Interaction351372
Node: Readline Bare Essentials352563
Node: Readline Movement Commands354352
Node: Readline Killing Commands355312
Node: Readline Arguments357233
Node: Searching358277
Node: Readline Init File360463
Node: Readline Init File Syntax361724
Node: Conditional Init Constructs385749
Node: Sample Init File389945
Node: Bindable Readline Commands393069
Node: Commands For Moving394273
Node: Commands For History396324
Node: Commands For Text401318
Node: Commands For Killing405296
Node: Numeric Arguments408000
Node: Commands For Completion409139
Node: Keyboard Macros413330
Node: Miscellaneous Commands414018
Node: Readline vi Mode420387
Node: Programmable Completion421294
Node: Programmable Completion Builtins429074
Node: A Programmable Completion Example440194
Node: Using History Interactively445442
Node: Bash History Facilities446126
Node: Bash History Builtins449137
Node: History Interaction454228
Node: Event Designators458480
Node: Word Designators460018
Node: Modifiers461883
Node: Installing Bash463691
Node: Basic Installation464828
Node: Compilers and Options468550
Node: Compiling For Multiple Architectures469291
Node: Installation Names470983
Node: Specifying the System Type473092
Node: Sharing Defaults473809
Node: Operation Controls474482
Node: Optional Features475440
Node: Reporting Bugs486660
Node: Major Differences From The Bourne Shell487994
Node: GNU Free Documentation License504852
Node: Indexes530029
Node: Builtin Index530483
Node: Reserved Word Index537584
Node: Variable Index540032
Node: Function Index557166
Node: Concept Index571025
Node: Shell Compatibility Mode327689
Node: Job Control335940
Node: Job Control Basics336400
Node: Job Control Builtins341402
Node: Job Control Variables347197
Node: Command Line Editing348353
Node: Introduction and Notation350024
Node: Readline Interaction351647
Node: Readline Bare Essentials352838
Node: Readline Movement Commands354627
Node: Readline Killing Commands355587
Node: Readline Arguments357508
Node: Searching358552
Node: Readline Init File360738
Node: Readline Init File Syntax361999
Node: Conditional Init Constructs386024
Node: Sample Init File390220
Node: Bindable Readline Commands393344
Node: Commands For Moving394548
Node: Commands For History396599
Node: Commands For Text401593
Node: Commands For Killing405571
Node: Numeric Arguments408275
Node: Commands For Completion409414
Node: Keyboard Macros413605
Node: Miscellaneous Commands414293
Node: Readline vi Mode420662
Node: Programmable Completion421569
Node: Programmable Completion Builtins429349
Node: A Programmable Completion Example440469
Node: Using History Interactively445717
Node: Bash History Facilities446401
Node: Bash History Builtins449412
Node: History Interaction454503
Node: Event Designators458755
Node: Word Designators460293
Node: Modifiers462158
Node: Installing Bash463966
Node: Basic Installation465103
Node: Compilers and Options468825
Node: Compiling For Multiple Architectures469566
Node: Installation Names471258
Node: Specifying the System Type473367
Node: Sharing Defaults474084
Node: Operation Controls474757
Node: Optional Features475715
Node: Reporting Bugs486935
Node: Major Differences From The Bourne Shell488269
Node: GNU Free Documentation License505127
Node: Indexes530304
Node: Builtin Index530758
Node: Reserved Word Index537859
Node: Variable Index540307
Node: Function Index557441
Node: Concept Index571300

End Tag Table