]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
new GLOBSORT variable
authorChet Ramey <chet.ramey@case.edu>
Sun, 16 Apr 2023 20:13:14 +0000 (16:13 -0400)
committerChet Ramey <chet.ramey@case.edu>
Sun, 16 Apr 2023 20:13:14 +0000 (16:13 -0400)
36 files changed:
CWRU/CWRU.chlog
MANIFEST
Makefile.in
config-top.h
config.h.in
configure
configure.ac
doc/bash.0
doc/bash.1
doc/bash.info
doc/bashref.info
doc/bashref.texi
doc/version.texi
examples/loadables/getconf.c
externs.h
lib/readline/examples/excallback.c
lib/readline/examples/fileman.c
lib/readline/examples/manexamp.c
lib/readline/examples/rl-callbacktest2.c
lib/readline/examples/rl.c
lib/readline/examples/rlcat.c
lib/readline/examples/rlptytest.c
lib/readline/examples/rltest.c
lib/sh/Makefile.in
lib/sh/anonfile.c [new file with mode: 0644]
lib/sh/strlcpy.c [new file with mode: 0644]
lib/sh/strscpy.c [new file with mode: 0644]
lib/sh/tmpfile.c
parse.y
pathexp.c
pathexp.h
pcomplete.c
po/hr.gmo
po/hr.po
variables.c
variables.h

index 02250cf463cc11285cb0767b561520b30ed51454..574bac6a775da269d74cedd3b9281f086e1cbd2d 100644 (file)
@@ -6001,3 +6001,33 @@ sig.c,sig.h
          not set anywhere yet), call sigpipe_handler instead of terminating
          the shell. Still need to make sure a sighandler is installed for
          SIGPIPE even if initialize_terminating_signals isn't called
+
+                                  4/14
+                                  ----
+lib/sh/tmpfile.c
+       - sh_mktmpfd: add support for MT_UNLINK flag, unlinks created filename
+         before returning fd, fails if the unlink fails for some reason
+
+                                  4/15
+                                  ----
+pathexp.c,pathexp.h
+       - globsort: support for various glob sorting criteria as defined by
+         the GLOBSORT variable: name, size, blocks, mtime, atime, ctime.
+         Default is ascending sort by name, as is traditional. Based on an
+         idea from Evan Gates <evan.gates@gmail.com>
+       - setup_globsort: parse the value of the GLOBSORT variable, find
+         sorting type and whether or not it's ascending or descending
+       - noquote_glob_filename: glob_filename for programmable completion,
+         doesn't call quote_string_for_globbing and honors GLOBSORT, dotglob,
+         and globstar
+
+pcomplete.c
+       - gen_globpat_matches: call noquote_glob_filename, let that handle
+         all the variables and GLOB_FAILED
+
+variables.c
+       - GLOBSORT: support for special variable, call setup_globsort on
+         set or unset
+
+doc/bash.1,doc/bashref.texi
+       - GLOBSORT: document variable and its effects on pathname expansion
index 14c2e0f1b7cd3a4902b4afb43ffeafe6a8672a13..c6d14945795774f804d74f311277e2faa6efbad9 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -398,6 +398,7 @@ lib/readline/examples/rl.c  f
 lib/readline/examples/rlcat.c  f
 lib/readline/examples/Inputrc  f
 lib/sh/Makefile.in     f
+lib/sh/anonfile.c      f
 lib/sh/casemod.c       f
 lib/sh/clktck.c                f
 lib/sh/clock.c         f
@@ -444,8 +445,10 @@ lib/sh/strerror.c  f
 lib/sh/strftime.c      f
 lib/sh/stringlist.c    f
 lib/sh/stringvec.c     f
+lib/sh/strlcpy.c       f
 lib/sh/strnlen.c       f
 lib/sh/strpbrk.c       f
+lib/sh/strscpy.c       f
 lib/sh/strstr.c                f
 lib/sh/strtod.c                f
 lib/sh/strtoimax.c     f
index ab45e1a55f872ef1f52c0b4ebeab380ccf257ca7..115c6a210bd0c3f10c7b1e43e704c4f59a6c5741 100644 (file)
@@ -236,7 +236,7 @@ SHLIB_SOURCE =      ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
                ${SH_LIBSRC}/eaccess.c ${SH_LIBSRC}/wcsdup.c \
                ${SH_LIBSRC}/zmapfd.c ${SH_LIBSRC}/fpurge.c \
                ${SH_LIBSRC}/zgetline.c ${SH_LIBSRC}/mbscmp.c \
-               ${SH_LIBSRC}/mbsncmp.c \
+               ${SH_LIBSRC}/mbsncmp.c ${SH_LIBSRC}/anonfile.c \
                ${SH_LIBSRC}/casemod.c ${SH_LIBSRC}/uconvert.c \
                ${SH_LIBSRC}/ufuncs.c ${SH_LIBSRC}/dprintf.c \
                ${SH_LIBSRC}/input_avail.c ${SH_LIBSRC}/mbscasecmp.c \
@@ -244,7 +244,8 @@ SHLIB_SOURCE =      ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
                ${SH_LIBSRC}/wcswidth.c ${SH_LIBSRC}/wcsnwidth.c \
                ${SH_LIBSRC}/shmbchar.c ${SH_LIBSRC}/utf8.c \
                ${SH_LIBSRC}/random.c ${SH_LIBSRC}/gettimeofday.c \
-               ${SH_LIBSRC}/timers.c ${SH_LIBSRC}/strvis.c
+               ${SH_LIBSRC}/timers.c ${SH_LIBSRC}/strvis.c \
+               ${SH_LIBSRC}/strlcpy.c ${SH_LIBSRC}/strscpy.c 
 
 SHLIB_LIB = -lsh
 SHLIB_LIBNAME = libsh.a
index 6e87a7cedaed19ca56114fa95fc88f8e0fe2248d..62b67096f43f9facccd698a7b0e4d41b8865a7cd 100644 (file)
@@ -69,7 +69,7 @@
    the Posix.2 confstr () function, or CS_PATH define are not present. */
 #ifndef STANDARD_UTILS_PATH
 #define STANDARD_UTILS_PATH \
-  "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
+  "/bin:/usr/bin:/sbin:/usr/sbin"
 #endif
 
 /* The default path for enable -f */
index 1681f8c34c64af8caacbaa64bdcce468388867e6..b5007fed06bfc7bb1930b9dfeb6776c51ef6e569 100644 (file)
 /* Define if you have the mbsrtowcs function. */
 #undef HAVE_MBSRTOWCS
 
+/* Define if you have the memfd_create function.  */
+#undef HAVE_MEMFD_CREATE
+
 /* Define if you have the memmove function.  */
 #undef HAVE_MEMMOVE
 
 #undef HAVE_SETRESUID
 #undef HAVE_DECL_SETRESUID
 
+/* Define if you have the shm_open function.  */
+#undef HAVE_SHM_OPEN
+
+/* Define if you have the shm_mkstemp function.  */
+#undef HAVE_SHM_MKSTEMP
+
 /* Define if you have the setvbuf function.  */
 #undef HAVE_SETVBUF
 
 /* Define if you have the strftime function. */
 #undef HAVE_STRFTIME
 
+/* Define if you have the strlcat function. */
+#undef HAVE_STRLCAT
+
 /* Define if you have the strnlen function. */
 #undef HAVE_STRNLEN
 
index 74dc82e8077cfd8a998c88bf2b9377d523795e18..f0d841f9aea38e55b5ba9f811aaa422118427197 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac for Bash 5.2, version 5.049.
+# From configure.ac for Bash 5.2, version 5.050.
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.71 for bash 5.2-maint.
 #
@@ -15305,6 +15305,33 @@ then :
 
 fi
 
+ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
+if test "x$ac_cv_func_strlcat" = xyes
+then :
+  printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_func "$LINENO" "memfd_create" "ac_cv_func_memfd_create"
+if test "x$ac_cv_func_memfd_create" = xyes
+then :
+  printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "shm_open" "ac_cv_func_shm_open"
+if test "x$ac_cv_func_shm_open" = xyes
+then :
+  printf "%s\n" "#define HAVE_SHM_OPEN 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "shm_mkstemp" "ac_cv_func_shm_mkstemp"
+if test "x$ac_cv_func_shm_mkstemp" = xyes
+then :
+  printf "%s\n" "#define HAVE_SHM_MKSTEMP 1" >>confdefs.h
+
+fi
+
 
 ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
 if test "x$ac_cv_func_getcwd" = xyes
@@ -15546,6 +15573,20 @@ esac
 
 fi
 
+ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
+if test "x$ac_cv_func_strlcpy" = xyes
+then :
+  printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h
+
+else $as_nop
+  case " $LIBOBJS " in
+  *" strlcpy.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
+ ;;
+esac
+
+fi
+
 
 ac_fn_c_check_header_compile "$LINENO" "libaudit.h" "ac_cv_header_libaudit_h" "$ac_includes_default"
 if test "x$ac_cv_header_libaudit_h" = xyes
index 68c38c09da0656f31cdc0f2e5e95d1e32689cb0e..bcd7f040d1efaf6c3862725b91b32d406e057d43 100644 (file)
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script.
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_REVISION([for Bash 5.2, version 5.049])dnl
+AC_REVISION([for Bash 5.2, version 5.050])dnl
 
 define(bashvers, 5.2)
 define(relstatus, maint)
@@ -857,6 +857,9 @@ AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)
 AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
 AC_CHECK_FUNCS(mkstemp mkdtemp)
 AC_CHECK_FUNCS(arc4random)
+AC_CHECK_FUNCS(strlcat)
+
+AC_CHECK_FUNCS(memfd_create shm_open shm_mkstemp)
 
 AC_REPLACE_FUNCS(getcwd memset)
 AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr)
@@ -864,6 +867,7 @@ AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoumax)
 AC_REPLACE_FUNCS(dprintf)
 AC_REPLACE_FUNCS(strchrnul)
 AC_REPLACE_FUNCS(strdup)
