No specific user configuration
[platform/upstream/bash.git] / doc / FAQ
diff --git a/doc/FAQ b/doc/FAQ
index c0e902f..1df48d5 100644 (file)
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -1,4 +1,4 @@
-This is the Bash FAQ, version 3.27, for Bash version 3.0.
+This is the Bash FAQ, version 4.13, for Bash version 4.3.
 
 This document contains a set of frequently-asked questions concerning
 Bash, the GNU Bourne-Again Shell.  Bash is a freely-available command
@@ -9,7 +9,7 @@ Another good source of basic information about shells is the collection
 of FAQ articles periodically posted to comp.unix.shell.
 
 Questions and comments concerning this document should be sent to
-chet@po.cwru.edu.
+chet.ramey@case.edu.
 
 This document is available for anonymous FTP with the URL
 
@@ -36,9 +36,9 @@ A10) What is the bash `posix mode'?
 
 Section B:  The latest version
 
-B1) What's new in version 3.0?
-B2) Are there any user-visible incompatibilities between bash-3.0 and
-    bash-1.14.7?
+B1) What's new in version 4.3?
+B2) Are there any user-visible incompatibilities between bash-4.3 and
+    previous bash versions?
 
 Section C:  Differences from other Unix shells
 
@@ -78,6 +78,10 @@ E10) Why does `cd //' leave $PWD as `//'?
 E11) If I resize my xterm while another program is running, why doesn't bash
      notice the change?
 E12) Why don't negative offsets in substring expansion work like I expect?
+E13) Why does filename completion misbehave if a colon appears in the filename?
+E14) Why does quoting the pattern argument to the regular expression matching
+     conditional operator (=~) cause matching to stop working?
+E15) Tell me more about the shell compatibility level.
 
 Section F:  Things to watch out for on certain Unix versions
 
@@ -140,22 +144,26 @@ of Case Western Reserve University.
 
 A2)  What's the latest version?
 
-The latest version is 3.0, first made available on 27 July, 2004.
+The latest version is 4.3, first made available on xx December, 2013.
 
 A3)  Where can I get it?
 
 Bash is the GNU project's shell, and so is available from the
 master GNU archive site, ftp.gnu.org, and its mirrors.  The
 latest version is also available for FTP from ftp.cwru.edu.
-The following URLs tell how to get version 3.0:
+The following URLs tell how to get version 4.3:
 
-ftp://ftp.gnu.org/pub/gnu/bash/bash-3.0.tar.gz
-ftp://ftp.cwru.edu/pub/bash/bash-3.0.tar.gz
+ftp://ftp.gnu.org/pub/gnu/bash/bash-4.3.tar.gz
+ftp://ftp.cwru.edu/pub/bash/bash-4.3.tar.gz
 
 Formatted versions of the documentation are available with the URLs:
 
-ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-3.0.tar.gz
-ftp://ftp.cwru.edu/pub/bash/bash-doc-3.0.tar.gz
+ftp://ftp.gnu.org/pub/gnu/bash/bash-doc-4.3.tar.gz
+ftp://ftp.cwru.edu/pub/bash/bash-doc-4.3.tar.gz
+
+Any patches for the current version are available with the URL:
+
+ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/
 
 A4)  On what machines will bash run?
 
@@ -181,16 +189,14 @@ earlier Minix versions yet.
 
 Bash has been ported to versions of Windows implementing the Win32
 programming interface.  This includes Windows 95 and Windows NT.
-The port was done by Cygnus Solutions as part of their CYGWIN
-project.  For more information about the project, look at the URLs
-
-http://www.cygwin.com/
-http://sourceware.cygnus.com/cygwin
+The port was done by Cygnus Solutions (now part of Red Hat) as part
+of their CYGWIN project.  For more information about the project, see
+http://www.cygwin.com/.
 
 Cygnus originally ported bash-1.14.7, and that port was part of their
-early GNU-Win32 (the original name) releases.  Cygnus has also done a
-port of bash-2.05 to the CYGWIN environment, and it is available as
-part of their current release.
+early GNU-Win32 (the original name) releases.  Cygnus has also done
+ports of bash-3.2 and bash-4.0 to the CYGWIN environment, and both
+are available as part of their current release.
 
 Bash-2.05b and later versions should require no local Cygnus changes to
 build and run under CYGWIN.
@@ -212,7 +218,9 @@ ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsh204s.zip      source
 Mark began to work with bash-2.05, but I don't know the current status.
 
 Bash-3.0 compiles and runs with no modifications under Microsoft's Services
-for Unix (SFU), once known as Interix.
+for Unix (SFU), once known as Interix.  I do not anticipate any problems
+with building bash-4.2 and later, but will gladly accept any patches that
+are needed.
 
 A6) How can I build bash with gcc? 
 
@@ -381,16 +389,472 @@ They are also listed in a section in the Bash Reference Manual
 
 Section B:  The latest version
 
-B1) What's new in version 3.0?
+B1) What's new in version 4.3?
 
-Bash-3.0 is the third major release of bash.  The features introduced
-in the intermediate releases following bash-2.05 have been completed.
-Support for the bash debugger (a separate project) has been integrated.
+Bash-4.3 is the third revision to the fourth major release of bash.
 
