changes to terminate_current_pipeline; fix for adding incomplete command substitutions to the history list; fix dotglob and compgen interaction

This commit is contained in:
Chet Ramey
2023-03-22 10:27:41 -04:00
parent 4c2b574c00
commit f539a75606
9 changed files with 234 additions and 71 deletions
+69 -12
View File
@@ -3030,7 +3030,7 @@ before the standard output was redirected to @var{dirlist}.
Bash handles several filenames specially when they are used in
redirections, as described in the following table.
If the operating system on which Bash is running provides these
special files, bash will use them; otherwise it will emulate them
special files, Bash will use them; otherwise it will emulate them
internally with the behavior described below.
@table @code
@@ -5690,7 +5690,7 @@ completed.
This means that dollar signs in variable names that expand to directories
will not be quoted;
however, any dollar signs appearing in filenames will not be quoted, either.
This is active only when bash is using backslashes to quote completed
This is active only when Bash is using backslashes to quote completed
filenames.
This variable is set by default, which is the default Bash behavior in
versions through 4.2.
@@ -6119,7 +6119,7 @@ subsequently reset.
@item BASH_ARGC
An array variable whose values are the number of parameters in each
frame of the current bash execution call stack. The number of
frame of the current Bash execution call stack. The number of
parameters to the current subroutine (shell function or script executed
with @code{.} or @code{source}) is at the top of the stack. When a
subroutine is executed, the number of parameters passed is pushed onto
@@ -6133,7 +6133,7 @@ or referencing this variable when @code{extdebug} is not set,
may result in inconsistent values.
@item BASH_ARGV
An array variable containing all of the parameters in the current bash
An array variable containing all of the parameters in the current Bash
execution call stack. The final parameter of the last subroutine call
is at the top of the stack; the first parameter of the initial call is
at the bottom. When a subroutine is executed, the parameters supplied
@@ -8166,9 +8166,62 @@ such as @code{jails}, @code{zones}, or @code{containers}.
@node Bash POSIX Mode
@section Bash POSIX Mode
@section Bash and POSIX
@subsection What is POSIX?
@cindex POSIX description
@sc{posix} is the name for a family of standards based on Unix.
A number of Unix services, tools, and functions are part of the standard,
ranging from the basic system calls and C library functions to common
applications and tools to system administration and management.
The @sc{posix} Shell and Utilities standard was originally developed by
IEEE Working Group 1003.2 (POSIX.2).
The first edition of the 1003.2 standard was published in 1992.
It was merged with the original IEEE 1003.1 Working Group and is
currently maintained by the Austin Group (a joint working group of the
IEEE, The Open Group and ISO/IEC SC22/WG15).
Today the Shell and Utilities are a volume within the set of documents that
make up IEEE Std 1003.1-2017, and thus the former POSIX.2 (from 1992)
is now part of the current unified @sc{posix} standard.
The Shell and Utilities volume concentrates on the command
interpreter interface and utility programs commonly executed from
the command line or by other programs.
The standard is freely available on the web at
@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html}.
Bash is concerned with the aspects of the shell's behavior defined
by the @sc{posix} Shell and Utilities volume. The shell command
language has of course been standardized, including the basic flow
control and program execution constructs, I/O redirection and
pipelines, argument handling, variable expansion, and quoting.
The @i{special} builtins, which must be implemented as part of the
shell to provide the desired functionality, are specified as
being part of the shell; examples of these are @code{eval} and
@code{export}.
Other utilities appear in the sections of POSIX not
devoted to the shell which are commonly (and in some cases must
be) implemented as builtin commands, such as
@code{read} and @code{test}.
POSIX also specifies aspects of the shell's interactive
behavior, including job control and command
line editing.
Only vi-style line editing commands have been
standardized; emacs editing commands were left out due to
objections.
@subsection Bash POSIX Mode
@cindex POSIX Mode
Although Bash is an implementation of the @sc{posix} shell
specification, there are areas where the Bash default behavior
differs from the specification.
The Bash @dfn{posix mode} changes the Bash
behavior in these areas so that it conforms to the standard more closely.
Starting Bash with the @option{--posix} command-line option or executing
@samp{set -o posix} while Bash is running will cause Bash to conform more
closely to the @sc{posix} standard by changing the behavior to
@@ -8521,6 +8574,10 @@ The @code{fc} builtin checks @code{$EDITOR} as a program to edit history
entries if @code{FCEDIT} is unset, rather than defaulting directly to
@code{ed}. @code{fc} uses @code{ed} if @code{EDITOR} is unset.
@item
A non-interactive shell does not exit if a variable assignment preceding
the @code{command} builtin or another non-special builtin fails.
@item
As noted above, Bash requires the @code{xpg_echo} option to be enabled for
the @code{echo} builtin to be fully conformant.
@@ -9172,7 +9229,7 @@ at the Bash prompt in your Bash source directory.
If you want to build Bash in a directory separate from the source
directory -- to build for multiple architectures, for example --
just use the full path to the configure script. The following commands
will build bash in a directory under @file{/usr/local/build} from
will build Bash in a directory under @file{/usr/local/build} from
the source code in @file{/usr/local/src/bash-4.4}:
@example
@@ -9274,7 +9331,7 @@ or by specifying a value for the @env{prefix} @samp{make}
variable when running @samp{make install}
(e.g., @samp{make install prefix=@var{PATH}}).
The @env{prefix} variable provides a default for @env{exec_prefix} and
other variables used when installing bash.
other variables used when installing Bash.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.
@@ -9288,7 +9345,7 @@ you can specify these variables as arguments to @code{make}:
@samp{make install exec_prefix=/} will install @code{bash} and
@code{bashbug} into @file{/bin} instead of the default @file{/usr/local/bin}.
If you want to see the files bash will install and where it will install
If you want to see the files Bash will install and where it will install
them without changing anything on your system, specify the variable
@env{DESTDIR} as an argument to @code{make}. Its value should be the
absolute directory path you'd like to use as the root of your sample
@@ -9443,7 +9500,7 @@ compiled, linked, and installed, rather than changing run-time features.
@table @code
@item --enable-largefile
Enable support for @uref{http://www.unix.org/version2/whatsnew/lfs20mar.html,
Enable support for @url{http://www.unix.org/version2/whatsnew/lfs20mar.html,
large files} if the operating system requires special compiler options
to build programs which can access large files. This is enabled by
default, if the operating system provides large file support.
@@ -9482,7 +9539,7 @@ Allow alias expansion and include the @code{alias} and @code{unalias}
builtins (@pxref{Aliases}).
@item --enable-alt-array-implementation
This builds bash using an alternate implementation of arrays
This builds Bash using an alternate implementation of arrays
(@pxref{Arrays}) that provides faster access at the expense of using
more memory (sometimes many times more, depending on how sparse an array is).
@@ -9532,7 +9589,7 @@ Include support for coprocesses and the @code{coproc} reserved word
(@pxref{Pipelines}).
@item --enable-debugger
Include support for the bash debugger (distributed separately).
Include support for the Bash debugger (distributed separately).
@item --enable-dev-fd-stat-broken
If calling @code{stat} on /dev/fd/@var{N} returns different results than
@@ -9676,7 +9733,7 @@ The latest version of Bash is always available for FTP from
Once you have determined that a bug actually exists, use the
@code{bashbug} command to submit a bug report or use the form at the
<a href="https://savannah.gnu.org/projects/bash/">Bash project page</a>.
@uref{https://savannah.gnu.org/projects/bash/,Bash project page}.
If you have a fix, you are encouraged to submit that as well!
Suggestions and `philosophical' bug reports may be mailed
to @email{bug-bash@@gnu.org} or @email{help-bash@@gnu.org}.