+AC_REPLACE_FUNCS(strlcpy)
 
 AC_CHECK_HEADERS(libaudit.h)
 AC_CHECK_DECLS([AUDIT_USER_TTY],,, [[#include <linux/audit.h>]])
index b8e32b75b4f5100878a697e341f015f00cef8077..5e635134c859c9945a96cd25872fa4af6eea5bd4 100644 (file)
@@ -1193,197 +1193,214 @@ P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
               names to be ignored by  pathname  expansion.   If  a  file  name
               matched  by a pathname expansion pattern also matches one of the
               patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE, it is removed from the list of matches.
+       G\bGL\bLO\bOB\bBS\bSO\bOR\bRT\bT
+              Control how the results of pathname expansion are  sorted.   The
+              value  of this variable specifies the sort criteria and sort or-
+              der for the results of pathname expansion.  If this variable  is
+              unset  or  set  to  the null string, pathname expansion uses the
+              historial behavior of sorting by name.  If set,  a  valid  value
+              begins  with  an  optional  _\b+, which is ignored, or _\b-, which re-
+              verses the sort order from ascending to descending, followed  by
+              a  sort  specifier.   The  valid sort specifiers are _\bn_\ba_\bm_\be, _\bs_\bi_\bz_\be,
+              _\bm_\bt_\bi_\bm_\be, _\ba_\bt_\bi_\bm_\be, _\bc_\bt_\bi_\bm_\be, and _\bb_\bl_\bo_\bc_\bk_\bs, which sort the files  on  name,
+              file  size,  modification  time, access time, inode change time,
+              and number of blocks, respectively.  For  example,  a  value  of
+              -\b-m\bmt\bti\bim\bme\be  sorts  the  results  in descending order by modification
+              time (newest first).  If the sort specifier is missing,  it  de-
+              faults  to  _\bn_\ba_\bm_\be,  so  a  value  of  _\b+ is equivalent to the null
+              string, and a value of _\b- sorts by name in descending order.  Any
+              invalid value restores the historical sorting behavior.
        H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL
-              A colon-separated list of values controlling  how  commands  are
-              saved  on  the history list.  If the list of values includes _\bi_\bg_\b-
-              _\bn_\bo_\br_\be_\bs_\bp_\ba_\bc_\be, lines which begin with  a  s\bsp\bpa\bac\bce\be  character  are  not
-              saved  in  the history list.  A value of _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs causes lines
+              A  colon-separated  list  of values controlling how commands are
+              saved on the history list.  If the list of values  includes  _\bi_\bg_\b-
+              _\bn_\bo_\br_\be_\bs_\bp_\ba_\bc_\be,  lines  which  begin  with  a s\bsp\bpa\bac\bce\be character are not
+              saved in the history list.  A value of _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs  causes  lines
               matching the previous history entry to not be saved.  A value of
               _\bi_\bg_\bn_\bo_\br_\be_\bb_\bo_\bt_\bh is shorthand for _\bi_\bg_\bn_\bo_\br_\be_\bs_\bp_\ba_\bc_\be and _\bi_\bg_\bn_\bo_\br_\be_\bd_\bu_\bp_\bs.  A value
               of _\be_\br_\ba_\bs_\be_\bd_\bu_\bp_\bs causes all previous lines matching the current line
-              to  be  removed from the history list before that line is saved.
-              Any value not in the above list is ignored.  If  H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\b is
-              unset,  or does not include a valid value, all lines read by the
+              to be removed from the history list before that line  is  saved.
+              Any  value  not in the above list is ignored.  If H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL is
+              unset, or does not include a valid value, all lines read by  the
               shell parser are saved on the history list, subject to the value
-              of  H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE.  The second and subsequent lines of a multi-line
-              compound command are not tested, and are added  to  the  history
+              of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE.  The second and subsequent lines of a  multi-line
+              compound  command  are  not tested, and are added to the history
               regardless of the value of H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL.
        H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bE
               The name of the file in which command history is saved (see H\bHI\bIS\bS-\b-
-              T\bTO\bOR\bRY\bbelow).  The default value is _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by.   If  unset,
+              T\bTO\bOR\bRY\b below).   The default value is _\b~_\b/_\b._\bb_\ba_\bs_\bh_\b__\bh_\bi_\bs_\bt_\bo_\br_\by.  If unset,
               the command history is not saved when a shell exits.
        H\bHI\bIS\bST\bTF\bFI\bIL\bLE\bES\bSI\bIZ\bZE\bE
               The maximum number of lines contained in the history file.  When
-              this variable is assigned a value, the  history  file  is  trun-
-              cated,  if  necessary,  to  contain  no more than that number of
-              lines by removing the oldest entries.  The history file is  also
-              truncated  to this size after writing it when a shell exits.  If
-              the value is 0, the history file  is  truncated  to  zero  size.
-              Non-numeric  values  and  numeric  values less than zero inhibit
-              truncation.  The shell sets the default value to  the  value  of
+              this  variable  is  assigned  a value, the history file is trun-
+              cated, if necessary, to contain no  more  than  that  number  of
+              lines  by removing the oldest entries.  The history file is also
+              truncated to this size after writing it when a shell exits.   If
+              the  value  is  0,  the  history file is truncated to zero size.
+              Non-numeric values and numeric values  less  than  zero  inhibit
+              truncation.   The  shell  sets the default value to the value of
               H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE after reading any startup files.
        H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE
-              A  colon-separated list of patterns used to decide which command
-              lines should be saved on the history list.  Each pattern is  an-
-              chored  at the beginning of the line and must match the complete
-              line (no implicit `*\b*' is  appended).   Each  pattern  is  tested
-              against  the  line after the checks specified by H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\bL are
+              A colon-separated list of patterns used to decide which  command
+              lines  should be saved on the history list.  Each pattern is an-
+              chored at the beginning of the line and must match the  complete
+              line  (no  implicit  `*\b*'  is  appended).  Each pattern is tested
+              against the line after the checks specified by  H\bHI\bIS\bST\bTC\bCO\bON\bNT\bTR\bRO\bOL\b are
               applied.  In addition to the normal shell pattern matching char-
-              acters,  `&\b&'  matches the previous history line.  `&\b&' may be es-
-              caped using a backslash; the backslash  is  removed  before  at-
-              tempting  a  match.  The second and subsequent lines of a multi-
-              line compound command are not tested, and are added to the  his-
-              tory  regardless of the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE.  The pattern match-
+              acters, `&\b&' matches the previous history line.  `&\b&' may  be  es-
+              caped  using  a  backslash;  the backslash is removed before at-
+              tempting a match.  The second and subsequent lines of  a  multi-
+              line  compound command are not tested, and are added to the his-
+              tory regardless of the value of H\bHI\bIS\bST\bTI\bIG\bGN\bNO\bOR\bRE\bE.  The pattern  match-
               ing honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb shell option.
        H\bHI\bIS\bST\bTS\bSI\bIZ\bZE\bE
-              The number of commands to remember in the command  history  (see
-              H\bHI\bIS\bST\bTO\bOR\bRY\b below).   If  the value is 0, commands are not saved in
+              The  number  of commands to remember in the command history (see
+              H\bHI\bIS\bST\bTO\bOR\bRY\bbelow).  If the value is 0, commands are  not  saved  in
               the history list.  Numeric values less than zero result in every
-              command  being  saved  on  the history list (there is no limit).
-              The shell sets the  default  value  to  500  after  reading  any
+              command being saved on the history list  (there  is  no  limit).
+              The  shell  sets  the  default  value  to  500 after reading any
               startup files.
        H\bHI\bIS\bST\bTT\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT
-              If  this  variable  is  set and not null, its value is used as a
+              If this variable is set and not null, its value  is  used  as  a
               format string for _\bs_\bt_\br_\bf_\bt_\bi_\bm_\be(3) to print the time stamp associated
-              with  each  history  entry displayed by the h\bhi\bis\bst\bto\bor\bry\by builtin.  If
-              this variable is set, time stamps are  written  to  the  history
-              file  so they may be preserved across shell sessions.  This uses
-              the history comment character  to  distinguish  timestamps  from
+              with each history entry displayed by the  h\bhi\bis\bst\bto\bor\bry\by  builtin.   If
+              this  variable  is  set,  time stamps are written to the history
+              file so they may be preserved across shell sessions.  This  uses
+              the  history  comment  character  to distinguish timestamps from
               other history lines.
        H\bHO\bOM\bME\bE   The home directory of the current user; the default argument for
               the c\bcd\bd builtin command.  The value of this variable is also used
               when performing tilde expansion.
        H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE
-              Contains  the  name  of  a file in the same format as _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs
+              Contains the name of a file in the  same  format  as  _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs
               that should be read when the shell needs to complete a hostname.
-              The  list  of possible hostname completions may be changed while
-              the shell is running; the next time hostname completion  is  at-
-              tempted  after  the  value is changed, b\bba\bas\bsh\bh adds the contents of
-              the new file to the existing list.  If H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is set, but  has
-              no  value,  or  does  not name a readable file, b\bba\bas\bsh\bh attempts to
-              read _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs to obtain the list of possible hostname  comple-
+              The list of possible hostname completions may be  changed  while
+              the  shell  is running; the next time hostname completion is at-
+              tempted after the value is changed, b\bba\bas\bsh\bh adds  the  contents  of
+              the  new file to the existing list.  If H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is set, but has
+              no value, or does not name a readable  file,  b\bba\bas\bsh\bh  attempts  to
+              read  _\b/_\be_\bt_\bc_\b/_\bh_\bo_\bs_\bt_\bs to obtain the list of possible hostname comple-
               tions.  When H\bHO\bOS\bST\bTF\bFI\bIL\bLE\bE is unset, the hostname list is cleared.
        I\bIF\bFS\bS    The _\bI_\bn_\bt_\be_\br_\bn_\ba_\bl _\bF_\bi_\be_\bl_\bd _\bS_\be_\bp_\ba_\br_\ba_\bt_\bo_\br that is used for word splitting af-
-              ter expansion and to  split  lines  into  words  with  the  r\bre\bea\bad\bd
+              ter  expansion  and  to  split  lines  into  words with the r\bre\bea\bad\bd
               builtin  command.   The  default  value  is  ``<space><tab><new-
               line>''.
        I\bIG\bGN\bNO\bOR\bRE\bEE\bEO\bOF\bF
               Controls the action of an interactive shell on receipt of an E\bEO\bOF\bF
               character as the sole input.  If set, the value is the number of
-              consecutive E\bEO\bOF\bF characters which must  be  typed  as  the  first
-              characters  on an input line before b\bba\bas\bsh\bh exits.  If the variable
-              exists but does not have a numeric value, or has no  value,  the
-              default  value  is  10.  If it does not exist, E\bEO\bOF\bF signifies the
+              consecutive  E\bEO\bOF\bF  characters  which  must  be typed as the first
+              characters on an input line before b\bba\bas\bsh\bh exits.  If the  variable
+              exists  but  does not have a numeric value, or has no value, the
+              default value is 10.  If it does not exist,  E\bEO\bOF\bF  signifies  the
               end of input to the shell.
        I\bIN\bNP\bPU\bUT\bTR\bRC\bC
-              The filename for the r\bre\bea\bad\bdl\bli\bin\bne\be startup file, overriding  the  de-
+              The  filename  for the r\bre\bea\bad\bdl\bli\bin\bne\be startup file, overriding the de-
               fault of _\b~_\b/_\b._\bi_\bn_\bp_\bu_\bt_\br_\bc (see R\bRE\bEA\bAD\bDL\bLI\bIN\bNE\bE below).
        I\bIN\bNS\bSI\bID\bDE\bE_\b_E\bEM\bMA\bAC\bCS\bS
-              If  this  variable  appears  in  the  environment when the shell
-              starts, b\bba\bas\bsh\bh assumes that it is running inside  an  Emacs  shell
-              buffer  and  may disable line editing, depending on the value of
+              If this variable appears  in  the  environment  when  the  shell
+              starts,  b\bba\bas\bsh\bh  assumes  that it is running inside an Emacs shell
+              buffer and may disable line editing, depending on the  value  of
               T\bTE\bER\bRM\bM.
-       L\bLA\bAN\bNG\bG   Used to determine the  locale  category  for  any  category  not
+       L\bLA\bAN\bNG\bG   Used  to  determine  the  locale  category  for any category not
               specifically selected with a variable starting with L\bLC\bC_\b_.
-       L\bLC\bC_\b_A\bAL\bLL\bL This  variable  overrides  the  value  of L\bLA\bAN\bNG\bG and any other L\bLC\bC_\b_
+       L\bLC\bC_\b_A\bAL\bLL\bL This variable overrides the value of  L\bLA\bAN\bNG\bG  and  any  other  L\bLC\bC_\b_
               variable specifying a locale category.
        L\bLC\bC_\b_C\bCO\bOL\bLL\bLA\bAT\bTE\bE
-              This variable determines the collation order used  when  sorting
-              the  results  of pathname expansion, and determines the behavior
-              of range expressions, equivalence  classes,  and  collating  se-
+              This  variable  determines the collation order used when sorting
+              the results of pathname expansion, and determines  the  behavior
+              of  range  expressions,  equivalence  classes, and collating se-
               quences within pathname expansion and pattern matching.
        L\bLC\bC_\b_C\bCT\bTY\bYP\bPE\bE
-              This  variable  determines  the interpretation of characters and
-              the behavior of character classes within pathname expansion  and
+              This variable determines the interpretation  of  characters  and
+              the  behavior of character classes within pathname expansion and
               pattern matching.
        L\bLC\bC_\b_M\bME\bES\bSS\bSA\bAG\bGE\bES\bS
-              This  variable  determines  the locale used to translate double-
+              This variable determines the locale used  to  translate  double-
               quoted strings preceded by a $\b$.
        L\bLC\bC_\b_N\bNU\bUM\bME\bER\bRI\bIC\bC
-              This variable determines the locale  category  used  for  number
+              This  variable  determines  the  locale category used for number
               formatting.
        L\bLC\bC_\b_T\bTI\bIM\bME\bE
-              This  variable  determines the locale category used for data and
+              This variable determines the locale category used for  data  and
               time formatting.
-       L\bLI\bIN\bNE\bES\bS  Used by the s\bse\bel\ble\bec\bct\bt compound  command  to  determine  the  column
-              length  for  printing selection lists.  Automatically set if the
-              c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\boption is enabled or in an interactive  shell  upon
+       L\bLI\bIN\bNE\bES\bS  Used  by  the  s\bse\bel\ble\bec\bct\bt  compound  command to determine the column
+              length for printing selection lists.  Automatically set  if  the
+              c\bch\bhe\bec\bck\bkw\bwi\bin\bns\bsi\biz\bze\b option  is enabled or in an interactive shell upon
               receipt of a S\bSI\bIG\bGW\bWI\bIN\bNC\bCH\bH.
-       M\bMA\bAI\bIL\bL   If  this  parameter  is  set to a file or directory name and the
-              M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bvariable is not set, b\bba\bas\bsh\bh informs the user of  the  ar-
+       M\bMA\bAI\bIL\bL   If this parameter is set to a file or  directory  name  and  the
+              M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\b variable  is not set, b\bba\bas\bsh\bh informs the user of the ar-
               rival of mail in the specified file or Maildir-format directory.
        M\bMA\bAI\bIL\bLC\bCH\bHE\bEC\bCK\bK
-              Specifies  how often (in seconds) b\bba\bas\bsh\bh checks for mail.  The de-
-              fault is 60 seconds.  When it is time to  check  for  mail,  the
-              shell  does  so  before  displaying the primary prompt.  If this
-              variable is unset, or set to  a  value  that  is  not  a  number
+              Specifies how often (in seconds) b\bba\bas\bsh\bh checks for mail.  The  de-
+              fault  is  60  seconds.   When it is time to check for mail, the
+              shell does so before displaying the  primary  prompt.   If  this
+              variable  is  unset,  or  set  to  a  value that is not a number
               greater than or equal to zero, the shell disables mail checking.
        M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH
               A colon-separated list of filenames to be checked for mail.  The
               message to be printed when mail arrives in a particular file may
-              be  specified by separating the filename from the message with a
-              `?'.  When used in the text of the message, $\b$_\b_  expands  to  the
+              be specified by separating the filename from the message with  a
+              `?'.   When  used  in the text of the message, $\b$_\b_ expands to the
               name of the current mailfile.  Example:
               M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH='/var/mail/bfox?"You  have  mail":~/shell-mail?"$_  has
               mail!"'
-              B\bBa\bas\bsh\bcan be configured to supply a default value for this  vari-
-              able  (there  is  no  value by default), but the location of the
+              B\bBa\bas\bsh\b can be configured to supply a default value for this vari-
+              able (there is no value by default), but  the  location  of  the
               user  mail  files  that  it  uses  is  system  dependent  (e.g.,
               /var/mail/$\b$U\bUS\bSE\bER\bR).
        O\bOP\bPT\bTE\bER\bRR\bR If set to the value 1, b\bba\bas\bsh\bh displays error messages generated by
-              the g\bge\bet\bto\bop\bpt\bts\bs builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\b below).
-              O\bOP\bPT\bTE\bER\bRR\b is  initialized to 1 each time the shell is invoked or a
+              the  g\bge\bet\bto\bop\bpt\bts\bs builtin command (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
+              O\bOP\bPT\bTE\bER\bRR\bis initialized to 1 each time the shell is invoked  or  a
               shell script is executed.
-       P\bPA\bAT\bTH\bH   The search path for commands.  It is a colon-separated  list  of
-              directories  in  which the shell looks for commands (see C\bCO\bOM\bMM\bMA\bAN\bND\bD
-              E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\bbelow).  A zero-length (null) directory  name  in  the
+       P\bPA\bAT\bTH\bH   The  search  path for commands.  It is a colon-separated list of
+              directories in which the shell looks for commands  (see  C\bCO\bOM\bMM\bMA\bAN\bND\bD
+              E\bEX\bXE\bEC\bCU\bUT\bTI\bIO\bON\b below).   A  zero-length (null) directory name in the
               value of P\bPA\bAT\bTH\bH indicates the current directory.  A null directory
-              name may appear as two adjacent colons,  or  as  an  initial  or
-              trailing  colon.   The  default path is system-dependent, and is
+              name  may  appear  as  two  adjacent colons, or as an initial or
+              trailing colon.  The default path is  system-dependent,  and  is
               set by the administrator who installs b\bba\bas\bsh\bh.  A common value is
               ``/usr/local/bin:/usr/lo-
               cal/sbin:/usr/bin:/usr/sbin:/bin:/sbin''.
        P\bPO\bOS\bSI\bIX\bXL\bLY\bY_\b_C\bCO\bOR\bRR\bRE\bEC\bCT\bT
-              If this variable is in the environment  when  b\bba\bas\bsh\bh  starts,  the
-              shell  enters _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be before reading the startup files, as if
-              the -\b--\b-p\bpo\bos\bsi\bix\bx invocation option had been supplied.  If it  is  set
-              while  the  shell is running, b\bba\bas\bsh\bh enables _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, as if the
-              command _\bs_\be_\bt _\b-_\bo _\bp_\bo_\bs_\bi_\bx had been executed.  When the  shell  enters
+              If  this  variable  is  in the environment when b\bba\bas\bsh\bh starts, the
+              shell enters _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be before reading the startup files, as  if
+              the  -\b--\b-p\bpo\bos\bsi\bix\bx  invocation option had been supplied.  If it is set
+              while the shell is running, b\bba\bas\bsh\bh enables _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, as  if  the
+              command  _\bs_\be_\bt  _\b-_\bo _\bp_\bo_\bs_\bi_\bx had been executed.  When the shell enters
               _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be, it sets this variable if it was not already set.
        P\bPR\bRO\bOM\bMP\bPT\bT_\b_C\bCO\bOM\bMM\bMA\bAN\bND\bD
-              If  this variable is set, and is an array, the value of each set
-              element is executed as a command prior to issuing  each  primary
-              prompt.   If this is set but not an array variable, its value is
+              If this variable is set, and is an array, the value of each  set
+              element  is  executed as a command prior to issuing each primary
+              prompt.  If this is set but not an array variable, its value  is
               used as a command to execute instead.
        P\bPR\bRO\bOM\bMP\bPT\bT_\b_D\bDI\bIR\bRT\bTR\bRI\bIM\bM
-              If set to a number greater than zero, the value is used  as  the
+              If  set  to a number greater than zero, the value is used as the
               number of trailing directory components to retain when expanding
-              the \\b\w\bw and \\b\W\bW  prompt  string  escapes  (see  P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\b below).
+              the  \\b\w\bw  and  \\b\W\bW  prompt  string  escapes (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
               Characters removed are replaced with an ellipsis.
-       P\bPS\bS0\b0    The  value  of  this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
-              and displayed by interactive shells after reading a command  and
+       P\bPS\bS0\b0    The value of this parameter is expanded  (see  P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\b below)
+              and  displayed by interactive shells after reading a command and
               before the command is executed.
-       P\bPS\bS1\b1    The  value  of  this parameter is expanded (see P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below)
-              and used as the primary prompt string.   The  default  value  is
+       P\bPS\bS1\b1    The value of this parameter is expanded  (see  P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\b below)
+              and  used  as  the  primary prompt string.  The default value is
               ``\\b\s\bs-\b-\\b\v\bv\\b\$\b$ ''.
-       P\bPS\bS2\b2    The  value of this parameter is expanded as with P\bPS\bS1\b1 and used as
+       P\bPS\bS2\b2    The value of this parameter is expanded as with P\bPS\bS1\b1 and used  as
               the secondary prompt string.  The default is ``>\b> ''.
        P\bPS\bS3\b3    The value of this parameter is used as the prompt for the s\bse\bel\ble\bec\bct\bt
               command (see S\bSH\bHE\bEL\bLL\bL G\bGR\bRA\bAM\bMM\bMA\bAR\bR above).
-       P\bPS\bS4\b4    The  value  of  this  parameter  is expanded as with P\bPS\bS1\b1 and the
+       P\bPS\bS4\b4    The value of this parameter is expanded  as  with  P\bPS\bS1\b1  and  the
               value is printed before each command b\bba\bas\bsh\bh displays during an ex-
               ecution trace.  The first character of the expanded value of P\bPS\bS4\b4
               is replicated multiple times, as necessary, to indicate multiple
               levels of indirection.  The default is ``+\b+ ''.
-       S\bSH\bHE\bEL\bLL\bL  This  variable expands to the full pathname to the shell.  If it
-              is not set when the shell starts, b\bba\bas\bsh\bh assigns to  it  the  full
+       S\bSH\bHE\bEL\bLL\bL  This variable expands to the full pathname to the shell.  If  it
+              is  not  set  when the shell starts, b\bba\bas\bsh\bh assigns to it the full
               pathname of the current user's login shell.
        T\bTI\bIM\bME\bEF\bFO\bOR\bRM\bMA\bAT\bT
-              The  value of this parameter is used as a format string specify-
-              ing how the timing information for pipelines prefixed  with  the
-              t\bti\bim\bme\b reserved word should be displayed.  The %\b% character intro-
-              duces an escape sequence that is expanded to  a  time  value  or
-              other  information.  The escape sequences and their meanings are
+              The value of this parameter is used as a format string  specify-
+              ing  how  the timing information for pipelines prefixed with the
+              t\bti\bim\bme\breserved word should be displayed.  The %\b% character  intro-
+              duces  an  escape  sequence  that is expanded to a time value or
+              other information.  The escape sequences and their meanings  are
               as follows; the braces denote optional portions.
               %\b%%\b%        A literal %\b%.
               %\b%[\b[_\bp]\b][\b[l\bl]\b]R\bR  The elapsed time in seconds.
@@ -1391,77 +1408,77 @@ P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
               %\b%[\b[_\bp]\b][\b[l\bl]\b]S\bS  The number of CPU seconds spent in system mode.
               %\b%P\bP        The CPU percentage, computed as (%U + %S) / %R.
 
-              The optional _\bp is a digit specifying the _\bp_\br_\be_\bc_\bi_\bs_\bi_\bo_\bn,  the  number
+              The  optional  _\bp is a digit specifying the _\bp_\br_\be_\bc_\bi_\bs_\bi_\bo_\bn, the number
               of fractional digits after a decimal point.  A value of 0 causes
               no decimal point or fraction to be output.  At most three places
-              after  the  decimal  point may be specified; values of _\bp greater
-              than 3 are changed to 3.  If _\bp is not specified, the value 3  is
+              after the decimal point may be specified; values  of  _\b greater
+              than  3 are changed to 3.  If _\bp is not specified, the value 3 is
               used.
 
-              The  optional l\bl specifies a longer format, including minutes, of
-              the form _\bM_\bMm_\bS_\bS._\bF_\bFs.  The value of _\bp determines  whether  or  not
+              The optional l\bl specifies a longer format, including minutes,  of
+              the  form  _\bM_\bMm_\bS_\bS._\bF_\bFs.   The value of _\bp determines whether or not
               the fraction is included.
 
-              If  this  variable  is not set, b\bba\bas\bsh\bh acts as if it had the value
-              $\b$'\b'\\b\n\bnr\bre\bea\bal\bl\\b\t\bt%\b%3\b3l\blR\bR\\b\n\bnu\bus\bse\ber\br\\b\t\bt%\b%3\b3l\blU\bU\\b\n\bns\bsy\bys\bs\\b\t\bt%\b%3\b3l\blS\bS'\b'.  If the value  is  null,
+              If this variable is not set, b\bba\bas\bsh\bh acts as if it  had  the  value
+              $\b$'\b'\\b\n\bnr\bre\bea\bal\bl\\b\t\bt%\b%3\b3l\blR\bR\\b\n\bnu\bus\bse\ber\br\\b\t\bt%\b%3\b3l\blU\bU\\b\n\bns\bsy\bys\bs\\b\t\bt%\b%3\b3l\blS\bS'\b'.   If  the value is null,
               no timing information is displayed.  A trailing newline is added
               when the format string is displayed.
        T\bTM\bMO\bOU\bUT\bT  If set to a value greater than zero, T\bTM\bMO\bOU\bUT\bT is treated as the de-
-              fault  timeout  for the r\bre\bea\bad\bd builtin.  The s\bse\bel\ble\bec\bct\bt command termi-
+              fault timeout for the r\bre\bea\bad\bd builtin.  The s\bse\bel\ble\bec\bct\bt  command  termi-
               nates if input does not arrive after T\bTM\bMO\bOU\bUT\bT seconds when input is
-              coming  from  a terminal.  In an interactive shell, the value is
+              coming from a terminal.  In an interactive shell, the  value  is
               interpreted as the number of seconds to wait for a line of input
               after issuing the primary prompt.  B\bBa\bas\bsh\bh terminates after waiting
-              for that number of seconds if a complete line of input does  not
+              for  that number of seconds if a complete line of input does not
               arrive.
-       T\bTM\bMP\bPD\bDI\bIR\bR If  set, b\bba\bas\bsh\bh uses its value as the name of a directory in which
+       T\bTM\bMP\bPD\bDI\bIR\bR If set, b\bba\bas\bsh\bh uses its value as the name of a directory in  which
               b\bba\bas\bsh\bh creates temporary files for the shell's use.
        a\bau\but\bto\bo_\b_r\bre\bes\bsu\bum\bme\be
               This variable controls how the shell interacts with the user and
-              job  control.   If this variable is set, single word simple com-
+              job control.  If this variable is set, single word  simple  com-
               mands without redirections are treated as candidates for resump-
               tion of an existing stopped job.  There is no ambiguity allowed;
-              if there is more than one job beginning with the  string  typed,
-              the  job  most  recently  accessed  is  selected.  The _\bn_\ba_\bm_\be of a
-              stopped job, in this context, is the command line used to  start
-              it.   If  set to the value _\be_\bx_\ba_\bc_\bt, the string supplied must match
-              the name of a stopped job exactly;  if  set  to  _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg,  the
-              string  supplied  needs  to  match  a substring of the name of a
-              stopped job.  The _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg value provides functionality  analo-
-              gous  to the %\b%?\b?  job identifier (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below).  If set
-              to any other value, the supplied string must be a  prefix  of  a
+              if  there  is more than one job beginning with the string typed,
+              the job most recently accessed  is  selected.   The  _\bn_\ba_\bm_\be  of  a
+              stopped  job, in this context, is the command line used to start
+              it.  If set to the value _\be_\bx_\ba_\bc_\bt, the string supplied  must  match
+              the  name  of  a  stopped  job exactly; if set to _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg, the
+              string supplied needs to match a substring  of  the  name  of  a
+              stopped  job.  The _\bs_\bu_\bb_\bs_\bt_\br_\bi_\bn_\bg value provides functionality analo-
+              gous to the %\b%?\b?  job identifier (see J\bJO\bOB\bB C\bCO\bON\bNT\bTR\bRO\bOL\bL below).  If  set
+              to  any  other  value, the supplied string must be a prefix of a
               stopped job's name; this provides functionality analogous to the
               %\b%_\bs_\bt_\br_\bi_\bn_\bg job identifier.
        h\bhi\bis\bst\btc\bch\bha\bar\brs\bs
-              The two or three characters which control history expansion  and
+              The  two or three characters which control history expansion and
               tokenization (see H\bHI\bIS\bST\bTO\bOR\bRY\bY E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN below).  The first character
-              is the _\bh_\bi_\bs_\bt_\bo_\br_\by _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn character, the character which  signals
-              the  start  of  a  history  expansion, normally `!\b!'.  The second
-              character is the _\bq_\bu_\bi_\bc_\bk _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character, which is used  as
-              shorthand  for  re-running the previous command entered, substi-
-              tuting one string for another in the command.   The  default  is
-              `^\b^'.   The optional third character is the character which indi-
-              cates that the remainder of the line is a comment when found  as
-              the  first  character of a word, normally `#\b#'.  The history com-
+              is  the _\bh_\bi_\bs_\bt_\bo_\br_\by _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn character, the character which signals
+              the start of a history  expansion,  normally  `!\b!'.   The  second
+              character  is the _\bq_\bu_\bi_\bc_\bk _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn character, which is used as
+              shorthand for re-running the previous command  entered,  substi-
+              tuting  one  string  for another in the command.  The default is
+              `^\b^'.  The optional third character is the character which  indi-
+              cates  that the remainder of the line is a comment when found as
+              the first character of a word, normally `#\b#'.  The  history  com-
               ment character causes history substitution to be skipped for the
-              remaining  words on the line.  It does not necessarily cause the
+              remaining words on the line.  It does not necessarily cause  the
               shell parser to treat the rest of the line as a comment.
 
    A\bAr\brr\bra\bay\bys\bs
-       B\bBa\bas\bsh\bprovides one-dimensional indexed and associative array  variables.
-       Any  variable may be used as an indexed array; the d\bde\bec\bcl\bla\bar\bre\be builtin will
-       explicitly declare an array.  There is no maximum limit on the size  of
-       an  array, nor any requirement that members be indexed or assigned con-
-       tiguously.  Indexed arrays are  referenced  using  integers  (including
+       B\bBa\bas\bsh\b provides one-dimensional indexed and associative array variables.
+       Any variable may be used as an indexed array; the d\bde\bec\bcl\bla\bar\bre\be builtin  will
+       explicitly  declare an array.  There is no maximum limit on the size of
+       an array, nor any requirement that members be indexed or assigned  con-
+       tiguously.   Indexed  arrays  are  referenced using integers (including
        arithmetic expressions) and are zero-based; associative arrays are ref-
        erenced using arbitrary strings.  Unless otherwise noted, indexed array
        indices must be non-negative integers.
 
-       An  indexed  array is created automatically if any variable is assigned
+       An indexed array is created automatically if any variable  is  assigned
        to using the syntax _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bv_\ba_\bl_\bu_\be.  The _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is treated as
        an arithmetic expression that must evaluate to a number.  To explicitly
-       declare an indexed array, use d\bde\bec\bcl\bla\bar\bre\be -\b-a\ba _\bn_\ba_\bm_\be (see S\bSH\bHE\bEL\bLL\bL  B\bBU\bUI\bIL\bLT\bTI\bIN\b C\bCO\bOM\bM-\b-
-       M\bMA\bAN\bND\bDS\b below).   d\bde\bec\bcl\bla\bar\bre\be  -\b-a\ba _\bn_\ba_\bm_\be[\b[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]\b] is also accepted; the _\bs_\bu_\bb_\b-
+       declare  an  indexed array, use d\bde\bec\bcl\bla\bar\bre\be -\b-a\ba _\bn_\ba_\bm_\be (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bM-\b-
+       M\bMA\bAN\bND\bDS\bbelow).  d\bde\bec\bcl\bla\bar\bre\be -\b-a\ba _\bn_\ba_\bm_\be[\b[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]\b] is also  accepted;  the  _\bs_\bu_\bb_\b-
        _\bs_\bc_\br_\bi_\bp_\bt is ignored.
 
        Associative arrays are created using d\bde\bec\bcl\bla\bar\bre\be -\b-A\bA _\bn_\ba_\bm_\be.
@@ -1469,159 +1486,159 @@ P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
        Attributes may be specified for an array variable using the d\bde\bec\bcl\bla\bar\bre\be and
        r\bre\bea\bad\bdo\bon\bnl\bly\by builtins.  Each attribute applies to all members of an array.
 
-       Arrays   are  assigned  to  using  compound  assignments  of  the  form
-       _\bn_\ba_\bm_\be=(\b(value_\b... value_\bn)\b), where each _\bv_\ba_\bl_\bu_\be may be  of  the  form  [_\bs_\bu_\bb_\b-
-       _\bs_\bc_\br_\bi_\bp_\bt]=_\bs_\bt_\br_\bi_\bn_\bg.   Indexed array assignments do not require anything but
-       _\bs_\bt_\br_\bi_\bn_\bg.  Each _\bv_\ba_\bl_\bu_\be in the list is expanded using the shell  expansions
+       Arrays  are  assigned  to  using  compound  assignments  of  the   form
+       _\bn_\ba_\bm_\be=(\b(value_\b ...  value_\bn)\b),  where  each _\bv_\ba_\bl_\bu_\be may be of the form [_\bs_\bu_\bb_\b-
+       _\bs_\bc_\br_\bi_\bp_\bt]=_\bs_\bt_\br_\bi_\bn_\bg.  Indexed array assignments do not require anything  but
+       _\bs_\bt_\br_\bi_\bn_\bg.   Each _\bv_\ba_\bl_\bu_\be in the list is expanded using the shell expansions
        described below under E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN, but _\bv_\ba_\bl_\bu_\bes that are valid variable as-
        signments including the brackets and subscript do not undergo brace ex-
-       pansion  and  word  splitting, as with individual variable assignments.
-       When assigning to indexed arrays, if the  optional  brackets  and  sub-
-       script  are supplied, that index is assigned to; otherwise the index of
-       the element assigned is the last index assigned  to  by  the  statement
+       pansion and word splitting, as with  individual  variable  assignments.
+       When  assigning  to  indexed  arrays, if the optional brackets and sub-
+       script are supplied, that index is assigned to; otherwise the index  of
+       the  element  assigned  is  the last index assigned to by the statement
        plus one.  Indexing starts at zero.
 
        When assigning to an associative array, the words in a compound assign-
-       ment may be either assignment statements, for which  the  subscript  is
-       required,  or  a list of words that is interpreted as a sequence of al-
-       ternating keys and values: _\bn_\ba_\bm_\be=(\b( _\bk_\be_\by_\b1 _\bv_\ba_\bl_\bu_\be_\b1 _\bk_\be_\by_\b2 _\bv_\ba_\bl_\bu_\be_\b2 ...)\b).   These
-       are  treated  identically  to  _\bn_\ba_\bm_\be=(\b( [_\bk_\be_\by_\b1]=_\bv_\ba_\bl_\bu_\be_\b1 [_\bk_\be_\by_\b2]=_\bv_\ba_\bl_\bu_\be_\b2 ...)\b).
-       The first word in the list determines how the remaining words  are  in-
-       terpreted;  all  assignments  in a list must be of the same type.  When
-       using key/value pairs, the keys may not be missing or  empty;  a  final
+       ment  may  be  either assignment statements, for which the subscript is
+       required, or a list of words that is interpreted as a sequence  of  al-
+       ternating  keys and values: _\bn_\ba_\bm_\be=(\b( _\bk_\be_\by_\b1 _\bv_\ba_\bl_\bu_\be_\b1 _\bk_\be_\by_\b2 _\bv_\ba_\bl_\bu_\be_\b2 ...)\b).  These
+       are treated identically to  _\bn_\ba_\bm_\be=(\b(  [_\bk_\be_\by_\b1]=_\bv_\ba_\bl_\bu_\be_\b1  [_\bk_\be_\by_\b2]=_\bv_\ba_\bl_\bu_\be_\b ...)\b).
+       The  first  word in the list determines how the remaining words are in-
+       terpreted; all assignments in a list must be of the  same  type.   When
+       using  key/value  pairs,  the keys may not be missing or empty; a final
        missing value is treated like the empty string.
 
-       This  syntax is also accepted by the d\bde\bec\bcl\bla\bar\bre\be builtin.  Individual array
-       elements may be assigned to using the _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bv_\ba_\bl_\bu_\be syntax  in-
-       troduced  above.   When  assigning to an indexed array, if _\bn_\ba_\bm_\be is sub-
-       scripted by a negative number, that number is interpreted  as  relative
-       to  one  greater  than  the  maximum index of _\bn_\ba_\bm_\be, so negative indices
+       This syntax is also accepted by the d\bde\bec\bcl\bla\bar\bre\be builtin.  Individual  array
+       elements  may be assigned to using the _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]=_\bv_\ba_\bl_\bu_\be syntax in-
+       troduced above.  When assigning to an indexed array, if  _\bn_\ba_\bm_\be  is  sub-
+       scripted  by  a negative number, that number is interpreted as relative
+       to one greater than the maximum index  of  _\bn_\ba_\bm_\be,  so  negative  indices
        count back from the end of the array, and an index of -1 references the
        last element.
 
-       The  +=  operator will append to an array variable when assigning using
+       The += operator will append to an array variable when  assigning  using
        the compound assignment syntax; see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS above.
 
-       Any element of an array may  be  referenced  using  ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}.
+       Any  element  of  an  array may be referenced using ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}.
        The braces are required to avoid conflicts with pathname expansion.  If
-       _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bis @\b@ or *\b*, the word expands to all members  of  _\bn_\ba_\bm_\be.   These
-       subscripts  differ only when the word appears within double quotes.  If
+       _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\b is  @\b@  or *\b*, the word expands to all members of _\bn_\ba_\bm_\be.  These
+       subscripts differ only when the word appears within double quotes.   If
        the word is double-quoted, ${_\bn_\ba_\bm_\be[*]} expands to a single word with the
-       value  of each array member separated by the first character of the I\bIF\bFS\bS
+       value of each array member separated by the first character of the  I\bIF\bFS\bS
        special variable, and ${_\bn_\ba_\bm_\be[@]} expands each element of _\bn_\ba_\bm_\be to a sep-
-       arate  word.   When  there  are no array members, ${_\bn_\ba_\bm_\be[@]} expands to
-       nothing.  If the double-quoted expansion occurs within a word, the  ex-
+       arate word.  When there are no array  members,  ${_\bn_\ba_\bm_\be[@]}  expands  to
+       nothing.   If the double-quoted expansion occurs within a word, the ex-
        pansion of the first parameter is joined with the beginning part of the
-       original word, and the expansion of the last parameter is  joined  with
+       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 *\b*  and  @\b@  (see  S\bSp\bpe\bec\bci\bia\bal\bl  P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\b above).
-       ${#_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}  expands  to  the length of ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}.  If
+       of  the  special  parameters  *\b*  and  @\b@ (see S\bSp\bpe\bec\bci\bia\bal\bl P\bPa\bar\bra\bam\bme\bet\bte\ber\brs\bs above).
+       ${#_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]} expands to the length  of  ${_\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt]}.   If
        _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is *\b* or @\b@, the expansion is the number of elements in the ar-
        ray.  If the _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt used to reference an element of an indexed array
-       evaluates to a number less than zero, it is interpreted as relative  to
-       one  greater  than  the maximum index of the array, so negative indices
+       evaluates  to a number less than zero, it is interpreted as relative to
+       one greater than the maximum index of the array,  so  negative  indices
        count back from the end of the array, and an index of -1 references the
        last element.
 
        Referencing an array variable without a subscript is equivalent to ref-
-       erencing the array with a subscript of 0.  Any reference to a  variable
+       erencing  the array with a subscript of 0.  Any reference to a variable
        using a valid subscript is legal, and b\bba\bas\bsh\bh will create an array if nec-
        essary.
 
-       An array variable is considered set if a subscript has been assigned  a
+       An  array variable is considered set if a subscript has been assigned a
        value.  The null string is a valid value.
 
-       It  is possible to obtain the keys (indices) of an array as well as the
-       values.  ${!\b!_\bn_\ba_\bm_\be[_\b@]} and ${!\b!_\bn_\ba_\bm_\be[_\b*]} expand to the indices assigned  in
+       It is possible to obtain the keys (indices) of an array as well as  the
+       values.   ${!\b!_\bn_\ba_\bm_\be[_\b@]} and ${!\b!_\bn_\ba_\bm_\be[_\b*]} expand to the indices assigned in
        array variable _\bn_\ba_\bm_\be.  The treatment when in double quotes is similar to
        the expansion of the special parameters _\b@ and _\b* within double quotes.
 
        The u\bun\bns\bse\bet\bt builtin is used to destroy arrays.  u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt] de-
        stroys the array element at index _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt, for both indexed and asso-
-       ciative arrays.  Negative subscripts to indexed arrays are  interpreted
-       as  described  above.   Unsetting the last element of an array variable
-       does not unset the variable.  u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be, where _\bn_\ba_\bm_\be is an  array,  re-
+       ciative  arrays.  Negative subscripts to indexed arrays are interpreted
+       as described above.  Unsetting the last element of  an  array  variable
+       does  not  unset the variable.  u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be, where _\bn_\ba_\bm_\be is an array, re-
        moves the entire array.  u\bun\bns\bse\bet\bt _\bn_\ba_\bm_\be[_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt], where _\bs_\bu_\bb_\bs_\bc_\br_\bi_\bp_\bt is *\b* or
        @\b@, behaves differently depending on whether _\bn_\ba_\bm_\be is an indexed or asso-
-       ciative  array.   If _\bn_\ba_\bm_\be is an associative array, this unsets the ele-
+       ciative array.  If _\bn_\ba_\bm_\be is an associative array, this unsets  the  ele-
        ment with subscript *\b* or @\b@.  If _\bn_\ba_\bm_\be is an indexed array, unset removes
        all of the elements but does not remove the array itself.
 
-       When  using  a  variable name with a subscript as an argument to a com-
-       mand, such as with u\bun\bns\bse\bet\bt, without using the word expansion  syntax  de-
+       When using a variable name with a subscript as an argument  to  a  com-
+       mand,  such  as with u\bun\bns\bse\bet\bt, without using the word expansion syntax de-
        scribed above, the argument is subject to pathname expansion.  If path-
        name expansion is not desired, the argument should be quoted.
 
-       The d\bde\bec\bcl\bla\bar\bre\be, l\blo\boc\bca\bal\bl, and r\bre\bea\bad\bdo\bon\bnl\bly\by builtins each accept a  -\b-a\ba  option  to
-       specify  an indexed array and a -\b-A\bA option to specify an associative ar-
-       ray.  If both options are supplied,  -\b-A\bA  takes  precedence.   The  r\bre\bea\bad\bd
-       builtin  accepts  a  -\b-a\ba  option to assign a list of words read from the
+       The  d\bde\bec\bcl\bla\bar\bre\be,  l\blo\boc\bca\bal\bl,  and r\bre\bea\bad\bdo\bon\bnl\bly\by builtins each accept a -\b-a\ba option to
+       specify an indexed array and a -\b-A\bA option to specify an associative  ar-
+       ray.   If  both  options  are  supplied, -\b-A\bA takes precedence.  The r\bre\bea\bad\bd
+       builtin accepts a -\b-a\ba option to assign a list of  words  read  from  the
        standard input to an array.  The s\bse\bet\bt and d\bde\bec\bcl\bla\bar\bre\be builtins display array
        values in a way that allows them to be reused as assignments.
 
 E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
        Expansion is performed on the command line after it has been split into
-       words.  There are seven kinds of expansion performed: _\bb_\br_\ba_\bc_\b _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn,
-       _\bt_\bi_\bl_\bd_\b _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn,  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  _\ba_\bn_\bd _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, _\bc_\bo_\bm_\bm_\ba_\bn_\bd _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\b-
+       words.   There are seven kinds of expansion performed: _\bb_\br_\ba_\bc_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn,
+       _\bt_\bi_\bl_\bd_\b_\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br _\ba_\bn_\bd _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be  _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn,  _\bc_\bo_\bm_\bm_\ba_\bn_\b _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\b-
        _\bt_\bi_\bo_\bn, _\ba_\br_\bi_\bt_\bh_\bm_\be_\bt_\bi_\bc _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, _\bw_\bo_\br_\bd _\bs_\bp_\bl_\bi_\bt_\bt_\bi_\bn_\bg, and _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn.
 
        The order of expansions is: brace expansion; tilde expansion, parameter
-       and  variable expansion, arithmetic expansion, and command substitution
-       (done in a left-to-right fashion); word splitting; and pathname  expan-
+       and variable expansion, arithmetic expansion, and command  substitution
+       (done  in a left-to-right fashion); word splitting; and pathname expan-
        sion.
 
        On systems that can support it, there is an additional expansion avail-
-       able: _\bp_\br_\bo_\bc_\be_\bs_\bs _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn.  This is performed  at  the  same  time  as
-       tilde,  parameter,  variable, and arithmetic expansion and command sub-
+       able:  _\bp_\br_\bo_\bc_\be_\bs_\bs  _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn.   This  is  performed at the same time as
+       tilde, parameter, variable, and arithmetic expansion and  command  sub-
        stitution.
 
-       After these expansions are performed, quote characters present  in  the
-       original  word  are  removed  unless  they  have been quoted themselves
+       After  these  expansions are performed, quote characters present in the
+       original word are removed  unless  they  have  been  quoted  themselves
        (_\bq_\bu_\bo_\bt_\be _\br_\be_\bm_\bo_\bv_\ba_\bl).
 
-       Only brace expansion, word splitting, and pathname  expansion  can  in-
-       crease  the number of words of the expansion; other expansions expand a
-       single word to a single word.  The only exceptions to this are the  ex-
+       Only  brace  expansion,  word splitting, and pathname expansion can in-
+       crease the number of words of the expansion; other expansions expand  a
+       single  word to a single word.  The only exceptions to this are the ex-
        pansions  of  "$\b$@\b@"  and  "$\b${\b{_\bn_\ba_\bm_\be[\b[@\b@]\b]}\b}",  and,  in  most  cases,  $\b$*\b*  and
        $\b${\b{_\bn_\ba_\bm_\be[\b[*\b*]\b]}\b} as explained above (see P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS).
 
    B\bBr\bra\bac\bce\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
        _\bB_\br_\ba_\bc_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn is a mechanism by which arbitrary strings may be gener-
-       ated.   This  mechanism is similar to _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, but the file-
+       ated.  This mechanism is similar to _\bp_\ba_\bt_\bh_\bn_\ba_\bm_\be _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn, but  the  file-
        names generated need not exist.  Patterns to be brace expanded take the
        form of an optional _\bp_\br_\be_\ba_\bm_\bb_\bl_\be, followed by either a series of comma-sep-
-       arated strings or a sequence expression between a pair of braces,  fol-
-       lowed  by  an  optional  _\bp_\bo_\bs_\bt_\bs_\bc_\br_\bi_\bp_\bt.   The preamble is prefixed to each
+       arated  strings or a sequence expression between a pair of braces, fol-
+       lowed by an optional _\bp_\bo_\bs_\bt_\bs_\bc_\br_\bi_\bp_\bt.  The  preamble  is  prefixed  to  each
        string contained within the braces, and the postscript is then appended
        to each resulting string, expanding left to right.
 
-       Brace  expansions  may  be nested.  The results of each expanded string
-       are not sorted;  left  to  right  order  is  preserved.   For  example,
+       Brace expansions may be nested.  The results of  each  expanded  string
+       are  not  sorted;  left  to  right  order  is  preserved.  For example,
        a{\b{d,c,b}\b}e expands into `ade ace abe'.
 
-       A  sequence expression takes the form {\b{_\bx.\b..\b._\by[\b[.\b..\b._\bi_\bn_\bc_\br]\b]}\b}, where _\bx and _\by are
-       either integers or single letters, and _\bi_\bn_\bc_\br, an optional increment,  is
+       A sequence expression takes the form {\b{_\bx.\b..\b._\by[\b[.\b..\b._\bi_\bn_\bc_\br]\b]}\b}, where _\bx and _\b are
+       either  integers or single letters, and _\bi_\bn_\bc_\br, an optional increment, is
        an integer.  When integers are supplied, the expression expands to each
-       number between _\bx and _\by, inclusive.  Supplied integers may  be  prefixed
-       with  _\b0  to force each term to have the same width.  When either _\bx or _\by
-       begins with a zero, the shell attempts to force all generated terms  to
-       contain  the same number of digits, zero-padding where necessary.  When
-       letters are supplied, the expression expands to each character  lexico-
-       graphically  between  _\bx  and  _\by, inclusive, using the default C locale.
-       Note that both _\bx and _\by must be of the same type  (integer  or  letter).
-       When  the  increment  is supplied, it is used as the difference between
+       number  between  _\bx and _\by, inclusive.  Supplied integers may be prefixed
+       with _\b0 to force each term to have the same width.  When either _\bx  or  _\by
+       begins  with a zero, the shell attempts to force all generated terms to
+       contain the same number of digits, zero-padding where necessary.   When
+       letters  are supplied, the expression expands to each character lexico-
+       graphically between _\bx and _\by, inclusive, using  the  default  C  locale.
+       Note  that  both  _\bx and _\by must be of the same type (integer or letter).
+       When the increment is supplied, it is used as  the  difference  between
        each term.  The default increment is 1 or -1 as appropriate.
 
        Brace expansion is performed before any other expansions, and any char-
-       acters  special to other expansions are preserved in the result.  It is
-       strictly textual.  B\bBa\bas\bsh\bh does not apply any syntactic interpretation  to
+       acters special to other expansions are preserved in the result.  It  is
+       strictly  textual.  B\bBa\bas\bsh\bh does not apply any syntactic interpretation to
        the context of the expansion or the text between the braces.
 
-       A  correctly-formed  brace  expansion must contain unquoted opening and
+       A correctly-formed brace expansion must contain  unquoted  opening  and
        closing braces, and at least one unquoted comma or a valid sequence ex-
        pression.  Any incorrectly formed brace expansion is left unchanged.  A
-       {\bor ,\b, may be quoted with a backslash to prevent its  being  considered
-       part  of  a brace expression.  To avoid conflicts with parameter expan-
+       {\b or  ,\b, may be quoted with a backslash to prevent its being considered
+       part of a brace expression.  To avoid conflicts with  parameter  expan-
        sion, the string $\b${\b{ is not considered eligible for brace expansion, and
        inhibits brace expansion until the closing }\b}.
 
@@ -1632,36 +1649,36 @@ E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
        or
               chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
 
-       Brace expansion introduces a  slight  incompatibility  with  historical
-       versions  of s\bsh\bh.  s\bsh\bh does not treat opening or closing braces specially
-       when they appear as part of a word, and preserves them in  the  output.
-       B\bBa\bas\bsh\b removes  braces  from  words as a consequence of brace expansion.
-       For example, a word entered to s\bsh\bh as _\bf_\bi_\bl_\be_\b{_\b1_\b,_\b2_\b} appears  identically  in
-       the  output.  The same word is output as _\bf_\bi_\bl_\be_\b1 _\bf_\bi_\bl_\be_\b2 after expansion by
-       b\bba\bas\bsh\bh.  If strict compatibility with s\bsh\bh is desired, start b\bba\bas\bsh\bh with  the
+       Brace  expansion  introduces  a  slight incompatibility with historical
+       versions of s\bsh\bh.  s\bsh\bh does not treat opening or closing braces  specially
+       when  they  appear as part of a word, and preserves them in the output.
+       B\bBa\bas\bsh\bremoves braces from words as a  consequence  of  brace  expansion.
+       For  example,  a word entered to s\bsh\bh as _\bf_\bi_\bl_\be_\b{_\b1_\b,_\b2_\b} appears identically in
+       the output.  The same word is output as _\bf_\bi_\bl_\be_\b1 _\bf_\bi_\bl_\be_\b2 after expansion  by
+       b\bba\bas\bsh\bh.   If strict compatibility with s\bsh\bh is desired, start b\bba\bas\bsh\bh with the
        +\b+B\bB option or disable brace expansion with the +\b+B\bB option to the s\bse\bet\bt com-
        mand (see S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS below).
 
    T\bTi\bil\bld\bde\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
-       If a word begins with an unquoted tilde character  (`~\b~'),  all  of  the
-       characters  preceding  the  first unquoted slash (or all characters, if
-       there is no unquoted slash) are considered a _\bt_\bi_\bl_\bd_\be_\b-_\bp_\br_\be_\bf_\bi_\bx.  If none  of
-       the  characters  in  the tilde-prefix are quoted, the characters in the
-       tilde-prefix following the tilde are treated as a possible _\bl_\bo_\bg_\bi_\b _\bn_\ba_\bm_\be.
-       If  this  login name is the null string, the tilde is replaced with the
-       value of the shell parameter H\bHO\bOM\bME\bE.  If H\bHO\bOM\bME\bE is unset, the  home  direc-
-       tory  of  the  user executing the shell is substituted instead.  Other-
-       wise, the tilde-prefix is replaced with the home  directory  associated
+       If  a  word  begins  with an unquoted tilde character (`~\b~'), all of the
+       characters preceding the first unquoted slash (or  all  characters,  if
+       there  is no unquoted slash) are considered a _\bt_\bi_\bl_\bd_\be_\b-_\bp_\br_\be_\bf_\bi_\bx.  If none of
+       the characters in the tilde-prefix are quoted, the  characters  in  the
+       tilde-prefix  following the tilde are treated as a possible _\bl_\bo_\bg_\bi_\bn _\bn_\ba_\bm_\be.
+       If this login name is the null string, the tilde is replaced  with  the
+       value  of  the shell parameter H\bHO\bOM\bME\bE.  If H\bHO\bOM\bME\bE is unset, the home direc-
+       tory of the user executing the shell is  substituted  instead.   Other-
+       wise,  the  tilde-prefix is replaced with the home directory associated
        with the specified login name.
 
-       If  the tilde-prefix is a `~+', the value of the shell variable P\bPW\bWD\bD re-
-       places the tilde-prefix.  If the tilde-prefix is a `~-', the  value  of
-       the  shell variable O\bOL\bLD\bDP\bPW\bWD\bD, if it is set, is substituted.  If the char-
-       acters following the tilde in the tilde-prefix consist of a  number  _\bN,
-       optionally  prefixed  by  a  `+' or a `-', the tilde-prefix is replaced
+       If the tilde-prefix is a `~+', the value of the shell variable P\bPW\bWD\b re-
+       places  the  tilde-prefix.  If the tilde-prefix is a `~-', the value of
+       the shell variable O\bOL\bLD\bDP\bPW\bWD\bD, if it is set, is substituted.  If the  char-
+       acters  following  the tilde in the tilde-prefix consist of a number _\bN,
+       optionally prefixed by a `+' or a `-',  the  tilde-prefix  is  replaced
        with the corresponding element from the directory stack, as it would be
        displayed by the d\bdi\bir\brs\bs builtin invoked with the tilde-prefix as an argu-
-       ment.  If the characters following the tilde in the  tilde-prefix  con-
+       ment.   If  the characters following the tilde in the tilde-prefix con-
        sist of a number without a leading `+' or `-', `+' is assumed.
 
        If the login name is invalid, or the tilde expansion fails, the word is
@@ -1670,140 +1687,140 @@ E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
        Each variable assignment is checked for unquoted tilde-prefixes immedi-
        ately following a :\b: or the first =\b=.  In these cases, tilde expansion is
        also performed.  Consequently, one may use filenames with tildes in as-
-       signments  to P\bPA\bAT\bTH\bH, M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH, and C\bCD\bDP\bPA\bAT\bTH\bH, and the shell assigns the ex-
+       signments to P\bPA\bAT\bTH\bH, M\bMA\bAI\bIL\bLP\bPA\bAT\bTH\bH, and C\bCD\bDP\bPA\bAT\bTH\bH, and the shell assigns the  ex-
        panded value.
 
-       Bash also performs tilde expansion on words satisfying  the  conditions
+       Bash  also  performs tilde expansion on words satisfying the conditions
        of variable assignments (as described above under P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS) when they
-       appear as arguments to simple commands.  Bash does not do this,  except
+       appear  as arguments to simple commands.  Bash does not do this, except
        for the _\bd_\be_\bc_\bl_\ba_\br_\ba_\bt_\bi_\bo_\bn commands listed above, when in _\bp_\bo_\bs_\bi_\bx _\bm_\bo_\bd_\be.
 
    P\bPa\bar\bra\bam\bme\bet\bte\ber\br E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
        The `$\b$' character introduces parameter expansion, command substitution,
-       or arithmetic expansion.  The parameter name or symbol to  be  expanded
-       may  be enclosed in braces, which are optional but serve to protect the
-       variable to be expanded from characters immediately following it  which
+       or  arithmetic  expansion.  The parameter name or symbol to be expanded
+       may be enclosed in braces, which are optional but serve to protect  the
+       variable  to be expanded from characters immediately following it which
        could be interpreted as part of the name.
 
-       When  braces  are  used, the matching ending brace is the first `}\b}' not
+       When braces are used, the matching ending brace is the  first  `}\b}'  not
        escaped by a backslash or within a quoted string, and not within an em-
-       bedded  arithmetic expansion, command substitution, or parameter expan-
+       bedded arithmetic expansion, command substitution, or parameter  expan-
        sion.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}
-              The value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is substituted.  The braces are  required
-              when  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  is  a  positional  parameter with more than one
+              The  value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is substituted.  The braces are required
+              when _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a positional  parameter  with  more  than  one
               digit, or when _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is followed by a character which is not
               to be interpreted as part of its name.  The _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a shell
-              parameter as described above P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS) or an  array  reference
+              parameter  as  described above P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS) or an array reference
               (A\bAr\brr\bra\bay\bys\bs).
 
-       If  the  first  character of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an exclamation point (!\b!), and
+       If the first character of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an exclamation  point  (!\b!),  and
        _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is not a _\bn_\ba_\bm_\be_\br_\be_\bf, it introduces a level of indirection.  B\bBa\bas\bsh\bh
        uses the value formed by expanding the rest of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br as the new _\bp_\ba_\b-
-       _\br_\ba_\bm_\be_\bt_\be_\br; this is then expanded and that value is used in  the  rest  of
-       the  expansion,  rather  than  the expansion of the original _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.
+       _\br_\ba_\bm_\be_\bt_\be_\br;  this  is  then expanded and that value is used in the rest of
+       the expansion, rather than the expansion  of  the  original  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.
        This is known as _\bi_\bn_\bd_\bi_\br_\be_\bc_\bt _\be_\bx_\bp_\ba_\bn_\bs_\bi_\bo_\bn.  The value is subject to tilde ex-
-       pansion,  parameter expansion, command substitution, and arithmetic ex-
-       pansion.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is a nameref, this expands to the  name  of  the
-       parameter  referenced  by  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br instead of performing the complete
-       indirect expansion.  The exceptions  to  this  are  the  expansions  of
-       ${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*}  and  ${!\b!_\bn_\ba_\bm_\be[_\b@]}  described  below.  The exclamation point
-       must immediately follow the left brace in order to  introduce  indirec-
+       pansion, parameter expansion, command substitution, and arithmetic  ex-
+       pansion.   If  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  is a nameref, this expands to the name of the
+       parameter referenced by _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br instead of  performing  the  complete
+       indirect  expansion.   The  exceptions  to  this  are the expansions of
+       ${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*} and ${!\b!_\bn_\ba_\bm_\be[_\b@]} described  below.   The  exclamation  point
+       must  immediately  follow the left brace in order to introduce indirec-
        tion.
 
        In each of the cases below, _\bw_\bo_\br_\bd is subject to tilde expansion, parame-
        ter expansion, command substitution, and arithmetic expansion.
 
        When not performing substring expansion, using the forms documented be-
-       low  (e.g.,  :\b:-\b-),  b\bba\bas\bsh\bh  tests  for  a parameter that is unset or null.
-       Omitting the colon results in a test only for a parameter that  is  un-
+       low (e.g., :\b:-\b-), b\bba\bas\bsh\bh tests for a  parameter  that  is  unset  or  null.
+       Omitting  the  colon results in a test only for a parameter that is un-
        set.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:-\b-_\bw_\bo_\br_\bd}
-              U\bUs\bse\b D\bDe\bef\bfa\bau\bul\blt\bt  V\bVa\bal\blu\bue\bes\bs.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null, the expan-
-              sion of _\bw_\bo_\br_\bd is substituted.  Otherwise, the value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+              U\bUs\bse\bD\bDe\bef\bfa\bau\bul\blt\bt V\bVa\bal\blu\bue\bes\bs.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null,  the  expan-
+              sion  of _\bw_\bo_\br_\bd is substituted.  Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
               is substituted.
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:=\b=_\bw_\bo_\br_\bd}
-              A\bAs\bss\bsi\big\bgn\b D\bDe\bef\bfa\bau\bul\blt\bt  V\bVa\bal\blu\bue\bes\bs.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null, the ex-
-              pansion of _\bw_\bo_\br_\bd is assigned to _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.  The value of  _\bp_\ba_\br_\ba_\bm_\be_\b-
-              _\bt_\be_\b is then substituted.  Positional parameters and special pa-
+              A\bAs\bss\bsi\big\bgn\bD\bDe\bef\bfa\bau\bul\blt\bt V\bVa\bal\blu\bue\bes\bs.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is unset or null,  the  ex-
+              pansion  of _\bw_\bo_\br_\bd is assigned to _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.  The value of _\bp_\ba_\br_\ba_\bm_\be_\b-
+              _\bt_\be_\bis then substituted.  Positional parameters and special  pa-
               rameters may not be assigned to in this way.
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:?\b?_\bw_\bo_\br_\bd}
-              D\bDi\bis\bsp\bpl\bla\bay\bE\bEr\brr\bro\bor\br i\bif\bf N\bNu\bul\bll\bl o\bor\br U\bUn\bns\bse\bet\bt.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or  unset,
-              the  expansion  of  _\bw_\bo_\br_\bd (or a message to that effect if _\bw_\bo_\br_\bd is
-              not present) is written to the standard error and the shell,  if
+              D\bDi\bis\bsp\bpl\bla\bay\b E\bEr\brr\bro\bor\br i\bif\bf N\bNu\bul\bll\bl o\bor\br U\bUn\bns\bse\bet\bt.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset,
+              the expansion of _\bw_\bo_\br_\bd (or a message to that effect  if  _\bw_\bo_\br_\b is
+              not  present) is written to the standard error and the shell, if
               it is not interactive, exits.  Otherwise, the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
               is substituted.
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:+\b+_\bw_\bo_\br_\bd}
-              U\bUs\bse\bA\bAl\blt\bte\ber\brn\bna\bat\bte\be V\bVa\bal\blu\bue\be.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset, nothing  is
+              U\bUs\bse\b A\bAl\blt\bte\ber\brn\bna\bat\bte\be V\bVa\bal\blu\bue\be.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is null or unset, nothing is
               substituted, otherwise the expansion of _\bw_\bo_\br_\bd is substituted.
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:_\bo_\bf_\bf_\bs_\be_\bt}
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br:\b:_\bo_\bf_\bf_\bs_\be_\bt:\b:_\bl_\be_\bn_\bg_\bt_\bh}
-              S\bSu\bub\bbs\bst\btr\bri\bin\bng\b E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn.  Expands to up to _\bl_\be_\bn_\bg_\bt_\bh characters of the
-              value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified  by  _\bo_\bf_\bf_\b-
-              _\bs_\be_\bt.   If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, an indexed array subscripted by @\b@
-              or *\b*, or an associative array name, the results  differ  as  de-
-              scribed  below.   If _\bl_\be_\bn_\bg_\bt_\bh is omitted, expands to the substring
+              S\bSu\bub\bbs\bst\btr\bri\bin\bng\bE\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn.  Expands to up to _\bl_\be_\bn_\bg_\bt_\bh characters of  the
+              value  of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by _\bo_\bf_\bf_\b-
+              _\bs_\be_\bt.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, an indexed array subscripted by  @\b@
+              or  *\b*,  or  an associative array name, the results differ as de-
+              scribed below.  If _\bl_\be_\bn_\bg_\bt_\bh is omitted, expands to  the  substring
               of the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br starting at the character specified by
               _\bo_\bf_\bf_\bs_\be_\bt and extending to the end of the value.  _\bl_\be_\bn_\bg_\bt_\bh and _\bo_\bf_\bf_\bs_\be_\bt
               are arithmetic expressions (see A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN below).
 
-              If _\bo_\bf_\bf_\bs_\be_\bt evaluates to a number less than  zero,  the  value  is
+              If  _\bo_\bf_\bf_\bs_\be_\bt  evaluates  to  a number less than zero, the value is
               used as an offset in characters from the end of the value of _\bp_\ba_\b-
-              _\br_\ba_\bm_\be_\bt_\be_\br.  If _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero, it  is
+              _\br_\ba_\bm_\be_\bt_\be_\br.   If _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero, it is
               interpreted as an offset in characters from the end of the value
-              of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br rather than a number of characters, and the  expan-
-              sion  is  the  characters  between _\bo_\bf_\bf_\bs_\be_\bt and that result.  Note
-              that a negative offset must be separated from the  colon  by  at
+              of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br rather than a number of characters, and the expan-
+              sion is the characters between _\bo_\bf_\bf_\bs_\be_\bt  and  that  result.   Note
+              that  a  negative  offset must be separated from the colon by at
               least one space to avoid being confused with the :\b:-\b- expansion.
 
-              If  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the result is _\bl_\be_\bn_\bg_\bt_\bh positional parame-
-              ters beginning at _\bo_\bf_\bf_\bs_\be_\bt.  A negative _\bo_\bf_\bf_\bs_\be_\bt is  taken  relative
-              to  one  greater  than  the greatest positional parameter, so an
+              If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the result is _\bl_\be_\bn_\bg_\bt_\bh positional  parame-
+              ters  beginning  at _\bo_\bf_\bf_\bs_\be_\bt.  A negative _\bo_\bf_\bf_\bs_\be_\bt is taken relative
+              to one greater than the greatest  positional  parameter,  so  an
               offset of -1 evaluates to the last positional parameter (or 0 if
-              there  are  no positional parameters).  It is an expansion error
+              there are no positional parameters).  It is an  expansion  error
               if _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero.
 
               If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an indexed array name subscripted by @ or *, the
-              result  is  the _\bl_\be_\bn_\bg_\bt_\bh members of the array beginning with ${_\bp_\ba_\b-
-              _\br_\ba_\bm_\be_\bt_\be_\br[_\bo_\bf_\bf_\bs_\be_\bt]}.  A negative _\bo_\bf_\bf_\bs_\be_\bt is taken  relative  to  one
+              result is the _\bl_\be_\bn_\bg_\bt_\bh members of the array beginning  with  ${_\bp_\ba_\b-
+              _\br_\ba_\bm_\be_\bt_\be_\br[_\bo_\bf_\bf_\bs_\be_\bt]}.   A  negative  _\bo_\bf_\bf_\bs_\be_\bt is taken relative to one
               greater than the maximum index of the specified array.  It is an
               expansion error if _\bl_\be_\bn_\bg_\bt_\bh evaluates to a number less than zero.
 
               Substring expansion applied to an associative array produces un-
               defined results.
 
-              Substring  indexing  is zero-based unless the positional parame-
-              ters are used, in which case the indexing starts  at  1  by  de-
-              fault.   If _\bo_\bf_\bf_\bs_\be_\bt is 0, and the positional parameters are used,
+              Substring indexing is zero-based unless the  positional  parame-
+              ters  are  used,  in  which case the indexing starts at 1 by de-
+              fault.  If _\bo_\bf_\bf_\bs_\be_\bt is 0, and the positional parameters are  used,
               $\b$0\b0 is prefixed to the list.
 
        ${!\b!_\bp_\br_\be_\bf_\bi_\bx*\b*}
        ${!\b!_\bp_\br_\be_\bf_\bi_\bx@\b@}
-              N\bNa\bam\bme\bes\bm\bma\bat\btc\bch\bhi\bin\bng\bg p\bpr\bre\bef\bfi\bix\bx.  Expands to the names of variables  whose
+              N\bNa\bam\bme\bes\b m\bma\bat\btc\bch\bhi\bin\bng\bg p\bpr\bre\bef\bfi\bix\bx.  Expands to the names of variables whose
               names begin with _\bp_\br_\be_\bf_\bi_\bx, separated by the first character of the
-              I\bIF\bFS\bspecial variable.  When _\b@ is used and the expansion  appears
-              within  double  quotes, each variable name expands to a separate
+              I\bIF\bFS\b special variable.  When _\b@ is used and the expansion appears
+              within double quotes, each variable name expands to  a  separate
               word.
 
        ${!\b!_\bn_\ba_\bm_\be[_\b@]}
        ${!\b!_\bn_\ba_\bm_\be[_\b*]}
-              L\bLi\bis\bst\bo\bof\bf a\bar\brr\bra\bay\by k\bke\bey\bys\bs.  If _\bn_\ba_\bm_\be is an array  variable,  expands  to
-              the  list  of array indices (keys) assigned in _\bn_\ba_\bm_\be.  If _\bn_\ba_\bm_\be is
-              not an array, expands to 0 if _\bn_\ba_\bm_\be is set  and  null  otherwise.
-              When  _\b@  is used and the expansion appears within double quotes,
+              L\bLi\bis\bst\b o\bof\bf  a\bar\brr\bra\bay\by  k\bke\bey\bys\bs.  If _\bn_\ba_\bm_\be is an array variable, expands to
+              the list of array indices (keys) assigned in _\bn_\ba_\bm_\be.  If  _\bn_\ba_\bm_\b is
+              not  an  array,  expands to 0 if _\bn_\ba_\bm_\be is set and null otherwise.
+              When _\b@ is used and the expansion appears within  double  quotes,
               each key expands to a separate word.
 
        ${#\b#_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br}
-              P\bPa\bar\bra\bam\bme\bet\bte\ber\bl\ble\ben\bng\bgt\bth\bh.  The length in characters of the value of  _\bp_\ba_\b-
-              _\br_\ba_\bm_\be_\bt_\be_\b is substituted.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is *\b* or @\b@, the value sub-
-              stituted is the number of positional parameters.   If  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+              P\bPa\bar\bra\bam\bme\bet\bte\ber\b l\ble\ben\bng\bgt\bth\bh.  The length in characters of the value of _\bp_\ba_\b-
+              _\br_\ba_\bm_\be_\bt_\be_\bis substituted.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is *\b* or @\b@, the value  sub-
+              stituted  is  the number of positional parameters.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
               is an array name subscripted by *\b* or @\b@, the value substituted is
               the number of elements in the array.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an indexed
-              array  name subscripted by a negative number, that number is in-
-              terpreted as relative to one greater than the maximum  index  of
-              _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,  so  negative  indices count back from the end of the
+              array name subscripted by a negative number, that number is  in-
+              terpreted  as  relative to one greater than the maximum index of
+              _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, so negative indices count back from the  end  of  the
               array, and an index of -1 references the last element.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br#\b#_\bw_\bo_\br_\bd}
@@ -1811,15 +1828,15 @@ E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
               R\bRe\bem\bmo\bov\bve\be m\bma\bat\btc\bch\bhi\bin\bng\bg p\bpr\bre\bef\bfi\bix\bx p\bpa\bat\btt\bte\ber\brn\bn.  The _\bw_\bo_\br_\bd is expanded to produce
               a pattern just as in pathname expansion, and matched against the
               expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br using the rules described under P\bPa\bat\bt-\b-
-              t\bte\ber\brn\b M\bMa\bat\btc\bch\bhi\bin\bng\bg  below.   If the pattern matches the beginning of
-              the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the expansion is  the
-              expanded  value  of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest matching pattern
-              (the ``#\b#'' case) or the longest  matching  pattern  (the  ``#\b##\b#''
-              case)  deleted.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the pattern removal op-
+              t\bte\ber\brn\bM\bMa\bat\btc\bch\bhi\bin\bng\bg below.  If the pattern matches  the  beginning  of
+              the  value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the expansion is the
+              expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest  matching  pattern
+              (the  ``#\b#''  case)  or  the longest matching pattern (the ``#\b##\b#''
+              case) deleted.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the pattern removal  op-
               eration is applied to each positional parameter in turn, and the
               expansion is the resultant list.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array vari-
-              able subscripted with @\b@ or *\b*, the pattern removal  operation  is
-              applied  to  each member of the array in turn, and the expansion
+              able  subscripted  with @\b@ or *\b*, the pattern removal operation is
+              applied to each member of the array in turn, and  the  expansion
               is the resultant list.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br%\b%_\bw_\bo_\br_\bd}
@@ -1827,15 +1844,15 @@ E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
               R\bRe\bem\bmo\bov\bve\be m\bma\bat\btc\bch\bhi\bin\bng\bg s\bsu\buf\bff\bfi\bix\bx p\bpa\bat\btt\bte\ber\brn\bn.  The _\bw_\bo_\br_\bd is expanded to produce
               a pattern just as in pathname expansion, and matched against the
               expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br using the rules described under P\bPa\bat\bt-\b-
-              t\bte\ber\brn\b M\bMa\bat\btc\bch\bhi\bin\bng\bg below.  If the pattern matches a trailing portion
-              of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of  the  ex-
-              pansion  is  the  expanded  value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with the shortest
-              matching pattern (the ``%\b%'' case) or the longest  matching  pat-
-              tern  (the  ``%\b%%\b%''  case)  deleted.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the
-              pattern removal operation is applied to each positional  parame-
+              t\bte\ber\brn\bM\bMa\bat\btc\bch\bhi\bin\bng\bg below.  If the pattern matches a trailing  portion
+              of  the  expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br, then the result of the ex-
+              pansion is the expanded value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  with  the  shortest
+              matching  pattern  (the ``%\b%'' case) or the longest matching pat-
+              tern (the ``%\b%%\b%'' case) deleted.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is  @\b@  or  *\b*,  the
+              pattern  removal operation is applied to each positional parame-
               ter in turn, and the expansion is the resultant list.  If _\bp_\ba_\br_\ba_\bm_\b-
-              _\be_\bt_\be_\bis an array variable subscripted with @\b@ or *\b*,  the  pattern
-              removal  operation  is  applied  to  each member of the array in
+              _\be_\bt_\be_\b is  an array variable subscripted with @\b@ or *\b*, the pattern
+              removal operation is applied to each  member  of  the  array  in
               turn, and the expansion is the resultant list.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
@@ -1843,116 +1860,116 @@ E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/#\b#_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br/\b/%\b%_\bp_\ba_\bt_\bt_\be_\br_\bn/\b/_\bs_\bt_\br_\bi_\bn_\bg}
               P\bPa\bat\btt\bte\ber\brn\bn s\bsu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn.  The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to produce a pat-
-              tern  just  as in pathname expansion.  _\bP_\ba_\br_\ba_\bm_\be_\bt_\be_\br is expanded and
-              the longest match of _\bp_\ba_\bt_\bt_\be_\br_\bn against its value is replaced  with
-              _\bs_\bt_\br_\bi_\bn_\bg.   _\bs_\bt_\br_\bi_\bn_\bg  undergoes tilde expansion, parameter and vari-
-              able expansion, arithmetic expansion, command and  process  sub-
-              stitution,  and quote removal.  The match is performed using the
+              tern just as in pathname expansion.  _\bP_\ba_\br_\ba_\bm_\be_\bt_\be_\br is  expanded  and
+              the  longest match of _\bp_\ba_\bt_\bt_\be_\br_\bn against its value is replaced with
+              _\bs_\bt_\br_\bi_\bn_\bg.  _\bs_\bt_\br_\bi_\bn_\bg undergoes tilde expansion, parameter  and  vari-
+              able  expansion,  arithmetic expansion, command and process sub-
+              stitution, and quote removal.  The match is performed using  the
               rules described under P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below.  In the first form
-              above,  only  the  first  match  is  replaced.  If there are two
+              above, only the first match  is  replaced.   If  there  are  two
               slashes  separating  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  and  _\bp_\ba_\bt_\bt_\be_\br_\bn  (the  second  form
-              above),  all  matches  of  _\bp_\ba_\bt_\bt_\be_\br_\bn are replaced with _\bs_\bt_\br_\bi_\bn_\bg.  If
-              _\bp_\ba_\bt_\bt_\be_\br_\bis preceded by #\b# (the third form above), it  must  match
+              above), all matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are  replaced  with  _\bs_\bt_\br_\bi_\bn_\bg.   If
+              _\bp_\ba_\bt_\bt_\be_\br_\b is  preceded by #\b# (the third form above), it must match
               at the beginning of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.  If _\bp_\ba_\bt_\bt_\be_\br_\bn
-              is preceded by %\b% (the fourth form above), it must match  at  the
-              end  of  the  expanded  value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.  If the expansion of
-              _\bs_\bt_\br_\bi_\bn_\bis null, matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are deleted.   If  _\bs_\bt_\br_\bi_\bn_\b is
+              is  preceded  by %\b% (the fourth form above), it must match at the
+              end of the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.   If  the  expansion  of
+              _\bs_\bt_\br_\bi_\bn_\b is  null,  matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are deleted.  If _\bs_\bt_\br_\bi_\bn_\bg is
               null, matches of _\bp_\ba_\bt_\bt_\be_\br_\bn are deleted and the /\b/ following _\bp_\ba_\bt_\bt_\be_\br_\bn
               may be omitted.
 
-              If the p\bpa\bat\bts\bsu\bub\bb_\b_r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt shell option is enabled  using  s\bsh\bho\bop\bpt\bt,
-              any  unquoted  instances  of  &\b&  in _\bs_\bt_\br_\bi_\bn_\bg are replaced with the
+              If  the  p\bpa\bat\bts\bsu\bub\bb_\b_r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt shell option is enabled using s\bsh\bho\bop\bpt\bt,
+              any unquoted instances of &\b& in  _\bs_\bt_\br_\bi_\bn_\bg  are  replaced  with  the
               matching portion of _\bp_\ba_\bt_\bt_\be_\br_\bn.
 
               Quoting any part of _\bs_\bt_\br_\bi_\bn_\bg inhibits replacement in the expansion
-              of  the  quoted portion, including replacement strings stored in
-              shell variables.  Backslash will escape &\b& in _\bs_\bt_\br_\bi_\bn_\bg;  the  back-
-              slash  is removed in order to permit a literal &\b& in the replace-
-              ment string.  Backslash can also be used to escape a  backslash;
-              \\b\\\b results  in  a  literal backslash in the replacement.  Users
-              should take care if _\bs_\bt_\br_\bi_\bn_\bg is double-quoted  to  avoid  unwanted
-              interactions  between  the  backslash  and double-quoting, since
-              backslash has special meaning  within  double  quotes.   Pattern
-              substitution  performs  the check for unquoted &\b& after expanding
+              of the quoted portion, including replacement strings  stored  in
+              shell  variables.   Backslash will escape &\b& in _\bs_\bt_\br_\bi_\bn_\bg; the back-
+              slash is removed in order to permit a literal &\b& in the  replace-
+              ment  string.  Backslash can also be used to escape a backslash;
+              \\b\\\bresults in a literal backslash  in  the  replacement.   Users
+              should  take  care  if _\bs_\bt_\br_\bi_\bn_\bg is double-quoted to avoid unwanted
+              interactions between the  backslash  and  double-quoting,  since
+              backslash  has  special  meaning  within double quotes.  Pattern
+              substitution performs the check for unquoted &\b&  after  expanding
               _\bs_\bt_\br_\bi_\bn_\bg; shell programmers should quote any occurrences of &\b& they
               want to be taken literally in the replacement and ensure any in-
               stances of &\b& they want to be replaced are unquoted.
 
-              If the n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh shell option is enabled, the  match  is  per-
-              formed  without regard to the case of alphabetic characters.  If
-              _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\bis @\b@ or *\b*, the substitution operation  is  applied  to
-              each  positional parameter in turn, and the expansion is the re-
-              sultant list.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is  an  array  variable  subscripted
-              with  @\b@ or *\b*, the substitution operation is applied to each mem-
-              ber of the array in turn, and the  expansion  is  the  resultant
+              If  the  n\bno\boc\bca\bas\bse\bem\bma\bat\btc\bch\bh  shell option is enabled, the match is per-
+              formed without regard to the case of alphabetic characters.   If
+              _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\b is  @\b@  or *\b*, the substitution operation is applied to
+              each positional parameter in turn, and the expansion is the  re-
+              sultant  list.   If  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  is an array variable subscripted
+              with @\b@ or *\b*, the substitution operation is applied to each  mem-
+              ber  of  the  array  in turn, and the expansion is the resultant
               list.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br^\b^_\bp_\ba_\bt_\bt_\be_\br_\bn}
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br^\b^^\b^_\bp_\ba_\bt_\bt_\be_\br_\bn}
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,\b,_\bp_\ba_\bt_\bt_\be_\br_\bn}
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br,\b,,\b,_\bp_\ba_\bt_\bt_\be_\br_\bn}
-              C\bCa\bas\bse\b m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn.   This expansion modifies the case of alpha-
-              betic characters in _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.  The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to  pro-
+              C\bCa\bas\bse\bm\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn.  This expansion modifies the case  of  alpha-
+              betic  characters in _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br.  The _\bp_\ba_\bt_\bt_\be_\br_\bn is expanded to pro-
               duce a pattern just as in pathname expansion.  Each character in
-              the expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is tested against _\bp_\ba_\bt_\bt_\be_\br_\bn,  and,
-              if  it  matches the pattern, its case is converted.  The pattern
-              should not attempt to match more than one character.  The ^\b op-
+              the  expanded value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is tested against _\bp_\ba_\bt_\bt_\be_\br_\bn, and,
+              if it matches the pattern, its case is converted.   The  pattern
+              should  not attempt to match more than one character.  The ^\b^ op-
               erator converts lowercase letters matching _\bp_\ba_\bt_\bt_\be_\br_\bn to uppercase;
               the ,\b, operator converts matching uppercase letters to lowercase.
-              The  ^\b^^\b^  and ,\b,,\b, expansions convert each matched character in the
-              expanded value; the ^\b^ and ,\b, expansions match  and  convert  only
-              the  first character in the expanded value.  If _\bp_\ba_\bt_\bt_\be_\br_\bn is omit-
-              ted, it is treated like a ?\b?, which matches every character.   If
-              _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\b is @\b@ or *\b*, the case modification operation is applied
-              to each positional parameter in turn, and the expansion  is  the
-              resultant  list.   If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted
-              with @\b@ or *\b*, the case modification operation is applied to  each
-              member  of the array in turn, and the expansion is the resultant
+              The ^\b^^\b^ and ,\b,,\b, expansions convert each matched character  in  the
+              expanded  value;  the  ^\b^ and ,\b, expansions match and convert only
+              the first character in the expanded value.  If _\bp_\ba_\bt_\bt_\be_\br_\bn is  omit-
+              ted,  it is treated like a ?\b?, which matches every character.  If
+              _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\bis @\b@ or *\b*, the case modification operation is  applied
+              to  each  positional parameter in turn, and the expansion is the
+              resultant list.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array  variable  subscripted
+              with  @\b@ or *\b*, the case modification operation is applied to each
+              member of the array in turn, and the expansion is the  resultant
               list.
 
        ${_\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br@\b@_\bo_\bp_\be_\br_\ba_\bt_\bo_\br}
               P\bPa\bar\bra\bam\bme\bet\bte\ber\br t\btr\bra\ban\bns\bsf\bfo\bor\brm\bma\bat\bti\bio\bon\bn.  The expansion is either a transforma-
-              tion  of  the  value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br or information about _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
-              itself, depending on the value of _\bo_\bp_\be_\br_\ba_\bt_\bo_\br.  Each _\bo_\bp_\be_\br_\ba_\bt_\bo_\br is  a
+              tion of the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br or  information  about  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+              itself,  depending on the value of _\bo_\bp_\be_\br_\ba_\bt_\bo_\br.  Each _\bo_\bp_\be_\br_\ba_\bt_\bo_\br is a
               single letter:
 
-              U\bU      The  expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
-                     with lowercase alphabetic characters converted to  upper-
+              U\bU      The expansion is a string that is the value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+                     with  lowercase alphabetic characters converted to upper-
                      case.
-              u\bu      The  expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+              u\bu      The expansion is a string that is the value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
                      with the first character converted to uppercase, if it is
                      alphabetic.
-              L\bL      The  expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
-                     with uppercase alphabetic characters converted to  lower-
+              L\bL      The expansion is a string that is the value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+                     with  uppercase alphabetic characters converted to lower-
                      case.
-              Q\bQ      The  expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+              Q\bQ      The expansion is a string that is the value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
                      quoted in a format that can be reused as input.
-              E\bE      The expansion is a string that is the value of  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
-                     with  backslash  escape  sequences  expanded  as with the
+              E\bE      The  expansion is a string that is the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br
+                     with backslash escape  sequences  expanded  as  with  the
                      $\b$'\b'.\b..\b..\b.'\b' quoting mechanism.
               P\bP      The expansion is a string that is the result of expanding
                      the value of _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br as if it were a prompt string (see
                      P\bPR\bRO\bOM\bMP\bPT\bTI\bIN\bNG\bG below).
-              A\bA      The expansion is a string in the form  of  an  assignment
-                     statement  or  d\bde\bec\bcl\bla\bar\bre\be  command  that, if evaluated, will
+              A\bA      The  expansion  is  a string in the form of an assignment
+                     statement or d\bde\bec\bcl\bla\bar\bre\be command  that,  if  evaluated,  will
                      recreate _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br with its attributes and value.
               K\bK      Produces a possibly-quoted version of the value of _\bp_\ba_\br_\ba_\bm_\b-
                      _\be_\bt_\be_\br, except that it prints the values of indexed and as-
-                     sociative arrays as a sequence of quoted key-value  pairs
+                     sociative  arrays as a sequence of quoted key-value pairs
                      (see A\bAr\brr\bra\bay\bys\bs above).
-              a\ba      The  expansion is a string consisting of flag values rep-
+              a\ba      The expansion is a string consisting of flag values  rep-
                      resenting _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br's attributes.
-              k\bk      Like the K transformation, but expands the keys and  val-
-                     ues  of  indexed and associative arrays to separate words
+              k\bk      Like  the K transformation, but expands the keys and val-
+                     ues of indexed and associative arrays to  separate  words
                      after word splitting.
 
-              If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is @\b@ or *\b*, the operation is applied to  each  posi-
-              tional  parameter  in  turn,  and the expansion is the resultant
-              list.  If _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted with  @\b or
+              If  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br  is @\b@ or *\b*, the operation is applied to each posi-
+              tional parameter in turn, and the  expansion  is  the  resultant
+              list.   If  _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br is an array variable subscripted with @\b@ or
               *\b*, the operation is applied to each member of the array in turn,
               and the expansion is the resultant list.
 
-              The result of the expansion is subject  to  word  splitting  and
+              The  result  of  the  expansion is subject to word splitting and
               pathname expansion as described below.
 
    C\bCo\bom\bmm\bma\ban\bnd\bd S\bSu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn
@@ -1966,132 +1983,135 @@ E\bEX\bXP\bPA\bAN\bNS\bSI\bIO\bON\bN
        B\bBa\bas\bsh\bh performs the expansion by executing _\bc_\bo_\bm_\bm_\ba_\bn_\bd in a subshell environ-
        ment and replacing the command substitution with the standard output of
        the command, with any trailing newlines deleted.  Embedded newlines are
-       not  deleted,  but they may be removed during word splitting.  The com-
-       mand substitution $\b$(\b(c\bca\bat\bt _\bf_\bi_\bl_\be)\b) can be replaced  by  the  equivalent  but
+       not deleted, but they may be removed during word splitting.   The  com-
+       mand  substitution  $\b$(\b(c\bca\bat\bt  _\bf_\bi_\bl_\be)\b)  can be replaced by the equivalent but
        faster $\b$(\b(<\b< _\bf_\bi_\bl_\be)\b).
 
-       When  the  old-style  backquote form of substitution is used, backslash
-       retains its literal meaning except when followed by $\b$, `\b`,  or  \\b\.   The
+       When the old-style backquote form of substitution  is  used,  backslash
+       retains  its  literal  meaning except when followed by $\b$, `\b`, or \\b\.  The
        first backquote not preceded by a backslash terminates the command sub-
-       stitution.  When using the $(_\bc_\bo_\bm_\bm_\ba_\bn_\bd) form, all characters between  the
+       stitution.   When using the $(_\bc_\bo_\bm_\bm_\ba_\bn_\bd) form, all characters between the
        parentheses make up the command; none are treated specially.
 
        Command substitutions may be nested.  To nest when using the backquoted
        form, escape the inner backquotes with backslashes.
 
-       If the substitution appears within double quotes,  word  splitting  and
+       If  the  substitution  appears within double quotes, word splitting and
        pathname expansion are not performed on the results.
 
    A\bAr\bri\bit\bth\bhm\bme\bet\bti\bic\bc E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
-       Arithmetic  expansion allows the evaluation of an arithmetic expression
-       and the substitution of the result.  The format for  arithmetic  expan-
+       Arithmetic expansion allows the evaluation of an arithmetic  expression
+       and  the  substitution of the result.  The format for arithmetic expan-
        sion is:
 
               $\b$(\b((\b(_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn)\b))\b)
 
-       The  _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn undergoes the same expansions as if it were within dou-
-       ble quotes, but double quote characters in _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn are  not  treated
+       The _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn undergoes the same expansions as if it were within  dou-
+       ble  quotes,  but double quote characters in _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn are not treated
        specially and are removed.  All tokens in the expression undergo param-
-       eter and variable expansion, command substitution, and  quote  removal.
-       The  result  is  treated  as the arithmetic expression to be evaluated.
+       eter  and  variable expansion, command substitution, and quote removal.
+       The result is treated as the arithmetic  expression  to  be  evaluated.
        Arithmetic expansions may be nested.
 
-       The evaluation is performed according to the rules listed  below  under
+       The  evaluation  is performed according to the rules listed below under
        A\bAR\bRI\bIT\bTH\bHM\bME\bET\bTI\bIC\bC E\bEV\bVA\bAL\bLU\bUA\bAT\bTI\bIO\bON\bN.  If _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn is invalid, b\bba\bas\bsh\bh prints a message
        indicating failure and no substitution occurs.
 
    P\bPr\bro\boc\bce\bes\bss\bs S\bSu\bub\bbs\bst\bti\bit\btu\but\bti\bio\bon\bn
-       _\bP_\br_\bo_\bc_\be_\bs_\b_\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn allows a process's input or output to be  referred
-       to  using  a  filename.   It takes the form of <\b<(\b(_\bl_\bi_\bs_\bt)\b) or >\b>(\b(_\bl_\bi_\bs_\bt)\b).  The
-       process _\bl_\bi_\bs_\bt is run asynchronously, and its input or output appears  as
+       _\bP_\br_\bo_\bc_\be_\bs_\b _\bs_\bu_\bb_\bs_\bt_\bi_\bt_\bu_\bt_\bi_\bo_\bn allows a process's input or output to be referred
+       to using a filename.  It takes the form of  <\b<(\b(_\bl_\bi_\bs_\bt)\b)  or  >\b>(\b(_\bl_\bi_\bs_\bt)\b).   The
+       process  _\bl_\bi_\bs_\bt is run asynchronously, and its input or output appears as
        a filename.  This filename is passed as an argument to the current com-
-       mand as the result of the expansion.  If  the  >\b>(\b(_\bl_\bi_\bs_\bt)\b)  form  is  used,
-       writing  to  the file will provide input for _\bl_\bi_\bs_\bt.  If the <\b<(\b(_\bl_\bi_\bs_\bt)\b) form
-       is used, the file passed as an argument should be read  to  obtain  the
+       mand  as  the  result  of  the expansion.  If the >\b>(\b(_\bl_\bi_\bs_\bt)\b) form is used,
+       writing to the file will provide input for _\bl_\bi_\bs_\bt.  If the  <\b<(\b(_\bl_\bi_\bs_\bt)\b form
+       is  used,  the  file passed as an argument should be read to obtain the
        output of _\bl_\bi_\bs_\bt.  Process substitution is supported on systems that sup-
        port named pipes (_\bF_\bI_\bF_\bO_\bs) or the /\b/d\bde\bev\bv/\b/f\bfd\bd method of naming open files.
 
-       When available, process substitution is performed  simultaneously  with
-       parameter  and variable expansion, command substitution, and arithmetic
+       When  available,  process substitution is performed simultaneously with
+       parameter and variable expansion, command substitution, and  arithmetic
        expansion.
 
    W\bWo\bor\brd\bd S\bSp\bpl\bli\bit\btt\bti\bin\bng\bg
-       The shell scans the results of parameter expansion,  command  substitu-
-       tion,  and arithmetic expansion that did not occur within double quotes
+       The  shell  scans the results of parameter expansion, command substitu-
+       tion, and arithmetic expansion that did not occur within double  quotes
        for _\bw_\bo_\br_\bd _\bs_\bp_\bl_\bi_\bt_\bt_\bi_\bn_\bg.
 
-       The shell treats each character of I\bIF\bFS\bS as a delimiter, and  splits  the
-       results  of  the  other expansions into words using these characters as
+       The  shell  treats each character of I\bIF\bFS\bS as a delimiter, and splits the
+       results of the other expansions into words using  these  characters  as
        field terminators.
 
        If I\bIF\bFS\bS is unset, or its value is exactly <\b<s\bsp\bpa\bac\bce\be>\b><\b<t\bta\bab\bb>\b><\b<n\bne\bew\bwl\bli\bin\bne\be>\b>, the de-
-       fault,  then  sequences of s\bsp\bpa\bac\bce\be, t\bta\bab\bb, and n\bne\bew\bwl\bli\bin\bne\be at the beginning and
-       end of the results of the previous expansions are ignored, and any  se-
-       quence  of I\bIF\bFS\bS characters not at the beginning or end serves to delimit
-       words.  If I\bIF\bFS\bS has a value other than the default,  then  sequences  of
-       the  whitespace  characters  s\bsp\bpa\bac\bce\be, t\bta\bab\bb, and n\bne\bew\bwl\bli\bin\bne\be are ignored at the
-       beginning and end of the word, as long as the whitespace  character  is
-       in  the  value  of I\bIF\bFS\bS (an I\bIF\bFS\bS whitespace character).  Any character in
-       I\bIF\bFS\bthat is not I\bIF\bFS\bS whitespace, along with any adjacent I\bIF\bFS\b whitespace
-       characters,  delimits a field.  A sequence of I\bIF\bFS\bS whitespace characters
+       fault, then sequences of s\bsp\bpa\bac\bce\be, t\bta\bab\bb, and n\bne\bew\bwl\bli\bin\bne\be at the  beginning  and
+       end  of the results of the previous expansions are ignored, and any se-
+       quence of I\bIF\bFS\bS characters not at the beginning or end serves to  delimit
+       words.   If  I\bIF\bFS\bS  has a value other than the default, then sequences of
+       the whitespace characters s\bsp\bpa\bac\bce\be, t\bta\bab\bb, and n\bne\bew\bwl\bli\bin\bne\be are  ignored  at  the
+       beginning  and  end of the word, as long as the whitespace character is
+       in the value of I\bIF\bFS\bS (an I\bIF\bFS\bS whitespace character).   Any  character  in
+       I\bIF\bFS\b that is not I\bIF\bFS\bS whitespace, along with any adjacent I\bIF\bFS\bS whitespace
+       characters, delimits a field.  A sequence of I\bIF\bFS\bS whitespace  characters
        is also treated as a delimiter.
 
-       If the value of I\bIF\bFS\bS is null, no word splitting occurs.  If I\bIF\bFS\bS  is  un-
-       set,  word  splitting  behaves  as if it contained the default value of
+       If  the  value of I\bIF\bFS\bS is null, no word splitting occurs.  If I\bIF\bFS\bS is un-
+       set, word splitting behaves as if it contained  the  default  value  of
        <\b<s\bsp\bpa\bac\bce\be>\b><\b<t\bta\bab\bb>\b><\b<n\bne\bew\bwl\bli\bin\bne\be>\b>.
 
-       Explicit null arguments ("\b""\b" or '\b''\b') are retained and passed to  commands
+       Explicit  null arguments ("\b""\b" or '\b''\b') are retained and passed to commands
        as empty strings.  Unquoted implicit null arguments, resulting from the
        expansion of parameters that have no values, are removed.  If a parame-
        ter with no value is expanded within double quotes, a null argument re-
        sults and is retained and passed to a command as an empty string.  When
-       a  quoted  null  argument  appears as part of a word whose expansion is
+       a quoted null argument appears as part of a  word  whose  expansion  is
        non-null, the null argument is removed.  That is, the word -d'' becomes
        -d after word splitting and null argument removal.
 
        Note that if no expansion occurs, no splitting is performed.
 
    P\bPa\bat\bth\bhn\bna\bam\bme\be E\bEx\bxp\bpa\ban\bns\bsi\bio\bon\bn
-       After  word  splitting,  unless  the -\b-f\bf option has been set, b\bba\bas\bsh\bh scans
-       each word for the characters *\b*, ?\b?, and [\b[.  If one of  these  characters
+       After word splitting, unless the -\b-f\bf option has  been  set,  b\bba\bas\bsh\b scans
+       each  word  for the characters *\b*, ?\b?, and [\b[.  If one of these characters
        appears, and is not quoted, then the word is regarded as a _\bp_\ba_\bt_\bt_\be_\br_\bn, and
-       replaced with an alphabetically sorted list of filenames  matching  the
-       pattern  (see  P\bPa\bat\btt\bte\ber\brn\bn  M\bMa\bat\btc\bch\bhi\bin\bng\bg  below).  If no matching filenames are
-       found, and the shell option n\bnu\bul\bll\blg\bgl\blo\bob\bb is not enabled, the word  is  left
-       unchanged.   If  the  n\bnu\bul\bll\blg\bgl\blo\bob\bb option is set, and no matches are found,
-       the word is removed.  If the f\bfa\bai\bil\blg\bgl\blo\bob\bb  shell  option  is  set,  and  no
-       matches  are  found, an error message is printed and the command is not
+       replaced  with  an alphabetically sorted list of filenames matching the
+       pattern (see P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg below).  If  no  matching  filenames  are
+       found,  and  the shell option n\bnu\bul\bll\blg\bgl\blo\bob\bb is not enabled, the word is left
+       unchanged.  If the n\bnu\bul\bll\blg\bgl\blo\bob\bb option is set, and no  matches  are  found,
+       the  word  is  removed.   If  the  f\bfa\bai\bil\blg\bgl\blo\bob\bb shell option is set, and no
+       matches are found, an error message is printed and the command  is  not
        executed.  If the shell option n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb is enabled, the match is per-
-       formed  without  regard  to  the case of alphabetic characters.  When a
-       pattern is used for pathname expansion, the  character  `\b``\b`.\b.'\b''\b'   at  the
-       start  of  a  name or immediately following a slash must be matched ex-
-       plicitly, unless the shell option d\bdo\bot\btg\bgl\blo\bob\bb is set.  In  order  to  match
+       formed without regard to the case of  alphabetic  characters.   When  a
+       pattern  is  used  for  pathname expansion, the character `\b``\b`.\b.'\b''\b'  at the
+       start of a name or immediately following a slash must  be  matched  ex-
+       plicitly,  unless  the  shell option d\bdo\bot\btg\bgl\blo\bob\bb is set.  In order to match
        the filenames `\b``\b`.\b.'\b''\b'  and `\b``\b`.\b..\b.'\b''\b', the pattern must begin with ``.'' (for
-       example, ``.?''), even if d\bdo\bot\btg\bgl\blo\bob\bb is set.  If  the  g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\b shell
-       option  is enabled, the filenames `\b``\b`.\b.'\b''\b'  and `\b``\b`.\b..\b.'\b''\b'  are never matched,
-       even if the pattern begins with a `\b``\b`.\b.'\b''\b'.  When not matching  pathnames,
-       the  `\b``\b`.\b.'\b''\b'   character is not treated specially.  When matching a path-
-       name, the slash character must always be matched explicitly by a  slash
-       in  the  pattern, but in other matching contexts it can be matched by a
-       special pattern character as described below  under  P\bPa\bat\btt\bte\ber\brn\b M\bMa\bat\btc\bch\bhi\bin\bng\bg.
-       See  the  description of s\bsh\bho\bop\bpt\bt below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS for a
-       description of the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb, n\bnu\bul\bll\blg\bgl\blo\bob\bb,  g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs,  f\bfa\bai\bil\blg\bgl\blo\bob\bb,  and
+       example,  ``.?''),  even  if d\bdo\bot\btg\bgl\blo\bob\bb is set.  If the g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs shell
+       option is enabled, the filenames `\b``\b`.\b.'\b''\b'  and `\b``\b`.\b..\b.'\b''\b'  are never  matched,
+       even  if the pattern begins with a `\b``\b`.\b.'\b''\b'.  When not matching pathnames,
+       the `\b``\b`.\b.'\b''\b'  character is not treated specially.  When matching  a  path-
+       name,  the slash character must always be matched explicitly by a slash
+       in the pattern, but in other matching contexts it can be matched  by  a
+       special  pattern  character  as described below under P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg.
+       See the description of s\bsh\bho\bop\bpt\bt below under S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS  for  a
+       description  of  the  n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb, n\bnu\bul\bll\blg\bgl\blo\bob\bb, g\bgl\blo\bob\bbs\bsk\bki\bip\bpd\bdo\bot\bts\bs, f\bfa\bai\bil\blg\bgl\blo\bob\bb, and
        d\bdo\bot\btg\bgl\blo\bob\bb shell options.
 
-       The  G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE  shell variable may be used to restrict the set of file
-       names matching a _\bp_\ba_\bt_\bt_\be_\br_\bn.  If G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is  set,  each  matching  file
-       name  that  also  matches  one of the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is removed
-       from the list of matches.  If the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb option is set, the  match-
-       ing  against  the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is performed without regard to
+       The G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE shell variable may be used to restrict the set  of  file
+       names  matching  a  _\bp_\ba_\bt_\bt_\be_\br_\bn.   If G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is set, each matching file
+       name that also matches one of the patterns  in  G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE  is  removed
+       from  the list of matches.  If the n\bno\boc\bca\bas\bse\beg\bgl\blo\bob\bb option is set, the match-
+       ing against the patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE is performed without  regard  to
        case.  The filenames `\b``\b`.\b.'\b''\b'  and `\b``\b`.\b..\b.'\b''\b'  are always ignored when G\bGL\bLO\bOB\bBI\bIG\bG-\b-
-       N\bNO\bOR\bRE\b is  set  and not null.  However, setting G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE to a non-null
+       N\bNO\bOR\bRE\bis set and not null.  However, setting G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE  to  a  non-null
        value has the effect of enabling the d\bdo\bot\btg\bgl\blo\bob\bb shell option, so all other
-       filenames  beginning with a `\b``\b`.\b.'\b''\b'  will match.  To get the old behavior
-       of ignoring filenames beginning with a `\b``\b`.\b.'\b''\b', make `\b``\b`.\b.*\b*'\b''\b'  one  of  the
+       filenames beginning with a `\b``\b`.\b.'\b''\b'  will match.  To get the old  behavior
+       of  ignoring  filenames beginning with a `\b``\b`.\b.'\b''\b', make `\b``\b`.\b.*\b*'\b''\b'  one of the
        patterns in G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE.  The d\bdo\bot\btg\bgl\blo\bob\bb option is disabled when G\bGL\bLO\bOB\bBI\bIG\bGN\bNO\bOR\bRE\bE
        is unset.  The pattern matching honors the setting of the e\bex\bxt\btg\bgl\blo\bob\bb shell
        option.
 
+       The G\bGL\bLO\bOB\bBS\bSO\bOR\bRT\bT variable controls how the results  of  pathname  expansion
+       are sorted, as described above.
+
        P\bPa\bat\btt\bte\ber\brn\bn M\bMa\bat\btc\bch\bhi\bin\bng\bg
 
        Any character that appears in a pattern, other than the special pattern
@@ -4625,7 +4645,7 @@ S\bSH\bHE\bEL\bLL\bL B\bBU\bUI\bIL\bLT\bTI\bIN\bN C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
               routine  call or _\be_\bx_\bp_\br does not correspond to a valid position in
               the call stack.
 
-       c\bcd\bd [-\b-L\bL|[-\b-P\bP [-\b-e\be]] [-@]] [_\bd_\bi_\br]
+       c\bcd\bd [-\b-L\bL|[-\b-P\bP [-\b-e\be]]] [-@] [_\bd_\bi_\br]
               Change the current directory to _\bd_\bi_\br.  if _\bd_\bi_\br  is  not  supplied,
               the  value of the H\bHO\bOM\bME\bE shell variable is the default.  The vari-
               able C\bCD\bDP\bPA\bAT\bTH\bH defines the search path for the directory containing
@@ -6718,4 +6738,4 @@ B\bBU\bUG\bGS\bS
 
 
 
-GNU Bash 5.2                     2023 March 14                         BASH(1)
+GNU Bash 5.2                     2023 April 15                         BASH(1)
index 0d42fcf5466faee4fb444af6f712adee1173ccaa..1f3ce371f5dd6772fa2a9ede8263726eaf1972a6 100644 (file)
@@ -5,12 +5,12 @@
 .\"    Case Western Reserve University
 .\"    chet.ramey@case.edu
 .\"
-.\"    Last Change: Tue Mar 14 16:19:06 EDT 2023
+.\"    Last Change: Sat Apr 15 17:52:31 EDT 2023
 .\"
 .\" bash_builtins, strip all but Built-Ins section
 .if \n(zZ=1 .ig zZ
 .if \n(zY=1 .ig zY
-.TH BASH 1 "2023 March 14" "GNU Bash 5.2"
+.TH BASH 1 "2023 April 15" "GNU Bash 5.2"
 .\"
 .\" There's some problem with having a `@'
 .\" in a tagged paragraph with the BSD man macros.
@@ -2248,6 +2248,32 @@ of the patterns in
 .BR GLOBIGNORE ,
 it is removed from the list of matches.
 .TP
+.B GLOBSORT
+Control how the results of pathname expansion are sorted.
+The value of this variable specifies the sort criteria and sort order for
+the results of pathname expansion.
+If this variable is unset or set to the null string, pathname expansion
+uses the historial behavior of sorting by name.
+If set, a valid value begins with an optional \fI+\fP, which is ignored,
+or \fI\-\fP, which reverses the sort order from ascending to descending,
+followed by a sort specifier.
+The valid sort specifiers are
+.IR name ,
+.IR size ,
+.IR mtime ,
+.IR atime ,
+.IR ctime ,
+and
+.IR blocks ,
+which sort the files on name, file size, modification time, access time,
+inode change time, and number of blocks, respectively.
+For example, a value of \fB\-mtime\fP sorts the results in descending
+order by modification time (newest first).
+If the sort specifier is missing, it defaults to \fIname\fP,
+so a value of \fI+\fP is equivalent to the null string,
+and a value of \fI-\fP sorts by name in descending order.
+Any invalid value restores the historical sorting behavior.
+.TP
 .B HISTCONTROL
 A colon-separated list of values controlling how commands are saved on
 the history list.
@@ -3859,6 +3885,12 @@ is unset.
 The pattern matching honors the setting of the \fBextglob\fP shell
 option.
 .PP
+The
+.SM
+.B GLOBSORT
+variable controls how the results of pathname expansion are sorted, as
+described above.
+.PP
 \fBPattern Matching\fP
 .PP
 Any character that appears in a pattern, other than the special pattern
index abe9eae7c552ec3dd45f5c21a3269eccc7bb2069..cb40ee476debb857514394d372e15cffdfd4dd41 100644 (file)
@@ -1,9 +1,9 @@
 This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.2, 14 March 2023).
+Bash shell (version 5.2, 15 April 2023).
 
-   This is Edition 5.2, last updated 14 March 2023, of 'The GNU Bash
+   This is Edition 5.2, last updated 15 April 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.2.
 
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
 *************
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.2, 14 March 2023).  The Bash home page is
+Bash shell (version 5.2, 15 April 2023).  The Bash home page is
 <http://www.gnu.org/software/bash/>.
 
