bash-5.1 distribution sources and documentation

This commit is contained in:
Chet Ramey
2020-12-06 15:51:17 -05:00
parent 36f2c406ff
commit 8868edaf22
828 changed files with 94641 additions and 56509 deletions
+41 -40
View File
@@ -17,106 +17,108 @@ The following list is what's changed when 'POSIX mode' is in effect:
re-search '$PATH' to find the new location. This is also available
with 'shopt -s checkhash'.
3. The message printed by the job control code and builtins when a job
exits with a non-zero status is 'Done(status)'.
3. Bash will not insert a command without the execute bit set into the
command hash table, even if it returns it as a (last-ditch) result
from a '$PATH' search.
4. The message printed by the job control code and builtins when a job
exits with a non-zero status is 'Done(status)'.
5. The message printed by the job control code and builtins when a job
is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example,
'SIGTSTP'.
5. Alias expansion is always enabled, even in non-interactive shells.
6. Alias expansion is always enabled, even in non-interactive shells.
6. Reserved words appearing in a context where reserved words are
7. Reserved words appearing in a context where reserved words are
recognized do not undergo alias expansion.
7. The POSIX 'PS1' and 'PS2' expansions of '!' to the history number
8. The POSIX 'PS1' and 'PS2' expansions of '!' to the history number
and '!!' to '!' are enabled, and parameter expansion is performed
on the values of 'PS1' and 'PS2' regardless of the setting of the
'promptvars' option.
8. The POSIX startup files are executed ('$ENV') rather than the
9. The POSIX startup files are executed ('$ENV') rather than the
normal Bash files.
9. Tilde expansion is only performed on assignments preceding a
10. Tilde expansion is only performed on assignments preceding a
command name, rather than on all assignment statements on the line.
10. The default history file is '~/.sh_history' (this is the default
11. The default history file is '~/.sh_history' (this is the default
value of '$HISTFILE').
11. Redirection operators do not perform filename expansion on the
12. Redirection operators do not perform filename expansion on the
word in the redirection unless the shell is interactive.
12. Redirection operators do not perform word splitting on the word in
13. Redirection operators do not perform word splitting on the word in
the redirection.
13. Function names must be valid shell 'name's. That is, they may not
14. Function names must be valid shell 'name's. That is, they may not
contain characters other than letters, digits, and underscores, and
may not start with a digit. Declaring a function with an invalid
name causes a fatal syntax error in non-interactive shells.
14. Function names may not be the same as one of the POSIX special
15. Function names may not be the same as one of the POSIX special
builtins.
15. POSIX special builtins are found before shell functions during
16. POSIX special builtins are found before shell functions during
command lookup.
16. When printing shell function definitions (e.g., by 'type'), Bash
17. When printing shell function definitions (e.g., by 'type'), Bash
does not print the 'function' keyword.
17. Literal tildes that appear as the first character in elements of
18. Literal tildes that appear as the first character in elements of
the 'PATH' variable are not expanded as described above under *note
Tilde Expansion::.
18. The 'time' reserved word may be used by itself as a command. When
19. The 'time' reserved word may be used by itself as a command. When
used in this way, it displays timing statistics for the shell and
its completed children. The 'TIMEFORMAT' variable controls the
format of the timing information.
19. When parsing and expanding a ${...} expansion that appears within
20. When parsing and expanding a ${...} expansion that appears within
double quotes, single quotes are no longer special and cannot be
used to quote a closing brace or other special character, unless
the operator is one of those defined to perform pattern removal.
In this case, they do not have to appear as matched pairs.
20. The parser does not recognize 'time' as a reserved word if the
21. The parser does not recognize 'time' as a reserved word if the
next token begins with a '-'.
21. The '!' character does not introduce history expansion within a
22. The '!' character does not introduce history expansion within a
double-quoted string, even if the 'histexpand' option is enabled.
22. If a POSIX special builtin returns an error status, a
23. If a POSIX special builtin returns an error status, a
non-interactive shell exits. The fatal errors are those listed in
the POSIX standard, and include things like passing incorrect
options, redirection errors, variable assignment errors for
assignments preceding the command name, and so on.
23. A non-interactive shell exits with an error status if a variable
24. A non-interactive shell exits with an error status if a variable
assignment error occurs when no command name follows the assignment
statements. A variable assignment error occurs, for example, when
trying to assign a value to a readonly variable.
24. A non-interactive shell exits with an error status if a variable
25. A non-interactive shell exits with an error status if a variable
assignment error occurs in an assignment statement preceding a
special builtin, but not with any other simple command.
25. A non-interactive shell exits with an error status if the
26. A non-interactive shell exits with an error status if the
iteration variable in a 'for' statement or the selection variable
in a 'select' statement is a readonly variable.
26. Non-interactive shells exit if FILENAME in '.' FILENAME is not
27. Non-interactive shells exit if FILENAME in '.' FILENAME is not
found.
27. Non-interactive shells exit if a syntax error in an arithmetic
28. Non-interactive shells exit if a syntax error in an arithmetic
expansion results in an invalid expression.
28. Non-interactive shells exit if a parameter expansion error occurs.
29. Non-interactive shells exit if a parameter expansion error occurs.
29. Non-interactive shells exit if there is a syntax error in a script
30. Non-interactive shells exit if there is a syntax error in a script
read with the '.' or 'source' builtins, or in a string processed by
the 'eval' builtin.
30. Process substitution is not available.
31. While variable indirection is available, it may not be applied to
the '#' and '?' special parameters.
@@ -127,39 +129,38 @@ The following list is what's changed when 'POSIX mode' is in effect:
33. Assignment statements preceding POSIX special builtins persist in
the shell environment after the builtin completes.
34. Assignment statements preceding shell function calls persist in
the shell environment after the function returns, as if a POSIX
special builtin command had been executed.
35. The 'command' builtin does not prevent builtins that take
34. The 'command' builtin does not prevent builtins that take
assignment statements as arguments from expanding them as
assignment statements; when not in POSIX mode, assignment builtins
lose their assignment statement expansion properties when preceded
by 'command'.
36. The 'bg' builtin uses the required format to describe each job
35. The 'bg' builtin uses the required format to describe each job
placed in the background, which does not include an indication of
whether the job is the current or previous job.
37. The output of 'kill -l' prints all the signal names on a single
36. The output of 'kill -l' prints all the signal names on a single
line, separated by spaces, without the 'SIG' prefix.
38. The 'kill' builtin does not accept signal names with a 'SIG'
37. The 'kill' builtin does not accept signal names with a 'SIG'
prefix.
39. The 'export' and 'readonly' builtin commands display their output
38. The 'export' and 'readonly' builtin commands display their output
in the format required by POSIX.
40. The 'trap' builtin displays signal names without the leading
39. The 'trap' builtin displays signal names without the leading
'SIG'.
41. The 'trap' builtin doesn't check the first argument for a possible
40. 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.
41. 'trap -p' displays signals whose dispositions are set to SIG_DFL
and those that were ignored when the shell started.
42. The '.' and 'source' builtins do not search the current directory
for the filename argument if it is not found by searching 'PATH'.