mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-01 09:29:51 +02:00
make buffered stream read errors sticky; handle EOF in comments explicitly; don't change point if alias-expand-line or history-expand-line don't expand anything
This commit is contained in:
@@ -5267,3 +5267,34 @@ arrayfunc.c
|
||||
for the rhs of the assignment or the second word in the kvpair to
|
||||
be more consistent with how assignment statements behave (e.g.,
|
||||
tilde expansion). Fixes issue reported by maroloccio@gmail.com
|
||||
|
||||
2/7
|
||||
---
|
||||
parse.y
|
||||
- discard_until: now returns the last character read. If we get an
|
||||
EOF while processing a comment, return EOF
|
||||
- shell_getc: if discard_until returns EOF, return yacc_EOF
|
||||
|
||||
input.h
|
||||
- bclearerror: new macro, clears the B_ERROR flag in the buffered
|
||||
stream BP
|
||||
|
||||
input.c
|
||||
- b_fill_buffer: try making errors `sticky': if the B_ERROR flag is
|
||||
set for the buffered stream, return EOF immediately. This is similar
|
||||
to what stdio does
|
||||
|
||||
builtins/fc.def
|
||||
- fc_builtin: in posix mode, if there are extra arguments supplied to
|
||||
-s (e.g. pat=rep first last), throw an error
|
||||
|
||||
doc/{bash.1,bashref.texi}
|
||||
- printf: document new altform for %q/%Q and %ls/%lc
|
||||
|
||||
2/8
|
||||
---
|
||||
bashline.c
|
||||
- alias_expand_line: if alias_expand doesn't change rl_line_buffer,
|
||||
just return right away without changing rl_point. Inspired by a
|
||||
report from Addison Brendtro <addison.brendtro@gmail.com>
|
||||
- history_expand_line: ditto
|
||||
|
||||
+14
@@ -2741,6 +2741,13 @@ alias_expand_line (int count, int ignore)
|
||||
|
||||
new_line = alias_expand (rl_line_buffer);
|
||||
|
||||
/* If we didn't expand anything, don't change anything. */
|
||||
if (new_line && STREQ (new_line, rl_line_buffer))
|
||||
{
|
||||
free (new_line);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (new_line)
|
||||
{
|
||||
set_up_new_line (new_line);
|
||||
@@ -2763,6 +2770,13 @@ history_expand_line (int count, int ignore)
|
||||
|
||||
new_line = history_expand_line_internal (rl_line_buffer);
|
||||
|
||||
/* If we didn't expand anything, don't change anything. */
|
||||
if (new_line && STREQ (new_line, rl_line_buffer))
|
||||
{
|
||||
free (new_line);
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (new_line)
|
||||
{
|
||||
set_up_new_line (new_line);
|
||||
|
||||
@@ -280,6 +280,15 @@ fc_builtin (WORD_LIST *list)
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
if (posixly_correct && list && list->next)
|
||||
{
|
||||
builtin_error (_("too many arguments"));
|
||||
if (rlist)
|
||||
FREE_RLIST ();
|
||||
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
if (rlist)
|
||||
{
|
||||
newcom = fc_dosubs (command, rlist);
|
||||
|
||||
+19
-9
@@ -5386,21 +5386,26 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
%%bb causes pprriinnttff to expand backslash escape sequences in the
|
||||
corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee.
|
||||
%%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a
|
||||
format that can be reused as shell input.
|
||||
%%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_-
|
||||
format that can be reused as shell input. %%qq and %%QQ use
|
||||
the $$'''' quoting style if any characters in the argument
|
||||
string require it, and backslash quoting otherwise. If
|
||||
the format string uses the _p_r_i_n_t_f alternate form, these
|
||||
two formats quote the argument string using single
|
||||
quotes.
|
||||
%%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_-
|
||||
_m_e_n_t before quoting it.
|
||||
%%((_d_a_t_e_f_m_t))TT
|
||||
causes pprriinnttff to output the date-time string resulting
|
||||
from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3).
|
||||
causes pprriinnttff to output the date-time string resulting
|
||||
from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3).
|
||||
The corresponding _a_r_g_u_m_e_n_t is an integer representing the
|
||||
number of seconds since the epoch. Two special argument
|
||||
values may be used: -1 represents the current time, and
|
||||
-2 represents the time the shell was invoked. If no ar-
|
||||
number of seconds since the epoch. Two special argument
|
||||
values may be used: -1 represents the current time, and
|
||||
-2 represents the time the shell was invoked. If no ar-
|
||||
gument is specified, conversion behaves as if -1 had been
|
||||
given. This is an exception to the usual pprriinnttff behav-
|
||||
given. This is an exception to the usual pprriinnttff behav-
|
||||
ior.
|
||||
|
||||
The %b, %q, and %T directives all use the field width and preci-
|
||||
The %b, %q, and %T specifiers all use the field width and preci-
|
||||
sion arguments from the format specification and write that many
|
||||
bytes from (or use that wide a field for) the expanded argument,
|
||||
which usually contains more characters than the original.
|
||||
@@ -5408,6 +5413,11 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS
|
||||
The %n format specifier accepts a corresponding argument that is
|
||||
treated as a shell variable name.
|
||||
|
||||
The %s and %c format specifiers accept an l (long) modifier,
|
||||
which forces them to convert the argument string to a wide-char-
|
||||
acter string and apply any supplied field width and precision in
|
||||
terms of characters, not bytes.
|
||||
|
||||
Arguments to non-string format specifiers are treated as C con-
|
||||
stants, except that a leading plus or minus sign is allowed, and
|
||||
if the leading character is a single or double quote, the value
|
||||
|
||||
+9
-1
@@ -9460,6 +9460,10 @@ in the same way as \fBecho \-e\fP.
|
||||
.B %q
|
||||
causes \fBprintf\fP to output the corresponding
|
||||
\fIargument\fP in a format that can be reused as shell input.
|
||||
\fB%q\fP and \fB%Q\fP use the \fB$''\fP quoting style if any characters
|
||||
in the argument string require it, and backslash quoting otherwise.
|
||||
If the format string uses the \fIprintf\fP alternate form, these two
|
||||
formats quote the argument string using single quotes.
|
||||
.TP
|
||||
.B %Q
|
||||
like \fB%q\fP, but applies any supplied precision to the \fIargument\fP
|
||||
@@ -9476,7 +9480,7 @@ If no argument is specified, conversion behaves as if \-1 had been given.
|
||||
This is an exception to the usual \fBprintf\fP behavior.
|
||||
.PD
|
||||
.PP
|
||||
The %b, %q, and %T directives all use the field width and precision
|
||||
The %b, %q, and %T format specifiers all use the field width and precision
|
||||
arguments from the format specification and write that many bytes from
|
||||
(or use that wide a field for) the expanded argument, which usually
|
||||
contains more characters than the original.
|
||||
@@ -9484,6 +9488,10 @@ contains more characters than the original.
|
||||
The %n format specifier accepts a corresponding argument that is treated
|
||||
as a shell variable name.
|
||||
.PP
|
||||
The %s and %c format specifiers accept an l (long) modifier, which forces
|
||||
them to convert the argument string to a wide-character string and apply
|
||||
any supplied field width and precision in terms of characters, not bytes.
|
||||
.PP
|
||||
Arguments to non-string format specifiers are treated as C constants,
|
||||
except that a leading plus or minus sign is allowed, and if the leading
|
||||
character is a single or double quote, the value is the ASCII value of
|
||||
|
||||
+229
-205
@@ -1,12 +1,12 @@
|
||||
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.2, 27 December 2022).
|
||||
Bash shell (version 5.2, 7 February 2023).
|
||||
|
||||
This is Edition 5.2, last updated 27 December 2022, of 'The GNU Bash
|
||||
This is Edition 5.2, last updated 7 February 2023, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.2.
|
||||
|
||||
Copyright (C) 1988-2022 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2023 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this
|
||||
document under the terms of the GNU Free Documentation License,
|
||||
@@ -26,10 +26,10 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
Bash shell (version 5.2, 27 December 2022). The Bash home page is
|
||||
Bash shell (version 5.2, 7 February 2023). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.2, last updated 27 December 2022, of 'The GNU Bash
|
||||
This is Edition 5.2, last updated 7 February 2023, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.2.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -2832,8 +2832,8 @@ File: bash.info, Node: Command Search and Execution, Next: Command Execution E
|
||||
----------------------------------
|
||||
|
||||
After a command has been split into words, if it results in a simple
|
||||
command and an optional list of arguments, the following actions are
|
||||
taken.
|
||||
command and an optional list of arguments, the shell performs the
|
||||
following actions.
|
||||
|
||||
1. If the command name contains no slashes, the shell attempts to
|
||||
locate it. If there exists a shell function by that name, that
|
||||
@@ -3564,7 +3564,7 @@ standard.
|
||||
children. The return status is zero.
|
||||
|
||||
'trap'
|
||||
trap [-lp] [ACTION] [SIGSPEC ...]
|
||||
trap [-Plp] [ACTION] [SIGSPEC ...]
|
||||
|
||||
The ACTION is a command that is read and executed when the shell
|
||||
receives signal SIGSPEC. If ACTION is absent (and there is a
|
||||
@@ -3580,7 +3580,13 @@ standard.
|
||||
displays the trap commands associated with each SIGSPEC, or, if no
|
||||
SIGSPECs are supplied, for all trapped signals, as a set of 'trap'
|
||||
commands that can be reused as shell input to restore the current
|
||||
signal dispositions.
|
||||
signal dispositions. The '-P' option behaves similarly, but
|
||||
displays only the actions associated with each SIGSPEC argument.
|
||||
'-P' requires at least one SIGSPEC argument. The '-P' or '-p'
|
||||
options to 'trap' may be used in a subshell environment (e.g.,
|
||||
command substitution) and, as long as they are used before 'trap'
|
||||
is used to change a signal's handling, will display the state of
|
||||
its parent's traps.
|
||||
|
||||
The '-l' option causes 'trap' to print a list of signal names and
|
||||
their corresponding numbers. Each SIGSPEC is either a signal name
|
||||
@@ -4112,7 +4118,13 @@ standard.
|
||||
Bash Builtins::).
|
||||
'%q'
|
||||
Causes 'printf' to output the corresponding ARGUMENT in a
|
||||
format that can be reused as shell input.
|
||||
format that can be reused as shell input. '%q' and '%Q'P use
|
||||
the ANSI-C quoting style (*note ANSI-C Quoting::) if any
|
||||
characters in the argument string require it, and backslash
|
||||
quoting otherwise. If the format string uses the 'printf'
|
||||
ALTERNATE FORM, these two formats quote the argument string
|
||||
using single quotes.
|
||||
|
||||
'%Q'
|
||||
like '%q', but applies any supplied precision to the ARGUMENT
|
||||
before quoting it.
|
||||
@@ -4126,14 +4138,19 @@ standard.
|
||||
conversion behaves as if -1 had been given. This is an
|
||||
exception to the usual 'printf' behavior.
|
||||
|
||||
The %b, %q, and %T directives all use the field width and precision
|
||||
arguments from the format specification and write that many bytes
|
||||
from (or use that wide a field for) the expanded argument, which
|
||||
usually contains more characters than the original.
|
||||
The %b, %q, and %T format specifiers all use the field width and
|
||||
precision arguments from the format specification and write that
|
||||
many bytes from (or use that wide a field for) the expanded
|
||||
argument, which usually contains more characters than the original.
|
||||
|
||||
The %n format specifier accepts a corresponding argument that is
|
||||
treated as a shell variable name.
|
||||
|
||||
The %s and %c format specifiers accept an l (long) modifier, which
|
||||
forces them to convert the argument string to a wide-character
|
||||
string and apply any supplied field width and precision in terms of
|
||||
characters, not bytes.
|
||||
|
||||
Arguments to non-string format specifiers are treated as C language
|
||||
constants, except that a leading plus or minus sign is allowed, and
|
||||
if the leading character is a single or double quote, the value is
|
||||
@@ -4638,9 +4655,9 @@ parameters, or to display the names and values of shell variables.
|
||||
'-x'
|
||||
Print a trace of simple commands, 'for' commands, 'case'
|
||||
commands, 'select' commands, and arithmetic 'for' commands and
|
||||
their arguments or associated word lists after they are
|
||||
expanded and before they are executed. The value of the 'PS4'
|
||||
variable is expanded and the resultant value is printed before
|
||||
their arguments or associated word lists to standard error
|
||||
after they are expanded and before they are executed. The
|
||||
shell prints the expanded value of the 'PS4' variable before
|
||||
the command and its expanded arguments.
|
||||
|
||||
'-B'
|
||||
@@ -7107,50 +7124,54 @@ startup files.
|
||||
16. Function names may not be the same as one of the POSIX special
|
||||
builtins.
|
||||
|
||||
17. POSIX special builtins are found before shell functions during
|
||||
17. Even if a shell function whose name contains a slash was defined
|
||||
before entering POSIX mode, the shell will not execute a function
|
||||
whose name contains one or more slashes.
|
||||
|
||||
18. POSIX special builtins are found before shell functions during
|
||||
command lookup.
|
||||
|
||||
18. When printing shell function definitions (e.g., by 'type'), Bash
|
||||
19. When printing shell function definitions (e.g., by 'type'), Bash
|
||||
does not print the 'function' keyword.
|
||||
|
||||
19. Literal tildes that appear as the first character in elements of
|
||||
20. Literal tildes that appear as the first character in elements of
|
||||
the 'PATH' variable are not expanded as described above under *note
|
||||
Tilde Expansion::.
|
||||
|
||||
20. The 'time' reserved word may be used by itself as a command. When
|
||||
21. 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.
|
||||
|
||||
21. When parsing and expanding a ${...} expansion that appears within
|
||||
22. 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.
|
||||
|
||||
22. The parser does not recognize 'time' as a reserved word if the
|
||||
23. The parser does not recognize 'time' as a reserved word if the
|
||||
next token begins with a '-'.
|
||||
|
||||
23. The '!' character does not introduce history expansion within a
|
||||
24. The '!' character does not introduce history expansion within a
|
||||
double-quoted string, even if the 'histexpand' option is enabled.
|
||||
|
||||
24. If a POSIX special builtin returns an error status, a
|
||||
25. 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.
|
||||
|
||||
25. The 'unset' builtin with the '-v' option specified returns a fatal
|
||||
26. The 'unset' builtin with the '-v' option specified returns a fatal
|
||||
error if it attempts to unset a 'readonly' or 'non-unsettable'
|
||||
variable, or encounters a variable name argument that is an invalid
|
||||
identifier, which causes a non-interactive shell to exit.
|
||||
|
||||
26. A non-interactive shell exits with an error status if a variable
|
||||
27. 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.
|
||||
|
||||
27. A non-interactive shell exits with an error status if a variable
|
||||
28. 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. For any
|
||||
other simple command, the shell aborts execution of that command,
|
||||
@@ -7158,142 +7179,145 @@ startup files.
|
||||
perform any further processing of the command in which the error
|
||||
occurred").
|
||||
|
||||
28. A non-interactive shell exits with an error status if the
|
||||
29. 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.
|
||||
|
||||
29. Non-interactive shells exit if FILENAME in '.' FILENAME is not
|
||||
30. Non-interactive shells exit if FILENAME in '.' FILENAME is not
|
||||
found.
|
||||
|
||||
30. Non-interactive shells exit if a syntax error in an arithmetic
|
||||
31. Non-interactive shells exit if a syntax error in an arithmetic
|
||||
expansion results in an invalid expression.
|
||||
|
||||
31. Non-interactive shells exit if a parameter expansion error occurs.
|
||||
32. Non-interactive shells exit if a parameter expansion error occurs.
|
||||
|
||||
32. Non-interactive shells exit if there is a syntax error in a script
|
||||
33. 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.
|
||||
|
||||
33. While variable indirection is available, it may not be applied to
|
||||
34. While variable indirection is available, it may not be applied to
|
||||
the '#' and '?' special parameters.
|
||||
|
||||
34. Expanding the '*' special parameter in a pattern context where the
|
||||
35. Expanding the '*' special parameter in a pattern context where the
|
||||
expansion is double-quoted does not treat the '$*' as if it were
|
||||
double-quoted.
|
||||
|
||||
35. Assignment statements preceding POSIX special builtins persist in
|
||||
36. Assignment statements preceding POSIX special builtins persist in
|
||||
the shell environment after the builtin completes.
|
||||
|
||||
36. The 'command' builtin does not prevent builtins that take
|
||||
37. 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'.
|
||||
|
||||
37. The 'bg' builtin uses the required format to describe each job
|
||||
38. 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.
|
||||
|
||||
38. The output of 'kill -l' prints all the signal names on a single
|
||||
39. The output of 'kill -l' prints all the signal names on a single
|
||||
line, separated by spaces, without the 'SIG' prefix.
|
||||
|
||||
39. The 'kill' builtin does not accept signal names with a 'SIG'
|
||||
40. The 'kill' builtin does not accept signal names with a 'SIG'
|
||||
prefix.
|
||||
|
||||
40. The 'export' and 'readonly' builtin commands display their output
|
||||
41. The 'export' and 'readonly' builtin commands display their output
|
||||
in the format required by POSIX.
|
||||
|
||||
41. The 'trap' builtin displays signal names without the leading
|
||||
42. The 'trap' builtin displays signal names without the leading
|
||||
'SIG'.
|
||||
|
||||
42. The 'trap' builtin doesn't check the first argument for a possible
|
||||
43. 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.
|
||||
|
||||
43. 'trap -p' without arguments displays signals whose dispositions
|
||||
44. '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.
|
||||
|
||||
44. The '.' and 'source' builtins do not search the current directory
|
||||
45. The '.' and 'source' builtins do not search the current directory
|
||||
for the filename argument if it is not found by searching 'PATH'.
|
||||
|
||||
45. Enabling POSIX mode has the effect of setting the
|
||||
46. 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.
|
||||
|
||||
46. Enabling POSIX mode has the effect of setting the 'shift_verbose'
|
||||
47. 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.
|
||||
|
||||
47. When the 'alias' builtin displays alias definitions, it does not
|
||||
48. When the 'alias' builtin displays alias definitions, it does not
|
||||
display them with a leading 'alias ' unless the '-p' option is
|
||||
supplied.
|
||||
|
||||
48. When the 'set' builtin is invoked without options, it does not
|
||||
49. When the 'set' builtin is invoked without options, it does not
|
||||
display shell function names and definitions.
|
||||
|
||||
49. When the 'set' builtin is invoked without options, it displays
|
||||
50. 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.
|
||||
|
||||
50. When the 'cd' builtin is invoked in logical mode, and the pathname
|
||||
51. 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.
|
||||
|
||||
51. When the 'cd' builtin cannot change a directory because the length
|
||||
52. 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.
|
||||
|
||||
52. The 'pwd' builtin verifies that the value it prints is the same as
|
||||
53. 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.
|
||||
|
||||
53. When listing the history, the 'fc' builtin does not include an
|
||||
54. When listing the history, the 'fc' builtin does not include an
|
||||
indication of whether or not a history entry has been modified.
|
||||
|
||||
54. The default editor used by 'fc' is 'ed'.
|
||||
55. The default editor used by 'fc' is 'ed'.
|
||||
|
||||
55. The 'type' and 'command' builtins will not report a non-executable
|
||||
56. If there are too many arguments supplied to 'fc -s', 'fc' prints
|
||||
an error message and returns failure.
|
||||
|
||||
57. 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'.
|
||||
|
||||
56. The 'vi' editing mode will invoke the 'vi' editor directly when
|
||||
58. The 'vi' editing mode will invoke the 'vi' editor directly when
|
||||
the 'v' command is run, instead of checking '$VISUAL' and
|
||||
'$EDITOR'.
|
||||
|
||||
57. When the 'xpg_echo' option is enabled, Bash does not attempt to
|
||||
59. 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.
|
||||
|
||||
58. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
|
||||
60. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
|
||||
and '-f' options.
|
||||
|
||||
59. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not
|
||||
61. 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.
|
||||
|
||||
60. The 'read' builtin may be interrupted by a signal for which a trap
|
||||
62. 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.
|
||||
|
||||
61. The 'printf' builtin uses 'double' (via 'strtod') to convert
|
||||
63. 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.
|
||||
|
||||
62. Bash removes an exited background process's status from the list
|
||||
64. Bash removes an exited background process's status from the list
|
||||
of such statuses after the 'wait' builtin is used to obtain it.
|
||||
|
||||
63. A double quote character ('"') is treated specially when it
|
||||
65. 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
|
||||
@@ -11875,8 +11899,8 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 69)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 212)
|
||||
* read: Bash Builtins. (line 492)
|
||||
* readarray: Bash Builtins. (line 589)
|
||||
* read: Bash Builtins. (line 503)
|
||||
* readarray: Bash Builtins. (line 600)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 222)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -11885,7 +11909,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 262)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 598)
|
||||
* source: Bash Builtins. (line 609)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 116)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -11894,14 +11918,14 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 360)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 366)
|
||||
* type: Bash Builtins. (line 603)
|
||||
* typeset: Bash Builtins. (line 641)
|
||||
* ulimit: Bash Builtins. (line 647)
|
||||
* type: Bash Builtins. (line 614)
|
||||
* typeset: Bash Builtins. (line 652)
|
||||
* ulimit: Bash Builtins. (line 658)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 422)
|
||||
* unalias: Bash Builtins. (line 753)
|
||||
(line 428)
|
||||
* unalias: Bash Builtins. (line 764)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 440)
|
||||
(line 446)
|
||||
* wait: Job Control Builtins.
|
||||
(line 76)
|
||||
|
||||
@@ -12565,138 +12589,138 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top894
|
||||
Node: Introduction2811
|
||||
Node: What is Bash?3024
|
||||
Node: What is a shell?4135
|
||||
Node: Definitions6670
|
||||
Node: Basic Shell Features9618
|
||||
Node: Shell Syntax10834
|
||||
Node: Shell Operation11857
|
||||
Node: Quoting13147
|
||||
Node: Escape Character14448
|
||||
Node: Single Quotes14930
|
||||
Node: Double Quotes15275
|
||||
Node: ANSI-C Quoting16550
|
||||
Node: Locale Translation17857
|
||||
Node: Creating Internationalized Scripts19165
|
||||
Node: Comments23279
|
||||
Node: Shell Commands23894
|
||||
Node: Reserved Words24829
|
||||
Node: Simple Commands25582
|
||||
Node: Pipelines26233
|
||||
Node: Lists29229
|
||||
Node: Compound Commands31021
|
||||
Node: Looping Constructs32030
|
||||
Node: Conditional Constructs34522
|
||||
Node: Command Grouping49007
|
||||
Node: Coprocesses50482
|
||||
Node: GNU Parallel53142
|
||||
Node: Shell Functions54056
|
||||
Node: Shell Parameters61938
|
||||
Node: Positional Parameters66323
|
||||
Node: Special Parameters67222
|
||||
Node: Shell Expansions70433
|
||||
Node: Brace Expansion72557
|
||||
Node: Tilde Expansion75288
|
||||
Node: Shell Parameter Expansion77906
|
||||
Node: Command Substitution96305
|
||||
Node: Arithmetic Expansion97657
|
||||
Node: Process Substitution98622
|
||||
Node: Word Splitting99739
|
||||
Node: Filename Expansion101680
|
||||
Node: Pattern Matching104426
|
||||
Node: Quote Removal109425
|
||||
Node: Redirections109717
|
||||
Node: Executing Commands119374
|
||||
Node: Simple Command Expansion120041
|
||||
Node: Command Search and Execution122148
|
||||
Node: Command Execution Environment124523
|
||||
Node: Environment127555
|
||||
Node: Exit Status129215
|
||||
Node: Signals130996
|
||||
Node: Shell Scripts134442
|
||||
Node: Shell Builtin Commands137466
|
||||
Node: Bourne Shell Builtins139501
|
||||
Node: Bash Builtins161283
|
||||
Node: Modifying Shell Behavior192671
|
||||
Node: The Set Builtin193013
|
||||
Node: The Shopt Builtin203611
|
||||
Node: Special Builtins219520
|
||||
Node: Shell Variables220496
|
||||
Node: Bourne Shell Variables220930
|
||||
Node: Bash Variables223031
|
||||
Node: Bash Features255843
|
||||
Node: Invoking Bash256853
|
||||
Node: Bash Startup Files262863
|
||||
Node: Interactive Shells267991
|
||||
Node: What is an Interactive Shell?268399
|
||||
Node: Is this Shell Interactive?269045
|
||||
Node: Interactive Shell Behavior269857
|
||||
Node: Bash Conditional Expressions273483
|
||||
Node: Shell Arithmetic278122
|
||||
Node: Aliases281063
|
||||
Node: Arrays283673
|
||||
Node: The Directory Stack290061
|
||||
Node: Directory Stack Builtins290842
|
||||
Node: Controlling the Prompt295099
|
||||
Node: The Restricted Shell298061
|
||||
Node: Bash POSIX Mode300668
|
||||
Node: Shell Compatibility Mode313227
|
||||
Node: Job Control321791
|
||||
Node: Job Control Basics322248
|
||||
Node: Job Control Builtins327247
|
||||
Node: Job Control Variables333039
|
||||
Node: Command Line Editing334192
|
||||
Node: Introduction and Notation335860
|
||||
Node: Readline Interaction337480
|
||||
Node: Readline Bare Essentials338668
|
||||
Node: Readline Movement Commands340454
|
||||
Node: Readline Killing Commands341411
|
||||
Node: Readline Arguments343329
|
||||
Node: Searching344370
|
||||
Node: Readline Init File346553
|
||||
Node: Readline Init File Syntax347811
|
||||
Node: Conditional Init Constructs371394
|
||||
Node: Sample Init File375587
|
||||
Node: Bindable Readline Commands378708
|
||||
Node: Commands For Moving379909
|
||||
Node: Commands For History381957
|
||||
Node: Commands For Text386948
|
||||
Node: Commands For Killing390594
|
||||
Node: Numeric Arguments393624
|
||||
Node: Commands For Completion394760
|
||||
Node: Keyboard Macros398948
|
||||
Node: Miscellaneous Commands399633
|
||||
Node: Readline vi Mode405575
|
||||
Node: Programmable Completion406479
|
||||
Node: Programmable Completion Builtins414256
|
||||
Node: A Programmable Completion Example425005
|
||||
Node: Using History Interactively430250
|
||||
Node: Bash History Facilities430931
|
||||
Node: Bash History Builtins433933
|
||||
Node: History Interaction438954
|
||||
Node: Event Designators442571
|
||||
Node: Word Designators443922
|
||||
Node: Modifiers445679
|
||||
Node: Installing Bash447484
|
||||
Node: Basic Installation448618
|
||||
Node: Compilers and Options452337
|
||||
Node: Compiling For Multiple Architectures453075
|
||||
Node: Installation Names454764
|
||||
Node: Specifying the System Type456870
|
||||
Node: Sharing Defaults457584
|
||||
Node: Operation Controls458254
|
||||
Node: Optional Features459209
|
||||
Node: Reporting Bugs470425
|
||||
Node: Major Differences From The Bourne Shell471766
|
||||
Node: GNU Free Documentation License488612
|
||||
Node: Indexes513786
|
||||
Node: Builtin Index514237
|
||||
Node: Reserved Word Index521061
|
||||
Node: Variable Index523506
|
||||
Node: Function Index540277
|
||||
Node: Concept Index554058
|
||||
Node: Top892
|
||||
Node: Introduction2807
|
||||
Node: What is Bash?3020
|
||||
Node: What is a shell?4131
|
||||
Node: Definitions6666
|
||||
Node: Basic Shell Features9614
|
||||
Node: Shell Syntax10830
|
||||
Node: Shell Operation11853
|
||||
Node: Quoting13143
|
||||
Node: Escape Character14444
|
||||
Node: Single Quotes14926
|
||||
Node: Double Quotes15271
|
||||
Node: ANSI-C Quoting16546
|
||||
Node: Locale Translation17853
|
||||
Node: Creating Internationalized Scripts19161
|
||||
Node: Comments23275
|
||||
Node: Shell Commands23890
|
||||
Node: Reserved Words24825
|
||||
Node: Simple Commands25578
|
||||
Node: Pipelines26229
|
||||
Node: Lists29225
|
||||
Node: Compound Commands31017
|
||||
Node: Looping Constructs32026
|
||||
Node: Conditional Constructs34518
|
||||
Node: Command Grouping49003
|
||||
Node: Coprocesses50478
|
||||
Node: GNU Parallel53138
|
||||
Node: Shell Functions54052
|
||||
Node: Shell Parameters61934
|
||||
Node: Positional Parameters66319
|
||||
Node: Special Parameters67218
|
||||
Node: Shell Expansions70429
|
||||
Node: Brace Expansion72553
|
||||
Node: Tilde Expansion75284
|
||||
Node: Shell Parameter Expansion77902
|
||||
Node: Command Substitution96301
|
||||
Node: Arithmetic Expansion97653
|
||||
Node: Process Substitution98618
|
||||
Node: Word Splitting99735
|
||||
Node: Filename Expansion101676
|
||||
Node: Pattern Matching104422
|
||||
Node: Quote Removal109421
|
||||
Node: Redirections109713
|
||||
Node: Executing Commands119370
|
||||
Node: Simple Command Expansion120037
|
||||
Node: Command Search and Execution122144
|
||||
Node: Command Execution Environment124528
|
||||
Node: Environment127560
|
||||
Node: Exit Status129220
|
||||
Node: Signals131001
|
||||
Node: Shell Scripts134447
|
||||
Node: Shell Builtin Commands137471
|
||||
Node: Bourne Shell Builtins139506
|
||||
Node: Bash Builtins161701
|
||||
Node: Modifying Shell Behavior193666
|
||||
Node: The Set Builtin194008
|
||||
Node: The Shopt Builtin204603
|
||||
Node: Special Builtins220512
|
||||
Node: Shell Variables221488
|
||||
Node: Bourne Shell Variables221922
|
||||
Node: Bash Variables224023
|
||||
Node: Bash Features256835
|
||||
Node: Invoking Bash257845
|
||||
Node: Bash Startup Files263855
|
||||
Node: Interactive Shells268983
|
||||
Node: What is an Interactive Shell?269391
|
||||
Node: Is this Shell Interactive?270037
|
||||
Node: Interactive Shell Behavior270849
|
||||
Node: Bash Conditional Expressions274475
|
||||
Node: Shell Arithmetic279114
|
||||
Node: Aliases282055
|
||||
Node: Arrays284665
|
||||
Node: The Directory Stack291053
|
||||
Node: Directory Stack Builtins291834
|
||||
Node: Controlling the Prompt296091
|
||||
Node: The Restricted Shell299053
|
||||
Node: Bash POSIX Mode301660
|
||||
Node: Shell Compatibility Mode314523
|
||||
Node: Job Control323087
|
||||
Node: Job Control Basics323544
|
||||
Node: Job Control Builtins328543
|
||||
Node: Job Control Variables334335
|
||||
Node: Command Line Editing335488
|
||||
Node: Introduction and Notation337156
|
||||
Node: Readline Interaction338776
|
||||
Node: Readline Bare Essentials339964
|
||||
Node: Readline Movement Commands341750
|
||||
Node: Readline Killing Commands342707
|
||||
Node: Readline Arguments344625
|
||||
Node: Searching345666
|
||||
Node: Readline Init File347849
|
||||
Node: Readline Init File Syntax349107
|
||||
Node: Conditional Init Constructs372690
|
||||
Node: Sample Init File376883
|
||||
Node: Bindable Readline Commands380004
|
||||
Node: Commands For Moving381205
|
||||
Node: Commands For History383253
|
||||
Node: Commands For Text388244
|
||||
Node: Commands For Killing391890
|
||||
Node: Numeric Arguments394920
|
||||
Node: Commands For Completion396056
|
||||
Node: Keyboard Macros400244
|
||||
Node: Miscellaneous Commands400929
|
||||
Node: Readline vi Mode406871
|
||||
Node: Programmable Completion407775
|
||||
Node: Programmable Completion Builtins415552
|
||||
Node: A Programmable Completion Example426301
|
||||
Node: Using History Interactively431546
|
||||
Node: Bash History Facilities432227
|
||||
Node: Bash History Builtins435229
|
||||
Node: History Interaction440250
|
||||
Node: Event Designators443867
|
||||
Node: Word Designators445218
|
||||
Node: Modifiers446975
|
||||
Node: Installing Bash448780
|
||||
Node: Basic Installation449914
|
||||
Node: Compilers and Options453633
|
||||
Node: Compiling For Multiple Architectures454371
|
||||
Node: Installation Names456060
|
||||
Node: Specifying the System Type458166
|
||||
Node: Sharing Defaults458880
|
||||
Node: Operation Controls459550
|
||||
Node: Optional Features460505
|
||||
Node: Reporting Bugs471721
|
||||
Node: Major Differences From The Bourne Shell473062
|
||||
Node: GNU Free Documentation License489908
|
||||
Node: Indexes515082
|
||||
Node: Builtin Index515533
|
||||
Node: Reserved Word Index522357
|
||||
Node: Variable Index524802
|
||||
Node: Function Index541573
|
||||
Node: Concept Index555354
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
+159
-141
@@ -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.2, 27 January 2023).
|
||||
Bash shell (version 5.2, 7 February 2023).
|
||||
|
||||
This is Edition 5.2, last updated 27 January 2023, of 'The GNU Bash
|
||||
This is Edition 5.2, last updated 7 February 2023, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.2.
|
||||
|
||||
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.2, 27 January 2023). The Bash home page is
|
||||
Bash shell (version 5.2, 7 February 2023). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.2, last updated 27 January 2023, of 'The GNU Bash
|
||||
This is Edition 5.2, last updated 7 February 2023, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.2.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -4119,7 +4119,13 @@ standard.
|
||||
Bash Builtins::).
|
||||
'%q'
|
||||
Causes 'printf' to output the corresponding ARGUMENT in a
|
||||
format that can be reused as shell input.
|
||||
format that can be reused as shell input. '%q' and '%Q'P use
|
||||
the ANSI-C quoting style (*note ANSI-C Quoting::) if any
|
||||
characters in the argument string require it, and backslash
|
||||
quoting otherwise. If the format string uses the 'printf'
|
||||
ALTERNATE FORM, these two formats quote the argument string
|
||||
using single quotes.
|
||||
|
||||
'%Q'
|
||||
like '%q', but applies any supplied precision to the ARGUMENT
|
||||
before quoting it.
|
||||
@@ -4133,14 +4139,19 @@ standard.
|
||||
conversion behaves as if -1 had been given. This is an
|
||||
exception to the usual 'printf' behavior.
|
||||
|
||||
The %b, %q, and %T directives all use the field width and precision
|
||||
arguments from the format specification and write that many bytes
|
||||
from (or use that wide a field for) the expanded argument, which
|
||||
usually contains more characters than the original.
|
||||
The %b, %q, and %T format specifiers all use the field width and
|
||||
precision arguments from the format specification and write that
|
||||
many bytes from (or use that wide a field for) the expanded
|
||||
argument, which usually contains more characters than the original.
|
||||
|
||||
The %n format specifier accepts a corresponding argument that is
|
||||
treated as a shell variable name.
|
||||
|
||||
The %s and %c format specifiers accept an l (long) modifier, which
|
||||
forces them to convert the argument string to a wide-character
|
||||
string and apply any supplied field width and precision in terms of
|
||||
characters, not bytes.
|
||||
|
||||
Arguments to non-string format specifiers are treated as C language
|
||||
constants, except that a leading plus or minus sign is allowed, and
|
||||
if the leading character is a single or double quote, the value is
|
||||
@@ -7114,50 +7125,54 @@ startup files.
|
||||
16. Function names may not be the same as one of the POSIX special
|
||||
builtins.
|
||||
|
||||
17. POSIX special builtins are found before shell functions during
|
||||
17. Even if a shell function whose name contains a slash was defined
|
||||
before entering POSIX mode, the shell will not execute a function
|
||||
whose name contains one or more slashes.
|
||||
|
||||
18. POSIX special builtins are found before shell functions during
|
||||
command lookup.
|
||||
|
||||
18. When printing shell function definitions (e.g., by 'type'), Bash
|
||||
19. When printing shell function definitions (e.g., by 'type'), Bash
|
||||
does not print the 'function' keyword.
|
||||
|
||||
19. Literal tildes that appear as the first character in elements of
|
||||
20. Literal tildes that appear as the first character in elements of
|
||||
the 'PATH' variable are not expanded as described above under *note
|
||||
Tilde Expansion::.
|
||||
|
||||
20. The 'time' reserved word may be used by itself as a command. When
|
||||
21. 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.
|
||||
|
||||
21. When parsing and expanding a ${...} expansion that appears within
|
||||
22. 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.
|
||||
|
||||
22. The parser does not recognize 'time' as a reserved word if the
|
||||
23. The parser does not recognize 'time' as a reserved word if the
|
||||
next token begins with a '-'.
|
||||
|
||||
23. The '!' character does not introduce history expansion within a
|
||||
24. The '!' character does not introduce history expansion within a
|
||||
double-quoted string, even if the 'histexpand' option is enabled.
|
||||
|
||||
24. If a POSIX special builtin returns an error status, a
|
||||
25. 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.
|
||||
|
||||
25. The 'unset' builtin with the '-v' option specified returns a fatal
|
||||
26. The 'unset' builtin with the '-v' option specified returns a fatal
|
||||
error if it attempts to unset a 'readonly' or 'non-unsettable'
|
||||
variable, or encounters a variable name argument that is an invalid
|
||||
identifier, which causes a non-interactive shell to exit.
|
||||
|
||||
26. A non-interactive shell exits with an error status if a variable
|
||||
27. 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.
|
||||
|
||||
27. A non-interactive shell exits with an error status if a variable
|
||||
28. 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. For any
|
||||
other simple command, the shell aborts execution of that command,
|
||||
@@ -7165,142 +7180,145 @@ startup files.
|
||||
perform any further processing of the command in which the error
|
||||
occurred").
|
||||
|
||||
28. A non-interactive shell exits with an error status if the
|
||||
29. 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.
|
||||
|
||||
29. Non-interactive shells exit if FILENAME in '.' FILENAME is not
|
||||
30. Non-interactive shells exit if FILENAME in '.' FILENAME is not
|
||||
found.
|
||||
|
||||
30. Non-interactive shells exit if a syntax error in an arithmetic
|
||||
31. Non-interactive shells exit if a syntax error in an arithmetic
|
||||
expansion results in an invalid expression.
|
||||
|
||||
31. Non-interactive shells exit if a parameter expansion error occurs.
|
||||
32. Non-interactive shells exit if a parameter expansion error occurs.
|
||||
|
||||
32. Non-interactive shells exit if there is a syntax error in a script
|
||||
33. 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.
|
||||
|
||||
33. While variable indirection is available, it may not be applied to
|
||||
34. While variable indirection is available, it may not be applied to
|
||||
the '#' and '?' special parameters.
|
||||
|
||||
34. Expanding the '*' special parameter in a pattern context where the
|
||||
35. Expanding the '*' special parameter in a pattern context where the
|
||||
expansion is double-quoted does not treat the '$*' as if it were
|
||||
double-quoted.
|
||||
|
||||
35. Assignment statements preceding POSIX special builtins persist in
|
||||
36. Assignment statements preceding POSIX special builtins persist in
|
||||
the shell environment after the builtin completes.
|
||||
|
||||
36. The 'command' builtin does not prevent builtins that take
|
||||
37. 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'.
|
||||
|
||||
37. The 'bg' builtin uses the required format to describe each job
|
||||
38. 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.
|
||||
|
||||
38. The output of 'kill -l' prints all the signal names on a single
|
||||
39. The output of 'kill -l' prints all the signal names on a single
|
||||
line, separated by spaces, without the 'SIG' prefix.
|
||||
|
||||
39. The 'kill' builtin does not accept signal names with a 'SIG'
|
||||
40. The 'kill' builtin does not accept signal names with a 'SIG'
|
||||
prefix.
|
||||
|
||||
40. The 'export' and 'readonly' builtin commands display their output
|
||||
41. The 'export' and 'readonly' builtin commands display their output
|
||||
in the format required by POSIX.
|
||||
|
||||
41. The 'trap' builtin displays signal names without the leading
|
||||
42. The 'trap' builtin displays signal names without the leading
|
||||
'SIG'.
|
||||
|
||||
42. The 'trap' builtin doesn't check the first argument for a possible
|
||||
43. 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.
|
||||
|
||||
43. 'trap -p' without arguments displays signals whose dispositions
|
||||
44. '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.
|
||||
|
||||
44. The '.' and 'source' builtins do not search the current directory
|
||||
45. The '.' and 'source' builtins do not search the current directory
|
||||
for the filename argument if it is not found by searching 'PATH'.
|
||||
|
||||
45. Enabling POSIX mode has the effect of setting the
|
||||
46. 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.
|
||||
|
||||
46. Enabling POSIX mode has the effect of setting the 'shift_verbose'
|
||||
47. 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.
|
||||
|
||||
47. When the 'alias' builtin displays alias definitions, it does not
|
||||
48. When the 'alias' builtin displays alias definitions, it does not
|
||||
display them with a leading 'alias ' unless the '-p' option is
|
||||
supplied.
|
||||
|
||||
48. When the 'set' builtin is invoked without options, it does not
|
||||
49. When the 'set' builtin is invoked without options, it does not
|
||||
display shell function names and definitions.
|
||||
|
||||
49. When the 'set' builtin is invoked without options, it displays
|
||||
50. 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.
|
||||
|
||||
50. When the 'cd' builtin is invoked in logical mode, and the pathname
|
||||
51. 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.
|
||||
|
||||
51. When the 'cd' builtin cannot change a directory because the length
|
||||
52. 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.
|
||||
|
||||
52. The 'pwd' builtin verifies that the value it prints is the same as
|
||||
53. 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.
|
||||
|
||||
53. When listing the history, the 'fc' builtin does not include an
|
||||
54. When listing the history, the 'fc' builtin does not include an
|
||||
indication of whether or not a history entry has been modified.
|
||||
|
||||
54. The default editor used by 'fc' is 'ed'.
|
||||
55. The default editor used by 'fc' is 'ed'.
|
||||
|
||||
55. The 'type' and 'command' builtins will not report a non-executable
|
||||
56. If there are too many arguments supplied to 'fc -s', 'fc' prints
|
||||
an error message and returns failure.
|
||||
|
||||
57. 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'.
|
||||
|
||||
56. The 'vi' editing mode will invoke the 'vi' editor directly when
|
||||
58. The 'vi' editing mode will invoke the 'vi' editor directly when
|
||||
the 'v' command is run, instead of checking '$VISUAL' and
|
||||
'$EDITOR'.
|
||||
|
||||
57. When the 'xpg_echo' option is enabled, Bash does not attempt to
|
||||
59. 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.
|
||||
|
||||
58. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
|
||||
60. The 'ulimit' builtin uses a block size of 512 bytes for the '-c'
|
||||
and '-f' options.
|
||||
|
||||
59. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not
|
||||
61. 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.
|
||||
|
||||
60. The 'read' builtin may be interrupted by a signal for which a trap
|
||||
62. 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.
|
||||
|
||||
61. The 'printf' builtin uses 'double' (via 'strtod') to convert
|
||||
63. 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.
|
||||
|
||||
62. Bash removes an exited background process's status from the list
|
||||
64. Bash removes an exited background process's status from the list
|
||||
of such statuses after the 'wait' builtin is used to obtain it.
|
||||
|
||||
63. A double quote character ('"') is treated specially when it
|
||||
65. 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
|
||||
@@ -11882,8 +11900,8 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 69)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 212)
|
||||
* read: Bash Builtins. (line 492)
|
||||
* readarray: Bash Builtins. (line 589)
|
||||
* read: Bash Builtins. (line 503)
|
||||
* readarray: Bash Builtins. (line 600)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 222)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -11892,7 +11910,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 262)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 598)
|
||||
* source: Bash Builtins. (line 609)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 116)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -11901,12 +11919,12 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 360)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 366)
|
||||
* type: Bash Builtins. (line 603)
|
||||
* typeset: Bash Builtins. (line 641)
|
||||
* ulimit: Bash Builtins. (line 647)
|
||||
* type: Bash Builtins. (line 614)
|
||||
* typeset: Bash Builtins. (line 652)
|
||||
* ulimit: Bash Builtins. (line 658)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 428)
|
||||
* unalias: Bash Builtins. (line 753)
|
||||
* unalias: Bash Builtins. (line 764)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 446)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -12626,84 +12644,84 @@ Node: Shell Scripts134600
|
||||
Node: Shell Builtin Commands137627
|
||||
Node: Bourne Shell Builtins139665
|
||||
Node: Bash Builtins161863
|
||||
Node: Modifying Shell Behavior193254
|
||||
Node: The Set Builtin193599
|
||||
Node: The Shopt Builtin204197
|
||||
Node: Special Builtins220109
|
||||
Node: Shell Variables221088
|
||||
Node: Bourne Shell Variables221525
|
||||
Node: Bash Variables223629
|
||||
Node: Bash Features256444
|
||||
Node: Invoking Bash257457
|
||||
Node: Bash Startup Files263470
|
||||
Node: Interactive Shells268601
|
||||
Node: What is an Interactive Shell?269012
|
||||
Node: Is this Shell Interactive?269661
|
||||
Node: Interactive Shell Behavior270476
|
||||
Node: Bash Conditional Expressions274105
|
||||
Node: Shell Arithmetic278747
|
||||
Node: Aliases281691
|
||||
Node: Arrays284304
|
||||
Node: The Directory Stack290695
|
||||
Node: Directory Stack Builtins291479
|
||||
Node: Controlling the Prompt295739
|
||||
Node: The Restricted Shell298704
|
||||
Node: Bash POSIX Mode301314
|
||||
Node: Shell Compatibility Mode313876
|
||||
Node: Job Control322443
|
||||
Node: Job Control Basics322903
|
||||
Node: Job Control Builtins327905
|
||||
Node: Job Control Variables333700
|
||||
Node: Command Line Editing334856
|
||||
Node: Introduction and Notation336527
|
||||
Node: Readline Interaction338150
|
||||
Node: Readline Bare Essentials339341
|
||||
Node: Readline Movement Commands341130
|
||||
Node: Readline Killing Commands342090
|
||||
Node: Readline Arguments344011
|
||||
Node: Searching345055
|
||||
Node: Readline Init File347241
|
||||
Node: Readline Init File Syntax348502
|
||||
Node: Conditional Init Constructs372088
|
||||
Node: Sample Init File376284
|
||||
Node: Bindable Readline Commands379408
|
||||
Node: Commands For Moving380612
|
||||
Node: Commands For History382663
|
||||
Node: Commands For Text387657
|
||||
Node: Commands For Killing391306
|
||||
Node: Numeric Arguments394339
|
||||
Node: Commands For Completion395478
|
||||
Node: Keyboard Macros399669
|
||||
Node: Miscellaneous Commands400357
|
||||
Node: Readline vi Mode406302
|
||||
Node: Programmable Completion407209
|
||||
Node: Programmable Completion Builtins414989
|
||||
Node: A Programmable Completion Example425741
|
||||
Node: Using History Interactively430989
|
||||
Node: Bash History Facilities431673
|
||||
Node: Bash History Builtins434678
|
||||
Node: History Interaction439702
|
||||
Node: Event Designators443322
|
||||
Node: Word Designators444676
|
||||
Node: Modifiers446436
|
||||
Node: Installing Bash448244
|
||||
Node: Basic Installation449381
|
||||
Node: Compilers and Options453103
|
||||
Node: Compiling For Multiple Architectures453844
|
||||
Node: Installation Names455536
|
||||
Node: Specifying the System Type457645
|
||||
Node: Sharing Defaults458362
|
||||
Node: Operation Controls459035
|
||||
Node: Optional Features459993
|
||||
Node: Reporting Bugs471212
|
||||
Node: Major Differences From The Bourne Shell472556
|
||||
Node: GNU Free Documentation License489405
|
||||
Node: Indexes514582
|
||||
Node: Builtin Index515036
|
||||
Node: Reserved Word Index521863
|
||||
Node: Variable Index524311
|
||||
Node: Function Index541085
|
||||
Node: Concept Index554869
|
||||
Node: Modifying Shell Behavior193831
|
||||
Node: The Set Builtin194176
|
||||
Node: The Shopt Builtin204774
|
||||
Node: Special Builtins220686
|
||||
Node: Shell Variables221665
|
||||
Node: Bourne Shell Variables222102
|
||||
Node: Bash Variables224206
|
||||
Node: Bash Features257021
|
||||
Node: Invoking Bash258034
|
||||
Node: Bash Startup Files264047
|
||||
Node: Interactive Shells269178
|
||||
Node: What is an Interactive Shell?269589
|
||||
Node: Is this Shell Interactive?270238
|
||||
Node: Interactive Shell Behavior271053
|
||||
Node: Bash Conditional Expressions274682
|
||||
Node: Shell Arithmetic279324
|
||||
Node: Aliases282268
|
||||
Node: Arrays284881
|
||||
Node: The Directory Stack291272
|
||||
Node: Directory Stack Builtins292056
|
||||
Node: Controlling the Prompt296316
|
||||
Node: The Restricted Shell299281
|
||||
Node: Bash POSIX Mode301891
|
||||
Node: Shell Compatibility Mode314757
|
||||
Node: Job Control323324
|
||||
Node: Job Control Basics323784
|
||||
Node: Job Control Builtins328786
|
||||
Node: Job Control Variables334581
|
||||
Node: Command Line Editing335737
|
||||
Node: Introduction and Notation337408
|
||||
Node: Readline Interaction339031
|
||||
Node: Readline Bare Essentials340222
|
||||
Node: Readline Movement Commands342011
|
||||
Node: Readline Killing Commands342971
|
||||
Node: Readline Arguments344892
|
||||
Node: Searching345936
|
||||
Node: Readline Init File348122
|
||||
Node: Readline Init File Syntax349383
|
||||
Node: Conditional Init Constructs372969
|
||||
Node: Sample Init File377165
|
||||
Node: Bindable Readline Commands380289
|
||||
Node: Commands For Moving381493
|
||||
Node: Commands For History383544
|
||||
Node: Commands For Text388538
|
||||
Node: Commands For Killing392187
|
||||
Node: Numeric Arguments395220
|
||||
Node: Commands For Completion396359
|
||||
Node: Keyboard Macros400550
|
||||
Node: Miscellaneous Commands401238
|
||||
Node: Readline vi Mode407183
|
||||
Node: Programmable Completion408090
|
||||
Node: Programmable Completion Builtins415870
|
||||
Node: A Programmable Completion Example426622
|
||||
Node: Using History Interactively431870
|
||||
Node: Bash History Facilities432554
|
||||
Node: Bash History Builtins435559
|
||||
Node: History Interaction440583
|
||||
Node: Event Designators444203
|
||||
Node: Word Designators445557
|
||||
Node: Modifiers447317
|
||||
Node: Installing Bash449125
|
||||
Node: Basic Installation450262
|
||||
Node: Compilers and Options453984
|
||||
Node: Compiling For Multiple Architectures454725
|
||||
Node: Installation Names456417
|
||||
Node: Specifying the System Type458526
|
||||
Node: Sharing Defaults459243
|
||||
Node: Operation Controls459916
|
||||
Node: Optional Features460874
|
||||
Node: Reporting Bugs472093
|
||||
Node: Major Differences From The Bourne Shell473437
|
||||
Node: GNU Free Documentation License490286
|
||||
Node: Indexes515463
|
||||
Node: Builtin Index515917
|
||||
Node: Reserved Word Index522744
|
||||
Node: Variable Index525192
|
||||
Node: Function Index541966
|
||||
Node: Concept Index555750
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
+15
-1
@@ -4885,6 +4885,12 @@ corresponding @var{argument} in the same way as @code{echo -e}
|
||||
@item %q
|
||||
Causes @code{printf} to output the
|
||||
corresponding @var{argument} in a format that can be reused as shell input.
|
||||
@code{%q} and @code{%Q}P use the ANSI-C quoting style (@pxref{ANSI-C Quoting})
|
||||
if any characters
|
||||
in the argument string require it, and backslash quoting otherwise.
|
||||
If the format string uses the @code{printf} @var{alternate form}, these two
|
||||
formats quote the argument string using single quotes.
|
||||
|
||||
@item %Q
|
||||
like @code{%q}, but applies any supplied precision to the @var{argument}
|
||||
before quoting it.
|
||||
@@ -4900,7 +4906,7 @@ This is an exception to the usual @code{printf} behavior.
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
The %b, %q, and %T directives all use the field width and precision
|
||||
The %b, %q, and %T format specifiers all use the field width and precision
|
||||
arguments from the format specification and write that many bytes from
|
||||
(or use that wide a field for) the expanded argument, which usually
|
||||
contains more characters than the original.
|
||||
@@ -4908,6 +4914,10 @@ contains more characters than the original.
|
||||
The %n format specifier accepts a corresponding argument that is treated
|
||||
as a shell variable name.
|
||||
|
||||
The %s and %c format specifiers accept an l (long) modifier, which forces
|
||||
them to convert the argument string to a wide-character string and apply
|
||||
any supplied field width and precision in terms of characters, not bytes.
|
||||
|
||||
Arguments to non-string format specifiers are treated as C language constants,
|
||||
except that a leading plus or minus sign is allowed, and if the leading
|
||||
character is a single or double quote, the value is the ASCII value of
|
||||
@@ -8423,6 +8433,10 @@ indication of whether or not a history entry has been modified.
|
||||
@item
|
||||
The default editor used by @code{fc} is @code{ed}.
|
||||
|
||||
@item
|
||||
If there are too many arguments supplied to @code{fc -s}, @code{fc} prints
|
||||
an error message and returns failure.
|
||||
|
||||
@item
|
||||
The @code{type} and @code{command} builtins will not report a non-executable
|
||||
file as having been found, though the shell will attempt to execute such a
|
||||
|
||||
+559
-548
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -2,10 +2,10 @@
|
||||
Copyright (C) 1988-2023 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Fri Jan 27 15:17:14 EST 2023
|
||||
@set LASTCHANGE Tue Feb 7 15:46:55 EST 2023
|
||||
|
||||
@set EDITION 5.2
|
||||
@set VERSION 5.2
|
||||
|
||||
@set UPDATED 27 January 2023
|
||||
@set UPDATED-MONTH January 2023
|
||||
@set UPDATED 7 February 2023
|
||||
@set UPDATED-MONTH February 2023
|
||||
|
||||
@@ -479,6 +479,10 @@ b_fill_buffer (BUFFERED_STREAM *bp)
|
||||
off_t o;
|
||||
|
||||
CHECK_TERMSIG;
|
||||
|
||||
if (bp->b_flag & B_ERROR) /* try making read errors `sticky' */
|
||||
return EOF;
|
||||
|
||||
/* In an environment where text and binary files are treated differently,
|
||||
compensate for lseek() on text files returning an offset different from
|
||||
the count of characters read() returns. Text-mode streams have to be
|
||||
|
||||
@@ -67,6 +67,10 @@ extern int bash_input_fd_changed;
|
||||
#define beof(bp) (((bp)->b_flag & B_EOF) != 0)
|
||||
#define berror(bp) (((bp)->b_flag & B_ERROR) != 0)
|
||||
|
||||
#undef bclearerror
|
||||
|
||||
#define bclearerror(bp) ((bp)->b_flag &= ~(B_ERROR|B_EOF))
|
||||
|
||||
#endif /* BUFFERED_INPUT */
|
||||
|
||||
typedef union {
|
||||
|
||||
@@ -176,7 +176,7 @@ static int yy_stream_unget (int);
|
||||
|
||||
static int shell_getc (int);
|
||||
static void shell_ungetc (int);
|
||||
static void discard_until (int);
|
||||
static int discard_until (int);
|
||||
|
||||
static void push_string (char *, int, alias_t *);
|
||||
static void pop_string (void);
|
||||
@@ -2822,7 +2822,7 @@ shell_ungetchar (void)
|
||||
|
||||
/* Discard input until CHARACTER is seen, then push that character back
|
||||
onto the input stream. */
|
||||
static void
|
||||
static int
|
||||
discard_until (int character)
|
||||
{
|
||||
int c;
|
||||
@@ -2832,6 +2832,7 @@ discard_until (int character)
|
||||
|
||||
if (c != EOF)
|
||||
shell_ungetc (c);
|
||||
return (c);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3440,7 +3441,13 @@ read_token (int command)
|
||||
{
|
||||
/* A comment. Discard until EOL or EOF, and then return a newline. */
|
||||
parser_state |= PST_COMMENT;
|
||||
discard_until ('\n');
|
||||
character = discard_until ('\n');
|
||||
if (character == EOF)
|
||||
{
|
||||
parser_state &= ~PST_COMMENT;
|
||||
EOF_Reached = 1;
|
||||
return (yacc_EOF); /* XXX */
|
||||
}
|
||||
shell_getc (0);
|
||||
parser_state &= ~PST_COMMENT;
|
||||
character = '\n'; /* this will take the next if statement and return. */
|
||||
|
||||
Reference in New Issue
Block a user