-   This is Edition 5.2, last updated 14 March 2023, of 'The GNU Bash
+   This is Edition 5.2, last updated 15 April 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.2.
 
    Bash contains features that appear in other popular shells, and some
@@ -2409,6 +2409,10 @@ behavior of ignoring filenames beginning with a '.', make '.*' one of
 the patterns in 'GLOBIGNORE'.  The 'dotglob' option is disabled when
 'GLOBIGNORE' is unset.
 
+   After the pattern is expanded and matched against filenames, the
+value of the 'GLOBSORT' variable controls how the results are sorted, as
+described below (*note Bash Variables::).
+
 \1f
 File: bash.info,  Node: Pattern Matching,  Up: Filename Expansion
 
@@ -2574,7 +2578,7 @@ was redirected to 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
+system on which Bash is running provides these special files, Bash will
 use them; otherwise it will emulate them internally with the behavior
 described below.
 
@@ -3249,7 +3253,7 @@ standard.
      than or equal to 1.
 
 'cd'
-          cd [-L|[-P [-e]] [-@] [DIRECTORY]
+          cd [-L|[-P [-e]]] [-@] [DIRECTORY]
 
      Change the current working directory to DIRECTORY.  If DIRECTORY is
      not supplied, the value of the 'HOME' shell variable is used.  If
@@ -4854,7 +4858,7 @@ This builtin allows you to change additional shell optional behavior.
           words to be 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
+          quoted, either.  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.
@@ -5259,7 +5263,7 @@ Variables::).
 
 '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 '.' or 'source') is at the top of the stack.  When a
      subroutine is executed, the number of parameters passed is pushed
