of @cite{The GNU Bash Reference Manual},
for @code{Bash}, Version @value{VERSION}.
-Copyright @copyright{} 1988-2004 Free Software Foundation, Inc.
+Copyright @copyright{} 1988-2005 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@menu
* Introduction:: An introduction to the shell.
-
* Definitions:: Some definitions used in the rest of this
manual.
-
* Basic Shell Features:: The shell "building blocks".
-
* Shell Builtin Commands:: Commands that are a part of the shell.
-
* Shell Variables:: Variables used or set by Bash.
-
* Bash Features:: Features found only in Bash.
-
-* Job Control:: A chapter describing what job control is
- and how Bash allows you to use it.
-
-* Using History Interactively:: Chapter dealing with history expansion
- rules.
-
+* Job Control:: What job control is and how Bash allows you
+ to use it.
+* Using History Interactively:: Command History Expansion
* Command Line Editing:: Chapter describing the command line
editing features.
-
* Installing Bash:: How to build and install Bash on your system.
-
* Reporting Bugs:: How to report bugs in Bash.
-
* Major Differences From The Bourne Shell:: A terse list of the differences
between Bash and historical
versions of /bin/sh.
-
* Copying This Manual:: Copying this manual.
-
* Builtin Index:: Index of Bash builtin commands.
-
* Reserved Word Index:: Index of Bash reserved words.
-
* Variable Index:: Quick reference helps you find the
variable you want.
-
* Function Index:: Index of bindable Readline functions.
-
* Concept Index:: General index for concepts described in
this manual.
@end menu
@chapter Introduction
@menu
* What is Bash?:: A short description of Bash.
-
* What is a shell?:: A brief introduction to shells.
@end menu
@section Shell Syntax
@menu
* Shell Operation:: The basic operation of the shell.
-
* Quoting:: How to remove the special meaning from characters.
-
* Comments:: How to specify comments.
@end menu
* Double Quotes:: How to suppress most of the interpretation of a
sequence of characters.
* ANSI-C Quoting:: How to expand ANSI-C sequences in quoted strings.
-
* Locale Translation:: How to translate strings into different languages.
@end menu
Each of the shell metacharacters (@pxref{Definitions})
has special meaning to the shell and must be quoted if it is to
represent itself.
-When the command history expansion facilities are being used, the
+When the command history expansion facilities are being used
+(@pxref{History Interaction}), the
@var{history expansion} character, usually @samp{!}, must be quoted
to prevent history expansion. @xref{Bash History Facilities}, for
more details concerning history expansion.
Enclosing characters in double quotes (@samp{"}) preserves the literal value
of all characters within the quotes, with the exception of
-@samp{$}, @samp{`}, and @samp{\}.
+@samp{$}, @samp{`}, @samp{\},
+and, when history expansion is enabled, @samp{!}.
The characters @samp{$} and @samp{`}
retain their special meaning within double quotes (@pxref{Shell Expansions}).
The backslash retains its special meaning only when followed by one of
special meaning are left unmodified.
A double quote may be quoted within double quotes by preceding it with
a backslash.
-When command history is being used, the double quote may not be used to
-quote the history expansion character.
+If enabled, history expansion will be performed unless an @samp{!}
+appearing in double quotes is escaped using a backslash.
+The backslash preceding the @samp{!} is not removed.
The special parameters @samp{*} and @samp{@@} have special meaning
when in double quotes (@pxref{Shell Parameter Expansion}).
@code{case} will selectively execute the @var{command-list} corresponding to
the first @var{pattern} that matches @var{word}.
+If the shell option @code{nocasematch}
+(see the description of @code{shopt} in @ref{Bash Builtins})
+is enabled, the match is performed without regard to the case
+of alphabetic characters.
The @samp{|} is used to separate multiple patterns, and the @samp{)}
operator terminates a pattern list.
A list of patterns and an associated command-list is known
When the @samp{==} and @samp{!=} operators are used, the string to the
right of the operator is considered a pattern and matched according
to the rules described below in @ref{Pattern Matching}.
+If the shell option @code{nocasematch}
+(see the description of @code{shopt} in @ref{Bash Builtins})
+is enabled, the match is performed without regard to the case
+of alphabetic characters.
The return value is 0 if the string matches or does not match
the pattern, respectively, and 1 otherwise.
Any part of the pattern may be quoted to force it to be matched as a
the pattern, and 1 otherwise.
If the regular expression is syntactically incorrect, the conditional
expression's return value is 2.
-If the shell option @code{nocaseglob}
+If the shell option @code{nocasematch}
(see the description of @code{shopt} in @ref{Bash Builtins})
is enabled, the match is performed without regard to the case
of alphabetic characters.
name of the function while the function is executing.
All other aspects of the shell execution
environment are identical between a function and its caller
-with the exception that the @env{DEBUG} trap
-below) is not inherited unless the function has been given the
+with the exception that the @env{DEBUG} and @env{RETURN} traps
+are not inherited unless the function has been given the
@code{trace} attribute using the @code{declare} builtin or
the @code{-o functrace} option has been enabled with
the @code{set} builtin,
-(in which case all functions inherit the @code{DEBUG} trap).
+(in which case all functions inherit the @env{DEBUG} and @env{RETURN} traps).
@xref{Bourne Shell Builtins}, for the description of the
@code{trap} builtin.
@code{declare}, @code{typeset}, @code{export}, @code{readonly},
and @code{local} builtin commands.
+In the context where an assignment statement is assigning a value
+to a shell variable or array index (@pxref{Arrays}), the @samp{+=}
+operator can be used to
+append to or add to the variable's previous value.
+When @samp{+=} is applied to a variable for which the integer attribute
+has been set, @var{value} is evaluated as an arithmetic expression and
+added to the variable's current value, which is also evaluated.
+When @samp{+=} is applied to an array variable using compound assignment
+(@pxref{Arrays}), the
+variable's value is not unset (as it is when using @samp{=}), and new
+values are appended to the array beginning at one greater than the array's
+maximum index.
+When applied to a string-valued variable, @var{value} is expanded and
+appended to the variable's value.
+
@node Positional Parameters
@subsection Positional Parameters
@cindex parameters, positional
expansion occurs within double quotes, each parameter expands to a
separate word. That is, @code{"$@@"} is equivalent to
@code{"$1" "$2" @dots{}}.
+If the double-quoted expansion occurs within a word, the expansion of
+the first parameter is joined with the beginning part of the original
+word, and the expansion of the last parameter is joined with the last
+part of the original word.
When there are no positional parameters, @code{"$@@"} and
@code{$@@}
expand to nothing (i.e., they are removed).
@item _
(An underscore.)
-At shell startup, set to the absolute filename of the shell or shell
-script being executed as passed in the argument list.
+At shell startup, set to the absolute pathname used to invoke the
+shell or shell script being executed as passed in the environment
+or argument list.
Subsequently, expands to the last argument to the previous command,
after expansion.
-Also set to the full pathname of each command executed and placed in
-the environment exported to that command.
+Also set to the full pathname used to invoke each command executed
+and placed in the environment exported to that command.
When checking mail, this parameter holds the name of the mail file.
@end vtable
left unchanged.
Each variable assignment is checked for unquoted tilde-prefixes immediately
-following a @samp{:} or @samp{=}.
+following a @samp{:} or the first @samp{=}.
In these cases, tilde expansion is also performed.
Consequently, one may use file names with tildes in assignments to
@env{PATH}, @env{MAILPATH}, and @env{CDPATH},
If @var{parameter} is an array name indexed by @samp{@@} or @samp{*},
the result is the @var{length}
members of the array beginning with @code{$@{@var{parameter}[@var{offset}]@}}.
+A negative @var{offset} is taken relative to one greater than the maximum
+index of the specified array.
+Note that a negative offset must be separated from the colon by at least
+one space to avoid being confused with the @samp{:-} expansion.
Substring indexing is zero-based unless the positional parameters
are used, in which case the indexing starts at 1.
Matches one or more occurrences of the given patterns.
@item @@(@var{pattern-list})
-Matches exactly one of the given patterns.
+Matches one of the given patterns.
@item !(@var{pattern-list})
Matches anything except one of the given patterns.
A failure to open or create a file causes the redirection to fail.
+Redirections using file descriptors greater than 9 should be used with
+care, as they may conflict with file descriptors the shell uses
+internally.
+
@subsection Redirecting Input
Redirection of input causes the file whose name results from
the expansion of @var{word}
@menu
* Simple Command Expansion:: How Bash expands simple commands before
executing them.
-
* Command Search and Execution:: How Bash finds commands and runs them.
-
* Command Execution Environment:: The environment in which Bash
executes commands that are not
shell builtins.
-
* Environment:: The environment given to a command.
-
* Exit Status:: The status returned by commands and how Bash
interprets it.
-
* Signals:: What happens when Bash or a command it runs
receives a signal.
-
@end menu
@node Simple Command Expansion
Unless otherwise noted, each builtin command documented as accepting
options preceded by @samp{-} accepts @samp{--}
to signify the end of the options.
+For example, the @code{:}, @code{true}, @code{false}, and @code{test}
+builtins do not accept options.
@node Bourne Shell Builtins
@section Bourne Shell Builtins
Each operator and operand must be a separate argument.
Expressions are composed of the primaries described below in
@ref{Bash Conditional Expressions}.
+@code{test} does not accept any options, nor does it accept and ignore
+an argument of @option{--} as signifying the end of options.
When the @code{[} form is used, the last argument to the command must
be a @code{]}.
@item -t
Give each @var{name} the @code{trace} attribute.
-Traced functions inherit the @code{DEBUG} trap from the calling shell.
+Traced functions inherit the @code{DEBUG} and @code{RETURN} traps from
+the calling shell.
The trace attribute has no special meaning for variables.
@item -x
The @code{xpg_echo} shell option may be used to
dynamically determine whether or not @code{echo} expands these
escape characters by default.
+@code{echo} does not interpret @option{--} to mean the end of options.
+
@code{echo} interprets the following escape sequences:
@table @code
@item \a
@item printf
@btindex printf
@example
-@code{printf} @var{format} [@var{arguments}]
+@code{printf} [-v @var{var}] @var{format} [@var{arguments}]
@end example
Write the formatted @var{arguments} to the standard output under the
control of the @var{format}.
and @samp{%q} causes @code{printf} to output the
corresponding @var{argument} in a format that can be reused as shell input.
+The @option{-v} option causes the output to be assigned to the variable
+@var{var} rather than being printed to the standard output.
+
The @var{format} is reused as necessary to consume all of the @var{arguments}.
If the @var{format} requires more @var{arguments} than are supplied, the
extra format specifications behave as if a zero value or null string, as
shell is executing in a subroutine (a shell function or a shell script
executed by the @code{.} or @code{source} builtins), a call to
@code{return} is simulated.
+
+@item
+@code{BASH_ARGC} and @code{BASH_ARGV} are updated as described in their
+descriptions (@pxref{Bash Variables}).
+
+@item
+Function tracing is enabled: command substitution, shell functions, and
+subshells invoked with @code{( @var{command} )} inherit the
+@code{DEBUG} and @code{RETURN} traps.
+
+@item
+Error tracing is enabled: command substitution, shell functions, and
+subshells invoked with @code{( @var{command} )} inherit the
+@code{ERROR} trap.
@end enumerate
@item extglob
If set, Bash matches filenames in a case-insensitive fashion when
performing filename expansion.
+@item nocasematch
+If set, Bash matches patterns in a case-insensitive fashion when
+performing matching while executing @code{case} or @code{[[}
+conditional commands.
+
@item nullglob
If set, Bash allows filename patterns which match no
files to expand to a null string, rather than themselves.
If no options or arguments are supplied, @code{set} displays the names
and values of all shell variables and functions, sorted according to the
-current locale, in a format that may be reused as input.
+current locale, in a format that may be reused as input
+for setting or resetting the currently-set variables.
+Read-only variables cannot be reset.
+In @sc{posix} mode, only shell variables are listed.
When options are supplied, they set or unset shell attributes.
Options, if specified, have the following meanings:
@end example
@item -T
-If set, any trap on @code{DEBUG} is inherited by shell functions, command
-substitutions, and commands executed in a subshell environment.
-The @code{DEBUG} trap is normally not inherited in such cases.
+If set, any trap on @code{DEBUG} and @code{RETURN} are inherited by
+shell functions, command substitutions, and commands executed
+in a subshell environment.
+The @code{DEBUG} and @code{RETURN} traps are normally not inherited
+in such cases.
@item --
If no arguments follow this option, then the positional parameters are
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
@code{BASH_ARGC}.
+The shell sets @code{BASH_ARGC} only when in extended debugging mode
+(see @ref{Bash Builtins}
+for a description of the @code{extdebug} option to the @code{shopt}
+builtin).
@item BASH_ARGV
An array variable containing all of the parameters in the current bash
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
are pushed onto @code{BASH_ARGV}.
+The shell sets @code{BASH_ARGV} only when in extended debugging mode
+(see @ref{Bash Builtins}
+for a description of the @code{extdebug} option to the @code{shopt}
+builtin).
@item BASH_COMMAND
The command currently being executed or about to be executed, unless the
An array variable whose members are the line numbers in source files
corresponding to each member of @var{FUNCNAME}.
@code{$@{BASH_LINENO[$i]@}} is the line number in the source file where
-@code{$@{FUNCNAME[$i + 1]@}} was called.
-The corresponding source file name is @code{$@{BASH_SOURCE[$i + 1]@}}.
+@code{$@{FUNCNAME[$i]@}} was called.
+The corresponding source file name is @code{$@{BASH_SOURCE[$i]@}}.
Use @code{LINENO} to obtain the current line number.
@item BASH_REMATCH
Bash terminates after that number of seconds if input does
not arrive.
+@item TMPDIR
+If set, Bash uses its value as the name of a directory in which
+Bash creates temporary files for the shell's use.
+
@item UID
The numeric real user id of the current user. This variable is readonly.
@item --dump-po-strings
A list of all double-quoted strings preceded by @samp{$}
-is printed on the standard ouput
+is printed on the standard output
in the @sc{gnu} @code{gettext} PO (portable object) file format.
Equivalent to @option{-D} except for the output format.
@item -D
A list of all double-quoted strings preceded by @samp{$}
-is printed on the standard ouput.
+is printed on the standard output.
These are the strings that
are subject to language translation when the current locale
is not @code{C} or @code{POSIX} (@pxref{Locale Translation}).
@item
When running in @sc{posix} mode, a special builtin returning an error
status will not cause the shell to exit (@pxref{Bash POSIX Mode}).
+
@item
A failed @code{exec} will not cause the shell to exit
(@pxref{Bourne Shell Builtins}).
@file{/dev/stdin}, @file{/dev/stdout}, or @file{/dev/stderr}, file
descriptor 0, 1, or 2, respectively, is checked.
+Unless otherwise specified, primaries that operate on files follow symbolic
+links and operate on the target of the link, rather than the link itself.
+
@table @code
@item -a @var{file}
True if @var{file} exists.
The digits greater than 9 are represented by the lowercase letters,
the uppercase letters, @samp{@@}, and @samp{_}, in that order.
If @var{base} is less than or equal to 36, lowercase and uppercase
-letters may be used interchangably to represent numbers between 10
+letters may be used interchangeably to represent numbers between 10
and 35.
Operators are evaluated in order of precedence. Sub-expressions in
conflicts with the shell's filename expansion operators. If the
@var{subscript} is @samp{@@} or @samp{*}, the word expands to all members
of the array @var{name}. These subscripts differ only when the word
-appears within double quotes. If the word is double-quoted,
+appears within double quotes.
+If the word is double-quoted,
@code{$@{name[*]@}} expands to a single word with
the value of each array member separated by the first character of the
@env{IFS} variable, and @code{$@{name[@@]@}} expands each element of
@var{name} to a separate word. When there are no array members,
-@code{$@{name[@@]@}} expands to nothing. This is analogous to the
+@code{$@{name[@@]@}} expands to nothing.
+If the double-quoted expansion occurs within a word, the expansion of
+the first parameter is joined with the beginning part of the original
+word, and the expansion of the last parameter is joined with the last
+part of the original word.
+This is analogous to the
expansion of the special parameters @samp{@@} and @samp{*}.
@code{$@{#name[}@var{subscript}@code{]@}} expands to the length of
@code{$@{name[}@var{subscript}@code{]@}}.
The @code{unset} builtin is used to destroy arrays.
@code{unset} @var{name}[@var{subscript}]
destroys the array element at index @var{subscript}.
+Care must be taken to avoid unwanted side effects caused by filename
+generation.
@code{unset} @var{name}, where @var{name} is an array, removes the
entire array. A subscript of @samp{*} or @samp{@@} also removes the
entire array.
example, @code{SIGTSTP}.
@item
-Reserved words may not be aliased.
+The @code{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.
+
+@item
+Reserved words appearing in a context where reserved words are recognized
+do not undergo alias expansion.
@item
The @sc{posix} 1003.2 @env{PS1} and @env{PS2} expansions of @samp{!} to
causes a fatal syntax error in non-interactive shells.
@item
-@sc{posix} 1003.2 `special' builtins are found before shell functions
+@sc{posix} 1003.2 special builtins are found before shell functions
during command lookup.
@item
the command name, and so on.
@item
-If the @code{cd} builtin finds a directory to change to
-using @env{$CDPATH}, the
-value it assigns to the @env{PWD} variable does not contain any
-symbolic links, as if @samp{cd -P} had been executed.
-
-@item
If @env{CDPATH} is set, the @code{cd} builtin will not implicitly
append the current directory to it. This means that @code{cd} will
fail if no valid directory name can be constructed from
@item
The @code{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. If users want to reset the handler for a given
+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 @samp{-} as the
first argument.
constructed from @code{$PWD} and the directory name supplied as an argument
does not refer to an existing directory, @code{cd} will fail instead of
falling back to @var{physical} mode.
+
+@item
+When the @code{pwd} builtin is supplied the @option{-P} option, it resets
+@code{$PWD} to a pathname containing no symlinks.
+
+@item
+The @code{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
+@option{-P} option.
+
+@item
+When listing the history, the @code{fc} builtin does not include an
+indication of whether or not a history entry has been modified.
+
+@item
+The default editor used by @code{fc} is @code{ed}.
+
+@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
+file if it is the only so-named file found in @code{$PATH}.
+
+@item
+The @code{vi} editing mode will invoke the @code{vi} editor directly when
+the @samp{v} command is run, instead of checking @code{$FCEDIT} and
+@code{$EDITOR}.
+
+@item
+When the @code{xpg_echo} option is enabled, Bash does not attempt to interpret
+any arguments to @code{echo} as options. Each argument is displayed, after
+escape characters are converted.
+
@end enumerate
-There is other @sc{posix} 1003.2 behavior that Bash does not implement.
+There is other @sc{posix} 1003.2 behavior that Bash does not implement by
+default even when in @sc{posix} mode.
Specifically:
@enumerate
-@item
-Assignment statements affect the execution environment of all
-builtins, not just special ones.
@item
-When a subshell is created to execute a shell script with execute permission,
-but without a leading @samp{#!}, Bash sets @code{$0} to the full pathname of
-the script as found by searching @code{$PATH}, rather than the command as
-typed by the user.
+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
-When using @samp{.} to source a shell script found in @code{$PATH}, bash
-checks execute permission bits rather than read permission bits, just as
-if it were searching for a command.
+As noted above, Bash requires the @code{xpg_echo} option to be enabled for
+the @code{echo} builtin to be fully conformant.
@end enumerate
+Bash can be configured to be @sc{posix}-conformant by default, by specifying
+the @option{--enable-strict-posix-default} to @code{configure} when building
+(@pxref{Optional Features}).
+
@node Job Control
@chapter Job Control
character @samp{%} introduces a job name.
Job number @code{n} may be referred to as @samp{%n}.
-The symbols @samp{%%} and
-@samp{%+} refer to the shell's notion of the current job, which
-is the last job stopped while it was in the foreground or started
-in the background. The
-previous job may be referenced using @samp{%-}. In output
+The symbols @samp{%%} and @samp{%+} refer to the shell's notion of the
+current job, which is the last job stopped while it was in the foreground
+or started in the background.
+A single @samp{%} (with no accompanying job specification) also refers
+to the current job.
+The previous job may be referenced using @samp{%-}. In output
pertaining to jobs (e.g., the output of the @code{jobs} command),
the current job is always flagged with a @samp{+}, and the
previous job with a @samp{-}.
@item bg
@btindex bg
@example
-bg [@var{jobspec}]
+bg [@var{jobspec} @dots{}]
@end example
-Resume the suspended job @var{jobspec} in the background, as if it
+Resume each suspended job @var{jobspec} in the background, as if it
had been started with @samp{&}.
If @var{jobspec} is not supplied, the current job is used.
The return status is zero unless it is run when job control is not
-enabled, or, when run with job control enabled, if @var{jobspec} was
-not found or @var{jobspec} specifies a job that was started without
-job control.
+enabled, or, when run with job control enabled, any
+@var{jobspec} was not found or specifies a job
+that was started without job control.
@item fg
@btindex fg
@item wait
@btindex wait
@example
-wait [@var{jobspec} or @var{pid}]
+wait [@var{jobspec} or @var{pid} ...]
@end example
-Wait until the child process specified by process @sc{id} @var{pid} or job
-specification @var{jobspec} exits and return the exit status of the last
-command waited for.
+Wait until the child process specified by each process @sc{id} @var{pid}
+or job specification @var{jobspec} exits and return the exit status of the
+last command waited for.
If a job spec is given, all processes in the job are waited for.
If no arguments are given, all currently active child processes are
waited for, and the return status is zero.
@menu
* Basic Installation:: Installation instructions.
-
* Compilers and Options:: How to set special options for various
systems.
-
* Compiling For Multiple Architectures:: How to compile Bash for more
than one kind of system from
the same source tree.
-
* Installation Names:: How to set the various paths used by the installation.
-
* Specifying the System Type:: How to configure Bash for a particular system.
-
* Sharing Defaults:: How to share default configuration values among GNU
programs.
-
* Operation Controls:: Options recognized by the configuration program.
-
* Optional Features:: How to enable and disable optional features when
building Bash.
@end menu
@item --with-bash-malloc
Use the Bash version of
-@code{malloc} in @file{lib/malloc/malloc.c}. This is not the same
+@code{malloc} in the directory @file{lib/malloc}. This is not the same
@code{malloc} that appears in @sc{gnu} libc, but an older version
-derived from the 4.2 @sc{bsd} @code{malloc}. This @code{malloc} is
-very fast, but wastes some space on each allocation.
+originally derived from the 4.2 @sc{bsd} @code{malloc}. This @code{malloc}
+is very fast, but wastes some space on each allocation.
This option is enabled by default.
The @file{NOTES} file contains a list of systems for
which this should be turned off, and @code{configure} disables this
@item --with-installed-readline[=@var{PREFIX}]
Define this to make Bash link with a locally-installed version of Readline
rather than the version in @file{lib/readline}. This works only with
-Readline 4.3 and later versions. If @var{PREFIX} is @code{yes} or not
+Readline 5.0 and later versions. If @var{PREFIX} is @code{yes} or not
supplied, @code{configure} uses the values of the make variables
@code{includedir} and @code{libdir}, which are subdirectories of @code{prefix}
by default, to find the installed version of Readline if it is not in
@samp{=~} binary operator in the @code{[[} conditional command.
(@pxref{Conditional Constructs}).
+@item --enable-debugger
+Include support for the bash debugger (distributed separately).
+
@item --enable-directory-stack
Include support for a @code{csh}-like directory stack and the
@code{pushd}, @code{popd}, and @code{dirs} builtins
This enables process substitution (@pxref{Process Substitution}) if
the operating system provides the necessary support.
+@item --enable-progcomp
+Enable the programmable completion facilities
+(@pxref{Programmable Completion}).
+If Readline is not enabled, this option has no effect.
+
@item --enable-prompt-string-decoding
Turn on the interpretation of a number of backslash-escaped characters
in the @env{$PS1}, @env{$PS2}, @env{$PS3}, and @env{$PS4} prompt
strings. See @ref{Printing a Prompt}, for a complete list of prompt
string escape sequences.
-@item --enable-progcomp
-Enable the programmable completion facilities
-(@pxref{Programmable Completion}).
-If Readline is not enabled, this option has no effect.
-
@item --enable-readline
Include support for command-line editing and history with the Bash
version of the Readline library (@pxref{Command Line Editing}).
Include the @code{select} builtin, which allows the generation of simple
menus (@pxref{Conditional Constructs}).
+@item --enable-separate-helpfiles
+Use external files for the documentation displayed by the @code{help} builtin
+instead of storing the text internally.
+
+@item --enable-single-help-strings
+Store the text displayed by the @code{help} builtin as a single string for
+each help topic. This aids in translating the text to different languages.
+You may need to disable this if your compiler cannot handle very long string
+literals.
+
+@item --enable-strict-posix-default
+Make Bash @sc{posix}-conformant by default (@pxref{Bash POSIX Mode}).
+
@item --enable-usg-echo-default
A synonym for @code{--enable-xpg-echo-default}.
without requiring the @option{-e} option.
This sets the default value of the @code{xpg_echo} shell option to @code{on},
which makes the Bash @code{echo} behave more like the version specified in
-the Single Unix Specification, version 2.
+the Single Unix Specification, version 3.
@xref{Bash Builtins}, for a description of the escape sequences that
@code{echo} recognizes.
section quickly details the differences of significance. A
number of these differences are explained in greater depth in
previous sections.
-This section uses the version of @code{sh} included in SVR4.2 as
-the baseline reference.
+This section uses the version of @code{sh} included in SVR4.2 (the
+last version of the historical Bourne shell) as the baseline reference.
@itemize @bullet
Bash implements the @code{!} keyword to negate the return value of
a pipeline (@pxref{Pipelines}).
Very useful when an @code{if} statement needs to act only if a test fails.
+The Bash @samp{-o pipefail} option to @code{set} will cause a pipeline to
+return a failure status if any command fails.
@item
Bash has the @code{time} reserved word and command timing (@pxref{Pipelines}).
@item
Bash includes the @code{[[} compound command, which makes conditional
-testing part of the shell grammar (@pxref{Conditional Constructs}).
+testing part of the shell grammar (@pxref{Conditional Constructs}), including
+optional regular expression matching.
+
+@item
+Bash provides optional case-insensitive matching for the @code{case} and
+@code{[[} constructs.
@item
Bash includes brace expansion (@pxref{Brace Expansion}) and tilde
command.
@item
+Bash supports the @samp{+=} assignment operator, which appends to the value
+of the variable named on the left hand side.
+
+@item
Bash includes the @sc{posix} pattern removal @samp{%}, @samp{#}, @samp{%%}
and @samp{##} expansions to remove leading or trailing substrings from
variable values (@pxref{Shell Parameter Expansion}).
file (@pxref{Redirections}).
@item
+Bash includes the @samp{<<<} redirection operator, allowing a string to
+be used as the standard input to a command.
+
+@item
+Bash implements the @samp{[n]<&@var{word}} and @samp{[n]>&@var{word}}
+redirection operators, which move one file descriptor to another.
+
+@item
Bash treats a number of filenames specially when they are
used in redirection operators (@pxref{Redirections}).
Commands specified with an @code{RETURN} trap are executed before
execution resumes after a shell function or a shell script executed with
@code{.} or @code{source} returns.
-The @code{RETURN} trap is not inherited by shell functions.
+The @code{RETURN} trap is not inherited by shell functions unless the
+function has been given the @code{trace} attribute or the
+@code{functrace} option has been enabled using the @code{shopt} builtin.
@item
The Bash @code{type} builtin is more extensive and gives more information
@code{SIGHUP}.
@item
+Bash includes a number of features to support a separate debugger for
+shell scripts.
+
+@item
The SVR4.2 shell has two privilege-related builtins
(@code{mldmode} and @code{priv}) not present in Bash.