-Bash-3.0 contains the following new features (see the manual page for
-complete descriptions and the CHANGES and NEWS files in the bash-3.0
+Bash-4.3 contains the following new features (see the manual page for
+complete descriptions and the CHANGES and NEWS files in the bash-4.3
 distribution):
 
+o  The `helptopic' completion action now maps to all the help topics, not just
+    the shell builtins.
+
+o  The `help' builtin no longer does prefix substring matching first, so
+   `help read' does not match `readonly', but will do it if exact string
+   matching fails.
+
+o  The shell can be compiled to not display a message about processes that
+    terminate due to SIGTERM.
+
+o  Non-interactive shells now react to the setting of checkwinsize and set
+    LINES and COLUMNS after a foreground job exits.
+
+o  There is a new shell option, `globasciiranges', which, when set to on,
+    forces globbing range comparisons to use character ordering as if they
+    were run in the C locale.
+
+o  There is a new shell option, `direxpand', which makes filename completion
+    expand variables in directory names in the way bash-4.1 did.
+
+o  In Posix mode, the `command' builtin does not change whether or not a
+    builtin it shadows is treated as an assignment builtin.
+
+o  The `return' and `exit' builtins accept negative exit status arguments.
+
+o  The word completion code checks whether or not a filename containing a
+   shell variable expands to a directory name and appends `/' to the word
+   as appropriate.  The same code expands shell variables in command names
+   when performing command completion.
+
+o  In Posix mode, it is now an error to attempt to define a shell function
+   with the same name as a Posix special builtin.
+
+o  When compiled for strict Posix conformance, history expansion is disabled
+   by default.
+
+o  The history expansion character (!) does not cause history expansion when
+   followed by the closing quote in a double-quoted string.
+
+o  `complete' and its siblings compgen/compopt now takes a new `-o noquote'
+   option to inhibit quoting of the completions.
+
+o  Setting HISTSIZE to a value less than zero causes the history list to be
+   unlimited (setting it 0 zero disables the history list).
+
+o  Setting HISTFILESIZE to a value less than zero causes the history file size
+   to be unlimited (setting it to 0 causes the history file to be truncated
+   to zero size).
+
+o  The `read' builtin now skips NUL bytes in the input.
+
+o  There is a new `bind -X' option to print all key sequences bound to Unix
+   commands.
+
+o  When in Posix mode, `read' is interruptible by a trapped signal.  After
+   running the trap handler, read returns 128+signal and throws away any
+   partially-read input.
+
+o  The command completion code skips whitespace and assignment statements
+   before looking for the command name word to be completed.
+
+o  The build process has a new mechanism for constructing separate help files
+   that better reflects the current set of compilation options.
+
+o  The -nt and -ot options to test now work with files with nanosecond
+   timestamp resolution.
+
+o  The shell saves the command history in any shell for which history is
+   enabled and HISTFILE is set, not just interactive shells.
+
+o  The shell has `nameref' variables and new -n(/+n) options to declare and
+   unset to use them, and a `test -R' option to test for them.
+
+o  The shell now allows assigning, referencing, and unsetting elements of
+   indexed arrays using negative subscripts (a[-1]=2, echo ${a[-1]}) which
+   count back from the last element of the array.
+
+o  The {x}<word redirection feature now allows words like {array[ind]} and
+   can use variables with special meanings to the shell (e.g., BASH_XTRACEFD).
+
+o  There is a new CHILD_MAX special shell variable; its value controls the
+   number of exited child statues the shell remembers.
+
+o  There is a new configuration option (--enable-direxpand-default) that
+   causes the `direxpand' shell option to be enabled by default.
+
+o  Bash does not do anything special to ensure that the file descriptor
+   assigned to X in {x}<foo remains open after the block containing it
+   completes.
+
+o  The `wait' builtin has a new `-n' option to wait for the next child to
+   change status.
+
+o  The `printf' %(...)T format specifier now uses the current time if no
+    argument is supplied.
+
+o  There is a new variable, BASH_COMPAT, that controls the current shell
+   compatibility level.
+
+o  The `popd' builtin now treats additional arguments as errors.
+
+o  The brace expansion code now treats a failed sequence expansion as a
+   simple string and will continue to expand brace terms in the remainder
+   of the word.
+
+o  Shells started to run process substitutions now run any trap set on EXIT.
+
+o  The fc builtin now interprets -0 as the current command line.
+
+o  Completing directory names containing shell variables now adds a trailing
+   slash if the expanded result is a directory.
+
+A short feature history dating back to Bash-2.0:
+
+Bash-4.2 contained the following new features:
+
+o   `exec -a foo' now sets $0 to `foo' in an executable shell script without a
+    leading #!.
+
+o   Subshells begun to execute command substitutions or run shell functions or
+    builtins in subshells do not reset trap strings until a new trap is
+    specified.  This allows $(trap) to display the caller's traps and the
+    trap strings to persist until a new trap is set.
+
+o   `trap -p' will now show signals ignored at shell startup, though their
+    disposition still cannot be modified.
+
+o   $'...', echo, and printf understand \uXXXX and \UXXXXXXXX escape sequences.
+
+o   declare/typeset has a new `-g' option, which creates variables in the
+    global scope even when run in a shell function.
+
+o   test/[/[[ have a new -v variable unary operator, which returns success if
+    `variable' has been set.
+
+o   Posix parsing changes to allow `! time command' and multiple consecutive
+    instances of `!' (which toggle) and `time' (which have no cumulative
+    effect).
+
+o   Posix change to allow `time' as a command by itself to print the elapsed
+    user, system, and real times for the shell and its children.
+
+o   $((...)) is always parsed as an arithmetic expansion first, instead of as
+    a potential nested command substitution, as Posix requires.
+
+o   A new FUNCNEST variable to allow the user to control the maximum shell
+    function nesting (recursive execution) level.
+
+o   The mapfile builtin now supplies a third argument to the callback command:
+    the line about to be assigned to the supplied array index.
+
+o   The printf builtin has as new %(fmt)T specifier, which allows time values
+    to use strftime-like formatting.
+
+o   There is a new `compat41' shell option.
+
+o   The cd builtin has a new Posix-mandated `-e' option.
+
+o   Negative subscripts to indexed arrays, previously errors, now are treated
+    as offsets from the maximum assigned index + 1.
+
+o   Negative length specifications in the ${var:offset:length} expansion,
+    previously errors, are now treated as offsets from the end of the variable.
+
+o   Parsing change to allow `time -p --'.
+
+o   Posix-mode parsing change to not recognize `time' as a keyword if the
+    following token begins with a `-'.  This means no more Posix-mode
+    `time -p'.  Posix interpretation 267.
+
+o   There is a new `lastpipe' shell option that runs the last command of a
+    pipeline in the current shell context.  The lastpipe option has no
+    effect if job control is enabled.
+
+o   History expansion no longer expands the `$!' variable expansion.
+
+o   Posix mode shells no longer exit if a variable assignment error occurs
+    with an assignment preceding a command that is not a special builtin.
+
+o   Non-interactive mode shells exit if -u is enabled an an attempt is made
+    to use an unset variable with the % or # expansions, the `//', `^', or
+    `,' expansions, or the parameter length expansion.
+
+o   Posix-mode shells use the argument passed to `.' as-is if a $PATH search
+    fails, effectively searching the current directory.  Posix-2008 change.
+
+A short feature history dating back to Bash-2.0:
+
+Bash-4.1 contained the following new features:
+
+o   Here-documents within $(...) command substitutions may once more be
+    delimited by the closing right paren, instead of requiring a newline.
+
+o   Bash's file status checks (executable, readable, etc.) now take file
+    system ACLs into account on file systems that support them.
+
+o   Bash now passes environment variables with names that are not valid
+    shell variable names through into the environment passed to child
+    processes.
+
+o   The `execute-unix-command' readline function now attempts to clear and
+    reuse the current line rather than move to a new one after the command
+    executes.
+
+o   `printf -v' can now assign values to array indices.
+
+o   New `complete -E' and `compopt -E' options that work on the "empty"
+    completion: completion attempted on an empty command line.
+
+o   New complete/compgen/compopt -D option to define a `default' completion:
+    a completion to be invoked on command for which no completion has been
+    defined.  If this function returns 124, programmable completion is
+    attempted again, allowing a user to dynamically build a set of completions
+    as completion is attempted by having the default completion function
+    install individual completion functions each time it is invoked.
+
+o   When displaying associative arrays, subscripts are now quoted.
+
+o   Changes to dabbrev-expand to make it more `emacs-like': no space appended
+    after matches, completions are not sorted, and most recent history entries
+    are presented first.
+
+o   The [[ and (( commands are now subject to the setting of `set -e' and the
+    ERR trap.
+
+o   The source/. builtin now removes NUL bytes from the file before attempting
+    to parse commands.
+
+o   There is a new configuration option (in config-top.h) that forces bash to
+    forward all history entries to syslog.
+
+o   A new variable $BASHOPTS to export shell options settable using `shopt' to
+    child processes.
+
+o   There is a new confgure option that forces the extglob option to be
+    enabled by default.
+
+o   New variable $BASH_XTRACEFD; when set to an integer bash will write xtrace
+    output to that file descriptor.
+
+o   If the optional left-hand-side of a redirection is of the form {var}, the
+    shell assigns the file descriptor used to $var or uses $var as the file
+    descriptor to move or close, depending on the redirection operator.
+
+o   The < and > operators to the [[ conditional command now do string
+    comparison according to the current locale.
+
+o   Programmable completion now uses the completion for `b' instead of `a'
+    when completion is attempted on a line like: a $(b c.
+
+o   Force extglob on temporarily when parsing the pattern argument to
+    the == and != operators to the [[ command, for compatibility.
+
+o   Changed the behavior of interrupting the wait builtin when a SIGCHLD is
+    received and a trap on SIGCHLD is set to be Posix-mode only.
+
+o   The read builtin has a new `-N nchars' option, which reads exactly NCHARS
+    characters, ignoring delimiters like newline.
+
+o   The mapfile/readarray builtin no longer stores the commands it invokes via
+    callbacks in the history list.
+
+o   There is a new `compat40' shopt option.
+
+o   The < and > operators to [[ do string comparisons using the current locale
+    only if the compatibility level is greater than 40 (set to 41 by default).
+
+o   New bindable readline function: menu-complete-backward.
+
+o   In the readline vi-mode insertion keymap, C-n is now bound to menu-complete
+    by default, and C-p to menu-complete-backward.
+
+o   When in readline vi command mode, repeatedly hitting ESC now does nothing,
+    even when ESC introduces a bound key sequence.  This is closer to how
+    historical vi behaves.
+
+o   New bindable readline function: skip-csi-sequence.  Can be used as a
+    default to consume key sequences generated by keys like Home and End
+    without having to bind all keys.
+
+o   New bindable readline variable: skip-completed-text, active when
+    completing in the middle of a word.  If enabled, it means that characters
+    in the completion that match characters in the remainder of the word are
+    "skipped" rather than inserted into the line.
+
+o   The pre-readline-6.0 version of menu completion is available as
+    "old-menu-complete" for users who do not like the readline-6.0 version.
+
+o   New bindable readline variable: echo-control-characters.  If enabled, and
+    the tty ECHOCTL bit is set, controls the echoing of characters
+    corresponding to keyboard-generated signals.
+
+o   New bindable readline variable: enable-meta-key.  Controls whether or not
+    readline sends the smm/rmm sequences if the terminal indicates it has a
+    meta key that enables eight-bit characters.
+
+Bash-4.0 contained the following new features:
+
+o   When using substring expansion on the positional parameters, a starting
+    index of 0 now causes $0 to be prefixed to the list.
+
+o   There is a new variable, $BASHPID, which always returns the process id of
+    the current shell.
+
+o   There is a new `autocd' option that, when enabled, causes bash to attempt
+    to `cd' to a directory name that is supplied as the first word of a
+    simple command.
+
+o   There is a new `checkjobs' option that causes the shell to check for and
+    report any running or stopped jobs at exit.
+
+o   The programmable completion code exports a new COMP_TYPE variable, set to
+    a character describing the type of completion being attempted.
+
+o   The programmable completion code exports a new COMP_KEY variable, set to
+    the character that caused the completion to be invoked (e.g., TAB).
+
+o   The programmable completion code now uses the same set of characters as
+    readline when breaking the command line into a list of words.
+
+o   The block multiplier for the ulimit -c and -f options is now 512 when in
+    Posix mode, as Posix specifies.
+
+o   Changed the behavior of the read builtin to save any partial input received
+    in the specified variable when the read builtin times out.  This also
+    results in variables specified as arguments to read to be set to the empty
+    string when there is no input available.  When the read builtin times out,
+    it returns an exit status greater than 128.
+
+o   The shell now has the notion of a `compatibility level', controlled by
+    new variables settable by `shopt'.  Setting this variable currently
+    restores the bash-3.1 behavior when processing quoted strings on the rhs
+    of the `=~' operator to the `[[' command.
+
+o   The `ulimit' builtin now has new -b (socket buffer size) and -T (number
+    of threads) options.
+
+o   There is a new `compopt' builtin that allows completion functions to modify
+    completion options for existing completions or the completion currently
+    being executed.
+
+o   The `read' builtin has a new -i option which inserts text into the reply
+    buffer when using readline.
+
+o   A new `-E' option to the complete builtin allows control of the default
+    behavior for completion on an empty line.
+
+o   There is now limited support for completing command name words containing
+    globbing characters.
+
+o   The `help' builtin now has a new -d option, to display a short description,
+    and a -m option, to print help information in a man page-like format.
+
+o   There is a new `mapfile' builtin to populate an array with lines from a
+    given file.
+
+o   If a command is not found, the shell attempts to execute a shell function
+    named `command_not_found_handle', supplying the command words as the
+    function arguments.
+
+o   There is a new shell option: `globstar'.  When enabled, the globbing code
+    treats `**' specially -- it matches all directories (and files within
+    them, when appropriate) recursively.
+
+o   There is a new shell option: `dirspell'.  When enabled, the filename
+    completion code performs spelling correction on directory names during
+    completion.
+
+o   The `-t' option to the `read' builtin now supports fractional timeout
+    values.
+
+o   Brace expansion now allows zero-padding of expanded numeric values and
+    will add the proper number of zeroes to make sure all values contain the
+    same number of digits.
+
+o   There is a new bash-specific bindable readline function: `dabbrev-expand'.
+    It uses menu completion on a set of words taken from the history list.
+
+o   The command assigned to a key sequence with `bind -x' now sets two new
+    variables in the environment of the executed command:  READLINE_LINE_BUFFER
+    and READLINE_POINT.  The command can change the current readline line
+    and cursor position by modifying READLINE_LINE_BUFFER and READLINE_POINT,
+    respectively.
+
+o   There is a new >>& redirection operator, which appends the standard output
+    and standard error to the named file.
+
+o   The parser now understands `|&' as a synonym for `2>&1 |', which redirects
+    the standard error for a command through a pipe.
+
+o   The new `;&' case statement action list terminator causes execution to
+    continue with the action associated with the next pattern in the
+    statement rather than terminating the command.
+
+o   The new `;;&' case statement action list terminator causes the shell to
+    test the next set of patterns after completing execution of the current
+    action, rather than terminating the command.
+
+o   The shell understands a new variable: PROMPT_DIRTRIM.  When set to an
+    integer value greater than zero, prompt expansion of \w and \W  will
+    retain only that number of trailing pathname components and replace
+    the intervening characters with `...'.
+
+o   There are new case-modifying word expansions: uppercase (^[^]) and
+    lowercase (,[,]).  They can work on either the first character or
+    array element, or globally.  They accept an optional shell pattern
+    that determines which characters to modify.  There is an optionally-
+    configured feature to include capitalization operators.
+
+o   The shell provides associative array variables, with the appropriate
+    support to create, delete, assign values to, and expand them.
+
+o   The `declare' builtin now has new -l (convert value to lowercase upon
+    assignment) and -u (convert value to uppercase upon assignment) options.
+    There is an optionally-configurable -c option to capitalize a value at
+    assignment.
+
+o   There is a new `coproc' reserved word that specifies a coprocess: an
+    asynchronous command run with two pipes connected to the creating shell.
+    Coprocs can be named.  The input and output file descriptors and the
+    PID of the coprocess are available to the calling shell in variables
+    with coproc-specific names.
+
+o   A value of 0 for the -t option to `read' now returns success if there is
+    input available to be read from the specified file descriptor.
+
+o   CDPATH and GLOBIGNORE are ignored when the shell is running in privileged
+    mode.
+
+o   New bindable readline functions shell-forward-word and shell-backward-word,
+    which move forward and backward words delimited by shell metacharacters
+    and honor shell quoting.
+
+o   New bindable readline functions shell-backward-kill-word and shell-kill-word
+    which kill words backward and forward, but use the same word boundaries
+    as shell-forward-word and shell-backward-word.
+
+Bash-3.2 contained the following new features:
+
+o Bash-3.2 now checks shell scripts for NUL characters rather than non-printing
+  characters when deciding whether or not a script is a binary file.
+
+o Quoting the string argument to the [[ command's  =~ (regexp) operator now
+  forces string matching, as with the other pattern-matching operators.
+
+Bash-3.1 contained the following new features:
+
+o Bash-3.1 may now be configured and built in a mode that enforces strict
+  POSIX compliance.
+
+o The `+=' assignment operator, which appends to the value of a string or
+  array variable, has been implemented.
+
+o It is now possible to ignore case when matching in contexts other than
+  filename generation using the new `nocasematch' shell option.
+
+Bash-3.0 contained the following new features:
+
 o Features to support the bash debugger have been implemented, and there
   is a new `extdebug' option to turn the non-default options on
 
@@ -419,8 +883,6 @@ o The `jobs', `kill', and `wait' builtins now accept job control notation
 o The `gettext' package and libintl have been integrated, and the shell
   messages may be translated into other languages
 
-A short feature history dating from Bash-2.0:
-
 Bash-2.05b introduced the following new features:
 
 o support for multibyte characters has been added to both bash and readline
@@ -628,13 +1090,14 @@ grammar tighter and smaller (66 reduce-reduce conflicts gone)
 lots of code now smaller and faster
 test suite greatly expanded
 
-B2) Are there any user-visible incompatibilities between bash-3.0 and
-    bash-1.14.7?
+B2) Are there any user-visible incompatibilities between bash-4.3 and
+    previous bash versions?
 
-There are a few incompatibilities between version 1.14.7 and version 3.0.
-They are detailed in the file COMPAT in the bash distribution.  That file
-is not meant to be all-encompassing; send mail to bash-maintainers@gnu.org
-if if you find something that's not mentioned there.
+There are a few incompatibilities between version 4.3 and previous
+versions.  They are detailed in the file COMPAT in the bash distribution.
+That file is not meant to be all-encompassing; send mail to
+bash-maintainers@gnu.org (or bug-bash@gnu.org if you would like
+community discussion) if you find something that's not mentioned there.
 
 Section C:  Differences from other Unix shells
 
@@ -664,30 +1127,30 @@ Things bash has that sh does not:
        the ${param/pat[/string]} parameter pattern substitution operator
        expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
        expansion of positional parameters beyond $9 with ${num}
-       variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
+       variables: BASH, BASHPID, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
                   TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
                   LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
                   ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
                   HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
                   PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
                   SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
-                  auto_resume
+                  auto_resume, PROMPT_DIRTRIM, BASHOPTS, BASH_XTRACEFD
        DEBUG trap
        ERR trap
        variable arrays with new compound assignment syntax
-       redirections: <>, &>, >|, <<<, [n]<&word-, [n]>&word-
+       redirections: <>, &>, >|, <<<, [n]<&word-, [n]>&word-, >>&
        prompt string special char translation and variable expansion
        auto-export of variables in initial environment
        command search finds functions before builtins
        bash return builtin will exit a file sourced with `.'
-       builtins: cd -/-L/-P, exec -l/-c/-a, echo -e/-E, hash -d/-l/-p/-t.
+       builtins: cd -/-L/-P/-@, exec -l/-c/-a, echo -e/-E, hash -d/-l/-p/-t.
                  export -n/-f/-p/name=value, pwd -L/-P,
-                 read -e/-p/-a/-t/-n/-d/-s/-u,
+                 read -e/-p/-a/-t/-n/-d/-s/-u/-i/-N,
                  readonly -a/-f/name=value, trap -l, set +o,
                  set -b/-m/-o option/-h/-p/-B/-C/-H/-P,
-                 unset -f/-v, ulimit -m/-p/-u,
+                 unset -f/-n/-v, ulimit -i/-m/-p/-q/-u/-x,
                  type -a/-p/-t/-f/-P, suspend -f, kill -n,
-                 test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S
+                 test -o optname/s1 == s2/s1 < s2/s1 > s2/-nt/-ot/-ef/-O/-G/-S/-R
        bash reads ~/.bashrc for interactive shells, $ENV for non-interactive
        bash restricted shell mode is more extensive
        bash allows functions and variables with the same name
@@ -704,7 +1167,7 @@ Things bash has that sh does not:
        other new bash builtins: bind, command, compgen, complete, builtin,
                                 declare/typeset, dirs, enable, fc, help,
                                 history, logout, popd, pushd, disown, shopt,
-                                printf
+                                printf, compopt, mapfile
        exported functions
        filename generation when using output redirection (command >a*)
        POSIX.2-style globbing character classes
@@ -714,12 +1177,21 @@ Things bash has that sh does not:
        case-insensitive pattern matching and globbing
        variable assignments preceding commands affect only that command,
                even for builtins and functions
-       posix mode
+       posix mode and strict posix conformance
        redirection to /dev/fd/N, /dev/stdin, /dev/stdout, /dev/stderr,
                /dev/tcp/host/port, /dev/udp/host/port
        debugger support, including `caller' builtin and new variables
        RETURN trap
-
+       the `+=' assignment operator
+       autocd shell option and behavior
+       command-not-found hook with command_not_found_handle shell function
+       globstar shell option and `**' globbing behavior
+       |& synonym for `2>&1 |'
+       ;& and ;;& case action list terminators
+       case-modifying word expansions and variable attributes
+       associative arrays
+       coprocesses using the `coproc' reserved word and variables
+       shell assignment of a file descriptor used in a redirection to a variable
 
 Things sh has that bash does not:
        uses variable SHACCT to do shell accounting
@@ -764,24 +1236,24 @@ Things bash has or uses that ksh88 does not:
        the ${!param*} prefix expansion operator
        the ${param:offset[:length]} parameter substring operator
        the ${param/pat[/string]} parameter pattern substitution operator
-       variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, SHLVL,
+       variables: BASH, BASH_VERSION, BASH_VERSINFO, BASHPID, UID, EUID, SHLVL,
                   TIMEFORMAT, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE,
                   HISTFILESIZE, HISTIGNORE, HISTCONTROL, PROMPT_COMMAND,
                   IGNOREEOF, FIGNORE, INPUTRC, HOSTFILE, DIRSTACK,
                   PIPESTATUS, HOSTNAME, OPTERR, SHELLOPTS, GLOBIGNORE,
-                  GROUPS, FUNCNAME, histchars, auto_resume
+                  GROUPS, FUNCNAME, histchars, auto_resume, PROMPT_DIRTRIM
        prompt expansion with backslash escapes and command substitution
-       redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word-
+       redirection: &> (stdout and stderr), <<<, [n]<&word-, [n]>&word-, >>&
        more extensive and extensible editing and programmable completion
        builtins: bind, builtin, command, declare, dirs, echo -e/-E, enable,
                  exec -l/-c/-a, fc -s, export -n/-f/-p, hash, help, history,
                  jobs -x/-r/-s, kill -s/-n/-l, local, logout, popd, pushd,
-                 read -e/-p/-a/-t/-n/-d/-s, readonly -a/-n/-f/-p,
+                 read -e/-p/-a/-t/-n/-d/-s/-N, readonly -a/-n/-f/-p,
                  set -o braceexpand/-o histexpand/-o interactive-comments/
                  -o notify/-o physical/-o posix/-o hashall/-o onecmd/
                  -h/-B/-C/-b/-H/-P, set +o, suspend, trap -l, type,
-                 typeset -a/-F/-p, ulimit -u, umask -S, alias -p, shopt,
-                 disown, printf, complete, compgen
+                 typeset -a/-F/-p, ulimit -i/-q/-u/-x, umask -S, alias -p,
+                 shopt, disown, printf, complete, compgen, compopt, mapfile
        `!' csh-style history expansion
        POSIX.2-style globbing character classes
        POSIX.2-style globbing equivalence classes
@@ -796,18 +1268,28 @@ Things bash has or uses that ksh88 does not:
        RETURN trap
        Timestamps in history entries
        {x..y} brace expansion
+       The `+=' assignment operator
+       autocd shell option and behavior
+       command-not-found hook with command_not_found_handle shell function
+       globstar shell option and `**' globbing behavior
+       |& synonym for `2>&1 |'
+       ;& and ;;& case action list terminators
+       case-modifying word expansions and variable attributes
+       associative arrays
+       coprocesses using the `coproc' reserved word and variables
+       shell assignment of a file descriptor used in a redirection to a variable
 
 Things ksh88 has or uses that bash does not:
        tracked aliases (alias -t)
        variables: ERRNO, FPATH, EDITOR, VISUAL
-       co-processes (|&, >&p, <&p)
+       co-processes (bash uses different syntax)
        weirdly-scoped functions
        typeset +f to list all function names without definitions
        text of command history kept in a file, not memory
        builtins: alias -x, cd old new, newgrp, print,
                  read -p/-s/var?prompt, set -A/-o gmacs/
                  -o bgnice/-o markdirs/-o trackall/-o viraw/-s,
-                 typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-l/-u/-t, whence
+                 typeset -H/-L/-R/-Z/-A/-ft/-fu/-fx/-t, whence
        using environment to pass attributes of exported variables
        arithmetic evaluation done on arguments to some builtins
        reads .profile from $PWD when invoked as login shell
@@ -823,59 +1305,95 @@ Implementation differences:
 
 C3)  Which new features in ksh-93 are not in bash, and which are?
 
-New things in ksh-93 not in bash-3.0:
-       associative arrays
-       floating point arithmetic and variables
-       math library functions
+This list is current through ksh93v (10/08/2013)
+
+New things in ksh-93 not in bash-4.3:
+       floating point arithmetic, variables, and constants
+       math library functions, including user-defined math functions
        ${!name[sub]} name of subscript for associative array
        `.' is allowed in variable names to create a hierarchical namespace
        more extensive compound assignment syntax
        discipline functions
-       `sleep' and `getconf' builtins (bash has loadable versions)
-       typeset -n and `nameref' variables
        KEYBD trap
        variables: .sh.edchar, .sh.edmode, .sh.edcol, .sh.edtext, .sh.version,
-                  .sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT
+                  .sh.name, .sh.subscript, .sh.value, .sh.match, HISTEDIT,
+                  .sh.sig, .sh.stats, .sh.siginfo, .sh.pwdfd, .sh.op_astbin,
+                  .sh.pool
        backreferences in pattern matching (\N)
-       `&' operator in pattern lists for matching
-       print -f (bash uses printf)
-       `fc' has been renamed to `hist'
-       `.' can execute shell functions
+       `&' operator in pattern lists for matching (match all instead of any)
        exit statuses between 0 and 255
-       `+=' variable assignment operator
        FPATH and PATH mixing
-       getopts -a
-       -I invocation option
-       printf %H, %P, %T, %Z modifiers, output base for %d
        lexical scoping for local variables in `ksh' functions
        no scoping for local variables in `POSIX' functions
-
-New things in ksh-93 present in bash-3.0:
+       $''  \C[.collating-element.] escape sequence
+       -C/-I invocation options
+       print -f (bash uses printf) and rest of print builtin options
+       printf %(type)q, %#q
+       `fc' has been renamed to `hist'
+       `.' can execute shell functions
+       getopts -a
+       printf %B, %H, %P, %R, %Z modifiers, output base for %d, `=' flag
+       read -n/-N differ/-v/-S
+       set -o showme/-o multiline (bash default)
+       set -K
+       kill -Q/-q/-L
+       trap -a
+       `sleep' and `getconf' builtins (bash has loadable versions)
+       [[ -R name ]] (checks whether or not name is a nameref)
+       typeset -C/-S/-T/-X/-h/-s/-c/-M
+       experimental `type' definitions (a la typedef) using typeset
+       array expansions ${array[sub1..sub2]} and ${!array[sub1..sub2]}
+       associative array assignments using `;' as element separator
+       command substitution $(n<#) expands to current byte offset for fd N
+       new '${ ' form of command substitution, executed in current shell
+       new >;/<>;/<#pat/<##pat/<#/># redirections
+       brace expansion printf-like formats 
+       CHLD trap triggered by SIGSTOP and SIGCONT
+       ~{fd} expansion, which replaces fd with the corresponding path name
+       $"string" expanded when referenced rather than when first parsed
+       job "pools", which allow a collection of jobs to be managed as a unit
+
+New things in ksh-93 present in bash-4.3:
+       associative arrays
        [n]<&word- and [n]>&word- redirections (combination dup and close)
         for (( expr1; expr2; expr3 )) ; do list; done - arithmetic for command
         ?:, ++, --, `expr1 , expr2' arithmetic operators
        expansions: ${!param}, ${param:offset[:len]}, ${param/pat[/str]},
                    ${!param*}
        compound array assignment
+       negative subscripts for indexed array variables
        the `!' reserved word
        loadable builtins -- but ksh uses `builtin' while bash uses `enable'
-       `command', `builtin', `disown' builtins
        new $'...' and $"..." quoting
        FIGNORE (but bash uses GLOBIGNORE), HISTCMD
-       set -o notify/-C
+       brace expansion and set -B
        changes to kill builtin
+       `command', `builtin', `disown' builtins
+       echo -e
+       exec -c/-a
+       printf %T modifier
        read -A (bash uses read -a)
         read -t/-d
        trap -p
-       exec -c/-a
        `.' restores the positional parameters when it completes
+       set -o notify/-C
+       set -o pipefail
+       set -G (-o globstar) and **
        POSIX.2 `test'
        umask -S
        unalias -a
        command and arithmetic substitution performed on PS1, PS4, and ENV
-       command name completion
+       command name completion, TAB displaying possible completions
        ENV processed only for interactive shells
-       set -o pipefail
+       The `+=' assignment operator
+       the `;&' case statement "fallthrough" pattern list terminator
+       csh-style history expansion and set -H
+       negative offsets in ${param:offset:length}
+       redirection operators preceded with {varname} to store fd number in varname
+       DEBUG can force skipping following command
+       [[ -v var ]] operator (checks whether or not var is set)
+       typeset -n and `nameref' variables
+       process substitutions work without /dev/fd
 
 Section D:  Why does bash do some things differently than other Unix shells?
 
@@ -885,7 +1403,9 @@ D1) Why does bash run a different version of `command' than
 On many systems, `which' is actually a csh script that assumes
 you're running csh.  In tcsh, `which' and its cousin `where'
 are builtins.  On other Unix systems, `which' is a perl script
-that uses the PATH environment variable.
+that uses the PATH environment variable.  Many Linux distributions
+use GNU `which', which is a C program that can understand shell
+aliases.
 
 The csh script version reads the csh startup files from your
 home directory and uses those to determine which `command' will
@@ -1099,9 +1619,8 @@ will try to write on a pipe without a reader.  In that case, bash
 will print `Broken pipe' to stderr when ps is killed by a
 SIGPIPE. 
 
-You can build a version of bash that will not report SIGPIPE errors
-by uncommenting the definition of DONT_REPORT_SIGPIPE in the file
-config-top.h.
+As of bash-3.1, bash does not report SIGPIPE errors by default.  You
+can build a version of bash that will report such errors.
 
 E3) When I have terminal escape sequences in my prompt, why does bash
     wrap lines at the wrong column?
@@ -1128,12 +1647,12 @@ simple calls to `read'.  For example, piping a command's output
 into a `while' loop that repeatedly calls `read' will result in
 the same behavior.
 
-Each element of a pipeline runs in a separate process, a child of
-the shell running the pipeline.  A subprocess cannot affect its
-parent's environment.  When the `read' command sets the variable
-to the input, that variable is set only in the subshell, not the
-parent shell.  When the subshell exits, the value of the variable
-is lost. 
+Each element of a pipeline, even a builtin or shell function,
+runs in a separate process, a child of the shell running the
+pipeline.  A subprocess cannot affect its parent's environment. 
+When the `read' command sets the variable to the input, that
+variable is set only in the subshell, not the parent shell.  When
+the subshell exits, the value of the variable is lost. 
 
 Many pipelines that end with `read variable' can be converted
 into command substitutions, which will capture the output of
@@ -1377,6 +1896,104 @@ expanded value of param is unset or null, and $param otherwise.
 To use negative offsets that begin with a minus sign, separate the
 minus sign and the colon with a space.
 
+E13) Why does filename completion misbehave if a colon appears in the filename?
+
+Filename completion (and word completion in general) may appear to behave
+improperly if there is a colon in the word to be completed.
+
+The colon is special to readline's word completion code:  it is one of the
+characters that breaks words for the completer.  Readline uses these characters
+in sort of the same way that bash uses $IFS: they break or separate the words
+the completion code hands to the application-specific or default word
+completion functions.  The original intent was to make it easy to edit
+colon-separated lists (such as $PATH in bash) in various applications using
+readline for input.
+
+This is complicated by the fact that some versions of the popular
+`bash-completion' programmable completion package have problems with the
+default completion behavior in the presence of colons.  
+
+The current set of completion word break characters is available in bash as
+the value of the COMP_WORDBREAKS variable.  Removing `:' from that value is
+enough to make the colon not special to completion:
+
+COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
+
+You can also quote the colon with a backslash to achieve the same result
+temporarily.
+
+E14) Why does quoting the pattern argument to the regular expression matching
+     conditional operator (=~) cause regexp matching to stop working?
+
+In versions of bash prior to bash-3.2, the effect of quoting the regular
+expression argument to the [[ command's =~ operator was not specified.
+The practical effect was that double-quoting the pattern argument required
+backslashes to quote special pattern characters, which interfered with the
+backslash processing performed by double-quoted word expansion and was
+inconsistent with how the == shell pattern matching operator treated
+quoted characters.
+
+In bash-3.2, the shell was changed to internally quote characters in single-
+and double-quoted string arguments to the =~ operator, which suppresses the
+special meaning of the characters special to regular expression processing
+(`.', `[', `\', `(', `), `*', `+', `?', `{', `|', `^', and `$') and forces
+them to be matched literally.  This is consistent with how the `==' pattern
+matching operator treats quoted portions of its pattern argument.
+
+Since the treatment of quoted string arguments was changed, several issues
+have arisen, chief among them the problem of white space in pattern arguments
+and the differing treatment of quoted strings between bash-3.1 and bash-3.2.
+Both problems may be solved by using a shell variable to hold the pattern.
+Since word splitting is not performed when expanding shell variables in all
+operands of the [[ command, this allows users to quote patterns as they wish
+when assigning the variable, then expand the values to a single string that
+may contain whitespace.  The first problem may be solved by using backslashes
+or any other quoting mechanism to escape the white space in the patterns.
+
+Bash-4.0 introduces the concept of a `compatibility level', controlled by
+several options to the `shopt' builtin.  If the `compat31' option is enabled,
+bash reverts to the bash-3.1 behavior with respect to quoting the rhs of
+the =~ operator.
+
+E15) Tell me more about the shell compatibility level.
+
+Bash-4.0 introduced the concept of a `shell compatibility level', specified
+as a set of options to the shopt builtin (compat31, compat32, compat40 at
+this writing).  There is only one current compatibility level -- each
+option is mutually exclusive.  This list does not mention behavior that is
+standard for a particular version (e.g., setting compat32 means that quoting
+the rhs of the regexp matching operator quotes special regexp characters in
+the word, which is default behavior in bash-3.2 and above).
+
+compat31 set
+       - the < and > operators to the [[ command do not consider the current
+         locale when comparing strings
+       - quoting the rhs of the regexp matching operator (=~) has no
+         special effect
+
+compat32 set
+       - the < and > operators to the [[ command do not consider the current
+         locale when comparing strings
+
+compat40 set
+       - the < and > operators to the [[ command do not consider the current
+         locale when comparing strings
+       - interrupting a command list such as "a ; b ; c" causes the execution
+         of the entire list to be aborted (in versions before bash-4.0,
+         interrupting one command in a list caused the next to be executed)
+
+compat41 set
+        - interrupting a command list such as "a ; b ; c" causes the execution
+          of the entire list to be aborted (in versions before bash-4.1,
+          interrupting one command in a list caused the next to be executed)
+        - when in posix mode, single quotes in the `word' portion of a
+          double-quoted parameter expansion define a new quoting context and
+          are treated specially
+    
+compat42 set
+        - the replacement string in double-quoted pattern substitution is not
+          run through quote removal, as in previous versions
+
 Section F:  Things to watch out for on certain Unix versions
 
 F1) Why can't I use command line editing in my `cmdtool'?
@@ -1562,6 +2179,9 @@ this.  These variables can be set in your .inputrc or using the bash
 The `set' commands between the single quotes may also be placed
 in ~/.inputrc.
 
+The script examples/scripts.noah/meta.bash encapsulates the bind
+commands in a shell function.
+
 G2) How do I write a function `x' to replace builtin command `x', but
     still invoke the command from within the function?
 
@@ -1615,7 +2235,7 @@ before `eval' is executed.  In versions of bash later than bash-2.0,
 does the same thing.
 
 This is not the same thing as ksh93 `nameref' variables, though the syntax
-is similar.  I may add namerefs in a future bash version.
+is similar.  Namerefs are available bash version 4.3, and work as in ksh93.
 
 G4) How can I make the bash `time' reserved word print timing output that
      looks like the output from my system's /usr/bin/time?
@@ -1691,7 +2311,12 @@ this:
        echo .!(.|) *
 
 A solution that works without extended globbing is given in the Unix Shell
-FAQ, posted periodically to comp.unix.shell.
+FAQ, posted periodically to comp.unix.shell.  It's a variant of
+
+       echo .[!.]* ..?* *
+
+(The ..?* catches files with names of three or more characters beginning
+with `..')
 
 Section H:  Where do I go from here?
 
@@ -1735,27 +2360,31 @@ ftp.cwru.edu in the `pub/bash' directory.
 Cameron Newham and Bill Rosenblatt have written a book on bash, published
 by O'Reilly and Associates.  The book is based on Bill Rosenblatt's Korn
 Shell book.  The title is ``Learning the Bash Shell'', and the ISBN number
-is 1-56592-147-X.  Look for it in fine bookstores near you.  This book
-covers bash-1.14, but has an appendix describing some of the new features
-in bash-2.0.  
-
-A second edition of this book is available, published in January, 1998.
-The ISBN number is 1-56592-347-2.  Look for it in the same fine bookstores
-or on the web.
+of the third edition, published in March, 2005, is 0-596-00965-8.  Look for
+it in fine bookstores near you.  This edition of the book has been updated
+to cover bash-3.0.
 
 The GNU Bash Reference Manual has been published as a printed book by
-Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Feb 2003).  It covers
-bash-2.0 and is available from most online bookstores (see
+Network Theory Ltd (Paperback, ISBN: 0-9541617-7-7, Nov. 2006).  It covers
+bash-3.2 and is available from most online bookstores (see
 http://www.network-theory.co.uk/bash/manual/ for details).  The publisher
 will donate $1 to the Free Software Foundation for each copy sold. 
 
+Arnold Robbins and Nelson Beebe have written ``Classic Shell Scripting'',
+published by O'Reilly.  The first edition, with ISBN number 0-596-00595-4,
+was published in May, 2005.
+
+Chris F. A. Johnson, a frequent contributor to comp.unix.shell and
+gnu.bash.bug, has written ``Shell Scripting Recipes: A Problem-Solution
+Approach,'' a new book on shell scripting, concentrating on features of
+the POSIX standard helpful to shell script writers.  The first edition from
+Apress, with ISBN number 1-59059-471-1, was published in May, 2005.
+
 H3) What's coming in future versions?
 
 These are features I hope to include in a future version of bash.
 
-Rocky Bernstein's bash debugger (support is included with bash-3.0)
-associative arrays
-co-processes, but with a new-style syntax that looks like function declaration
+Rocky Bernstein's bash debugger (support is included with bash-4.0)
 
 H4) What's on the bash `wish list' for future versions?
 
@@ -1763,21 +2392,18 @@ These are features that may or may not appear in a future version of bash.
 
 breaking some of the shell functionality into embeddable libraries
 a module system like zsh's, using dynamic loading like builtins
-date-stamped command history
 a bash programmer's guide with a chapter on creating loadable builtins
 a better loadable interface to perl with access to the shell builtins and
        variables (contributions gratefully accepted)
-ksh93-like `nameref' variables
-ksh93-like `+=' variable assignment operator
 ksh93-like `xx.yy' variables (including some of the .sh.* variables) and
        associated disipline functions
 Some of the new ksh93 pattern matching operators, like backreferencing
 
 H5) When will the next release appear?
 
-The next version will appear sometime in 2005.  Never make predictions. 
+The next version will appear sometime in 2015.  Never make predictions. 
 
-This document is Copyright 1995-2004 by Chester Ramey.
+This document is Copyright 1995-2014 by Chester Ramey.
 
 Permission is hereby granted, without written agreement and
 without license or royalty fees, to use, copy, and distribute