@@ -5272,7 +5276,7 @@ Variables::).
 
 'BASH_ARGV'
      An array variable containing all of the parameters in the current
-     bash execution call stack.  The final parameter of the last
+     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 are pushed onto 'BASH_ARGV'.  The shell
@@ -5561,6 +5565,28 @@ Variables::).
      'GLOBIGNORE', it is removed from the list of matches.  The pattern
      matching honors the setting of the 'extglob' shell option.
 
+'GLOBSORT'
+     Control how the results of filename expansion are sorted.  The
+     value of this variable specifies the sort criteria and sort order
+     for the results of filename expansion.  If this variable is unset
+     or set to the null string, filename expansion uses the historial
+     behavior of sorting by name.  If set, a valid value begins with an
+     optional '+', which is ignored, or '-', which reverses the sort
+     order from ascending to descending, followed by a sort specifier.
+     The valid sort specifiers are 'name', 'size', 'mtime', 'atime',
+     'ctime', and 'blocks', which sort the files on name, file size,
+     modification time, access time, inode change time, and number of
+     blocks, respectively.
+
+     For example, a value of '-mtime' sorts the results in descending
+     order by modification time (newest first).
+
+     If the sort specifier is missing, it defaults to NAME, so a value
+     of '+' is equivalent to the null string, and a value of '-' sorts
+     by name in descending order.
+
+     Any invalid value restores the historical sorting behavior.
+
 'GROUPS'
      An array variable containing the list of groups of which the
      current user is a member.  Assignments to 'GROUPS' have no effect.
@@ -6573,7 +6599,7 @@ decreasing precedence.
 '||'
      logical OR
 
-'expr ? expr : expr'
+'expr ? if-true-expr : if-false-expr'
      conditional operator
 
 '= *= /= %= += -= <<= >>= &= ^= |='
@@ -7069,13 +7095,60 @@ environment, such as 'jails', 'zones', or 'containers'.
 \1f
 File: bash.info,  Node: Bash POSIX Mode,  Next: Shell Compatibility Mode,  Prev: The Restricted Shell,  Up: Bash Features
 
-6.11 Bash POSIX Mode
-====================
+6.11 Bash and POSIX
+===================
 
-Starting Bash with the '--posix' command-line option or executing 'set
--o posix' while Bash is running will cause Bash to conform more closely
-to the POSIX standard by changing the behavior to match that specified
-by POSIX in areas where the Bash default differs.
+6.11.1 What is POSIX?
+---------------------
+
+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 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 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
+<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html>.
+
+   Bash is concerned with the aspects of the shell's behavior defined by
+the 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 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 'eval' and '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 'read' and '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.
+
+6.11.2 Bash POSIX Mode
+----------------------
+
+Although Bash is an implementation of the POSIX shell specification,
+there are areas where the Bash default behavior differs from the
+specification.  The Bash "posix mode" changes the Bash behavior in these
+areas so that it conforms to the standard more closely.
+
+   Starting Bash with the '--posix' command-line option or executing
+'set -o posix' while Bash is running will cause Bash to conform more
+closely to the POSIX standard by changing the behavior to match that
+specified by POSIX in areas where the Bash default differs.
 
    When invoked as 'sh', Bash enters POSIX mode after reading the
 startup files.
@@ -7338,6 +7411,13 @@ startup files.
      that a backslash preceding a double quote character will escape it
      and the backslash will be removed.
 
+  66. Command substitutions don't set the '?' special parameter.  The
+     exit status of a simple command without a command word is still the
+     exit status of the last command substitution that occurred while
+     evaluating the variable assignments and redirections in that
+     command, but that does not happen until after all of the
+     assignments and redirections.
+
    There is other POSIX behavior that Bash does not implement by default
 even when in POSIX mode.  Specifically:
 
@@ -7345,7 +7425,11 @@ even when in POSIX mode.  Specifically:
      entries if 'FCEDIT' is unset, rather than defaulting directly to
      'ed'.  'fc' uses 'ed' if 'EDITOR' is unset.
 
-  2. As noted above, Bash requires the 'xpg_echo' option to be enabled
+  2. A non-interactive shell does not exit if a variable assignment
+     preceding the 'command' builtin or another non-special builtin
+     fails.
+
+  3. As noted above, Bash requires the 'xpg_echo' option to be enabled
      for the 'echo' builtin to be fully conformant.
 
    Bash can be configured to be POSIX-conformant by default, by
@@ -10485,7 +10569,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 '/usr/local/build' from the source code
+build Bash in a directory under '/usr/local/build' from the source code
 in '/usr/local/src/bash-4.4':
 
      mkdir /usr/local/build/bash-4.4
@@ -10578,7 +10662,7 @@ By default, 'make install' will install into '/usr/local/bin',
 specifying a value for the 'prefix' 'make' variable when running 'make
 install' (e.g., 'make install prefix=PATH').  The 'prefix' variable
 provides a default for 'exec_prefix' and other variables used when
-installing bash.
+installing Bash.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
@@ -10591,7 +10675,7 @@ run, you can specify these variables as arguments to 'make': 'make
 install exec_prefix=/' will install 'bash' and 'bashbug' into '/bin'
 instead of the default '/usr/local/bin'.
 
-   If you want to see the files bash will install and where it will
+   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 'DESTDIR' as an argument to 'make'.  Its value should be the
 absolute directory path you'd like to use as the root of your sample
@@ -10773,7 +10857,7 @@ does not provide the necessary support.
      builtins (*note Aliases::).
 
 '--enable-alt-array-implementation'
-     This builds bash using an alternate implementation of arrays (*note
+     This builds Bash using an alternate implementation of arrays (*note
      Arrays::) that provides faster access at the expense of using more
      memory (sometimes many times more, depending on how sparse an array
      is).
@@ -10824,7 +10908,7 @@ does not provide the necessary support.
      (*note Pipelines::).
 
 '--enable-debugger'
-     Include support for the bash debugger (distributed separately).
+     Include support for the Bash debugger (distributed separately).
 
 '--enable-dev-fd-stat-broken'
      If calling 'stat' on /dev/fd/N returns different results than
@@ -10962,11 +11046,11 @@ of Bash.  The latest version of Bash is always available for FTP from
 <http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz>.
 
    Once you have determined that a bug actually exists, use the
-'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>.
-If you have a fix, you are encouraged to submit that as well!
-Suggestions and 'philosophical' bug reports may be mailed to
-<bug-bash@gnu.org> or <help-bash@gnu.org>.
+'bashbug' command to submit a bug report or use the form at the Bash
+project page (https://savannah.gnu.org/projects/bash/).  If you have a
+fix, you are encouraged to submit that as well!  Suggestions and
+'philosophical' bug reports may be mailed to <bug-bash@gnu.org> or
+<help-bash@gnu.org>.
 
    All bug reports should include:
    * The version number of Bash.
@@ -12110,57 +12194,58 @@ D.3 Parameter and Variable Index
 * FUNCNAME:                              Bash Variables.      (line 326)
 * FUNCNEST:                              Bash Variables.      (line 343)
 * GLOBIGNORE:                            Bash Variables.      (line 348)
-* GROUPS:                                Bash Variables.      (line 355)
-* histchars:                             Bash Variables.      (line 361)
-* HISTCMD:                               Bash Variables.      (line 376)
-* HISTCONTROL:                           Bash Variables.      (line 382)
-* HISTFILE:                              Bash Variables.      (line 398)
-* HISTFILESIZE:                          Bash Variables.      (line 402)
-* HISTIGNORE:                            Bash Variables.      (line 413)
+* GLOBSORT:                              Bash Variables.      (line 355)
+* GROUPS:                                Bash Variables.      (line 377)
+* histchars:                             Bash Variables.      (line 383)
+* HISTCMD:                               Bash Variables.      (line 398)
+* HISTCONTROL:                           Bash Variables.      (line 404)
+* HISTFILE:                              Bash Variables.      (line 420)
+* HISTFILESIZE:                          Bash Variables.      (line 424)
+* HISTIGNORE:                            Bash Variables.      (line 435)
 * history-preserve-point:                Readline Init File Syntax.
                                                               (line 211)
 * history-size:                          Readline Init File Syntax.
                                                               (line 217)
-* HISTSIZE:                              Bash Variables.      (line 433)
-* HISTTIMEFORMAT:                        Bash Variables.      (line 440)
+* HISTSIZE:                              Bash Variables.      (line 455)
+* HISTTIMEFORMAT:                        Bash Variables.      (line 462)
 * HOME:                                  Bourne Shell Variables.
                                                               (line  13)
 * horizontal-scroll-mode:                Readline Init File Syntax.
                                                               (line 226)
-* HOSTFILE:                              Bash Variables.      (line 448)
-* HOSTNAME:                              Bash Variables.      (line 459)
-* HOSTTYPE:                              Bash Variables.      (line 462)
+* HOSTFILE:                              Bash Variables.      (line 470)
+* HOSTNAME:                              Bash Variables.      (line 481)
+* HOSTTYPE:                              Bash Variables.      (line 484)
 * IFS:                                   Bourne Shell Variables.
                                                               (line  18)
-* IGNOREEOF:                             Bash Variables.      (line 465)
+* IGNOREEOF:                             Bash Variables.      (line 487)
 * input-meta:                            Readline Init File Syntax.
                                                               (line 235)
-* INPUTRC:                               Bash Variables.      (line 475)
-* INSIDE_EMACS:                          Bash Variables.      (line 479)
+* INPUTRC:                               Bash Variables.      (line 497)
+* INSIDE_EMACS:                          Bash Variables.      (line 501)
 * isearch-terminators:                   Readline Init File Syntax.
                                                               (line 245)
 * keymap:                                Readline Init File Syntax.
                                                               (line 252)
 * LANG:                                  Creating Internationalized Scripts.
                                                               (line  51)
-* LANG <1>:                              Bash Variables.      (line 485)
-* LC_ALL:                                Bash Variables.      (line 489)
-* LC_COLLATE:                            Bash Variables.      (line 493)
-* LC_CTYPE:                              Bash Variables.      (line 500)
+* LANG <1>:                              Bash Variables.      (line 507)
+* LC_ALL:                                Bash Variables.      (line 511)
+* LC_COLLATE:                            Bash Variables.      (line 515)
+* LC_CTYPE:                              Bash Variables.      (line 522)
 * LC_MESSAGES:                           Creating Internationalized Scripts.
                                                               (line  51)
-* LC_MESSAGES <1>:                       Bash Variables.      (line 505)
-* LC_NUMERIC:                            Bash Variables.      (line 509)
-* LC_TIME:                               Bash Variables.      (line 513)
-* LINENO:                                Bash Variables.      (line 517)
-* LINES:                                 Bash Variables.      (line 522)
-* MACHTYPE:                              Bash Variables.      (line 528)
+* LC_MESSAGES <1>:                       Bash Variables.      (line 527)
+* LC_NUMERIC:                            Bash Variables.      (line 531)
+* LC_TIME:                               Bash Variables.      (line 535)
+* LINENO:                                Bash Variables.      (line 539)
+* LINES:                                 Bash Variables.      (line 544)
+* MACHTYPE:                              Bash Variables.      (line 550)
 * MAIL:                                  Bourne Shell Variables.
                                                               (line  22)
-* MAILCHECK:                             Bash Variables.      (line 532)
+* MAILCHECK:                             Bash Variables.      (line 554)
 * MAILPATH:                              Bourne Shell Variables.
                                                               (line  27)
-* MAPFILE:                               Bash Variables.      (line 540)
+* MAPFILE:                               Bash Variables.      (line 562)
 * mark-modified-lines:                   Readline Init File Syntax.
                                                               (line 282)
 * mark-symlinked-directories:            Readline Init File Syntax.
@@ -12171,46 +12256,46 @@ D.3 Parameter and Variable Index
                                                               (line 299)
 * meta-flag:                             Readline Init File Syntax.
                                                               (line 235)
-* OLDPWD:                                Bash Variables.      (line 544)
+* OLDPWD:                                Bash Variables.      (line 566)
 * OPTARG:                                Bourne Shell Variables.
                                                               (line  34)
-* OPTERR:                                Bash Variables.      (line 547)
+* OPTERR:                                Bash Variables.      (line 569)
 * OPTIND:                                Bourne Shell Variables.
                                                               (line  38)
-* OSTYPE:                                Bash Variables.      (line 551)
+* OSTYPE:                                Bash Variables.      (line 573)
 * output-meta:                           Readline Init File Syntax.
                                                               (line 304)
 * page-completions:                      Readline Init File Syntax.
                                                               (line 312)
 * PATH:                                  Bourne Shell Variables.
                                                               (line  42)
-* PIPESTATUS:                            Bash Variables.      (line 554)
-* POSIXLY_CORRECT:                       Bash Variables.      (line 559)
-* PPID:                                  Bash Variables.      (line 569)
-* PROMPT_COMMAND:                        Bash Variables.      (line 573)
-* PROMPT_DIRTRIM:                        Bash Variables.      (line 579)
-* PS0:                                   Bash Variables.      (line 585)
+* PIPESTATUS:                            Bash Variables.      (line 576)
+* POSIXLY_CORRECT:                       Bash Variables.      (line 581)
+* PPID:                                  Bash Variables.      (line 591)
+* PROMPT_COMMAND:                        Bash Variables.      (line 595)
+* PROMPT_DIRTRIM:                        Bash Variables.      (line 601)
+* PS0:                                   Bash Variables.      (line 607)
 * PS1:                                   Bourne Shell Variables.
                                                               (line  48)
 * PS2:                                   Bourne Shell Variables.
                                                               (line  53)
-* PS3:                                   Bash Variables.      (line 590)
-* PS4:                                   Bash Variables.      (line 595)
-* PWD:                                   Bash Variables.      (line 603)
-* RANDOM:                                Bash Variables.      (line 606)
-* READLINE_ARGUMENT:                     Bash Variables.      (line 612)
-* READLINE_LINE:                         Bash Variables.      (line 616)
-* READLINE_MARK:                         Bash Variables.      (line 620)
-* READLINE_POINT:                        Bash Variables.      (line 626)
-* REPLY:                                 Bash Variables.      (line 630)
+* PS3:                                   Bash Variables.      (line 612)
+* PS4:                                   Bash Variables.      (line 617)
+* PWD:                                   Bash Variables.      (line 625)
+* RANDOM:                                Bash Variables.      (line 628)
+* READLINE_ARGUMENT:                     Bash Variables.      (line 634)
+* READLINE_LINE:                         Bash Variables.      (line 638)
+* READLINE_MARK:                         Bash Variables.      (line 642)
+* READLINE_POINT:                        Bash Variables.      (line 648)
+* REPLY:                                 Bash Variables.      (line 652)
 * revert-all-at-newline:                 Readline Init File Syntax.
                                                               (line 322)
 * search-ignore-case:                    Readline Init File Syntax.
                                                               (line 329)
-* SECONDS:                               Bash Variables.      (line 633)
-* SHELL:                                 Bash Variables.      (line 642)
-* SHELLOPTS:                             Bash Variables.      (line 647)
-* SHLVL:                                 Bash Variables.      (line 656)
+* SECONDS:                               Bash Variables.      (line 655)
+* SHELL:                                 Bash Variables.      (line 664)
+* SHELLOPTS:                             Bash Variables.      (line 669)
+* SHLVL:                                 Bash Variables.      (line 678)
 * show-all-if-ambiguous:                 Readline Init File Syntax.
                                                               (line 334)
 * show-all-if-unmodified:                Readline Init File Syntax.
@@ -12219,15 +12304,15 @@ D.3 Parameter and Variable Index
                                                               (line 349)
 * skip-completed-text:                   Readline Init File Syntax.
                                                               (line 355)
-* SRANDOM:                               Bash Variables.      (line 661)
+* SRANDOM:                               Bash Variables.      (line 683)
 * TEXTDOMAIN:                            Creating Internationalized Scripts.
                                                               (line  51)
 * TEXTDOMAINDIR:                         Creating Internationalized Scripts.
                                                               (line  51)
-* TIMEFORMAT:                            Bash Variables.      (line 670)
-* TMOUT:                                 Bash Variables.      (line 708)
-* TMPDIR:                                Bash Variables.      (line 720)
-* UID:                                   Bash Variables.      (line 724)
+* TIMEFORMAT:                            Bash Variables.      (line 692)
+* TMOUT:                                 Bash Variables.      (line 730)
+* TMPDIR:                                Bash Variables.      (line 742)
+* UID:                                   Bash Variables.      (line 746)
 * vi-cmd-mode-string:                    Readline Init File Syntax.
                                                               (line 368)
 * vi-ins-mode-string:                    Readline Init File Syntax.
@@ -12454,11 +12539,14 @@ D.5 Concept Index
 * arithmetic evaluation:                 Shell Arithmetic.    (line   6)
 * arithmetic expansion:                  Arithmetic Expansion.
                                                               (line   6)
+* arithmetic operators:                  Shell Arithmetic.    (line  17)
 * arithmetic, shell:                     Shell Arithmetic.    (line   6)
 * arrays:                                Arrays.              (line   6)
 * background:                            Job Control Basics.  (line   6)
 * Bash configuration:                    Basic Installation.  (line   6)
 * Bash installation:                     Basic Installation.  (line   6)
+* binary arithmetic operators:           Shell Arithmetic.    (line  17)
+* bitwise arithmetic operators:          Shell Arithmetic.    (line  17)
 * Bourne shell:                          Basic Shell Features.
                                                               (line   6)
 * brace expansion:                       Brace Expansion.     (line   6)
@@ -12492,6 +12580,7 @@ D.5 Concept Index
                                                               (line   6)
 * completion builtins:                   Programmable Completion Builtins.
                                                               (line   6)
+* conditional arithmetic operator:       Shell Arithmetic.    (line  17)
 * configuration:                         Basic Installation.  (line   6)
 * control operator:                      Definitions.         (line  21)
 * coprocess:                             Coprocesses.         (line   6)
@@ -12566,7 +12655,8 @@ D.5 Concept Index
 * pattern matching:                      Pattern Matching.    (line   6)
 * pipeline:                              Pipelines.           (line   6)
 * POSIX:                                 Definitions.         (line   9)
-* POSIX Mode:                            Bash POSIX Mode.     (line   6)
+* POSIX description:                     Bash POSIX Mode.     (line   9)
+* POSIX Mode:                            Bash POSIX Mode.     (line  48)
 * process group:                         Definitions.         (line  62)
 * process group ID:                      Definitions.         (line  66)
 * process substitution:                  Process Substitution.
@@ -12601,6 +12691,7 @@ D.5 Concept Index
 * tilde expansion:                       Tilde Expansion.     (line   6)
 * token:                                 Definitions.         (line  86)
 * translation, native languages:         Locale Translation.  (line   6)
+* unary arithmetic operators:            Shell Arithmetic.    (line  17)
 * variable, shell:                       Shell Parameters.    (line   6)
 * variables, readline:                   Readline Init File Syntax.
                                                               (line  37)
@@ -12652,98 +12743,98 @@ Node: Arithmetic Expansion\7f97645
 Node: Process Substitution\7f98610
 Node: Word Splitting\7f99727
 Node: Filename Expansion\7f101772
-Node: Pattern Matching\7f104518
-Node: Quote Removal\7f109517
-Node: Redirections\7f109809
-Node: Executing Commands\7f119499
-Node: Simple Command Expansion\7f120166
-Node: Command Search and Execution\7f122273
-Node: Command Execution Environment\7f124657
-Node: Environment\7f127689
-Node: Exit Status\7f129349
-Node: Signals\7f131130
-Node: Shell Scripts\7f134576
-Node: Shell Builtin Commands\7f137600
-Node: Bourne Shell Builtins\7f139635
-Node: Bash Builtins\7f161830
-Node: Modifying Shell Behavior\7f193826
-Node: The Set Builtin\7f194168
-Node: The Shopt Builtin\7f204763
-Node: Special Builtins\7f220672
-Node: Shell Variables\7f221648
-Node: Bourne Shell Variables\7f222082
-Node: Bash Variables\7f224183
-Node: Bash Features\7f256995
-Node: Invoking Bash\7f258005
-Node: Bash Startup Files\7f264015
-Node: Interactive Shells\7f269143
-Node: What is an Interactive Shell?\7f269551
-Node: Is this Shell Interactive?\7f270197
-Node: Interactive Shell Behavior\7f271009
-Node: Bash Conditional Expressions\7f274635
-Node: Shell Arithmetic\7f279274
-Node: Aliases\7f282215
-Node: Arrays\7f285106
-Node: The Directory Stack\7f291666
-Node: Directory Stack Builtins\7f292447
-Node: Controlling the Prompt\7f296704
-Node: The Restricted Shell\7f299666
-Node: Bash POSIX Mode\7f302273
-Node: Shell Compatibility Mode\7f315136
-Node: Job Control\7f323700
-Node: Job Control Basics\7f324157
-Node: Job Control Builtins\7f329156
-Node: Job Control Variables\7f334948
-Node: Command Line Editing\7f336101
-Node: Introduction and Notation\7f337769
-Node: Readline Interaction\7f339389
-Node: Readline Bare Essentials\7f340577
-Node: Readline Movement Commands\7f342363
-Node: Readline Killing Commands\7f343320
-Node: Readline Arguments\7f345238
-Node: Searching\7f346279
-Node: Readline Init File\7f348462
-Node: Readline Init File Syntax\7f349720
-Node: Conditional Init Constructs\7f373508
-Node: Sample Init File\7f377701
-Node: Bindable Readline Commands\7f380822
-Node: Commands For Moving\7f382023
-Node: Commands For History\7f384071
-Node: Commands For Text\7f389062
-Node: Commands For Killing\7f392708
-Node: Numeric Arguments\7f395738
-Node: Commands For Completion\7f396874
-Node: Keyboard Macros\7f401062
-Node: Miscellaneous Commands\7f401747
-Node: Readline vi Mode\7f407782
-Node: Programmable Completion\7f408686
-Node: Programmable Completion Builtins\7f416463
-Node: A Programmable Completion Example\7f427212
-Node: Using History Interactively\7f432457
-Node: Bash History Facilities\7f433138
-Node: Bash History Builtins\7f436140
-Node: History Interaction\7f441161
-Node: Event Designators\7f444778
-Node: Word Designators\7f446129
-Node: Modifiers\7f447886
-Node: Installing Bash\7f449691
-Node: Basic Installation\7f450825
-Node: Compilers and Options\7f454544
-Node: Compiling For Multiple Architectures\7f455282
-Node: Installation Names\7f456971
-Node: Specifying the System Type\7f459077
-Node: Sharing Defaults\7f459791
-Node: Operation Controls\7f460461
-Node: Optional Features\7f461416
-Node: Reporting Bugs\7f472632
-Node: Major Differences From The Bourne Shell\7f473973
-Node: GNU Free Documentation License\7f490819
-Node: Indexes\7f515993
-Node: Builtin Index\7f516444
-Node: Reserved Word Index\7f523268
-Node: Variable Index\7f525713
-Node: Function Index\7f542625
-Node: Concept Index\7f556406
+Node: Pattern Matching\7f104702
+Node: Quote Removal\7f109701
+Node: Redirections\7f109993
+Node: Executing Commands\7f119683
+Node: Simple Command Expansion\7f120350
+Node: Command Search and Execution\7f122457
+Node: Command Execution Environment\7f124841
+Node: Environment\7f127873
+Node: Exit Status\7f129533
+Node: Signals\7f131314
+Node: Shell Scripts\7f134760
+Node: Shell Builtin Commands\7f137784
+Node: Bourne Shell Builtins\7f139819
+Node: Bash Builtins\7f162015
+Node: Modifying Shell Behavior\7f194011
+Node: The Set Builtin\7f194353
+Node: The Shopt Builtin\7f204948
+Node: Special Builtins\7f220857
+Node: Shell Variables\7f221833
+Node: Bourne Shell Variables\7f222267
+Node: Bash Variables\7f224368
+Node: Bash Features\7f258281
+Node: Invoking Bash\7f259291
+Node: Bash Startup Files\7f265301
+Node: Interactive Shells\7f270429
+Node: What is an Interactive Shell?\7f270837
+Node: Is this Shell Interactive?\7f271483
+Node: Interactive Shell Behavior\7f272295
+Node: Bash Conditional Expressions\7f275921
+Node: Shell Arithmetic\7f280560
+Node: Aliases\7f283518
+Node: Arrays\7f286409
+Node: The Directory Stack\7f292969
+Node: Directory Stack Builtins\7f293750
+Node: Controlling the Prompt\7f298007
+Node: The Restricted Shell\7f300969
+Node: Bash POSIX Mode\7f303576
+Node: Shell Compatibility Mode\7f319366
+Node: Job Control\7f327930
+Node: Job Control Basics\7f328387
+Node: Job Control Builtins\7f333386
+Node: Job Control Variables\7f339178
+Node: Command Line Editing\7f340331
+Node: Introduction and Notation\7f341999
+Node: Readline Interaction\7f343619
+Node: Readline Bare Essentials\7f344807
+Node: Readline Movement Commands\7f346593
+Node: Readline Killing Commands\7f347550
+Node: Readline Arguments\7f349468
+Node: Searching\7f350509
+Node: Readline Init File\7f352692
+Node: Readline Init File Syntax\7f353950
+Node: Conditional Init Constructs\7f377738
+Node: Sample Init File\7f381931
+Node: Bindable Readline Commands\7f385052
+Node: Commands For Moving\7f386253
+Node: Commands For History\7f388301
+Node: Commands For Text\7f393292
+Node: Commands For Killing\7f396938
+Node: Numeric Arguments\7f399968
+Node: Commands For Completion\7f401104
+Node: Keyboard Macros\7f405292
+Node: Miscellaneous Commands\7f405977
+Node: Readline vi Mode\7f412012
+Node: Programmable Completion\7f412916
+Node: Programmable Completion Builtins\7f420693
+Node: A Programmable Completion Example\7f431442
+Node: Using History Interactively\7f436687
+Node: Bash History Facilities\7f437368
+Node: Bash History Builtins\7f440370
+Node: History Interaction\7f445391
+Node: Event Designators\7f449008
+Node: Word Designators\7f450359
+Node: Modifiers\7f452116
+Node: Installing Bash\7f453921
+Node: Basic Installation\7f455055
+Node: Compilers and Options\7f458774
+Node: Compiling For Multiple Architectures\7f459512
+Node: Installation Names\7f461201
+Node: Specifying the System Type\7f463307
+Node: Sharing Defaults\7f464021
+Node: Operation Controls\7f464691
+Node: Optional Features\7f465646
+Node: Reporting Bugs\7f476862
+Node: Major Differences From The Bourne Shell\7f478193
+Node: GNU Free Documentation License\7f495039
+Node: Indexes\7f520213
+Node: Builtin Index\7f520664
+Node: Reserved Word Index\7f527488
+Node: Variable Index\7f529933
+Node: Function Index\7f546918
+Node: Concept Index\7f560699
 \1f
 End Tag Table
 
index c3692b9439af3933686eb62ab70377f69b6db9ba..5c023108ba3d85ca8edc87e526c0cc395f1b820d 100644 (file)
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.8 from
 bashref.texi.
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.2, 14 March 2023).
+Bash shell (version 5.2, 15 April 2023).
 
-   This is Edition 5.2, last updated 14 March 2023, of 'The GNU Bash
+   This is Edition 5.2, last updated 15 April 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.2.
 
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
 *************
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.2, 14 March 2023).  The Bash home page is
+Bash shell (version 5.2, 15 April 2023).  The Bash home page is
 <http://www.gnu.org/software/bash/>.
 
-   This is Edition 5.2, last updated 14 March 2023, of 'The GNU Bash
+   This is Edition 5.2, last updated 15 April 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.2.
 
    Bash contains features that appear in other popular shells, and some
@@ -2410,6 +2410,10 @@ behavior of ignoring filenames beginning with a '.', make '.*' one of
 the patterns in 'GLOBIGNORE'.  The 'dotglob' option is disabled when
 'GLOBIGNORE' is unset.
 
+   After the pattern is expanded and matched against filenames, the
+value of the 'GLOBSORT' variable controls how the results are sorted, as
+described below (*note Bash Variables::).
+
 \1f
 File: bashref.info,  Node: Pattern Matching,  Up: Filename Expansion
 
@@ -2575,7 +2579,7 @@ was redirected to 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
+system on which Bash is running provides these special files, Bash will
 use them; otherwise it will emulate them internally with the behavior
 described below.
 
@@ -3250,7 +3254,7 @@ standard.
      than or equal to 1.
 
 'cd'
-          cd [-L|[-P [-e]] [-@] [DIRECTORY]
+          cd [-L|[-P [-e]]] [-@] [DIRECTORY]
 
      Change the current working directory to DIRECTORY.  If DIRECTORY is
      not supplied, the value of the 'HOME' shell variable is used.  If
@@ -4855,7 +4859,7 @@ This builtin allows you to change additional shell optional behavior.
           words to be 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
+          quoted, either.  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.
@@ -5260,7 +5264,7 @@ Variables::).
 
 '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 '.' or 'source') is at the top of the stack.  When a
      subroutine is executed, the number of parameters passed is pushed
@@ -5273,7 +5277,7 @@ Variables::).
 
 'BASH_ARGV'
      An array variable containing all of the parameters in the current
-     bash execution call stack.  The final parameter of the last
+     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 are pushed onto 'BASH_ARGV'.  The shell
@@ -5562,6 +5566,28 @@ Variables::).
      'GLOBIGNORE', it is removed from the list of matches.  The pattern
      matching honors the setting of the 'extglob' shell option.
 
+'GLOBSORT'
+     Control how the results of filename expansion are sorted.  The
+     value of this variable specifies the sort criteria and sort order
+     for the results of filename expansion.  If this variable is unset
+     or set to the null string, filename expansion uses the historial
+     behavior of sorting by name.  If set, a valid value begins with an
+     optional '+', which is ignored, or '-', which reverses the sort
+     order from ascending to descending, followed by a sort specifier.
+     The valid sort specifiers are 'name', 'size', 'mtime', 'atime',
+     'ctime', and 'blocks', which sort the files on name, file size,
+     modification time, access time, inode change time, and number of
+     blocks, respectively.
+
+     For example, a value of '-mtime' sorts the results in descending
+     order by modification time (newest first).
+
+     If the sort specifier is missing, it defaults to NAME, so a value
+     of '+' is equivalent to the null string, and a value of '-' sorts
+     by name in descending order.
+
+     Any invalid value restores the historical sorting behavior.
+
 'GROUPS'
      An array variable containing the list of groups of which the
      current user is a member.  Assignments to 'GROUPS' have no effect.
@@ -6574,7 +6600,7 @@ decreasing precedence.
 '||'
      logical OR
 
-'expr ? expr : expr'
+'expr ? if-true-expr : if-false-expr'
      conditional operator
 
 '= *= /= %= += -= <<= >>= &= ^= |='
@@ -7070,13 +7096,60 @@ environment, such as 'jails', 'zones', or 'containers'.
 \1f
 File: bashref.info,  Node: Bash POSIX Mode,  Next: Shell Compatibility Mode,  Prev: The Restricted Shell,  Up: Bash Features
 
-6.11 Bash POSIX Mode
-====================
+6.11 Bash and POSIX
+===================
 
-Starting Bash with the '--posix' command-line option or executing 'set
--o posix' while Bash is running will cause Bash to conform more closely
-to the POSIX standard by changing the behavior to match that specified
-by POSIX in areas where the Bash default differs.
+6.11.1 What is POSIX?
+---------------------
+
+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 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 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
+<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html>.
+
+   Bash is concerned with the aspects of the shell's behavior defined by
+the 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 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 'eval' and '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 'read' and '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.
+
+6.11.2 Bash POSIX Mode
+----------------------
+
+Although Bash is an implementation of the POSIX shell specification,
+there are areas where the Bash default behavior differs from the
+specification.  The Bash "posix mode" changes the Bash behavior in these
+areas so that it conforms to the standard more closely.
+
+   Starting Bash with the '--posix' command-line option or executing
+'set -o posix' while Bash is running will cause Bash to conform more
+closely to the POSIX standard by changing the behavior to match that
+specified by POSIX in areas where the Bash default differs.
 
    When invoked as 'sh', Bash enters POSIX mode after reading the
 startup files.
@@ -7339,6 +7412,13 @@ startup files.
      that a backslash preceding a double quote character will escape it
      and the backslash will be removed.
 
+  66. Command substitutions don't set the '?' special parameter.  The
+     exit status of a simple command without a command word is still the
+     exit status of the last command substitution that occurred while
+     evaluating the variable assignments and redirections in that
+     command, but that does not happen until after all of the
+     assignments and redirections.
+
    There is other POSIX behavior that Bash does not implement by default
 even when in POSIX mode.  Specifically:
 
@@ -7346,7 +7426,11 @@ even when in POSIX mode.  Specifically:
      entries if 'FCEDIT' is unset, rather than defaulting directly to
      'ed'.  'fc' uses 'ed' if 'EDITOR' is unset.
 
-  2. As noted above, Bash requires the 'xpg_echo' option to be enabled
+  2. A non-interactive shell does not exit if a variable assignment
+     preceding the 'command' builtin or another non-special builtin
+     fails.
+
+  3. As noted above, Bash requires the 'xpg_echo' option to be enabled
      for the 'echo' builtin to be fully conformant.
 
    Bash can be configured to be POSIX-conformant by default, by
@@ -10486,7 +10570,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 '/usr/local/build' from the source code
+build Bash in a directory under '/usr/local/build' from the source code
 in '/usr/local/src/bash-4.4':
 
      mkdir /usr/local/build/bash-4.4
@@ -10579,7 +10663,7 @@ By default, 'make install' will install into '/usr/local/bin',
 specifying a value for the 'prefix' 'make' variable when running 'make
 install' (e.g., 'make install prefix=PATH').  The 'prefix' variable
 provides a default for 'exec_prefix' and other variables used when
-installing bash.
+installing Bash.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
@@ -10592,7 +10676,7 @@ run, you can specify these variables as arguments to 'make': 'make
 install exec_prefix=/' will install 'bash' and 'bashbug' into '/bin'
 instead of the default '/usr/local/bin'.
 
-   If you want to see the files bash will install and where it will
+   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 'DESTDIR' as an argument to 'make'.  Its value should be the
 absolute directory path you'd like to use as the root of your sample
@@ -10774,7 +10858,7 @@ does not provide the necessary support.
      builtins (*note Aliases::).
 
 '--enable-alt-array-implementation'
-     This builds bash using an alternate implementation of arrays (*note
+     This builds Bash using an alternate implementation of arrays (*note
      Arrays::) that provides faster access at the expense of using more
      memory (sometimes many times more, depending on how sparse an array
      is).
@@ -10825,7 +10909,7 @@ does not provide the necessary support.
      (*note Pipelines::).
 
 '--enable-debugger'
-     Include support for the bash debugger (distributed separately).
+     Include support for the Bash debugger (distributed separately).
 
 '--enable-dev-fd-stat-broken'
      If calling 'stat' on /dev/fd/N returns different results than
@@ -10963,11 +11047,11 @@ of Bash.  The latest version of Bash is always available for FTP from
 <http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz>.
 
    Once you have determined that a bug actually exists, use the
-'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>.
-If you have a fix, you are encouraged to submit that as well!
-Suggestions and 'philosophical' bug reports may be mailed to
-<bug-bash@gnu.org> or <help-bash@gnu.org>.
+'bashbug' command to submit a bug report or use the form at the Bash
+project page (https://savannah.gnu.org/projects/bash/).  If you have a
+fix, you are encouraged to submit that as well!  Suggestions and
+'philosophical' bug reports may be mailed to <bug-bash@gnu.org> or
+<help-bash@gnu.org>.
 
    All bug reports should include:
    * The version number of Bash.
@@ -12111,57 +12195,58 @@ D.3 Parameter and Variable Index
 * FUNCNAME:                              Bash Variables.      (line 326)
 * FUNCNEST:                              Bash Variables.      (line 343)
 * GLOBIGNORE:                            Bash Variables.      (line 348)
-* GROUPS:                                Bash Variables.      (line 355)
-* histchars:                             Bash Variables.      (line 361)
-* HISTCMD:                               Bash Variables.      (line 376)
-* HISTCONTROL:                           Bash Variables.      (line 382)
-* HISTFILE:                              Bash Variables.      (line 398)
-* HISTFILESIZE:                          Bash Variables.      (line 402)
-* HISTIGNORE:                            Bash Variables.      (line 413)
+* GLOBSORT:                              Bash Variables.      (line 355)
+* GROUPS:                                Bash Variables.      (line 377)
+* histchars:                             Bash Variables.      (line 383)
+* HISTCMD:                               Bash Variables.      (line 398)
+* HISTCONTROL:                           Bash Variables.      (line 404)
+* HISTFILE:                              Bash Variables.      (line 420)
+* HISTFILESIZE:                          Bash Variables.      (line 424)
+* HISTIGNORE:                            Bash Variables.      (line 435)
 * history-preserve-point:                Readline Init File Syntax.
                                                               (line 211)
 * history-size:                          Readline Init File Syntax.
                                                               (line 217)
-* HISTSIZE:                              Bash Variables.      (line 433)
-* HISTTIMEFORMAT:                        Bash Variables.      (line 440)
+* HISTSIZE:                              Bash Variables.      (line 455)
+* HISTTIMEFORMAT:                        Bash Variables.      (line 462)
 * HOME:                                  Bourne Shell Variables.
                                                               (line  13)
 * horizontal-scroll-mode:                Readline Init File Syntax.
                                                               (line 226)
-* HOSTFILE:                              Bash Variables.      (line 448)
-* HOSTNAME:                              Bash Variables.      (line 459)
-* HOSTTYPE:                              Bash Variables.      (line 462)
+* HOSTFILE:                              Bash Variables.      (line 470)
+* HOSTNAME:                              Bash Variables.      (line 481)
+* HOSTTYPE:                              Bash Variables.      (line 484)
 * IFS:                                   Bourne Shell Variables.
                                                               (line  18)
-* IGNOREEOF:                             Bash Variables.      (line 465)
+* IGNOREEOF:                             Bash Variables.      (line 487)
 * input-meta:                            Readline Init File Syntax.
                                                               (line 235)
-* INPUTRC:                               Bash Variables.      (line 475)
-* INSIDE_EMACS:                          Bash Variables.      (line 479)
+* INPUTRC:                               Bash Variables.      (line 497)
+* INSIDE_EMACS:                          Bash Variables.      (line 501)
 * isearch-terminators:                   Readline Init File Syntax.
                                                               (line 245)
 * keymap:                                Readline Init File Syntax.
                                                               (line 252)
 * LANG:                                  Creating Internationalized Scripts.
                                                               (line  51)
-* LANG <1>:                              Bash Variables.      (line 485)
-* LC_ALL:                                Bash Variables.      (line 489)
-* LC_COLLATE:                            Bash Variables.      (line 493)
-* LC_CTYPE:                              Bash Variables.      (line 500)
+* LANG <1>:                              Bash Variables.      (line 507)
+* LC_ALL:                                Bash Variables.      (line 511)
+* LC_COLLATE:                            Bash Variables.      (line 515)
+* LC_CTYPE:                              Bash Variables.      (line 522)
 * LC_MESSAGES:                           Creating Internationalized Scripts.
                                                               (line  51)
-* LC_MESSAGES <1>:                       Bash Variables.      (line 505)
-* LC_NUMERIC:                            Bash Variables.      (line 509)
-* LC_TIME:                               Bash Variables.      (line 513)
-* LINENO:                                Bash Variables.      (line 517)
-* LINES:                                 Bash Variables.      (line 522)
-* MACHTYPE:                              Bash Variables.      (line 528)
+* LC_MESSAGES <1>:                       Bash Variables.      (line 527)
+* LC_NUMERIC:                            Bash Variables.      (line 531)
+* LC_TIME:                               Bash Variables.      (line 535)
+* LINENO:                                Bash Variables.      (line 539)
+* LINES:                                 Bash Variables.      (line 544)
+* MACHTYPE:                              Bash Variables.      (line 550)
 * MAIL:                                  Bourne Shell Variables.
                                                               (line  22)
-* MAILCHECK:                             Bash Variables.      (line 532)
+* MAILCHECK:                             Bash Variables.      (line 554)
 * MAILPATH:                              Bourne Shell Variables.
                                                               (line  27)
-* MAPFILE:                               Bash Variables.      (line 540)
+* MAPFILE:                               Bash Variables.      (line 562)
 * mark-modified-lines:                   Readline Init File Syntax.
                                                               (line 282)
 * mark-symlinked-directories:            Readline Init File Syntax.
@@ -12172,46 +12257,46 @@ D.3 Parameter and Variable Index
                                                               (line 299)
 * meta-flag:                             Readline Init File Syntax.
                                                               (line 235)
-* OLDPWD:                                Bash Variables.      (line 544)
+* OLDPWD:                                Bash Variables.      (line 566)
 * OPTARG:                                Bourne Shell Variables.
                                                               (line  34)
-* OPTERR:                                Bash Variables.      (line 547)
+* OPTERR:                                Bash Variables.      (line 569)
 * OPTIND:                                Bourne Shell Variables.
                                                               (line  38)
-* OSTYPE:                                Bash Variables.      (line 551)
+* OSTYPE:                                Bash Variables.      (line 573)
 * output-meta:                           Readline Init File Syntax.
                                                               (line 304)
 * page-completions:                      Readline Init File Syntax.
                                                               (line 312)
 * PATH:                                  Bourne Shell Variables.
                                                               (line  42)
-* PIPESTATUS:                            Bash Variables.      (line 554)
-* POSIXLY_CORRECT:                       Bash Variables.      (line 559)
-* PPID:                                  Bash Variables.      (line 569)
-* PROMPT_COMMAND:                        Bash Variables.      (line 573)
-* PROMPT_DIRTRIM:                        Bash Variables.      (line 579)
-* PS0:                                   Bash Variables.      (line 585)
+* PIPESTATUS:                            Bash Variables.      (line 576)
+* POSIXLY_CORRECT:                       Bash Variables.      (line 581)
+* PPID:                                  Bash Variables.      (line 591)
+* PROMPT_COMMAND:                        Bash Variables.      (line 595)
+* PROMPT_DIRTRIM:                        Bash Variables.      (line 601)
+* PS0:                                   Bash Variables.      (line 607)
 * PS1:                                   Bourne Shell Variables.
                                                               (line  48)
 * PS2:                                   Bourne Shell Variables.
                                                               (line  53)
-* PS3:                                   Bash Variables.      (line 590)
-* PS4:                                   Bash Variables.      (line 595)
-* PWD:                                   Bash Variables.      (line 603)
-* RANDOM:                                Bash Variables.      (line 606)
-* READLINE_ARGUMENT:                     Bash Variables.      (line 612)
-* READLINE_LINE:                         Bash Variables.      (line 616)
-* READLINE_MARK:                         Bash Variables.      (line 620)
-* READLINE_POINT:                        Bash Variables.      (line 626)
-* REPLY:                                 Bash Variables.      (line 630)
+* PS3:                                   Bash Variables.      (line 612)
+* PS4:                                   Bash Variables.      (line 617)
+* PWD:                                   Bash Variables.      (line 625)
+* RANDOM:                                Bash Variables.      (line 628)
+* READLINE_ARGUMENT:                     Bash Variables.      (line 634)
+* READLINE_LINE:                         Bash Variables.      (line 638)
+* READLINE_MARK:                         Bash Variables.      (line 642)
+* READLINE_POINT:                        Bash Variables.      (line 648)
+* REPLY:                                 Bash Variables.      (line 652)
 * revert-all-at-newline:                 Readline Init File Syntax.
                                                               (line 322)
 * search-ignore-case:                    Readline Init File Syntax.
                                                               (line 329)
-* SECONDS:                               Bash Variables.      (line 633)
-* SHELL:                                 Bash Variables.      (line 642)
-* SHELLOPTS:                             Bash Variables.      (line 647)
-* SHLVL:                                 Bash Variables.      (line 656)
+* SECONDS:                               Bash Variables.      (line 655)
+* SHELL:                                 Bash Variables.      (line 664)
+* SHELLOPTS:                             Bash Variables.      (line 669)
+* SHLVL:                                 Bash Variables.      (line 678)
 * show-all-if-ambiguous:                 Readline Init File Syntax.
                                                               (line 334)
 * show-all-if-unmodified:                Readline Init File Syntax.
@@ -12220,15 +12305,15 @@ D.3 Parameter and Variable Index
                                                               (line 349)
 * skip-completed-text:                   Readline Init File Syntax.
                                                               (line 355)
-* SRANDOM:                               Bash Variables.      (line 661)
+* SRANDOM:                               Bash Variables.      (line 683)
 * TEXTDOMAIN:                            Creating Internationalized Scripts.
                                                               (line  51)
 * TEXTDOMAINDIR:                         Creating Internationalized Scripts.
                                                               (line  51)
-* TIMEFORMAT:                            Bash Variables.      (line 670)
-* TMOUT:                                 Bash Variables.      (line 708)
-* TMPDIR:                                Bash Variables.      (line 720)
-* UID:                                   Bash Variables.      (line 724)
+* TIMEFORMAT:                            Bash Variables.      (line 692)
+* TMOUT:                                 Bash Variables.      (line 730)
+* TMPDIR:                                Bash Variables.      (line 742)
+* UID:                                   Bash Variables.      (line 746)
 * vi-cmd-mode-string:                    Readline Init File Syntax.
                                                               (line 368)
 * vi-ins-mode-string:                    Readline Init File Syntax.
@@ -12455,11 +12540,14 @@ D.5 Concept Index
 * arithmetic evaluation:                 Shell Arithmetic.    (line   6)
 * arithmetic expansion:                  Arithmetic Expansion.
                                                               (line   6)
+* arithmetic operators:                  Shell Arithmetic.    (line  17)
 * arithmetic, shell:                     Shell Arithmetic.    (line   6)
 * arrays:                                Arrays.              (line   6)
 * background:                            Job Control Basics.  (line   6)
 * Bash configuration:                    Basic Installation.  (line   6)
 * Bash installation:                     Basic Installation.  (line   6)
+* binary arithmetic operators:           Shell Arithmetic.    (line  17)
+* bitwise arithmetic operators:          Shell Arithmetic.    (line  17)
 * Bourne shell:                          Basic Shell Features.
                                                               (line   6)
 * brace expansion:                       Brace Expansion.     (line   6)
@@ -12493,6 +12581,7 @@ D.5 Concept Index
                                                               (line   6)
 * completion builtins:                   Programmable Completion Builtins.
                                                               (line   6)
+* conditional arithmetic operator:       Shell Arithmetic.    (line  17)
 * configuration:                         Basic Installation.  (line   6)
 * control operator:                      Definitions.         (line  21)
 * coprocess:                             Coprocesses.         (line   6)
@@ -12567,7 +12656,8 @@ D.5 Concept Index
 * pattern matching:                      Pattern Matching.    (line   6)
 * pipeline:                              Pipelines.           (line   6)
 * POSIX:                                 Definitions.         (line   9)
-* POSIX Mode:                            Bash POSIX Mode.     (line   6)
+* POSIX description:                     Bash POSIX Mode.     (line   9)
+* POSIX Mode:                            Bash POSIX Mode.     (line  48)
 * process group:                         Definitions.         (line  62)
 * process group ID:                      Definitions.         (line  66)
 * process substitution:                  Process Substitution.
@@ -12602,6 +12692,7 @@ D.5 Concept Index
 * tilde expansion:                       Tilde Expansion.     (line   6)
 * token:                                 Definitions.         (line  86)
 * translation, native languages:         Locale Translation.  (line   6)
+* unary arithmetic operators:            Shell Arithmetic.    (line  17)
 * variable, shell:                       Shell Parameters.    (line   6)
 * variables, readline:                   Readline Init File Syntax.
                                                               (line  37)
@@ -12653,98 +12744,98 @@ Node: Arithmetic Expansion\7f97756
 Node: Process Substitution\7f98724
 Node: Word Splitting\7f99844
 Node: Filename Expansion\7f101892
-Node: Pattern Matching\7f104641
-Node: Quote Removal\7f109643
-Node: Redirections\7f109938
-Node: Executing Commands\7f119631
-Node: Simple Command Expansion\7f120301
-Node: Command Search and Execution\7f122411
-Node: Command Execution Environment\7f124798
-Node: Environment\7f127833
-Node: Exit Status\7f129496
-Node: Signals\7f131280
-Node: Shell Scripts\7f134729
-Node: Shell Builtin Commands\7f137756
-Node: Bourne Shell Builtins\7f139794
-Node: Bash Builtins\7f161992
-Node: Modifying Shell Behavior\7f193991
-Node: The Set Builtin\7f194336
-Node: The Shopt Builtin\7f204934
-Node: Special Builtins\7f220846
-Node: Shell Variables\7f221825
-Node: Bourne Shell Variables\7f222262
-Node: Bash Variables\7f224366
-Node: Bash Features\7f257181
-Node: Invoking Bash\7f258194
-Node: Bash Startup Files\7f264207
-Node: Interactive Shells\7f269338
-Node: What is an Interactive Shell?\7f269749
-Node: Is this Shell Interactive?\7f270398
-Node: Interactive Shell Behavior\7f271213
-Node: Bash Conditional Expressions\7f274842
-Node: Shell Arithmetic\7f279484
-Node: Aliases\7f282428
-Node: Arrays\7f285322
-Node: The Directory Stack\7f291885
-Node: Directory Stack Builtins\7f292669
-Node: Controlling the Prompt\7f296929
-Node: The Restricted Shell\7f299894
-Node: Bash POSIX Mode\7f302504
-Node: Shell Compatibility Mode\7f315370
-Node: Job Control\7f323937
-Node: Job Control Basics\7f324397
-Node: Job Control Builtins\7f329399
-Node: Job Control Variables\7f335194
-Node: Command Line Editing\7f336350
-Node: Introduction and Notation\7f338021
-Node: Readline Interaction\7f339644
-Node: Readline Bare Essentials\7f340835
-Node: Readline Movement Commands\7f342624
-Node: Readline Killing Commands\7f343584
-Node: Readline Arguments\7f345505
-Node: Searching\7f346549
-Node: Readline Init File\7f348735
-Node: Readline Init File Syntax\7f349996
-Node: Conditional Init Constructs\7f373787
-Node: Sample Init File\7f377983
-Node: Bindable Readline Commands\7f381107
-Node: Commands For Moving\7f382311
-Node: Commands For History\7f384362
-Node: Commands For Text\7f389356
-Node: Commands For Killing\7f393005
-Node: Numeric Arguments\7f396038
-Node: Commands For Completion\7f397177
-Node: Keyboard Macros\7f401368
-Node: Miscellaneous Commands\7f402056
-Node: Readline vi Mode\7f408094
-Node: Programmable Completion\7f409001
-Node: Programmable Completion Builtins\7f416781
-Node: A Programmable Completion Example\7f427533
-Node: Using History Interactively\7f432781
-Node: Bash History Facilities\7f433465
-Node: Bash History Builtins\7f436470
-Node: History Interaction\7f441494
-Node: Event Designators\7f445114
-Node: Word Designators\7f446468
-Node: Modifiers\7f448228
-Node: Installing Bash\7f450036
-Node: Basic Installation\7f451173
-Node: Compilers and Options\7f454895
-Node: Compiling For Multiple Architectures\7f455636
-Node: Installation Names\7f457328
-Node: Specifying the System Type\7f459437
-Node: Sharing Defaults\7f460154
-Node: Operation Controls\7f460827
-Node: Optional Features\7f461785
-Node: Reporting Bugs\7f473004
-Node: Major Differences From The Bourne Shell\7f474348
-Node: GNU Free Documentation License\7f491197
-Node: Indexes\7f516374
-Node: Builtin Index\7f516828
-Node: Reserved Word Index\7f523655
-Node: Variable Index\7f526103
-Node: Function Index\7f543018
-Node: Concept Index\7f556802
+Node: Pattern Matching\7f104825
+Node: Quote Removal\7f109827
+Node: Redirections\7f110122
+Node: Executing Commands\7f119815
+Node: Simple Command Expansion\7f120485
+Node: Command Search and Execution\7f122595
+Node: Command Execution Environment\7f124982
+Node: Environment\7f128017
+Node: Exit Status\7f129680
+Node: Signals\7f131464
+Node: Shell Scripts\7f134913
+Node: Shell Builtin Commands\7f137940
+Node: Bourne Shell Builtins\7f139978
+Node: Bash Builtins\7f162177
+Node: Modifying Shell Behavior\7f194176
+Node: The Set Builtin\7f194521
+Node: The Shopt Builtin\7f205119
+Node: Special Builtins\7f221031
+Node: Shell Variables\7f222010
+Node: Bourne Shell Variables\7f222447
+Node: Bash Variables\7f224551
+Node: Bash Features\7f258467
+Node: Invoking Bash\7f259480
+Node: Bash Startup Files\7f265493
+Node: Interactive Shells\7f270624
+Node: What is an Interactive Shell?\7f271035
+Node: Is this Shell Interactive?\7f271684
+Node: Interactive Shell Behavior\7f272499
+Node: Bash Conditional Expressions\7f276128
+Node: Shell Arithmetic\7f280770
+Node: Aliases\7f283731
+Node: Arrays\7f286625
+Node: The Directory Stack\7f293188
+Node: Directory Stack Builtins\7f293972
+Node: Controlling the Prompt\7f298232
+Node: The Restricted Shell\7f301197
+Node: Bash POSIX Mode\7f303807
+Node: Shell Compatibility Mode\7f319600
+Node: Job Control\7f328167
+Node: Job Control Basics\7f328627
+Node: Job Control Builtins\7f333629
+Node: Job Control Variables\7f339424
+Node: Command Line Editing\7f340580
+Node: Introduction and Notation\7f342251
+Node: Readline Interaction\7f343874
+Node: Readline Bare Essentials\7f345065
+Node: Readline Movement Commands\7f346854
+Node: Readline Killing Commands\7f347814
+Node: Readline Arguments\7f349735
+Node: Searching\7f350779
+Node: Readline Init File\7f352965
+Node: Readline Init File Syntax\7f354226
+Node: Conditional Init Constructs\7f378017
+Node: Sample Init File\7f382213
+Node: Bindable Readline Commands\7f385337
+Node: Commands For Moving\7f386541
+Node: Commands For History\7f388592
+Node: Commands For Text\7f393586
+Node: Commands For Killing\7f397235
+Node: Numeric Arguments\7f400268
+Node: Commands For Completion\7f401407
+Node: Keyboard Macros\7f405598
+Node: Miscellaneous Commands\7f406286
+Node: Readline vi Mode\7f412324
+Node: Programmable Completion\7f413231
+Node: Programmable Completion Builtins\7f421011
+Node: A Programmable Completion Example\7f431763
+Node: Using History Interactively\7f437011
+Node: Bash History Facilities\7f437695
+Node: Bash History Builtins\7f440700
+Node: History Interaction\7f445724
+Node: Event Designators\7f449344
+Node: Word Designators\7f450698
+Node: Modifiers\7f452458
+Node: Installing Bash\7f454266
+Node: Basic Installation\7f455403
+Node: Compilers and Options\7f459125
+Node: Compiling For Multiple Architectures\7f459866
+Node: Installation Names\7f461558
+Node: Specifying the System Type\7f463667
+Node: Sharing Defaults\7f464384
+Node: Operation Controls\7f465057
+Node: Optional Features\7f466015
+Node: Reporting Bugs\7f477234
+Node: Major Differences From The Bourne Shell\7f478568
+Node: GNU Free Documentation License\7f495417
+Node: Indexes\7f520594
+Node: Builtin Index\7f521048
+Node: Reserved Word Index\7f527875
+Node: Variable Index\7f530323
+Node: Function Index\7f547311
+Node: Concept Index\7f561095
 \1f
 End Tag Table
 
index e058c9b9b72320b0155cb6813e65ddccbbcb0997..7ed8ec86eba93b4d4764bc5b23a2a391e470146f 100644 (file)
@@ -2838,6 +2838,10 @@ To get the old behavior of ignoring filenames beginning with a
 The @code{dotglob} option is disabled when @env{GLOBIGNORE}
 is unset.
 
+After the pattern is expanded and matched against filenames, the value of the
+@env{GLOBSORT} variable controls how the results are sorted, as described
+below (@pxref{Bash Variables}).
+
 @node Pattern Matching
 @subsubsection Pattern Matching
 @cindex pattern matching
@@ -6467,6 +6471,35 @@ of matches.
 The pattern matching honors the setting of the @code{extglob} shell
 option.
 
+@item GLOBSORT
+Control how the results of filename expansion are sorted.
+The value of this variable specifies the sort criteria and sort order for
+the results of filename expansion.
+If this variable is unset or set to the null string, filename expansion
+uses the historial behavior of sorting by name.
+If set, a valid value begins with an optional @samp{+}, which is ignored,
+or @samp{-}, which reverses the sort order from ascending to descending,
+followed by a sort specifier.
+The valid sort specifiers are
+@samp{name},
+@samp{size},
+@samp{mtime},
+@samp{atime},
+@samp{ctime},
+and
+@samp{blocks},
+which sort the files on name, file size, modification time, access time,
+inode change time, and number of blocks, respectively.
+
+For example, a value of @code{-mtime} sorts the results in descending
+order by modification time (newest first).
+
+If the sort specifier is missing, it defaults to @var{name},
+so a value of @samp{+} is equivalent to the null string,
+and a value of @samp{-} sorts by name in descending order.
+
+Any invalid value restores the historical sorting behavior.
+
 @item GROUPS
 An array variable containing the list of groups of which the current    
 user is a member.
index 928b9836b6ce54aaeb7bd2af57be13a35dce8f32..3918a4bf1eb9f7859d80f3671afaed341147e3b0 100644 (file)
@@ -2,10 +2,10 @@
 Copyright (C) 1988-2023 Free Software Foundation, Inc.
 @end ignore
 
-@set LASTCHANGE Thu Apr  6 11:58:41 EDT 2023
+@set LASTCHANGE Sat Apr 15 17:27:25 EDT 2023
 
 @set EDITION 5.2
 @set VERSION 5.2
 
-@set UPDATED 6 April 2023
+@set UPDATED 15 April 2023
 @set UPDATED-MONTH April 2023
index 0dc213be93f87cda3d4416713095ffd953f1d499..27a04dcfd23e2e31d0c8ba23ade2dbc1ebaf474b 100644 (file)
@@ -43,6 +43,11 @@ extern int errno;
 #define VAL_SSIZE_MAX          -1004
 #define VAL_SIZE_MAX           -1005
 
+/* We don't want to collide with anything else. */
+#ifndef _CS_PATH
+#define _CS_PATH       -1001
+#endif
+
 struct conf
   {
     const char *name;
@@ -916,6 +921,31 @@ static int getconf_all (void);
 static int getconf_one (WORD_LIST *);
 static int getconf_internal (const struct conf *, int);
 
+#ifndef HAVE_CONFSTR
+/* If we don't have confstr, this will only support `getconf PATH'. */
+
+static size_t
+confstr (int name, char *buf, size_t len)
+{
+  char *p;
+  size_t n;
+
+  switch (name)
+    {
+    case _CS_PATH:
+      p = conf_standard_path ();
+      n = STRLEN (p) + 1;
+      if (len != 0 && buf != 0)
+       strlcpy (buf, p, len);
+      free (p);
+      return n;
+    default:
+      errno = EINVAL;
+      return 0;
+    }
+}
+#endif /* !HAVE_CONFSTR */
+
 static int
 getconf_internal (const struct conf *c, int all)
 {
index 7c70da92730ac994f79943ed0bcb7574477c8bb6..3eb49ecbb1434b460c4dc1d9766f8d791a13aba9 100644 (file)
--- a/externs.h
+++ b/externs.h
@@ -179,6 +179,10 @@ extern void show_shell_version (int);
 /* Functions from the bash library, lib/sh/libsh.a.  These should really
    go into a separate include file. */
 
+/* declarations for functions defined in lib/sh/anonfile.c */
+extern int anonopen (const char *, int);
+extern int anonclose (int, const char *);
+
 /* declarations for functions defined in lib/sh/casemod.c */
 extern char *sh_modcase (const char *, char *, int);
 
@@ -496,6 +500,7 @@ extern void print_timeval (FILE *, struct timeval *);
 #define MT_READWRITE           0x0002
 #define MT_USERANDOM           0x0004
 #define MT_TEMPLATE            0x0008
+#define MT_UNLINK              0x0010  /* unlink after opening */
 
 extern char *sh_mktmpname (const char *, int);
 extern int sh_mktmpfd (const char *, int, char **);
index 923c9238b6ecaf9d799171ec6aa9002f4089c1a5..04ecb140828fcf8e46a4b4ab27320359c0524e68 100644 (file)
@@ -102,7 +102,7 @@ cc_t     old_vtime;
 struct termios term;
 
 int 
-main()
+main(int c, char **v)
 {
     fd_set fds;
 
index 2a8b097ad146b74abce85369c906a6cf426280ac..c14fe3bf5bc3b270520bfe77786595516f125183 100644 (file)
@@ -1,6 +1,6 @@
 /* fileman.c - file manager example for readline library. */
 
-/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009,2023 Free Software Foundation, Inc.
 
    This file is part of the GNU Readline Library (Readline), a library for
    reading lines of text with interactive input and history editing.
 #  include <readline/history.h>
 #endif
 
-extern char *xmalloc PARAMS((size_t));
+extern char *xmalloc (size_t);
 
-void initialize_readline PARAMS((void));
-void too_dangerous PARAMS((char *));
+void initialize_readline (void);
+void too_dangerous (char *);
 
-int execute_line PARAMS((char *));
-int valid_argument PARAMS((char *, char *));
+int execute_line (char *);
+int valid_argument (char *, char *);
 
 /* The names of functions that actually do the manipulation. */
-int com_list PARAMS((char *));
-int com_view PARAMS((char *));
-int com_rename PARAMS((char *));
-int com_stat PARAMS((char *));
-int com_pwd PARAMS((char *));
-int com_delete PARAMS((char *));
-int com_help PARAMS((char *));
-int com_cd PARAMS((char *));
-int com_quit PARAMS((char *));
+int com_list (char *);
+int com_view (char *);
+int com_rename (char *);
+int com_stat (char *);
+int com_pwd (char *);
+int com_delete (char *);
+int com_help (char *);
+int com_cd (char *);
+int com_quit (char *);
 
 /* A structure which contains information on the commands this program
    can understand. */
@@ -105,8 +105,11 @@ COMMAND commands[] = {
 };
 
 /* Forward declarations. */
-char *stripwhite ();
-COMMAND *find_command ();
+char *dupstr (char *);
+int execute_line (char *);
+char *stripwhite (char *);
+
+COMMAND *find_command (char *);
 
 /* The name of this program, as taken from argv[0]. */
 char *progname;
@@ -115,8 +118,7 @@ char *progname;
 int done;
 
 char *
-dupstr (s)
-     char *s;
+dupstr (char *s)
 {
   char *r;
 
@@ -125,45 +127,9 @@ dupstr (s)
   return (r);
 }
 
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  char *line, *s;
-
-  progname = argv[0];
-
-  initialize_readline ();      /* Bind our completer. */
-
-  /* Loop reading and executing lines until the user quits. */
-  for ( ; done == 0; )
-    {
-      line = readline ("FileMan: ");
-
-      if (!line)
-        break;
-
-      /* Remove leading and trailing whitespace from the line.
-         Then, if there is anything left, add it to the history list
-         and execute it. */
-      s = stripwhite (line);
-
-      if (*s)
-        {
-          add_history (s);
-          execute_line (s);
-        }
-
-      free (line);
-    }
-  exit (0);
-}
-
 /* Execute a command line. */
 int
-execute_line (line)
-     char *line;
+execute_line (char *line)
 {
   register int i;
   COMMAND *command;
@@ -202,8 +168,7 @@ execute_line (line)
 /* Look up NAME as the name of a command, and return a pointer to that
    command.  Return a NULL pointer if NAME isn't a command name. */
 COMMAND *
-find_command (name)
-     char *name;
+find_command (char *name)
 {
   register int i;
 
@@ -217,8 +182,7 @@ find_command (name)
 /* Strip whitespace from the start and end of STRING.  Return a pointer
    into STRING. */
 char *
-stripwhite (string)
-     char *string;
+stripwhite (char *string)
 {
   register char *s, *t;
 
@@ -242,14 +206,14 @@ stripwhite (string)
 /*                                                                  */
 /* **************************************************************** */
 
-char *command_generator PARAMS((const char *, int));
-char **fileman_completion PARAMS((const char *, int, int));
+char *command_generator (const char *, int);
+char **fileman_completion (const char *, int, int);
 
 /* Tell the GNU Readline library how to complete.  We want to try to complete
    on command names if this is the first word in the line, or on filenames
    if not. */
 void
-initialize_readline ()
+initialize_readline (void)
 {
   /* Allow conditional parsing of the ~/.inputrc file. */
   rl_readline_name = "FileMan";
@@ -264,9 +228,7 @@ initialize_readline ()
    in case we want to do some simple parsing.  Return the array of matches,
    or NULL if there aren't any. */
 char **
-fileman_completion (text, start, end)
-     const char *text;
-     int start, end;
+fileman_completion (const char *text, int start, int end)
 {
   char **matches;
 
@@ -285,9 +247,7 @@ fileman_completion (text, start, end)
    to start from scratch; without any state (i.e. STATE == 0), then we
    start at the top of the list. */
 char *
-command_generator (text, state)
-     const char *text;
-     int state;
+command_generator (const char *text, int state)
 {
   static int list_index, len;
   char *name;
@@ -504,3 +464,36 @@ valid_argument (caller, arg)
 
   return (1);
 }
+
+int
+main (int argc, char **argv)
+{
+  char *line, *s;
+
+  progname = argv[0];
+
+  initialize_readline ();      /* Bind our completer. */
+
+  /* Loop reading and executing lines until the user quits. */
+  for ( ; done == 0; )
+    {
+      line = readline ("FileMan: ");
+
+      if (!line)
+        break;
+
+      /* Remove leading and trailing whitespace from the line.
+         Then, if there is anything left, add it to the history list
+         and execute it. */
+      s = stripwhite (line);
+
+      if (*s)
+        {
+          add_history (s);
+          execute_line (s);
+        }
+
+      free (line);
+    }
+  exit (0);
+}
index 351c6285ed7ecc8bf65bcd574189da65264452b6..c8e11d5c83a76ea812d052eb91e04517d42d8800 100644 (file)
@@ -1,6 +1,6 @@
 /* manexamp.c -- The examples which appear in the documentation are here. */
 
-/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009,2023 Free Software Foundation, Inc.
 
    This file is part of the GNU Readline Library (Readline), a library for
    reading lines of text with interactive input and history editing.
    You should have received a copy of the GNU General Public License
    along with Readline.  If not, see <http://www.gnu.org/licenses/>.
 */
+#if defined (HAVE_CONFIG_H)
+#  include <config.h>
+#endif
 
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
+
+#include <stdlib.h>
 #include <stdio.h>
-#include <readline/readline.h>
+
+#include <ctype.h>
+#include <string.h>
+#include <errno.h>
+   
+#include <locale.h>
+
+#ifndef errno
+extern int errno;
+#endif
+
+#if defined (READLINE_LIBRARY)
+#  include "readline.h"
+#  include "history.h"
+#else
+#  include <readline/readline.h>
+#  include <readline/history.h>
+#endif
 
 /* **************************************************************** */
 /*                                                                  */
@@ -33,7 +59,7 @@ static char *line_read = (char *)NULL;
 
 /* Read a string, and return a pointer to it.  Returns NULL on EOF. */
 char *
-rl_gets ()
+rl_gets (void)
 {
   /* If the buffer has already been allocated, return the memory
      to the free pool. */
@@ -60,10 +86,11 @@ rl_gets ()
 /* **************************************************************** */
 
 /* Invert the case of the COUNT following characters. */
-invert_case_line (count, key)
-     int count, key;
+int
+invert_case_line (int count, int key)
 {
-  register int start, end;
+  int start, end;
+  int direction;
 
   start = rl_point;
 
@@ -92,7 +119,7 @@ invert_case_line (count, key)
     }
 
   if (start == end)
-    return;
+    return 0;
 
   /* Tell readline that we are modifying the line, so save the undo
      information. */
@@ -108,4 +135,5 @@ invert_case_line (count, key)
 
   /* Move point to on top of the last character changed. */
   rl_point = end - direction;
+  return 0;
 }
index dfaf9675587d918479806df607533015b59f68f8..0bf0641c984ff88af3eda9b77e27344005db72fd 100644 (file)
@@ -46,7 +46,7 @@ cb_linehandler (char *line)
 }
 
 static char *
-cb_readline ()
+cb_readline (void)
 {
   fd_set fds;
   int r, err;
@@ -102,15 +102,13 @@ else if (RL_ISSTATE (RL_STATE_NSEARCH))
 }
 
 void
-sigint_sighandler (s)
-     int s;
+sigint_sighandler (int s)
 {
   saw_signal = s;
 }
 
 int
-sigint_handler (s)
-     int s;
+sigint_handler (int s)
 {
   rl_free_line_state ();
   rl_callback_sigcleanup ();
index e04bbd6a58ad21385d87f7f0078642a709644d11..dd8f88d49c32ba2da5f224bc40d4612d1b6aaa02 100644 (file)
@@ -59,7 +59,7 @@ static char *progname;
 static char *deftext;
 
 static int
-set_deftext ()
+set_deftext (void)
 {
   if (deftext)
     {
@@ -71,16 +71,14 @@ set_deftext ()
 }
 
 static void
-usage()
+usage(void)
 {
   fprintf (stderr, "%s: usage: %s [-p prompt] [-u unit] [-d default] [-n nchars]\n",
                progname, progname);
 }
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
 {
   char *temp, *prompt;
   struct stat sb;
index aabe0ca3e98673179a77d0f647122639e3028fa9..419a1973a0fcd7a096fb0b215e70404e1d72e2ad 100644 (file)
@@ -4,7 +4,7 @@
  * usage: rlcat
  */
 
-/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009,2023 Free Software Foundation, Inc.
 
    This file is part of the GNU Readline Library (Readline), a library for
    reading lines of text with interactive input and history editing.
@@ -64,27 +64,26 @@ extern int errno;
 extern int optind;
 extern char *optarg;
 
-static int stdcat();
+static int fcopy(FILE *);
+static int stdcat(int, char **);
 
 static char *progname;
 static int vflag;
 
 static void
-usage()
+usage(void)
 {
   fprintf (stderr, "%s: usage: %s [-vEVN] [filename]\n", progname, progname);
 }
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
 {
   char *temp;
   int opt, Vflag, Nflag;
 
 #ifdef HAVE_SETLOCALE
-  setlocale (LC_ALL, ""):
+  setlocale (LC_ALL, "");
 #endif
 
   progname = strrchr(argv[0], '/');
@@ -134,8 +133,7 @@ main (argc, argv)
 }
 
 static int
-fcopy(fp)
-     FILE *fp;
+fcopy(FILE *fp)
 {
   int c;
   char *x;
@@ -155,9 +153,7 @@ fcopy(fp)
 }
 
 int
-stdcat (argc, argv)
-     int argc;
-     char **argv;
+stdcat (int argc, char **argv)
 {
   int  i, fd, r;
   char *s;
index d170f62ff822cc12d66319e6dec2af2633d37bb4..021a868b042060081318f219d487f53f91f4d292 100644 (file)
@@ -42,8 +42,7 @@ static int masterfd = -1;
 static int slavefd;
 
 void
-sigint (s)
-     int s;
+sigint (int s)
 {
   tty_reset (STDIN_FILENO);
   close (masterfd);
@@ -53,14 +52,13 @@ sigint (s)
 }
 
 void
-sigwinch (s)
-     int s;
+sigwinch (int s)
 {
   rl_resize_terminal ();
 }
 
 static int 
-user_input()
+user_input(void)
 {
   int size;
   const int MAX = 1024;
@@ -78,7 +76,7 @@ user_input()
 }
 
 static int 
-readline_input()
+readline_input(void)
 {
   const int MAX = 1024;
   char *buf = (char *)malloc(MAX+1);
@@ -124,7 +122,7 @@ rlctx_send_user_command(char *line)
 }
 
 static void 
-custom_deprep_term_function ()
+custom_deprep_term_function (void)
 {
 }
 
@@ -226,9 +224,10 @@ static enum { RESET, TCBREAK } ttystate = RESET;
  * 
  * Returns: 0 on success, -1 on error
  */
-int tty_cbreak(int fd){
+int tty_cbreak(int fd)
+{
    struct termios buf;
-    int ttysavefd = -1;
+   int ttysavefd = -1;
    
    if(tcgetattr(fd, &save_termios) < 0)
       return -1;
@@ -316,7 +315,7 @@ int tty_reset(int fd)
 }
 
 int 
-main()
+main(int c, char **v)
 {
   int val;
 
index 8b7c00c8c49a0e7f071c09f1d93d818b597afd23..feab90f22a9369852241e2b893c718a7c27910b4 100644 (file)
@@ -4,7 +4,7 @@
 /*                                                                 */
 /* **************************************************************** */
 
-/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2009,2023 Free Software Foundation, Inc.
 
    This file is part of the GNU Readline Library (Readline), a library for
    reading lines of text with interactive input and history editing.
@@ -48,10 +48,8 @@ extern void exit();
 #  include <readline/history.h>
 #endif
 
-extern HIST_ENTRY **history_list ();
-
 int
-main ()
+main (int c, char **v)
 {
   char *temp, *prompt;
   int done;
index b343dd66c1f032d8718eb5882349eb07c64f9454..4d4ad17a4ae4e8eec0b1b125629c30de9ff71cdf 100644 (file)
@@ -94,7 +94,8 @@ CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \
           wcsdup.c fpurge.c zgetline.c mbscmp.c mbsncmp.c  uconvert.c \
           ufuncs.c casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \
           strchrnul.c unicode.c wcswidth.c wcsnwidth.c shmbchar.c strdup.c \
-          strvis.c utf8.c random.c gettimeofday.c timers.c
+          strvis.c strlcpy.c strscpy.c utf8.c random.c gettimeofday.c \
+          timers.c anonfile.c
 
 # The header files for this library.
 HSOURCES = 
@@ -109,6 +110,7 @@ OBJECTS = clktck.o clock.o getenv.o oslib.o setlinebuf.o strnlen.o \
          fmtullong.o fmtumax.o zcatfd.o zmapfd.o winsize.o wcsdup.o \
          fpurge.o zgetline.o mbscmp.o mbsncmp.o uconvert.o ufuncs.o casemod.o \
          input_avail.o mbscasecmp.o fnxform.o unicode.o shmbchar.o strvis.o \
+         strscpy.o anonfile.o \
          utf8.o random.o gettimeofday.o timers.o wcsnwidth.o ${LIBOBJS}
 
 SUPPORT = Makefile
@@ -144,6 +146,7 @@ ${BUILD_DIR}/pathnames.h: ${BUILD_DIR}/config.h ${BUILD_DIR}/Makefile Makefile
        -( cd ${BUILD_DIR} && ${MAKE} ${MFLAGS} pathnames.h )
 
 # rules for losing makes, like SunOS
+anonfile.o: anonfile.c
 casemod.o: casemod.c
 clktck.o: clktck.c
 clock.o: clock.c
@@ -200,6 +203,8 @@ strtoull.o: strtoull.c
 strtoumax.o: strtoumax.c
 strtrans.o: strtrans.c
 strvis.o: strvis.c
+strlcpy.o: strlcpy.c
+strscpy.o: strscpy.c
 timers.o: timers.c
 times.o: times.c
 timeval.o: timeval.c
@@ -227,6 +232,7 @@ strtoul.o: strtol.c
 strtoull.o: strtol.c
 
 # all files in the library depend on config.h
+anonfile.o: ${BUILD_DIR}/config.h
 casemod.o: ${BUILD_DIR}/config.h
 clktck.o: ${BUILD_DIR}/config.h
 clock.o: ${BUILD_DIR}/config.h
@@ -283,6 +289,8 @@ strtoull.o: ${BUILD_DIR}/config.h
 strtoumax.o: ${BUILD_DIR}/config.h
 strtrans.o: ${BUILD_DIR}/config.h
 strvis.o: ${BUILD_DIR}/config.h
+strlcpy.o: ${BUILD_DIR}/config.h
+strscpy.o: ${BUILD_DIR}/config.h
 timers.o: ${BUILD_DIR}/config.h
 times.o: ${BUILD_DIR}/config.h
 timeval.o: ${BUILD_DIR}/config.h
@@ -521,6 +529,14 @@ strvis.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h
 strvis.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h
 strvis.o: ${topdir}/bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h
 
+strlcpy.o: ${topdir}/bashansi.h
+strlcpy.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h
+strlcpy.o: ${BASHINCDIR}/typemax.h
+
+strscpy.o: ${topdir}/bashansi.h
+strscpy.o: ${BASHINCDIR}/ansi_stdlib.h ${BASHINCDIR}/chartypes.h
+strscpy.o: ${BASHINCDIR}/typemax.h
+
 times.o: ${BASHINCDIR}/systimes.h
 times.o: ${BASHINCDIR}/posixtime.h
 
@@ -539,7 +555,6 @@ tmpfile.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h
 tmpfile.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h
 tmpfile.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h
 
-uconvert.o: ${topdir}/bashtypes.h
 uconvert.o: ${BASHINCDIR}/chartypes.h
 uconvert.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h
 uconvert.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h
@@ -662,3 +677,14 @@ zmapfd.o: ${BASHINCDIR}/stdc.h
 zmapfd.o: ${topdir}/command.h
 zmapfd.o: ${topdir}/general.h
 zmapfd.o: ${topdir}/bashtypes.h ${BASHINCDIR}/chartypes.h ${topdir}/xmalloc.h
+
+anonfile.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
+anonfile.o: ${topdir}/bashtypes.h
+anonfile.o: ${BASHINCDIR}/filecntl.h
+anonfile.o: ${topdir}/shell.h ${topdir}/syntax.h ${topdir}/bashjmp.h ${BASHINCDIR}/posixjmp.h
+anonfile.o: ${topdir}/command.h ${BASHINCDIR}/stdc.h ${topdir}/error.h
+anonfile.o: ${topdir}/general.h ${topdir}/bashtypes.h ${topdir}/variables.h ${topdir}/conftypes.h
+anonfile.o: ${topdir}/array.h ${topdir}/hashlib.h ${topdir}/quit.h
+anonfile.o: ${topdir}/unwind_prot.h ${topdir}/dispose_cmd.h
+anonfile.o: ${topdir}/make_cmd.h ${topdir}/subst.h ${topdir}/sig.h
+anonfile.o: ${BUILD_DIR}/pathnames.h ${topdir}/externs.h
diff --git a/lib/sh/anonfile.c b/lib/sh/anonfile.c
new file mode 100644 (file)
index 0000000..ded456b
--- /dev/null
@@ -0,0 +1,67 @@
+/* anonfile.c - open and close temporary files (anonymous and memory-backed if possible). */
+
+/* Copyright (C) 2023 Free Software Foundation, Inc.
+
+   This file is part of GNU Bash, the Bourne Again SHell.
+
+   Bash is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   Bash is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Bash.  If not, see <http://www.gnu.org/licenses/>.
+*/
+   
+#include <config.h>
+
+#if defined (HAVE_UNISTD_H)
+#  include <unistd.h>
+#endif
+#include <bashtypes.h>
+
+#if defined (HAVE_MEMFD_CREATE) || defined (HAVE_SHM_OPEN) || defined (HAVE_SHM_MKSTEMP)
+#  include <sys/mman.h>
+#endif
+#include <filecntl.h>
+
+#include <errno.h>
+
+#include <shell.h>
+#include <bashansi.h>
+
+/* Placeholder for future use of memfd_create/shm_open/shm_mkstemp */
+
+static int
+anonunlink (const char *fn)
+{
+  int r;
+
+  r = unlink (fn);
+  return r;
+}
+
+int
+anonopen (const char *name, int flags)
+{
+  int fd, flag;
+
+  /* Heuristic */
+  flag = (name && *name == '/') ? MT_TEMPLATE : MT_USETMPDIR;
+  fd = sh_mktmpfd (name, flag|MT_USERANDOM|MT_READWRITE|MT_UNLINK, (char **)NULL);
+  return fd;
+}
+
+int
+anonclose (int fd, const char *name)
+{
+  int r;
+
+  r = close (fd);
+  return r;
+}
diff --git a/lib/sh/strlcpy.c b/lib/sh/strlcpy.c
new file mode 100644 (file)
index 0000000..9781c3f
--- /dev/null
@@ -0,0 +1,39 @@
+/* strlcpy - null-terminated string copy with length checking. */
+
+/* Copyright (C) 2023 Free Software Foundation, Inc.
+
+   This file is part of GNU Bash, the Bourne Again SHell.
+
+   Bash is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   Bash is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Bash.  If not, see <http://www.gnu.org/licenses/>.
+*/
+   
+#include <config.h>
+
+#include <bashansi.h>
+
+size_t
+strlcpy(const char *dest, const const char *src, size_t size)
+{
+  size_t ret;
+
+  ret = strlen(src);
+  if (size)
+    {
+      size_t len;
+      len = (ret >= size) ? size - 1 : ret;
+      memcpy (dest, src, len);
+      dest[len] = '\0';
+    }
+  return ret;
+}
diff --git a/lib/sh/strscpy.c b/lib/sh/strscpy.c
new file mode 100644 (file)
index 0000000..7a948eb
--- /dev/null
@@ -0,0 +1,38 @@
+/* strscpy - null-terminated string copy with length checking. */
+
+/* Copyright (C) 2023 Free Software Foundation, Inc.
+
+   This file is part of GNU Bash, the Bourne Again SHell.
+
+   Bash is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   Bash is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with Bash.  If not, see <http://www.gnu.org/licenses/>.
+*/
+   
+#include <config.h>
+
+#include <bashansi.h>
+
+ssize_t
+strscpy (char *d, const char *s, size_t len)
+{
+  size_t i;
+
+  for (i = 0; i < len; i++)
+    if ((d[i] = s[i]) == 0)
+      return ((ssize_t)i);
+
+  if (i != 0)
+    d[--i] = '\0';
+
+  return (-1);         /* strlen (s) > len */
+}
index 5026760966ce16dc00bc6dc5822747863ee2f136..83e3684968afc0f73e6a11e8601d7f81a3c90a01 100644 (file)
@@ -58,6 +58,8 @@ extern int errno;
 
 extern pid_t dollar_dollar_pid;
 
+static int tmpunlink (const char *);
+
 static char *get_sys_tmpdir (void);
 static char *get_tmpdir (int);
 
@@ -134,6 +136,15 @@ sh_seedrand (void)
 #endif
 }
 
+static int
+tmpunlink (const char *fn)
+{
+  int r;
+
+  r = unlink (fn);
+  return r;
+}
+
 char *
 sh_mktmpname (const char *nameroot, int flags)
 {
@@ -181,7 +192,7 @@ sh_mktmpname (const char *nameroot, int flags)
                (unsigned long) dollar_dollar_pid ^
                x;
       sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
-      if (tmpnamelen > 0 && tmpnamelen < 32)
+      if (tmpnamelen > 0 && tmpnamelen < 32)           /* XXX */
        filename[tdlen + 1 + tmpnamelen] = '\0';
 #  ifdef HAVE_LSTAT
       r = lstat (filename, &sb);
@@ -220,6 +231,13 @@ sh_mktmpfd (const char *nameroot, int flags, char **namep)
   else
     sprintf (filename, "%s/%s.XXXXXX", tdir, lroot);
   fd = mkstemp (filename);
+  if ((flags & MT_UNLINK) && tmpunlink (filename) < 0)
+    {
+      int e = errno;
+      close (fd);
+      fd = -1;
+      errno = e;
+    }
   if (fd < 0 || namep == 0)
     {
       free (filename);
@@ -227,6 +245,7 @@ sh_mktmpfd (const char *nameroot, int flags, char **namep)
     }
   if (namep)
     *namep = filename;
+
   return fd;
 #else /* !USE_MKSTEMP */
 #ifndef USE_URANDOM32
@@ -245,16 +264,27 @@ sh_mktmpfd (const char *nameroot, int flags, char **namep)
                (unsigned long) dollar_dollar_pid ^
                x;
       sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
-      if (tmpnamelen > 0 && tmpnamelen < 32)
+      if (tmpnamelen > 0 && tmpnamelen < 32)           /* XXX */
        filename[tdlen + 1 + tmpnamelen] = '\0';
       fd = open (filename, BASEOPENFLAGS | ((flags & MT_READWRITE) ? O_RDWR : O_WRONLY), 0600);
     }
   while (fd < 0 && errno == EEXIST);
 
+  if ((flags & MT_UNLINK) && (tmpunlink (filename) < 0)
+    {
+      int e = errno;
+      close (fd);
+      fd = -1;
+      errno = e;
+    }
+  if (fd < 0 || namep == 0)
+    {
+      free (filename);
+      filename = NULL;
+    }
+
   if (namep)
     *namep = filename;
-  else
-    free (filename);
 
   return fd;
 #endif /* !USE_MKSTEMP */
diff --git a/parse.y b/parse.y
index e70b340d48072a776b93ac1b659a7756d188149f..d05f0a61b866f1e5840205ed82a96c0826149833 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -381,6 +381,8 @@ static FILE *yyerrstream;
 
 /* Special; never created by yylex; only set by parse_comsub and xparse_dolparen */
 %token DOLPAREN
+/* Special; never created by yylex; only set by parse_matched_pair/parse_comsub/xparse_dolparen */
+%token DOLBRACE
 
 /* The types that the various syntactical units return. */
 
@@ -1041,6 +1043,14 @@ comsub:          DOLPAREN compound_list ')'
                        {
                          $$ = (COMMAND *)NULL;
                        }
+       |       DOLBRACE compound_list '}'
+                       {
+                         $$ = $2;
+                       }
+       |       DOLBRACE newline_list '}'
+                       {
+                         $$ = (COMMAND *)NULL;
+                       }
        ;
 
 coproc:                COPROC shell_command
index 38e5b8a01ff527f284fc013a1dea9aefa14dc364..21eed383513a36478569dec622f5a84e833662b7 100644 (file)
--- a/pathexp.c
+++ b/pathexp.c
@@ -27,6 +27,9 @@
 #  include <unistd.h>
 #endif
 
+#include "posixstat.h"
+#include "stat-time.h"
+
 #include "bashansi.h"
 
 #include "shell.h"
 #include "shmbutil.h"
 #include "bashintl.h"
 
+
 #include <glob/strmatch.h>
 
 static int glob_name_is_acceptable (const char *);
 static void ignore_globbed_names (char **, sh_ignore_func_t *);
 static char *split_ignorespec (char *, int *);
+static void sh_sortglob (char **);
               
 #include <glob/glob.h>
 
@@ -396,7 +401,8 @@ quote_globbing_chars (const char *string)
   return temp;
 }
 
-/* Call the glob library to do globbing on PATHNAME. */
+/* Call the glob library to do globbing on PATHNAME, honoring all the shell
+   variables that control globbing. */
 char **
 shell_glob_filename (const char *pathname, int qflags)
 {
@@ -415,7 +421,7 @@ shell_glob_filename (const char *pathname, int qflags)
       if (should_ignore_glob_matches ())
        ignore_glob_matches (results);
       if (results && results[0])
-       strvec_sort (results, 1);               /* posix sort */
+        sh_sortglob (results);
       else
        {
          FREE (results);
@@ -426,6 +432,28 @@ shell_glob_filename (const char *pathname, int qflags)
   return (results);
 }
 
+#if defined (READLINE) && defined (PROGRAMMABLE_COMPLETION)
+char **
+noquote_glob_filename (char *pathname)
+{
+  char **results;
+  int gflags;
+
+  noglob_dot_filenames = glob_dot_filenames == 0;
+  gflags = glob_star ? GX_GLOBSTAR : 0;
+
+  results = glob_filename (pathname, gflags);
+
+  if (results && GLOB_FAILED (results))
+    results = (char **)NULL;
+
+  if (results && results[0])
+    sh_sortglob (results);
+
+  return (results);
+}
+#endif
+
 /* Stuff for GLOBIGNORE. */
 
 static struct ignorevar globignore =
@@ -615,3 +643,210 @@ setup_ignore_patterns (struct ignorevar *ivp)
   ivp->ignores[numitems].val = (char *)NULL;
   ivp->num_ignores = numitems;
 }
+
+/* Functions to handle sorting glob results in different ways depending on
+   the value of the GLOBSORT variable. */
+
+static int glob_sorttype = STAT_NONE;
+
+static STRING_INT_ALIST sorttypes[] = {
+  { "name",    STAT_NAME },
+  { "size",    STAT_SIZE },
+  { "mtime",   STAT_MTIME },
+  { "atime",   STAT_ATIME },
+  { "ctime",   STAT_CTIME },
+  { "blocks",  STAT_BLOCKS },
+  { (char *)NULL,      -1 }
+};
+
+/* A subset of the fields in the posix stat struct -- the ones we need --
+   normalized to using struct timespec. */
+struct globstat {
+  off_t size;
+  struct timespec mtime;
+  struct timespec atime;
+  struct timespec ctime;
+  int blocks;
+};
+  
+struct globsort_t {
+  char *name;
+  struct globstat st;
+};
+
+static struct globstat glob_nullstat = { -1, { -1, -1 }, { -1, -1 }, { -1, -1 }, -1 };
+
+static inline int
+glob_findtype (char *t)
+{
+  int type;
+
+  type = find_string_in_alist (t, sorttypes, 0);
+  return (type == -1 ? STAT_NONE : type);
+}
+
+void
+setup_globsort (const char *varname)
+{
+  char *val;
+  int r, t;
+
+  glob_sorttype = STAT_NONE;
+  val = get_string_value (varname);
+  if (val == 0 || *val == 0)
+    return;
+
+  t = r = 0;
+  while (*val && whitespace (*val))
+    val++;                     /* why not? */
+  if (*val == '+')
+    val++;                     /* allow leading `+' but ignore it */
+  else if (*val == '-')
+    {
+      r = STAT_REVERSE;                /* leading `-' reverses sort order */
+      val++;
+    }
+
+  if (*val == 0)
+    {
+      /* A bare `+' means the default sort by name in ascending order; a bare
+         `-' means to sort by name in descending order. */
+      glob_sorttype = STAT_NAME | r;
+      return;
+    }
+
+  t = glob_findtype (val);
+  /* any other value is equivalent to the historical behavior */
+  glob_sorttype = (t == STAT_NONE) ? t : t | r;
+}
+
+static int
+globsort_namecmp (char **s1, char **s2)
+{
+  return ((glob_sorttype < STAT_REVERSE) ? strvec_posixcmp (s1, s2) : strvec_posixcmp (s2, s1));
+}
+
+static int
+globsort_sizecmp (struct globsort_t *g1, struct globsort_t *g2)
+{
+  return ((glob_sorttype < STAT_REVERSE) ? g1->st.size - g2->st.size : g2->st.size - g1->st.size);
+}
+
+static int
+globsort_timecmp (struct globsort_t *g1, struct globsort_t *g2)
+{
+  int t;
+  struct timespec t1, t2;
+
+  t = (glob_sorttype < STAT_REVERSE) ? glob_sorttype : glob_sorttype - STAT_REVERSE;
+  if (t == STAT_MTIME)
+    {
+      t1 = g1->st.mtime;
+      t2 = g2->st.mtime;
+    }
+  else if (t == STAT_ATIME)
+    {
+      t1 = g1->st.atime;
+      t2 = g2->st.atime;
+    }
+  else
+    {
+      t1 = g1->st.ctime;
+      t2 = g2->st.ctime;
+    }
+
+  return ((glob_sorttype < STAT_REVERSE) ? timespec_cmp (t1, t2) : timespec_cmp (t2, t1));
+}
+
+static int
+globsort_blockscmp (struct globsort_t *g1, struct globsort_t *g2)
+{
+  return ((glob_sorttype < STAT_REVERSE) ? g1->st.blocks - g2->st.blocks : g2->st.blocks - g1->st.blocks);
+}
+
+static struct globsort_t *
+globsort_buildarray (char **array, size_t len)
+{
+  struct globsort_t *ret;
+  int i;
+  struct stat st;
+
+  ret = (struct globsort_t *)xmalloc (len * sizeof (struct globsort_t));
+
+  for (i = 0; i < len; i++)
+    {
+      ret[i].name = array[i];
+      if (stat (array[i], &st) != 0)
+        ret[i].st = glob_nullstat;
+      else
+        {
+          ret[i].st.size = st.st_size;
+          ret[i].st.mtime = get_stat_mtime (&st);
+          ret[i].st.atime = get_stat_atime (&st);
+          ret[i].st.ctime = get_stat_ctime (&st);
+          ret[i].st.blocks = st.st_blocks;
+        }
+    }
+
+  return ret;
+}  
+          
+static inline void
+globsort_sortbyname (char **results)
+{
+  qsort (results, strvec_len (results), sizeof (char *), (QSFUNC *)globsort_namecmp);
+}
+
+static void
+globsort_sortarray (struct globsort_t *garray, size_t len)
+{
+  int t;
+  QSFUNC *sortfunc;
+
+  t = (glob_sorttype < STAT_REVERSE) ? glob_sorttype : glob_sorttype - STAT_REVERSE;
+
+  switch (t)
+    {
+    case STAT_SIZE:
+      sortfunc = (QSFUNC *)globsort_sizecmp;
+      break;
+    case STAT_ATIME:
+    case STAT_MTIME:
+    case STAT_CTIME:
+      sortfunc = (QSFUNC *)globsort_timecmp;
+      break;
+    case STAT_BLOCKS:
+      sortfunc = (QSFUNC *)globsort_blockscmp;
+      break;
+    default:
+      internal_error (_("invalid glob sort type"));
+      break;
+    }
+
+  qsort (garray, len, sizeof (struct globsort_t), sortfunc);
+}
+
+static void
+sh_sortglob (char **results)
+{
+  size_t rlen;
+  struct globsort_t *garray;
+
+  if (glob_sorttype == STAT_NONE || glob_sorttype == STAT_NAME)
+    globsort_sortbyname (results);     /* posix sort */
+  else if (glob_sorttype == (STAT_NAME|STAT_REVERSE))
+    globsort_sortbyname (results);     /* posix sort reverse order */
+  else
+    {
+      int i;
+
+      rlen = strvec_len (results);
+      /* populate an array of name/statinfo, sort it appropriately, copy the
+        names from the sorted array back to RESULTS, and free the array */
+      garray = globsort_buildarray (results, rlen);
+      globsort_sortarray (garray, rlen);
+      for (i = 0; i < rlen; i++)
+        results[i] = garray[i].name;
+      free (garray);
+    }
+}
index 6a549912e419fe98be1189e9e9e48c0b2af42e4f..87da5f9e9c0afd60f231ee3810acc830a1cea0c6 100644 (file)
--- a/pathexp.h
+++ b/pathexp.h
@@ -71,6 +71,8 @@ extern char *quote_globbing_chars (const char *);
    whether or not we've already performed quote removal. */
 extern char **shell_glob_filename (const char *, int);
 
+extern char **noquote_glob_filename (char *);
+
 /* Filename completion ignore.  Used to implement the "fignore" facility of
    tcsh, GLOBIGNORE (like ksh-93 FIGNORE), and EXECIGNORE.
 
@@ -102,4 +104,17 @@ extern void setup_glob_ignore (const char *);
 extern int should_ignore_glob_matches (void);
 extern void ignore_glob_matches (char **);
 
+/* Definitions for glob sorting */
+#define STAT_NONE      0
+#define STAT_NAME      1
+#define STAT_SIZE      2
+#define STAT_MTIME     3
+#define STAT_ATIME     4
+#define STAT_CTIME     5
+#define STAT_BLOCKS    6
+
+#define STAT_REVERSE   128
+
+extern void setup_globsort (const char *);
+
 #endif
index 553623d5845f683a78b6381375eb34a5154a17e1..b1c5a37147ed730d5ed82371abbf825c281405f4 100644 (file)
@@ -849,14 +849,9 @@ static STRINGLIST *
 gen_globpat_matches (COMPSPEC *cs, const char *text)
 {
   STRINGLIST *sl;
-  int gflags;
 
-  noglob_dot_filenames = glob_dot_filenames == 0;
-  gflags = glob_star ? GX_GLOBSTAR : 0;
   sl = strlist_create (0);
-  sl->list = glob_filename (cs->globpat, gflags);
-  if (GLOB_FAILED (sl->list))
-    sl->list = (char **)NULL;
+  sl->list = noquote_glob_filename (cs->globpat);
   if (sl->list)
     sl->list_len = sl->list_size = strvec_len (sl->list);
   return sl;
@@ -1484,6 +1479,7 @@ pcomp_set_readline_variables (int flags, int nval)
      option is supposed to turn it off */
   if (flags & COPT_NOQUOTE)
     rl_filename_quoting_desired = 1 - nval;
+  /* Ditto */
   if (flags & COPT_NOSORT)
     rl_sort_completion_matches = 1 - nval;
 }
index 2ac09d9668627399041b601ef76378d982538276..afd51b02cfe614fb6fcdd9e9c0a1f46d55e4948c 100644 (file)
Binary files a/po/hr.gmo and b/po/hr.gmo differ
index 9b34f029dbc451039929831a6e7d138e98748543..65e1aba8dca11cfa9c181bfc00b9ee3e8bcb5e8f 100644 (file)
--- a/po/hr.po
+++ b/po/hr.po
@@ -3,13 +3,13 @@
 # This file is distributed under the same license as the bash package.
 #
 # Tomislav Krznar <tomislav.krznar@gmail.com>, 2012, 2013.
-# Božidar Putanec <bozidarp@yahoo.com>, 2018, 2019, 2020, 2021, 2022.
+# Božidar Putanec <bozidarp@yahoo.com>, 2018, 2019, 2020, 2021, 2022, 2023.
 msgid ""
 msgstr ""
-"Project-Id-Version: bash 5.2-rc1\n"
+"Project-Id-Version: bash-5.2-rc1\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2022-01-11 14:50-0500\n"
-"PO-Revision-Date: 2022-06-17 11:19-0700\n"
+"PO-Revision-Date: 2023-04-12 12:19-0700\n"
 "Last-Translator: Božidar Putanec <bozidarp@yahoo.com>\n"
 "Language-Team: Croatian <lokalizacija@linux.hr>\n"
 "Language: hr\n"
@@ -18,7 +18,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 "X-Bugs: Report translation errors to the Language-Team address.\n"
-"X-Generator: Lokalize 22.07.70\n"
+"X-Generator: Poedit 3.2.2\n"
 
 #: arrayfunc.c:66
 msgid "bad array subscript"
@@ -3736,8 +3736,8 @@ msgstr ""
 "    Varijable, za upotrebu u izrazima, ne moraju imati atribut cijelog broja.\n"
 "\n"
 "    Operatori se vrednuju prema pravilima prednosti. Najprije se\n"
-"    vrednuju pod-izrazi u zagradama i tako mogu prevagnuti nad gore\n"
-"    opisanim pravilima prednosti.\n"
+"    vrednuju pod-izrazi u zagradama i tako mogu redefinirati gore\n"
+"    opisana pravilila prednosti.\n"
 "\n"
 "    Ako je vrednovanje zadnjeg ARGUMENTA nula (0), „let“ završi s kȏdom 1;\n"
 "    inače završi s uspjehom."
index 868b34b085615c26ddda2a1eb2cc762fb546a693..9d9c8a438036e5171ecc178c933cd652cba2ca74 100644 (file)
@@ -5639,6 +5639,7 @@ static struct name_and_function special_vars[] = {
   { "FUNCNEST", sv_funcnest },
 
   { "GLOBIGNORE", sv_globignore },
+  { "GLOBSORT", sv_globsort },
 
 #if defined (HISTORY)
   { "HISTCONTROL", sv_history_control },
@@ -5833,6 +5834,13 @@ sv_globignore (const char *name)
     setup_glob_ignore (name);
 }
 
+/* What to do when GLOBSORT changes. */
+void
+sv_globsort (const char *name)
+{
+  setup_globsort (name);
+}
+
 #if defined (READLINE)
 void
 sv_comp_wordbreaks (const char *name)
index f469a3f305d473990e25a7ea3b43656bfe2bce60..576796e84ce370ab100f8a0ca078864d04dab399 100644 (file)
@@ -431,6 +431,7 @@ extern void sv_opterr (const char *);
 extern void sv_locale (const char *);
 extern void sv_xtracefd (const char *);
 extern void sv_shcompat (const char *);
+extern void sv_globsort (const char *);
 
 #if defined (READLINE)
 extern void sv_comp_wordbreaks (const char *);