]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
use name as GLOBSORT secondary sort key; new GLOBSORT sort specifier: `numeric';...
authorChet Ramey <chet.ramey@case.edu>
Fri, 21 Jun 2024 14:51:53 +0000 (10:51 -0400)
committerChet Ramey <chet.ramey@case.edu>
Fri, 21 Jun 2024 14:51:53 +0000 (10:51 -0400)
29 files changed:
CWRU/CWRU.chlog
MANIFEST
builtins/declare.def
doc/bash.0
doc/bash.1
doc/bash.info
doc/bash.pdf
doc/bashref.aux
doc/bashref.bt
doc/bashref.bts
doc/bashref.fn
doc/bashref.fns
doc/bashref.info
doc/bashref.log
doc/bashref.pdf
doc/bashref.texi
doc/bashref.toc
doc/bashref.vr
doc/bashref.vrs
lib/sh/winsize.c
pathexp.c
pathexp.h
subst.c
tests/glob.right
tests/glob11.sub
tests/printf3.sub
tests/varenv.right
tests/varenv.tests
tests/varenv25.sub [new file with mode: 0644]

index 1cab359e7c4bce4eb5e900ee2a9ff90067605de3..bcbb643727ccf02998756994771407ea743ea55e 100644 (file)
@@ -9646,3 +9646,34 @@ builtins/source.def
 doc/bash.1,doc/bashref.texi
        - source: document -p
 
+pathexp.c
+       - if the size, blocks, or any of the time values compare equal, use
+         the name for a secondary sort key
+
+lib/sh/winsize.c
+       - tcgetwinsize: provide definition for missing newly-standard function
+       - get_new_window_size: use tcgetwinsize
+
+subst.c
+       - do_compound_assignment: if ASS_CHKLOCAL is in the flags, check for
+         variables at previous local scopes instead of just the current local
+         scope and the global scope
+         Part of fix for inconsistency between arrays and scalar variables
+         reported by Will Allan <billyzkid@yahoo.com>
+
+builtins/declare.def
+       - declare_find_variable: if `declare -G' is used, check for
+         variables at previous local scopes instead of just the current local
+         scope and the global scope
+         Rest of fix for inconsistency between arrays and scalar variables
+         reported by Will Allan <billyzkid@yahoo.com>
+
+pathexp.h
+       - SORT_NUMERIC: new "numeric" sort specifier
+
+pathexp.c
+       - globsort_numericcmp: new sort function for the "numeric" sort
+         specifier: all-digit names are sorted as numbers; names containing
+         any non-digits sort after all-digit names and are sorted
+         lexicographically.
+         Inspired by a discussion with Robert Elz <kre@munnari.oz.au>
index b19ee02c19f040b786fd339c300391a7c63eb897..55a3c41a444b34c5d3e4f3fe9ccfa003836dfc71 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1639,6 +1639,7 @@ tests/varenv21.sub        f
 tests/varenv22.sub     f
 tests/varenv23.sub     f
 tests/varenv24.sub     f
+tests/varenv25.sub     f
 tests/version          f
 tests/version.mini     f
 tests/vredir.tests     f
index b8e1f223a04ab61b0f4df8b452ac27ec4c926812..5d87cf55f098f1b2e88dd04bab93f83616ca34d5 100644 (file)
@@ -152,13 +152,8 @@ declare_find_variable (const char *name, int mkglobal, int chklocal)
   if (mkglobal == 0)
     return (find_variable (name));
   else if (chklocal)
-    {
-      var = find_variable (name);
-      if (var && local_p (var) && var->context == variable_context)
-       return var;
-      /* XXX - add check for previous scopes here if wanted 6/4/2024 */
-      return (find_global_variable (name));
-    }
+    /* Changed to find variables at previous local scopes 6/12/2024 */
+    return (find_variable (name));
   else
     return (find_global_variable (name));
 }
@@ -315,7 +310,7 @@ declare_internal (WORD_LIST *list, int local_var)
        case 'f':
          *flags |= att_function;
          break;
-       case 'G':
+       case 'G':                       /* undocumented, used internally */
          if (flags == &flags_on)
            chklocal = 1;
          /*FALLTHROUGH*/
index 6cd41b43214b1339f794c5b0da1bbda5abf28581..6e3bae2bd49913e1ce22dd397253e30a657328b1 100644 (file)
@@ -1218,21 +1218,33 @@ P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
               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
-              historical 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-_\bm_\bt_\bi_\bm_\be  sorts  the  results  in descending order by modification
-              time (newest first).  A sort specifier of _\bn_\bo_\bs_\bo_\br_\bt disables  sort-
-              ing  completely;  the results are returned in the order they are
-              read from the file system, and any leading _\b+ or  _\b-  is  ignored.
-              If  the  sort  specifier  is  missing, it defaults 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.
+              historical behavior of sorting by name.
+
+              If set, a valid value begins with an optional _\b+,  which  is  ig-
+              nored, or _\b-, which reverses the sort order from ascending to de-
+              scending,  followed  by a sort specifier.  The valid sort speci-
+              fiers are _\bn_\ba_\bm_\be, _\bn_\bu_\bm_\be_\br_\bi_\bc, _\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, names in numeric rather than lexi-
+              cographic  order, file size, modification time, access time, in-
+              ode change time, and number of blocks, respectively.  If any  of
+              the  non-name  keys compare as equal (e.g., if two files are the
+              same size), sorting uses the name as a secondary sort key.   For
+              example, a value of _\b-_\bm_\bt_\bi_\bm_\be sorts the results in descending order
+              by modification time (newest first).
+
+              The  _\bn_\bu_\bm_\be_\br_\bi_\bc  specifier treats names consisting solely of digits
+              as numbers and sorts them using the numeric value (so  "2"  will
+              sort  before "10", for example).  When using _\bn_\bu_\bm_\be_\br_\bi_\bc, names con-
+              taining non-digits sort after all the all-digit  names  and  are
+              sorted by name using the traditional behavior.
+
+              A  sort specifier of _\bn_\bo_\bs_\bo_\br_\bt disables sorting completely; the re-
+              sults are returned in the order they are read from the file sys-
+              tem, and any leading _\b+ or _\b- is ignored.  If the  sort  specifier
+              is  missing,  it defaults 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 behav-
+              ior.
        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
index 7a91649b143b850fc3a2c726cc5f3ff4d3ee6353..328a609442189662d5b06ad35af0c7e864f0c5f7 100644 (file)
@@ -2305,26 +2305,39 @@ of the patterns in
 it is removed from the list of matches.
 .TP
 .B GLOBSORT
+.PD
 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 historical behavior of sorting by name.
+.IP
 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 numeric ,
 .IR size ,
 .IR mtime ,
 .IR atime ,
 .IR ctime ,
 and
 .IR blocks ,
-which sort the files on name, file size, modification time, access time,
+which sort the files on name, names in numeric rather than lexicographic order,
+file size, modification time, access time,
 inode change time, and number of blocks, respectively.
+If any of the non-name keys compare as equal (e.g., if two files are
+the same size), sorting uses the name as a secondary sort key.
 For example, a value of \fI\-mtime\fP sorts the results in descending
 order by modification time (newest first).
+.IP
+The \fInumeric\fP specifier treats names consisting solely of digits as
+numbers and sorts them using the numeric value (so "2" will sort before
+"10", for example).
+When using \fInumeric\fP, names containing non-digits sort after all
+the all-digit names and are sorted by name using the traditional behavior.
+.IP
 A sort specifier of \fInosort\fP disables sorting completely; the results
 are returned in the order they are read from the file system,
 and any leading \fI+\fP or \fI\-\fP is ignored.
@@ -2332,6 +2345,7 @@ 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.
+.PD 0
 .TP
 .B HISTCONTROL
 A colon-separated list of values controlling how commands are saved on
index ab227dc3bf87fea2d3be6b0066527ed3670256e1..14b721d6de7006f97dee4ce57a348f8c92580ae3 100644 (file)
@@ -5723,14 +5723,23 @@ Variables::).
      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.
+     The valid sort specifiers are â€˜name’, â€˜numeric’, â€˜size’, â€˜mtime’,
+     â€˜atime’, â€˜ctime’, and â€˜blocks’, which sort the files on name, names
+     in numeric rather than lexicographic order, file size, modification
+     time, access time, inode change time, and number of blocks,
+     respectively.  If any of the non-name keys compare as equal (e.g.,
+     if two files are the same size), sorting uses the name as a
+     secondary sort key.
 
      For example, a value of â€˜-mtime’ sorts the results in descending
      order by modification time (newest first).
 
+     The â€˜numeric’ specifier treats names consisting solely of digits as
+     numbers and sorts them using the numeric value (so "2" will sort
+     before "10", for example).  When using â€˜numeric’, names containing
+     non-digits sort after all the all-digit names and are sorted by
+     name using the traditional behavior.
+
      A sort specifier of â€˜nosort’ disables sorting completely; the
      results are returned in the order they are read from the file
      system, and any leading â€˜-’ is ignored.
@@ -12480,57 +12489,57 @@ D.3 Parameter and Variable Index
 * FUNCNEST:                              Bash Variables.      (line 361)
 * GLOBIGNORE:                            Bash Variables.      (line 366)
 * GLOBSORT:                              Bash Variables.      (line 373)
-* GROUPS:                                Bash Variables.      (line 399)
-* histchars:                             Bash Variables.      (line 405)
-* HISTCMD:                               Bash Variables.      (line 420)
-* HISTCONTROL:                           Bash Variables.      (line 426)
-* HISTFILE:                              Bash Variables.      (line 442)
-* HISTFILESIZE:                          Bash Variables.      (line 447)
-* HISTIGNORE:                            Bash Variables.      (line 458)
+* GROUPS:                                Bash Variables.      (line 408)
+* histchars:                             Bash Variables.      (line 414)
+* HISTCMD:                               Bash Variables.      (line 429)
+* HISTCONTROL:                           Bash Variables.      (line 435)
+* HISTFILE:                              Bash Variables.      (line 451)
+* HISTFILESIZE:                          Bash Variables.      (line 456)
+* HISTIGNORE:                            Bash Variables.      (line 467)
 * history-preserve-point:                Readline Init File Syntax.
                                                               (line 214)
 * history-size:                          Readline Init File Syntax.
                                                               (line 220)
-* HISTSIZE:                              Bash Variables.      (line 480)
-* HISTTIMEFORMAT:                        Bash Variables.      (line 487)
+* HISTSIZE:                              Bash Variables.      (line 489)
+* HISTTIMEFORMAT:                        Bash Variables.      (line 496)
 * HOME:                                  Bourne Shell Variables.
                                                               (line  13)
 * horizontal-scroll-mode:                Readline Init File Syntax.
                                                               (line 229)
-* HOSTFILE:                              Bash Variables.      (line 496)
-* HOSTNAME:                              Bash Variables.      (line 507)
-* HOSTTYPE:                              Bash Variables.      (line 510)
+* HOSTFILE:                              Bash Variables.      (line 505)
+* HOSTNAME:                              Bash Variables.      (line 516)
+* HOSTTYPE:                              Bash Variables.      (line 519)
 * IFS:                                   Bourne Shell Variables.
                                                               (line  18)
-* IGNOREEOF:                             Bash Variables.      (line 513)
+* IGNOREEOF:                             Bash Variables.      (line 522)
 * input-meta:                            Readline Init File Syntax.
                                                               (line 238)
-* INPUTRC:                               Bash Variables.      (line 523)
-* INSIDE_EMACS:                          Bash Variables.      (line 527)
+* INPUTRC:                               Bash Variables.      (line 532)
+* INSIDE_EMACS:                          Bash Variables.      (line 536)
 * isearch-terminators:                   Readline Init File Syntax.
                                                               (line 248)
 * keymap:                                Readline Init File Syntax.
                                                               (line 255)
 * LANG:                                  Creating Internationalized Scripts.
                                                               (line  51)
-* LANG <1>:                              Bash Variables.      (line 533)
-* LC_ALL:                                Bash Variables.      (line 537)
-* LC_COLLATE:                            Bash Variables.      (line 541)
-* LC_CTYPE:                              Bash Variables.      (line 548)
+* LANG <1>:                              Bash Variables.      (line 542)
+* LC_ALL:                                Bash Variables.      (line 546)
+* LC_COLLATE:                            Bash Variables.      (line 550)
+* LC_CTYPE:                              Bash Variables.      (line 557)
 * LC_MESSAGES:                           Creating Internationalized Scripts.
                                                               (line  51)
-* LC_MESSAGES <1>:                       Bash Variables.      (line 553)
-* LC_NUMERIC:                            Bash Variables.      (line 557)
-* LC_TIME:                               Bash Variables.      (line 561)
-* LINENO:                                Bash Variables.      (line 565)
-* LINES:                                 Bash Variables.      (line 570)
-* MACHTYPE:                              Bash Variables.      (line 576)
+* LC_MESSAGES <1>:                       Bash Variables.      (line 562)
+* LC_NUMERIC:                            Bash Variables.      (line 566)
+* LC_TIME:                               Bash Variables.      (line 570)
+* LINENO:                                Bash Variables.      (line 574)
+* LINES:                                 Bash Variables.      (line 579)
+* MACHTYPE:                              Bash Variables.      (line 585)
 * MAIL:                                  Bourne Shell Variables.
                                                               (line  22)
-* MAILCHECK:                             Bash Variables.      (line 580)
+* MAILCHECK:                             Bash Variables.      (line 589)
 * MAILPATH:                              Bourne Shell Variables.
                                                               (line  27)
-* MAPFILE:                               Bash Variables.      (line 588)
+* MAPFILE:                               Bash Variables.      (line 597)
 * mark-modified-lines:                   Readline Init File Syntax.
                                                               (line 285)
 * mark-symlinked-directories:            Readline Init File Syntax.
@@ -12541,46 +12550,46 @@ D.3 Parameter and Variable Index
                                                               (line 302)
 * meta-flag:                             Readline Init File Syntax.
                                                               (line 238)
-* OLDPWD:                                Bash Variables.      (line 592)
+* OLDPWD:                                Bash Variables.      (line 601)
 * OPTARG:                                Bourne Shell Variables.
                                                               (line  34)
-* OPTERR:                                Bash Variables.      (line 595)
+* OPTERR:                                Bash Variables.      (line 604)
 * OPTIND:                                Bourne Shell Variables.
                                                               (line  38)
-* OSTYPE:                                Bash Variables.      (line 599)
+* OSTYPE:                                Bash Variables.      (line 608)
 * output-meta:                           Readline Init File Syntax.
                                                               (line 307)
 * page-completions:                      Readline Init File Syntax.
                                                               (line 315)
 * PATH:                                  Bourne Shell Variables.
                                                               (line  42)
-* PIPESTATUS:                            Bash Variables.      (line 602)
-* POSIXLY_CORRECT:                       Bash Variables.      (line 608)
-* PPID:                                  Bash Variables.      (line 618)
-* PROMPT_COMMAND:                        Bash Variables.      (line 622)
-* PROMPT_DIRTRIM:                        Bash Variables.      (line 628)
-* PS0:                                   Bash Variables.      (line 634)
+* PIPESTATUS:                            Bash Variables.      (line 611)
+* POSIXLY_CORRECT:                       Bash Variables.      (line 617)
+* PPID:                                  Bash Variables.      (line 627)
+* PROMPT_COMMAND:                        Bash Variables.      (line 631)
+* PROMPT_DIRTRIM:                        Bash Variables.      (line 637)
+* PS0:                                   Bash Variables.      (line 643)
 * PS1:                                   Bourne Shell Variables.
                                                               (line  48)
 * PS2:                                   Bourne Shell Variables.
                                                               (line  53)
-* PS3:                                   Bash Variables.      (line 639)
-* PS4:                                   Bash Variables.      (line 644)
-* PWD:                                   Bash Variables.      (line 652)
-* RANDOM:                                Bash Variables.      (line 655)
-* READLINE_ARGUMENT:                     Bash Variables.      (line 661)
-* READLINE_LINE:                         Bash Variables.      (line 665)
-* READLINE_MARK:                         Bash Variables.      (line 669)
-* READLINE_POINT:                        Bash Variables.      (line 675)
-* REPLY:                                 Bash Variables.      (line 679)
+* PS3:                                   Bash Variables.      (line 648)
+* PS4:                                   Bash Variables.      (line 653)
+* PWD:                                   Bash Variables.      (line 661)
+* RANDOM:                                Bash Variables.      (line 664)
+* READLINE_ARGUMENT:                     Bash Variables.      (line 670)
+* READLINE_LINE:                         Bash Variables.      (line 674)
+* READLINE_MARK:                         Bash Variables.      (line 678)
+* READLINE_POINT:                        Bash Variables.      (line 684)
+* REPLY:                                 Bash Variables.      (line 688)
 * revert-all-at-newline:                 Readline Init File Syntax.
                                                               (line 325)
 * search-ignore-case:                    Readline Init File Syntax.
                                                               (line 332)
-* SECONDS:                               Bash Variables.      (line 682)
-* SHELL:                                 Bash Variables.      (line 691)
-* SHELLOPTS:                             Bash Variables.      (line 696)
-* SHLVL:                                 Bash Variables.      (line 705)
+* SECONDS:                               Bash Variables.      (line 691)
+* SHELL:                                 Bash Variables.      (line 700)
+* SHELLOPTS:                             Bash Variables.      (line 705)
+* SHLVL:                                 Bash Variables.      (line 714)
 * show-all-if-ambiguous:                 Readline Init File Syntax.
                                                               (line 337)
 * show-all-if-unmodified:                Readline Init File Syntax.
@@ -12589,15 +12598,15 @@ D.3 Parameter and Variable Index
                                                               (line 352)
 * skip-completed-text:                   Readline Init File Syntax.
                                                               (line 358)
-* SRANDOM:                               Bash Variables.      (line 710)
+* SRANDOM:                               Bash Variables.      (line 719)
 * TEXTDOMAIN:                            Creating Internationalized Scripts.
                                                               (line  51)
 * TEXTDOMAINDIR:                         Creating Internationalized Scripts.
                                                               (line  51)
-* TIMEFORMAT:                            Bash Variables.      (line 719)
-* TMOUT:                                 Bash Variables.      (line 757)
-* TMPDIR:                                Bash Variables.      (line 769)
-* UID:                                   Bash Variables.      (line 773)
+* TIMEFORMAT:                            Bash Variables.      (line 728)
+* TMOUT:                                 Bash Variables.      (line 766)
+* TMPDIR:                                Bash Variables.      (line 778)
+* UID:                                   Bash Variables.      (line 782)
 * vi-cmd-mode-string:                    Readline Init File Syntax.
                                                               (line 371)
 * vi-ins-mode-string:                    Readline Init File Syntax.
@@ -13050,77 +13059,77 @@ Node: Special Builtins\7f234437
 Node: Shell Variables\7f235426
 Node: Bourne Shell Variables\7f235860
 Node: Bash Variables\7f238053
-Node: Bash Features\7f274670
-Node: Invoking Bash\7f275684
-Node: Bash Startup Files\7f282083
-Node: Interactive Shells\7f287395
-Node: What is an Interactive Shell?\7f287803
-Node: Is this Shell Interactive?\7f288469
-Node: Interactive Shell Behavior\7f289293
-Node: Bash Conditional Expressions\7f293047
-Node: Shell Arithmetic\7f298221
-Node: Aliases\7f301303
-Node: Arrays\7f304258
-Node: The Directory Stack\7f311057
-Node: Directory Stack Builtins\7f311854
-Node: Controlling the Prompt\7f316303
-Node: The Restricted Shell\7f319441
-Node: Bash POSIX Mode\7f322228
-Node: Shell Compatibility Mode\7f339739
-Node: Job Control\7f348758
-Node: Job Control Basics\7f349215
-Node: Job Control Builtins\7f354389
-Node: Job Control Variables\7f360349
-Node: Command Line Editing\7f361526
-Node: Introduction and Notation\7f363230
-Node: Readline Interaction\7f364874
-Node: Readline Bare Essentials\7f366062
-Node: Readline Movement Commands\7f367880
-Node: Readline Killing Commands\7f368877
-Node: Readline Arguments\7f370855
-Node: Searching\7f371912
-Node: Readline Init File\7f374141
-Node: Readline Init File Syntax\7f375423
-Node: Conditional Init Constructs\7f400361
-Node: Sample Init File\7f404726
-Node: Bindable Readline Commands\7f407847
-Node: Commands For Moving\7f409072
-Node: Commands For History\7f411299
-Node: Commands For Text\7f416504
-Node: Commands For Killing\7f420638
-Node: Numeric Arguments\7f423439
-Node: Commands For Completion\7f424591
-Node: Keyboard Macros\7f428907
-Node: Miscellaneous Commands\7f429608
-Node: Readline vi Mode\7f436262
-Node: Programmable Completion\7f437214
-Node: Programmable Completion Builtins\7f445171
-Node: A Programmable Completion Example\7f456737
-Node: Using History Interactively\7f462082
-Node: Bash History Facilities\7f462763
-Node: Bash History Builtins\7f465875
-Node: History Interaction\7f471118
-Node: Event Designators\7f475443
-Node: Word Designators\7f477026
-Node: Modifiers\7f479012
-Node: Installing Bash\7f480921
-Node: Basic Installation\7f482055
-Node: Compilers and Options\7f485934
-Node: Compiling For Multiple Architectures\7f486684
-Node: Installation Names\7f488433
-Node: Specifying the System Type\7f490667
-Node: Sharing Defaults\7f491413
-Node: Operation Controls\7f492127
-Node: Optional Features\7f493146
-Node: Reporting Bugs\7f504948
-Node: Major Differences From The Bourne Shell\7f506297
-Node: GNU Free Documentation License\7f526032
-Node: Indexes\7f551209
-Node: Builtin Index\7f551660
-Node: Reserved Word Index\7f558758
-Node: Variable Index\7f561203
-Node: Function Index\7f578334
-Node: Concept Index\7f592190
+Node: Bash Features\7f275218
+Node: Invoking Bash\7f276232
+Node: Bash Startup Files\7f282631
+Node: Interactive Shells\7f287943
+Node: What is an Interactive Shell?\7f288351
+Node: Is this Shell Interactive?\7f289017
+Node: Interactive Shell Behavior\7f289841
+Node: Bash Conditional Expressions\7f293595
+Node: Shell Arithmetic\7f298769
+Node: Aliases\7f301851
+Node: Arrays\7f304806
+Node: The Directory Stack\7f311605
+Node: Directory Stack Builtins\7f312402
+Node: Controlling the Prompt\7f316851
+Node: The Restricted Shell\7f319989
+Node: Bash POSIX Mode\7f322776
+Node: Shell Compatibility Mode\7f340287
+Node: Job Control\7f349306
+Node: Job Control Basics\7f349763
+Node: Job Control Builtins\7f354937
+Node: Job Control Variables\7f360897
+Node: Command Line Editing\7f362074
+Node: Introduction and Notation\7f363778
+Node: Readline Interaction\7f365422
+Node: Readline Bare Essentials\7f366610
+Node: Readline Movement Commands\7f368428
+Node: Readline Killing Commands\7f369425
+Node: Readline Arguments\7f371403
+Node: Searching\7f372460
+Node: Readline Init File\7f374689
+Node: Readline Init File Syntax\7f375971
+Node: Conditional Init Constructs\7f400909
+Node: Sample Init File\7f405274
+Node: Bindable Readline Commands\7f408395
+Node: Commands For Moving\7f409620
+Node: Commands For History\7f411847
+Node: Commands For Text\7f417052
+Node: Commands For Killing\7f421186
+Node: Numeric Arguments\7f423987
+Node: Commands For Completion\7f425139
+Node: Keyboard Macros\7f429455
+Node: Miscellaneous Commands\7f430156
+Node: Readline vi Mode\7f436810
+Node: Programmable Completion\7f437762
+Node: Programmable Completion Builtins\7f445719
+Node: A Programmable Completion Example\7f457285
+Node: Using History Interactively\7f462630
+Node: Bash History Facilities\7f463311
+Node: Bash History Builtins\7f466423
+Node: History Interaction\7f471666
+Node: Event Designators\7f475991
+Node: Word Designators\7f477574
+Node: Modifiers\7f479560
+Node: Installing Bash\7f481469
+Node: Basic Installation\7f482603
+Node: Compilers and Options\7f486482
+Node: Compiling For Multiple Architectures\7f487232
+Node: Installation Names\7f488981
+Node: Specifying the System Type\7f491215
+Node: Sharing Defaults\7f491961
+Node: Operation Controls\7f492675
+Node: Optional Features\7f493694
+Node: Reporting Bugs\7f505496
+Node: Major Differences From The Bourne Shell\7f506845
+Node: GNU Free Documentation License\7f526580
+Node: Indexes\7f551757
+Node: Builtin Index\7f552208
+Node: Reserved Word Index\7f559306
+Node: Variable Index\7f561751
+Node: Function Index\7f578882
+Node: Concept Index\7f592738
 \1f
 End Tag Table
 
index 9b8c80c2b9d3fde71a33afa4b06cb572061f9930..4848eb464c52fd9391c2139bfcb36f9438e37e4f 100644 (file)
Binary files a/doc/bash.pdf and b/doc/bash.pdf differ
index c58af6313508c7be321cf20849f820073652d807..3a8aee60decb9fefb7fae6b4c563811441dc0c44 100644 (file)
 @xrdef{The Set Builtin-pg}{69}
 @xrdef{The Shopt Builtin-title}{The Shopt Builtin}
 @xrdef{The Shopt Builtin-snt}{Section@tie 4.3.2}
-@xrdef{The Shopt Builtin-pg}{73}
+@xrdef{The Shopt Builtin-pg}{74}
 @xrdef{Special Builtins-title}{Special Builtins}
 @xrdef{Special Builtins-snt}{Section@tie 4.4}
 @xrdef{Special Builtins-pg}{80}
 @xrdef{Commands For Killing-pg}{143}
 @xrdef{Numeric Arguments-title}{Specifying Numeric Arguments}
 @xrdef{Numeric Arguments-snt}{Section@tie 8.4.5}
-@xrdef{Numeric Arguments-pg}{144}
 @xrdef{Commands For Completion-title}{Letting Readline Type For You}
 @xrdef{Commands For Completion-snt}{Section@tie 8.4.6}
+@xrdef{Numeric Arguments-pg}{145}
 @xrdef{Commands For Completion-pg}{145}
 @xrdef{Keyboard Macros-title}{Keyboard Macros}
 @xrdef{Keyboard Macros-snt}{Section@tie 8.4.7}
-@xrdef{Keyboard Macros-pg}{146}
 @xrdef{Miscellaneous Commands-title}{Some Miscellaneous Commands}
 @xrdef{Miscellaneous Commands-snt}{Section@tie 8.4.8}
+@xrdef{Keyboard Macros-pg}{147}
 @xrdef{Miscellaneous Commands-pg}{147}
 @xrdef{Readline vi Mode-title}{Readline vi Mode}
 @xrdef{Readline vi Mode-snt}{Section@tie 8.5}
+@xrdef{Readline vi Mode-pg}{149}
 @xrdef{Programmable Completion-title}{Programmable Completion}
 @xrdef{Programmable Completion-snt}{Section@tie 8.6}
-@xrdef{Readline vi Mode-pg}{149}
 @xrdef{Programmable Completion-pg}{150}
 @xrdef{Programmable Completion Builtins-title}{Programmable Completion Builtins}
 @xrdef{Programmable Completion Builtins-snt}{Section@tie 8.7}
index f2ed060ec778c465b93369793999271f22acbf9d..c1380fc3de02067e773dcf3784e572c83c85e314 100644 (file)
@@ -3,14 +3,14 @@
 \entry{break}{50}{\code {break}}
 \entry{cd}{50}{\code {cd}}
 \entry{continue}{50}{\code {continue}}
-\entry{eval}{50}{\code {eval}}
+\entry{eval}{51}{\code {eval}}
 \entry{exec}{51}{\code {exec}}
 \entry{exit}{51}{\code {exit}}
 \entry{export}{51}{\code {export}}
 \entry{false}{51}{\code {false}}
 \entry{getopts}{51}{\code {getopts}}
 \entry{hash}{52}{\code {hash}}
-\entry{pwd}{52}{\code {pwd}}
+\entry{pwd}{53}{\code {pwd}}
 \entry{readonly}{53}{\code {readonly}}
 \entry{return}{53}{\code {return}}
 \entry{shift}{53}{\code {shift}}
 \entry{readarray}{67}{\code {readarray}}
 \entry{source}{67}{\code {source}}
 \entry{type}{67}{\code {type}}
-\entry{typeset}{67}{\code {typeset}}
+\entry{typeset}{68}{\code {typeset}}
 \entry{ulimit}{68}{\code {ulimit}}
 \entry{unalias}{69}{\code {unalias}}
 \entry{set}{69}{\code {set}}
-\entry{shopt}{73}{\code {shopt}}
+\entry{shopt}{74}{\code {shopt}}
 \entry{dirs}{106}{\code {dirs}}
 \entry{popd}{106}{\code {popd}}
 \entry{pushd}{106}{\code {pushd}}
index 01960a36a81cfd58cbcca3d68ee5fb0ae072c707..a83c18ea3d8f65c640c8773f4382244bd53518f4 100644 (file)
@@ -26,7 +26,7 @@
 \initial {E}
 \entry{\code {echo}}{61}
 \entry{\code {enable}}{62}
-\entry{\code {eval}}{50}
+\entry{\code {eval}}{51}
 \entry{\code {exec}}{51}
 \entry{\code {exit}}{51}
 \entry{\code {export}}{51}
@@ -54,7 +54,7 @@
 \entry{\code {popd}}{106}
 \entry{\code {printf}}{64}
 \entry{\code {pushd}}{106}
-\entry{\code {pwd}}{52}
+\entry{\code {pwd}}{53}
 \initial {R}
 \entry{\code {read}}{65}
 \entry{\code {readarray}}{67}
@@ -63,7 +63,7 @@
 \initial {S}
 \entry{\code {set}}{69}
 \entry{\code {shift}}{53}
-\entry{\code {shopt}}{73}
+\entry{\code {shopt}}{74}
 \entry{\code {source}}{67}
 \entry{\code {suspend}}{121}
 \initial {T}
@@ -72,7 +72,7 @@
 \entry{\code {trap}}{55}
 \entry{\code {true}}{56}
 \entry{\code {type}}{67}
-\entry{\code {typeset}}{67}
+\entry{\code {typeset}}{68}
 \initial {U}
 \entry{\code {ulimit}}{68}
 \entry{\code {umask}}{56}
index 6f86579636e56bc7d06008a5c7544ac43e943d59..e4083d77086f433d70f9795980dd61fc1da919a1 100644 (file)
 \entry{forward-search-history (C-s)}{140}{\code {forward-search-history (C-s)}}
 \entry{non-incremental-reverse-search-history (M-p)}{140}{\code {non-incremental-reverse-search-history (M-p)}}
 \entry{non-incremental-forward-search-history (M-n)}{141}{\code {non-incremental-forward-search-history (M-n)}}
-\entry{history-search-forward ()}{141}{\code {history-search-forward ()}}
 \entry{history-search-backward ()}{141}{\code {history-search-backward ()}}
-\entry{history-substring-search-forward ()}{141}{\code {history-substring-search-forward ()}}
+\entry{history-search-forward ()}{141}{\code {history-search-forward ()}}
 \entry{history-substring-search-backward ()}{141}{\code {history-substring-search-backward ()}}
+\entry{history-substring-search-forward ()}{141}{\code {history-substring-search-forward ()}}
 \entry{yank-nth-arg (M-C-y)}{141}{\code {yank-nth-arg (M-C-y)}}
 \entry{yank-last-arg (M-. or M-_)}{141}{\code {yank-last-arg (M-. or M-_)}}
-\entry{operate-and-get-next (C-o)}{141}{\code {operate-and-get-next (C-o)}}
+\entry{operate-and-get-next (C-o)}{142}{\code {operate-and-get-next (C-o)}}
 \entry{fetch-history ()}{142}{\code {fetch-history ()}}
 \entry{end-of-file (usually C-d)}{142}{\code {\i {end-of-file} (usually C-d)}}
 \entry{delete-char (C-d)}{142}{\code {delete-char (C-d)}}
@@ -45,7 +45,7 @@
 \entry{kill-line (C-k)}{143}{\code {kill-line (C-k)}}
 \entry{backward-kill-line (C-x Rubout)}{143}{\code {backward-kill-line (C-x Rubout)}}
 \entry{unix-line-discard (C-u)}{143}{\code {unix-line-discard (C-u)}}
-\entry{kill-whole-line ()}{143}{\code {kill-whole-line ()}}
+\entry{kill-whole-line ()}{144}{\code {kill-whole-line ()}}
 \entry{kill-word (M-d)}{144}{\code {kill-word (M-d)}}
 \entry{backward-kill-word (M-DEL)}{144}{\code {backward-kill-word (M-\key {DEL})}}
 \entry{shell-kill-word (M-C-d)}{144}{\code {shell-kill-word (M-C-d)}}
 \entry{copy-forward-word ()}{144}{\code {copy-forward-word ()}}
 \entry{yank (C-y)}{144}{\code {yank (C-y)}}
 \entry{yank-pop (M-y)}{144}{\code {yank-pop (M-y)}}
-\entry{digit-argument (M-0, M-1, ...{} M--)}{144}{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}
+\entry{digit-argument (M-0, M-1, ...{} M--)}{145}{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}
 \entry{universal-argument ()}{145}{\code {universal-argument ()}}
 \entry{complete (TAB)}{145}{\code {complete (\key {TAB})}}
 \entry{possible-completions (M-?)}{145}{\code {possible-completions (M-?)}}
 \entry{insert-completions (M-*)}{145}{\code {insert-completions (M-*)}}
 \entry{menu-complete ()}{145}{\code {menu-complete ()}}
 \entry{menu-complete-backward ()}{145}{\code {menu-complete-backward ()}}
-\entry{delete-char-or-list ()}{145}{\code {delete-char-or-list ()}}
-\entry{complete-filename (M-/)}{145}{\code {complete-filename (M-/)}}
+\entry{delete-char-or-list ()}{146}{\code {delete-char-or-list ()}}
+\entry{complete-filename (M-/)}{146}{\code {complete-filename (M-/)}}
 \entry{possible-filename-completions (C-x /)}{146}{\code {possible-filename-completions (C-x /)}}
 \entry{complete-username (M-~)}{146}{\code {complete-username (M-~)}}
 \entry{possible-username-completions (C-x ~)}{146}{\code {possible-username-completions (C-x ~)}}
@@ -80,8 +80,8 @@
 \entry{dynamic-complete-history (M-TAB)}{146}{\code {dynamic-complete-history (M-\key {TAB})}}
 \entry{dabbrev-expand ()}{146}{\code {dabbrev-expand ()}}
 \entry{complete-into-braces (M-{\indexlbrace })}{146}{\code {complete-into-braces (M-{\tt \char 123})}}
-\entry{start-kbd-macro (C-x ()}{146}{\code {start-kbd-macro (C-x ()}}
-\entry{end-kbd-macro (C-x ))}{146}{\code {end-kbd-macro (C-x ))}}
+\entry{start-kbd-macro (C-x ()}{147}{\code {start-kbd-macro (C-x ()}}
+\entry{end-kbd-macro (C-x ))}{147}{\code {end-kbd-macro (C-x ))}}
 \entry{call-last-kbd-macro (C-x e)}{147}{\code {call-last-kbd-macro (C-x e)}}
 \entry{print-last-kbd-macro ()}{147}{\code {print-last-kbd-macro ()}}
 \entry{re-read-init-file (C-x C-r)}{147}{\code {re-read-init-file (C-x C-r)}}
 \entry{set-mark (C-@)}{147}{\code {set-mark (C-@)}}
 \entry{exchange-point-and-mark (C-x C-x)}{147}{\code {exchange-point-and-mark (C-x C-x)}}
 \entry{character-search (C-])}{147}{\code {character-search (C-])}}
-\entry{character-search-backward (M-C-])}{147}{\code {character-search-backward (M-C-])}}
-\entry{skip-csi-sequence ()}{147}{\code {skip-csi-sequence ()}}
+\entry{character-search-backward (M-C-])}{148}{\code {character-search-backward (M-C-])}}
+\entry{skip-csi-sequence ()}{148}{\code {skip-csi-sequence ()}}
 \entry{insert-comment (M-#)}{148}{\code {insert-comment (M-#)}}
 \entry{dump-functions ()}{148}{\code {dump-functions ()}}
 \entry{dump-variables ()}{148}{\code {dump-variables ()}}
 \entry{dump-macros ()}{148}{\code {dump-macros ()}}
 \entry{spell-correct-word (C-x s)}{148}{\code {spell-correct-word (C-x s)}}
 \entry{glob-complete-word (M-g)}{148}{\code {glob-complete-word (M-g)}}
-\entry{glob-expand-word (C-x *)}{148}{\code {glob-expand-word (C-x *)}}
-\entry{glob-list-expansions (C-x g)}{148}{\code {glob-list-expansions (C-x g)}}
+\entry{glob-expand-word (C-x *)}{149}{\code {glob-expand-word (C-x *)}}
+\entry{glob-list-expansions (C-x g)}{149}{\code {glob-list-expansions (C-x g)}}
 \entry{display-shell-version (C-x C-v)}{149}{\code {display-shell-version (C-x C-v)}}
 \entry{shell-expand-line (M-C-e)}{149}{\code {shell-expand-line (M-C-e)}}
 \entry{history-expand-line (M-^)}{149}{\code {history-expand-line (M-^)}}
index 608e849212a09f14db8974c4beaf9f7b7cfaf2a9..d32b42a7574e6a3591d69548dd181db6de1cf36f 100644 (file)
 \entry{\code {call-last-kbd-macro (C-x e)}}{147}
 \entry{\code {capitalize-word (M-c)}}{143}
 \entry{\code {character-search (C-])}}{147}
-\entry{\code {character-search-backward (M-C-])}}{147}
+\entry{\code {character-search-backward (M-C-])}}{148}
 \entry{\code {clear-display (M-C-l)}}{140}
 \entry{\code {clear-screen (C-l)}}{140}
 \entry{\code {complete (\key {TAB})}}{145}
 \entry{\code {complete-command (M-!)}}{146}
-\entry{\code {complete-filename (M-/)}}{145}
+\entry{\code {complete-filename (M-/)}}{146}
 \entry{\code {complete-hostname (M-@)}}{146}
 \entry{\code {complete-into-braces (M-{\tt \char 123})}}{146}
 \entry{\code {complete-username (M-~)}}{146}
@@ -31,9 +31,9 @@
 \initial {D}
 \entry{\code {dabbrev-expand ()}}{146}
 \entry{\code {delete-char (C-d)}}{142}
-\entry{\code {delete-char-or-list ()}}{145}
+\entry{\code {delete-char-or-list ()}}{146}
 \entry{\code {delete-horizontal-space ()}}{144}
-\entry{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}{144}
+\entry{\code {digit-argument (\kbd {M-0}, \kbd {M-1}, \dots {} \kbd {M--})}}{145}
 \entry{\code {display-shell-version (C-x C-v)}}{149}
 \entry{\code {do-lowercase-version (M-A, M-B, M-\var {x}, \dots {})}}{147}
 \entry{\code {downcase-word (M-l)}}{143}
@@ -43,7 +43,7 @@
 \entry{\code {dynamic-complete-history (M-\key {TAB})}}{146}
 \initial {E}
 \entry{\code {edit-and-execute-command (C-x C-e)}}{149}
-\entry{\code {end-kbd-macro (C-x ))}}{146}
+\entry{\code {end-kbd-macro (C-x ))}}{147}
 \entry{\code {\i {end-of-file} (usually C-d)}}{142}
 \entry{\code {end-of-history (M->)}}{140}
 \entry{\code {end-of-line (C-e)}}{139}
@@ -57,8 +57,8 @@
 \entry{\code {forward-word (M-f)}}{139}
 \initial {G}
 \entry{\code {glob-complete-word (M-g)}}{148}
-\entry{\code {glob-expand-word (C-x *)}}{148}
-\entry{\code {glob-list-expansions (C-x g)}}{148}
+\entry{\code {glob-expand-word (C-x *)}}{149}
+\entry{\code {glob-list-expansions (C-x g)}}{149}
 \initial {H}
 \entry{\code {history-and-alias-expand-line ()}}{149}
 \entry{\code {history-expand-line (M-^)}}{149}
@@ -73,7 +73,7 @@
 \initial {K}
 \entry{\code {kill-line (C-k)}}{143}
 \entry{\code {kill-region ()}}{144}
-\entry{\code {kill-whole-line ()}}{143}
+\entry{\code {kill-whole-line ()}}{144}
 \entry{\code {kill-word (M-d)}}{144}
 \initial {M}
 \entry{\code {magic-space ()}}{149}
@@ -85,7 +85,7 @@
 \entry{\code {non-incremental-forward-search-history (M-n)}}{141}
 \entry{\code {non-incremental-reverse-search-history (M-p)}}{140}
 \initial {O}
-\entry{\code {operate-and-get-next (C-o)}}{141}
+\entry{\code {operate-and-get-next (C-o)}}{142}
 \entry{\code {overwrite-mode ()}}{143}
 \initial {P}
 \entry{\code {possible-command-completions (C-x !)}}{146}
 \entry{\code {shell-forward-word (M-C-f)}}{139}
 \entry{\code {shell-kill-word (M-C-d)}}{144}
 \entry{\code {shell-transpose-words (M-C-t)}}{143}
-\entry{\code {skip-csi-sequence ()}}{147}
+\entry{\code {skip-csi-sequence ()}}{148}
 \entry{\code {spell-correct-word (C-x s)}}{148}
-\entry{\code {start-kbd-macro (C-x ()}}{146}
+\entry{\code {start-kbd-macro (C-x ()}}{147}
 \initial {T}
 \entry{\code {tilde-expand (M-&)}}{147}
 \entry{\code {transpose-chars (C-t)}}{142}
index fac093c7b7a180363059779e871988768a19707d..0bafcd38418cc894d951960b65d105c938971f9a 100644 (file)
@@ -5724,14 +5724,23 @@ Variables::).
      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.
+     The valid sort specifiers are â€˜name’, â€˜numeric’, â€˜size’, â€˜mtime’,
+     â€˜atime’, â€˜ctime’, and â€˜blocks’, which sort the files on name, names
+     in numeric rather than lexicographic order, file size, modification
+     time, access time, inode change time, and number of blocks,
+     respectively.  If any of the non-name keys compare as equal (e.g.,
+     if two files are the same size), sorting uses the name as a
+     secondary sort key.
 
      For example, a value of â€˜-mtime’ sorts the results in descending
      order by modification time (newest first).
 
+     The â€˜numeric’ specifier treats names consisting solely of digits as
+     numbers and sorts them using the numeric value (so "2" will sort
+     before "10", for example).  When using â€˜numeric’, names containing
+     non-digits sort after all the all-digit names and are sorted by
+     name using the traditional behavior.
+
      A sort specifier of â€˜nosort’ disables sorting completely; the
      results are returned in the order they are read from the file
      system, and any leading â€˜-’ is ignored.
@@ -12481,57 +12490,57 @@ D.3 Parameter and Variable Index
 * FUNCNEST:                              Bash Variables.      (line 361)
 * GLOBIGNORE:                            Bash Variables.      (line 366)
 * GLOBSORT:                              Bash Variables.      (line 373)
-* GROUPS:                                Bash Variables.      (line 399)
-* histchars:                             Bash Variables.      (line 405)
-* HISTCMD:                               Bash Variables.      (line 420)
-* HISTCONTROL:                           Bash Variables.      (line 426)
-* HISTFILE:                              Bash Variables.      (line 442)
-* HISTFILESIZE:                          Bash Variables.      (line 447)
-* HISTIGNORE:                            Bash Variables.      (line 458)
+* GROUPS:                                Bash Variables.      (line 408)
+* histchars:                             Bash Variables.      (line 414)
+* HISTCMD:                               Bash Variables.      (line 429)
+* HISTCONTROL:                           Bash Variables.      (line 435)
+* HISTFILE:                              Bash Variables.      (line 451)
+* HISTFILESIZE:                          Bash Variables.      (line 456)
+* HISTIGNORE:                            Bash Variables.      (line 467)
 * history-preserve-point:                Readline Init File Syntax.
                                                               (line 214)
 * history-size:                          Readline Init File Syntax.
                                                               (line 220)
-* HISTSIZE:                              Bash Variables.      (line 480)
-* HISTTIMEFORMAT:                        Bash Variables.      (line 487)
+* HISTSIZE:                              Bash Variables.      (line 489)
+* HISTTIMEFORMAT:                        Bash Variables.      (line 496)
 * HOME:                                  Bourne Shell Variables.
                                                               (line  13)
 * horizontal-scroll-mode:                Readline Init File Syntax.
                                                               (line 229)
-* HOSTFILE:                              Bash Variables.      (line 496)
-* HOSTNAME:                              Bash Variables.      (line 507)
-* HOSTTYPE:                              Bash Variables.      (line 510)
+* HOSTFILE:                              Bash Variables.      (line 505)
+* HOSTNAME:                              Bash Variables.      (line 516)
+* HOSTTYPE:                              Bash Variables.      (line 519)
 * IFS:                                   Bourne Shell Variables.
                                                               (line  18)
-* IGNOREEOF:                             Bash Variables.      (line 513)
+* IGNOREEOF:                             Bash Variables.      (line 522)
 * input-meta:                            Readline Init File Syntax.
                                                               (line 238)
-* INPUTRC:                               Bash Variables.      (line 523)
-* INSIDE_EMACS:                          Bash Variables.      (line 527)
+* INPUTRC:                               Bash Variables.      (line 532)
+* INSIDE_EMACS:                          Bash Variables.      (line 536)
 * isearch-terminators:                   Readline Init File Syntax.
                                                               (line 248)
 * keymap:                                Readline Init File Syntax.
                                                               (line 255)
 * LANG:                                  Creating Internationalized Scripts.
                                                               (line  51)
-* LANG <1>:                              Bash Variables.      (line 533)
-* LC_ALL:                                Bash Variables.      (line 537)
-* LC_COLLATE:                            Bash Variables.      (line 541)
-* LC_CTYPE:                              Bash Variables.      (line 548)
+* LANG <1>:                              Bash Variables.      (line 542)
+* LC_ALL:                                Bash Variables.      (line 546)
+* LC_COLLATE:                            Bash Variables.      (line 550)
+* LC_CTYPE:                              Bash Variables.      (line 557)
 * LC_MESSAGES:                           Creating Internationalized Scripts.
                                                               (line  51)
-* LC_MESSAGES <1>:                       Bash Variables.      (line 553)
-* LC_NUMERIC:                            Bash Variables.      (line 557)
-* LC_TIME:                               Bash Variables.      (line 561)
-* LINENO:                                Bash Variables.      (line 565)
-* LINES:                                 Bash Variables.      (line 570)
-* MACHTYPE:                              Bash Variables.      (line 576)
+* LC_MESSAGES <1>:                       Bash Variables.      (line 562)
+* LC_NUMERIC:                            Bash Variables.      (line 566)
+* LC_TIME:                               Bash Variables.      (line 570)
+* LINENO:                                Bash Variables.      (line 574)
+* LINES:                                 Bash Variables.      (line 579)
+* MACHTYPE:                              Bash Variables.      (line 585)
 * MAIL:                                  Bourne Shell Variables.
                                                               (line  22)
-* MAILCHECK:                             Bash Variables.      (line 580)
+* MAILCHECK:                             Bash Variables.      (line 589)
 * MAILPATH:                              Bourne Shell Variables.
                                                               (line  27)
-* MAPFILE:                               Bash Variables.      (line 588)
+* MAPFILE:                               Bash Variables.      (line 597)
 * mark-modified-lines:                   Readline Init File Syntax.
                                                               (line 285)
 * mark-symlinked-directories:            Readline Init File Syntax.
@@ -12542,46 +12551,46 @@ D.3 Parameter and Variable Index
                                                               (line 302)
 * meta-flag:                             Readline Init File Syntax.
                                                               (line 238)
-* OLDPWD:                                Bash Variables.      (line 592)
+* OLDPWD:                                Bash Variables.      (line 601)
 * OPTARG:                                Bourne Shell Variables.
                                                               (line  34)
-* OPTERR:                                Bash Variables.      (line 595)
+* OPTERR:                                Bash Variables.      (line 604)
 * OPTIND:                                Bourne Shell Variables.
                                                               (line  38)
-* OSTYPE:                                Bash Variables.      (line 599)
+* OSTYPE:                                Bash Variables.      (line 608)
 * output-meta:                           Readline Init File Syntax.
                                                               (line 307)
 * page-completions:                      Readline Init File Syntax.
                                                               (line 315)
 * PATH:                                  Bourne Shell Variables.
                                                               (line  42)
-* PIPESTATUS:                            Bash Variables.      (line 602)
-* POSIXLY_CORRECT:                       Bash Variables.      (line 608)
-* PPID:                                  Bash Variables.      (line 618)
-* PROMPT_COMMAND:                        Bash Variables.      (line 622)
-* PROMPT_DIRTRIM:                        Bash Variables.      (line 628)
-* PS0:                                   Bash Variables.      (line 634)
+* PIPESTATUS:                            Bash Variables.      (line 611)
+* POSIXLY_CORRECT:                       Bash Variables.      (line 617)
+* PPID:                                  Bash Variables.      (line 627)
+* PROMPT_COMMAND:                        Bash Variables.      (line 631)
+* PROMPT_DIRTRIM:                        Bash Variables.      (line 637)
+* PS0:                                   Bash Variables.      (line 643)
 * PS1:                                   Bourne Shell Variables.
                                                               (line  48)
 * PS2:                                   Bourne Shell Variables.
                                                               (line  53)
-* PS3:                                   Bash Variables.      (line 639)
-* PS4:                                   Bash Variables.      (line 644)
-* PWD:                                   Bash Variables.      (line 652)
-* RANDOM:                                Bash Variables.      (line 655)
-* READLINE_ARGUMENT:                     Bash Variables.      (line 661)
-* READLINE_LINE:                         Bash Variables.      (line 665)
-* READLINE_MARK:                         Bash Variables.      (line 669)
-* READLINE_POINT:                        Bash Variables.      (line 675)
-* REPLY:                                 Bash Variables.      (line 679)
+* PS3:                                   Bash Variables.      (line 648)
+* PS4:                                   Bash Variables.      (line 653)
+* PWD:                                   Bash Variables.      (line 661)
+* RANDOM:                                Bash Variables.      (line 664)
+* READLINE_ARGUMENT:                     Bash Variables.      (line 670)
+* READLINE_LINE:                         Bash Variables.      (line 674)
+* READLINE_MARK:                         Bash Variables.      (line 678)
+* READLINE_POINT:                        Bash Variables.      (line 684)
+* REPLY:                                 Bash Variables.      (line 688)
 * revert-all-at-newline:                 Readline Init File Syntax.
                                                               (line 325)
 * search-ignore-case:                    Readline Init File Syntax.
                                                               (line 332)
-* SECONDS:                               Bash Variables.      (line 682)
-* SHELL:                                 Bash Variables.      (line 691)
-* SHELLOPTS:                             Bash Variables.      (line 696)
-* SHLVL:                                 Bash Variables.      (line 705)
+* SECONDS:                               Bash Variables.      (line 691)
+* SHELL:                                 Bash Variables.      (line 700)
+* SHELLOPTS:                             Bash Variables.      (line 705)
+* SHLVL:                                 Bash Variables.      (line 714)
 * show-all-if-ambiguous:                 Readline Init File Syntax.
                                                               (line 337)
 * show-all-if-unmodified:                Readline Init File Syntax.
@@ -12590,15 +12599,15 @@ D.3 Parameter and Variable Index
                                                               (line 352)
 * skip-completed-text:                   Readline Init File Syntax.
                                                               (line 358)
-* SRANDOM:                               Bash Variables.      (line 710)
+* SRANDOM:                               Bash Variables.      (line 719)
 * TEXTDOMAIN:                            Creating Internationalized Scripts.
                                                               (line  51)
 * TEXTDOMAINDIR:                         Creating Internationalized Scripts.
                                                               (line  51)
-* TIMEFORMAT:                            Bash Variables.      (line 719)
-* TMOUT:                                 Bash Variables.      (line 757)
-* TMPDIR:                                Bash Variables.      (line 769)
-* UID:                                   Bash Variables.      (line 773)
+* TIMEFORMAT:                            Bash Variables.      (line 728)
+* TMOUT:                                 Bash Variables.      (line 766)
+* TMPDIR:                                Bash Variables.      (line 778)
+* UID:                                   Bash Variables.      (line 782)
 * vi-cmd-mode-string:                    Readline Init File Syntax.
                                                               (line 371)
 * vi-ins-mode-string:                    Readline Init File Syntax.
@@ -13051,77 +13060,77 @@ Node: Special Builtins\7f234611
 Node: Shell Variables\7f235603
 Node: Bourne Shell Variables\7f236040
 Node: Bash Variables\7f238236
-Node: Bash Features\7f274856
-Node: Invoking Bash\7f275873
-Node: Bash Startup Files\7f282275
-Node: Interactive Shells\7f287590
-Node: What is an Interactive Shell?\7f288001
-Node: Is this Shell Interactive?\7f288670
-Node: Interactive Shell Behavior\7f289497
-Node: Bash Conditional Expressions\7f293254
-Node: Shell Arithmetic\7f298431
-Node: Aliases\7f301516
-Node: Arrays\7f304474
-Node: The Directory Stack\7f311276
-Node: Directory Stack Builtins\7f312076
-Node: Controlling the Prompt\7f316528
-Node: The Restricted Shell\7f319669
-Node: Bash POSIX Mode\7f322459
-Node: Shell Compatibility Mode\7f339973
-Node: Job Control\7f348995
-Node: Job Control Basics\7f349455
-Node: Job Control Builtins\7f354632
-Node: Job Control Variables\7f360595
-Node: Command Line Editing\7f361775
-Node: Introduction and Notation\7f363482
-Node: Readline Interaction\7f365129
-Node: Readline Bare Essentials\7f366320
-Node: Readline Movement Commands\7f368141
-Node: Readline Killing Commands\7f369141
-Node: Readline Arguments\7f371122
-Node: Searching\7f372182
-Node: Readline Init File\7f374414
-Node: Readline Init File Syntax\7f375699
-Node: Conditional Init Constructs\7f400640
-Node: Sample Init File\7f405008
-Node: Bindable Readline Commands\7f408132
-Node: Commands For Moving\7f409360
-Node: Commands For History\7f411590
-Node: Commands For Text\7f416798
-Node: Commands For Killing\7f420935
-Node: Numeric Arguments\7f423739
-Node: Commands For Completion\7f424894
-Node: Keyboard Macros\7f429213
-Node: Miscellaneous Commands\7f429917
-Node: Readline vi Mode\7f436574
-Node: Programmable Completion\7f437529
-Node: Programmable Completion Builtins\7f445489
-Node: A Programmable Completion Example\7f457058
-Node: Using History Interactively\7f462406
-Node: Bash History Facilities\7f463090
-Node: Bash History Builtins\7f466205
-Node: History Interaction\7f471451
-Node: Event Designators\7f475779
-Node: Word Designators\7f477365
-Node: Modifiers\7f479354
-Node: Installing Bash\7f481266
-Node: Basic Installation\7f482403
-Node: Compilers and Options\7f486285
-Node: Compiling For Multiple Architectures\7f487038
-Node: Installation Names\7f488790
-Node: Specifying the System Type\7f491027
-Node: Sharing Defaults\7f491776
-Node: Operation Controls\7f492493
-Node: Optional Features\7f493515
-Node: Reporting Bugs\7f505320
-Node: Major Differences From The Bourne Shell\7f506672
-Node: GNU Free Documentation License\7f526410
-Node: Indexes\7f551590
-Node: Builtin Index\7f552044
-Node: Reserved Word Index\7f559145
-Node: Variable Index\7f561593
-Node: Function Index\7f578727
-Node: Concept Index\7f592586
+Node: Bash Features\7f275404
+Node: Invoking Bash\7f276421
+Node: Bash Startup Files\7f282823
+Node: Interactive Shells\7f288138
+Node: What is an Interactive Shell?\7f288549
+Node: Is this Shell Interactive?\7f289218
+Node: Interactive Shell Behavior\7f290045
+Node: Bash Conditional Expressions\7f293802
+Node: Shell Arithmetic\7f298979
+Node: Aliases\7f302064
+Node: Arrays\7f305022
+Node: The Directory Stack\7f311824
+Node: Directory Stack Builtins\7f312624
+Node: Controlling the Prompt\7f317076
+Node: The Restricted Shell\7f320217
+Node: Bash POSIX Mode\7f323007
+Node: Shell Compatibility Mode\7f340521
+Node: Job Control\7f349543
+Node: Job Control Basics\7f350003
+Node: Job Control Builtins\7f355180
+Node: Job Control Variables\7f361143
+Node: Command Line Editing\7f362323
+Node: Introduction and Notation\7f364030
+Node: Readline Interaction\7f365677
+Node: Readline Bare Essentials\7f366868
+Node: Readline Movement Commands\7f368689
+Node: Readline Killing Commands\7f369689
+Node: Readline Arguments\7f371670
+Node: Searching\7f372730
+Node: Readline Init File\7f374962
+Node: Readline Init File Syntax\7f376247
+Node: Conditional Init Constructs\7f401188
+Node: Sample Init File\7f405556
+Node: Bindable Readline Commands\7f408680
+Node: Commands For Moving\7f409908
+Node: Commands For History\7f412138
+Node: Commands For Text\7f417346
+Node: Commands For Killing\7f421483
+Node: Numeric Arguments\7f424287
+Node: Commands For Completion\7f425442
+Node: Keyboard Macros\7f429761
+Node: Miscellaneous Commands\7f430465
+Node: Readline vi Mode\7f437122
+Node: Programmable Completion\7f438077
+Node: Programmable Completion Builtins\7f446037
+Node: A Programmable Completion Example\7f457606
+Node: Using History Interactively\7f462954
+Node: Bash History Facilities\7f463638
+Node: Bash History Builtins\7f466753
+Node: History Interaction\7f471999
+Node: Event Designators\7f476327
+Node: Word Designators\7f477913
+Node: Modifiers\7f479902
+Node: Installing Bash\7f481814
+Node: Basic Installation\7f482951
+Node: Compilers and Options\7f486833
+Node: Compiling For Multiple Architectures\7f487586
+Node: Installation Names\7f489338
+Node: Specifying the System Type\7f491575
+Node: Sharing Defaults\7f492324
+Node: Operation Controls\7f493041
+Node: Optional Features\7f494063
+Node: Reporting Bugs\7f505868
+Node: Major Differences From The Bourne Shell\7f507220
+Node: GNU Free Documentation License\7f526958
+Node: Indexes\7f552138
+Node: Builtin Index\7f552592
+Node: Reserved Word Index\7f559693
+Node: Variable Index\7f562141
+Node: Function Index\7f579275
+Node: Concept Index\7f593134
 \1f
 End Tag Table
 
index 9c500d332e436ca8140f8a14531a41f597cbc900..1167104994af2fde39e42d577f7f590433626c51 100644 (file)
@@ -1,11 +1,12 @@
-This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024/MacPorts 2024.70613_0) (preloaded format=pdfetex 2024.4.9)  23 APR 2024 17:29
+This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/MacPorts 2023.66589_3) (preloaded format=pdfetex 2024.1.2)  12 JUN 2024 15:53
 entering extended mode
  restricted \write18 enabled.
  file:line:error style messages enabled.
  %&-line parsing enabled.
-**\input /usr/local/src/bash/bash-20240422/doc/bashref.texi
-(/usr/local/src/bash/bash-20240422/doc/bashref.texi
-(/usr/local/src/bash/bash-20240422/doc/texinfo.tex
+**\input /usr/local/src/bash/bash-20240609/doc/bashref.texi \input /usr/local/s
+rc/bash/bash-20240609/doc/bashref.texi
+(/usr/local/src/bash/bash-20240609/doc/bashref.texi
+(/usr/local/src/bash/bash-20240609/doc/texinfo.tex
 Loading texinfo [version 2015-11-22.14]:
 \outerhsize=\dimen16
 \outervsize=\dimen17
@@ -161,15 +162,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011>
 texinfo.tex: doing @include of version.texi
 
 
-(/usr/local/src/bash/bash-20240422/doc/version.texi) [1{/opt/local/var/db/texmf
+(/usr/local/src/bash/bash-20240609/doc/version.texi) [1{/opt/local/var/db/texmf
 /fonts/map/pdftex/updmap/pdftex.map}] [2]
-(/usr/local/build/bash/bash-20240422/doc/bashref.toc [-1] [-2] [-3]) [-4]
-(/usr/local/build/bash/bash-20240422/doc/bashref.toc)
-(/usr/local/build/bash/bash-20240422/doc/bashref.toc) Chapter 1
+(/usr/local/build/bash/bash-20240609/doc/bashref.toc [-1] [-2] [-3]) [-4]
+(/usr/local/build/bash/bash-20240609/doc/bashref.toc)
+(/usr/local/build/bash/bash-20240609/doc/bashref.toc) Chapter 1
 \openout0 = `bashref.toc'.
 
 
-(/usr/local/build/bash/bash-20240422/doc/bashref.aux)
+(/usr/local/build/bash/bash-20240609/doc/bashref.aux)
 \openout1 = `bashref.aux'.
 
  Chapter 2 [1] [2]
@@ -230,7 +231,7 @@ live/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [20] [21] [22] [23] [24]
  [49] [50] [51] [52]
 [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67]
 [68]
-Overfull \hbox (38.26585pt too wide) in paragraph at lines 5441--5441
+Overfull \hbox (38.26585pt too wide) in paragraph at lines 5446--5446
  []@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
 -] [@textttsl ar-gu-ment []@texttt ][] 
 
@@ -243,7 +244,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5441--5441
 .etc.
 
 
-Overfull \hbox (38.26585pt too wide) in paragraph at lines 5442--5442
+Overfull \hbox (38.26585pt too wide) in paragraph at lines 5447--5447
  []@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
 -] [@textttsl ar-gu-ment []@texttt ][] 
 
@@ -262,7 +263,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5442--5442
 [119] [120]
 texinfo.tex: doing @include of rluser.texi
 
- (/usr/local/src/bash/bash-20240422/lib/readline/doc/rluser.texi
+ (/usr/local/src/bash/bash-20240609/lib/readline/doc/rluser.texi
 Chapter 8 [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131]
 [132]
 Underfull \hbox (badness 7540) in paragraph at lines 882--888
@@ -312,10 +313,10 @@ gnored[]
 texinfo.tex: doing @include of hsuser.texi
 
 
-(/usr/local/src/bash/bash-20240422/lib/readline/doc/hsuser.texi Chapter 9
+(/usr/local/src/bash/bash-20240609/lib/readline/doc/hsuser.texi Chapter 9
 [158] [159] [160] [161] [162] [163]) Chapter 10 [164] [165] [166] [167]
 [168]
-Underfull \hbox (badness 10000) in paragraph at lines 9827--9836
+Underfull \hbox (badness 10000) in paragraph at lines 9844--9853
 []@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
 entation[]@textrm '[],
 
@@ -328,7 +329,7 @@ entation[]@textrm '[],
 .etc.
 
 
-Underfull \hbox (badness 10000) in paragraph at lines 9827--9836
+Underfull \hbox (badness 10000) in paragraph at lines 9844--9853
 @textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
 extrm '[], `@texttt strict-posix-default[]@textrm '[], and
 
@@ -344,17 +345,17 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
 [178] [179] Appendix C [180]
 texinfo.tex: doing @include of fdl.texi
 
- (/usr/local/src/bash/bash-20240422/doc/fdl.texi
+ (/usr/local/src/bash/bash-20240609/doc/fdl.texi
 [181] [182] [183] [184] [185] [186] [187]) Appendix D [188] [189] [190]
 [191] [192] [193] [194] [195] [196] [197] ) 
 Here is how much of TeX's memory you used:
  4105 strings out of 495840
  47629 string characters out of 6171739
- 143243 words of memory out of 5000000
+ 143252 words of memory out of 5000000
  5048 multiletter control sequences out of 15000+600000
  34315 words of font info for 116 fonts, out of 8000000 for 9000
  701 hyphenation exceptions out of 8191
- 16i,6n,16p,331b,983s stack positions out of 10000i,1000n,20000p,200000b,200000s
+ 16i,6n,16p,389b,983s stack positions out of 10000i,1000n,20000p,200000b,200000s
 </opt/local/share/texmf-texlive/font
 s/type1/public/amsfonts/cm/cmbx12.pfb></opt/local/share/texmf-texlive/fonts/typ
 e1/public/amsfonts/cm/cmcsc10.pfb></opt/local/share/texmf-texlive/fonts/type1/p
@@ -371,10 +372,10 @@ texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt12.pfb></opt/local/share/texmf
 -texlive/fonts/type1/public/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texli
 ve/fonts/type1/public/cm-super/sfrm1095.pfb></opt/local/share/texmf-texlive/fon
 ts/type1/public/cm-super/sfrm1440.pfb>
-Output written on bashref.pdf (203 pages, 819186 bytes).
+Output written on bashref.pdf (203 pages, 820685 bytes).
 PDF statistics:
- 2834 PDF objects out of 2984 (max. 8388607)
- 2584 compressed objects within 26 object streams
+ 2835 PDF objects out of 2984 (max. 8388607)
+ 2585 compressed objects within 26 object streams
  331 named destinations out of 1000 (max. 500000)
  1157 words of extra memory for PDF output out of 10000 (max. 10000000)
 
index 058b45b95efacf7ee3ae43849b39b8af13dfde1d..4f3245f81466912f1f4da5ef347238f3d5f546c6 100644 (file)
Binary files a/doc/bashref.pdf and b/doc/bashref.pdf differ
index 60ca415f7334ab007883067aaa78fe4d40aab661..26ea6d8c9840b99d4c27fa22bfc4dbfe9e53a28e 100644 (file)
@@ -6688,18 +6688,28 @@ or @samp{-}, which reverses the sort order from ascending to descending,
 followed by a sort specifier.
 The valid sort specifiers are
 @samp{name},
+@samp{numeric},
 @samp{size},
 @samp{mtime},
 @samp{atime},
 @samp{ctime},
 and
 @samp{blocks},
-which sort the files on name, file size, modification time, access time,
+which sort the files on name, names in numeric rather than lexicographic order,
+file size, modification time, access time,
 inode change time, and number of blocks, respectively.
+If any of the non-name keys compare as equal (e.g., if two files are
+the same size), sorting uses the name as a secondary sort key.
 
 For example, a value of @code{-mtime} sorts the results in descending
 order by modification time (newest first).
 
+The @samp{numeric} specifier treats names consisting solely of digits as
+numbers and sorts them using the numeric value (so "2" will sort before
+"10", for example).
+When using @samp{numeric}, names containing non-digits sort after all
+the all-digit names and are sorted by name using the traditional behavior.
+
 A sort specifier of @samp{nosort} disables sorting completely; the results
 are returned in the order they are read from the file system,
 and any leading @samp{-} is ignored.
index c8be3cb8ce2a4e2d0ec2ad6518f9aa7ce000734e..0e55790f94b6c5ed22f98dd769ece0cbde6d5056 100644 (file)
@@ -62,7 +62,7 @@
 @numsecentry{Bash Builtin Commands}{4.2}{Bash Builtins}{57}
 @numsecentry{Modifying Shell Behavior}{4.3}{Modifying Shell Behavior}{69}
 @numsubsecentry{The Set Builtin}{4.3.1}{The Set Builtin}{69}
-@numsubsecentry{The Shopt Builtin}{4.3.2}{The Shopt Builtin}{73}
+@numsubsecentry{The Shopt Builtin}{4.3.2}{The Shopt Builtin}{74}
 @numsecentry{Special Builtins}{4.4}{Special Builtins}{80}
 @numchapentry{Shell Variables}{5}{Shell Variables}{81}
 @numsecentry{Bourne Shell Variables}{5.1}{Bourne Shell Variables}{81}
 @numsubsecentry{Commands For Manipulating The History}{8.4.2}{Commands For History}{140}
 @numsubsecentry{Commands For Changing Text}{8.4.3}{Commands For Text}{142}
 @numsubsecentry{Killing And Yanking}{8.4.4}{Commands For Killing}{143}
-@numsubsecentry{Specifying Numeric Arguments}{8.4.5}{Numeric Arguments}{144}
+@numsubsecentry{Specifying Numeric Arguments}{8.4.5}{Numeric Arguments}{145}
 @numsubsecentry{Letting Readline Type For You}{8.4.6}{Commands For Completion}{145}
-@numsubsecentry{Keyboard Macros}{8.4.7}{Keyboard Macros}{146}
+@numsubsecentry{Keyboard Macros}{8.4.7}{Keyboard Macros}{147}
 @numsubsecentry{Some Miscellaneous Commands}{8.4.8}{Miscellaneous Commands}{147}
 @numsecentry{Readline vi Mode}{8.5}{Readline vi Mode}{149}
 @numsecentry{Programmable Completion}{8.6}{Programmable Completion}{150}
index 0c7e5c8d30d4dee875a00af7b298ae8659e474e2..ae3b87e138489c15348d1b32a80bf97c8799b877 100644 (file)
 \entry{histchars}{88}{\code {histchars}}
 \entry{HISTCMD}{88}{\code {HISTCMD}}
 \entry{HISTCONTROL}{88}{\code {HISTCONTROL}}
-\entry{HISTFILE}{88}{\code {HISTFILE}}
+\entry{HISTFILE}{89}{\code {HISTFILE}}
 \entry{HISTFILESIZE}{89}{\code {HISTFILESIZE}}
 \entry{HISTIGNORE}{89}{\code {HISTIGNORE}}
 \entry{HISTSIZE}{89}{\code {HISTSIZE}}
 \entry{HISTTIMEFORMAT}{89}{\code {HISTTIMEFORMAT}}
 \entry{HOSTFILE}{89}{\code {HOSTFILE}}
-\entry{HOSTNAME}{89}{\code {HOSTNAME}}
-\entry{HOSTTYPE}{89}{\code {HOSTTYPE}}
+\entry{HOSTNAME}{90}{\code {HOSTNAME}}
+\entry{HOSTTYPE}{90}{\code {HOSTTYPE}}
 \entry{IGNOREEOF}{90}{\code {IGNOREEOF}}
 \entry{INPUTRC}{90}{\code {INPUTRC}}
 \entry{INSIDE_EMACS}{90}{\code {INSIDE_EMACS}}
 \entry{LC_TIME}{90}{\code {LC_TIME}}
 \entry{LINENO}{90}{\code {LINENO}}
 \entry{LINES}{90}{\code {LINES}}
-\entry{MACHTYPE}{90}{\code {MACHTYPE}}
-\entry{MAILCHECK}{90}{\code {MAILCHECK}}
+\entry{MACHTYPE}{91}{\code {MACHTYPE}}
+\entry{MAILCHECK}{91}{\code {MAILCHECK}}
 \entry{MAPFILE}{91}{\code {MAPFILE}}
 \entry{OLDPWD}{91}{\code {OLDPWD}}
 \entry{OPTERR}{91}{\code {OPTERR}}
 \entry{PROMPT_DIRTRIM}{91}{\code {PROMPT_DIRTRIM}}
 \entry{PS0}{91}{\code {PS0}}
 \entry{PS3}{91}{\code {PS3}}
-\entry{PS4}{91}{\code {PS4}}
+\entry{PS4}{92}{\code {PS4}}
 \entry{PWD}{92}{\code {PWD}}
 \entry{RANDOM}{92}{\code {RANDOM}}
 \entry{READLINE_ARGUMENT}{92}{\code {READLINE_ARGUMENT}}
 \entry{SHELL}{92}{\code {SHELL}}
 \entry{SHELLOPTS}{92}{\code {SHELLOPTS}}
 \entry{SHLVL}{92}{\code {SHLVL}}
-\entry{SRANDOM}{92}{\code {SRANDOM}}
+\entry{SRANDOM}{93}{\code {SRANDOM}}
 \entry{TIMEFORMAT}{93}{\code {TIMEFORMAT}}
 \entry{TMOUT}{93}{\code {TMOUT}}
 \entry{TMPDIR}{93}{\code {TMPDIR}}
index 3afd316857f0e5d40484793384bdeed8a671b088..cce96799b2c82854a31fbb1fd53906f827bde373 100644 (file)
 \entry{\code {histchars}}{88}
 \entry{\code {HISTCMD}}{88}
 \entry{\code {HISTCONTROL}}{88}
-\entry{\code {HISTFILE}}{88}
+\entry{\code {HISTFILE}}{89}
 \entry{\code {HISTFILESIZE}}{89}
 \entry{\code {HISTIGNORE}}{89}
 \entry{\code {history-preserve-point}}{129}
 \entry{\code {HOME}}{81}
 \entry{\code {horizontal-scroll-mode}}{129}
 \entry{\code {HOSTFILE}}{89}
-\entry{\code {HOSTNAME}}{89}
-\entry{\code {HOSTTYPE}}{89}
+\entry{\code {HOSTNAME}}{90}
+\entry{\code {HOSTTYPE}}{90}
 \initial {I}
 \entry{\code {IFS}}{81}
 \entry{\code {IGNOREEOF}}{90}
 \entry{\code {LINENO}}{90}
 \entry{\code {LINES}}{90}
 \initial {M}
-\entry{\code {MACHTYPE}}{90}
+\entry{\code {MACHTYPE}}{91}
 \entry{\code {MAIL}}{81}
-\entry{\code {MAILCHECK}}{90}
+\entry{\code {MAILCHECK}}{91}
 \entry{\code {MAILPATH}}{81}
 \entry{\code {MAPFILE}}{91}
 \entry{\code {mark-modified-lines}}{130}
 \entry{\code {PS1}}{81}
 \entry{\code {PS2}}{81}
 \entry{\code {PS3}}{91}
-\entry{\code {PS4}}{91}
+\entry{\code {PS4}}{92}
 \entry{\code {PWD}}{92}
 \initial {R}
 \entry{\code {RANDOM}}{92}
 \entry{\code {show-all-if-unmodified}}{131}
 \entry{\code {show-mode-in-prompt}}{132}
 \entry{\code {skip-completed-text}}{132}
-\entry{\code {SRANDOM}}{92}
+\entry{\code {SRANDOM}}{93}
 \initial {T}
 \entry{\code {TEXTDOMAIN}}{8}
 \entry{\code {TEXTDOMAINDIR}}{8}
index 42461c8ff0ae94ee6465616f8119df17f92b6d6b..a6941152e6778235a27ccd8bbc6c3653ba4bfa9c 100644 (file)
@@ -71,6 +71,19 @@ extern void rl_set_screen_size (int, int);
 #endif
 extern void sh_set_lines_and_columns (int, int);
 
+#ifndef HAVE_TCGETWINSIZE
+int
+tcgetwinsize (int fd, struct winsize *wp)
+{
+#if defined (TIOCGWINSZ)
+  return (ioctl (fd, TIOCGWINSZ, wp));
+#else
+  errno = EINVAL;
+  return -1;
+#endif
+}
+#endif
+
 void
 get_new_window_size (int from_sig, int *rp, int *cp)
 {
@@ -79,8 +92,7 @@ get_new_window_size (int from_sig, int *rp, int *cp)
   int tty;
 
   tty = input_tty ();
-  if (tty >= 0 && (ioctl (tty, TIOCGWINSZ, &win) == 0) &&
-      win.ws_row > 0 && win.ws_col > 0)
+  if (tty >= 0 && (tcgetwinsize (tty, &win) == 0) && win.ws_row > 0 && win.ws_col > 0)
     {
       sh_set_lines_and_columns (win.ws_row, win.ws_col);
 #if defined (READLINE)
index fcc3fa556faf57928a82917661ddd32348ce9d27..806ace05b2246cee4c9644acb75d7ab3959fe403 100644 (file)
--- a/pathexp.c
+++ b/pathexp.c
@@ -679,6 +679,7 @@ static STRING_INT_ALIST sorttypes[] = {
   { "atime",   SORT_ATIME },
   { "ctime",   SORT_CTIME },
   { "blocks",  SORT_BLOCKS },
+  { "numeric", SORT_NUMERIC },
   { "nosort",  SORT_NOSORT },
   { (char *)NULL,      -1 }
 };
@@ -758,13 +759,16 @@ globsort_namecmp (char **s1, char **s2)
 static int
 globsort_sizecmp (struct globsort_t *g1, struct globsort_t *g2)
 {
-  return ((glob_sorttype < SORT_REVERSE) ? GENCMP(g1->st.size, g2->st.size) : GENCMP(g2->st.size, g1->st.size));
+  int x;
+
+  x = (glob_sorttype < SORT_REVERSE) ? GENCMP(g1->st.size, g2->st.size) : GENCMP(g2->st.size, g1->st.size);
+  return (x == 0) ? (globsort_namecmp (&g1->name, &g2->name)) : x;
 }
 
 static int
 globsort_timecmp (struct globsort_t *g1, struct globsort_t *g2)
 {
-  int t;
+  int t, x;
   struct timespec t1, t2;
 
   t = (glob_sorttype < SORT_REVERSE) ? glob_sorttype : glob_sorttype - SORT_REVERSE;
@@ -784,13 +788,50 @@ globsort_timecmp (struct globsort_t *g1, struct globsort_t *g2)
       t2 = g2->st.ctime;
     }
 
-  return ((glob_sorttype < SORT_REVERSE) ? timespec_cmp (t1, t2) : timespec_cmp (t2, t1));
+  x = (glob_sorttype < SORT_REVERSE) ? timespec_cmp (t1, t2) : timespec_cmp (t2, t1);
+  return (x == 0) ? (globsort_namecmp (&g1->name, &g2->name)) : x;
 }
 
 static int
 globsort_blockscmp (struct globsort_t *g1, struct globsort_t *g2)
 {
-  return (glob_sorttype < SORT_REVERSE ? GENCMP(g1->st.blocks, g2->st.blocks) : GENCMP(g2->st.blocks, g1->st.blocks));
+  int x;
+
+  x = (glob_sorttype < SORT_REVERSE) ? GENCMP(g1->st.blocks, g2->st.blocks) : GENCMP(g2->st.blocks, g1->st.blocks);
+  return (x == 0) ? (globsort_namecmp (&g1->name, &g2->name)) : x;
+}
+
+static inline int
+gs_checknum (char *string, intmax_t *val)
+{
+  int v;
+  intmax_t i;
+
+  v = all_digits (string);
+  if (v)
+    *val = strtoimax (string, (char **)NULL, 10);
+  return v;
+}
+
+static int
+globsort_numericcmp (struct globsort_t *g1, struct globsort_t *g2)
+{
+  intmax_t i1, i2;
+  int v1, v2, x;
+
+  /* like valid_number but doesn't allow leading/trailing whitespace or sign */
+  v1 = gs_checknum (g1->name, &i1);
+  v2 = gs_checknum (g2->name, &i2);
+
+  if (v1 && v2)                /* both valid numbers */
+    /* Don't need to fall back to name comparison here */
+    return (glob_sorttype < SORT_REVERSE) ? GENCMP(i1, i2) : GENCMP(i2, i1);
+  else if (v1 == 0 && v2 == 0) /* neither valid numbers */
+    return (globsort_namecmp (&g1->name, &g2->name));
+  else if (v1 != 0 && v2 == 0)
+    return (glob_sorttype < SORT_REVERSE) ? -1 : 1;
+  else
+    return (glob_sorttype < SORT_REVERSE) ? 1 : -1;
 }
 
 #undef GENCMP
@@ -849,6 +890,9 @@ globsort_sortarray (struct globsort_t *garray, size_t len)
     case SORT_BLOCKS:
       sortfunc = (QSFUNC *)globsort_blockscmp;
       break;
+    case SORT_NUMERIC:
+      sortfunc = (QSFUNC *)globsort_numericcmp;
+      break;
     default:
       internal_error (_("invalid glob sort type"));
       break;
index 6f80ca086a2979706d1aa919bb871f510971171a..854323996cc6a2a45191ad83f2419e02f3347943 100644 (file)
--- a/pathexp.h
+++ b/pathexp.h
@@ -112,7 +112,8 @@ extern void ignore_glob_matches (char **);
 #define SORT_ATIME     4
 #define SORT_CTIME     5
 #define SORT_BLOCKS    6
-#define SORT_NOSORT    7
+#define SORT_NUMERIC   7
+#define SORT_NOSORT    8
 
 #define SORT_REVERSE   128
 
diff --git a/subst.c b/subst.c
index 03205f951cac94766b88d6de6ba275b8eb4301fd..a3c49755576ec4a2c3215d75f23a018d1c3ed5d5 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -3468,15 +3468,11 @@ do_compound_assignment (const char *name, char *value, int flags)
        return ((SHELL_VAR *)0);
     }
   /* In a function but forcing assignment in global context. CHKLOCAL means to
-     check for an existing local variable first. */
+     check for an existing local variable first */
   else if (mkglobal && variable_context)
     {
-      v = chklocal ? find_variable (name) : 0;
-      /* XXX - if we want to make chklocal search previous scopes, change here 2024/06/04 */
-      if (v && (local_p (v) == 0 || v->context != variable_context))
-       v = 0;
-      if (v == 0)
-        v = find_global_variable (name);
+      /* Changed to find variables at previous local scopes 6/12/2024 */
+      v = chklocal ? find_variable (name) : find_global_variable (name);
       if (v && ASSIGN_DISALLOWED (v, flags))
        {
          if (readonly_p (v))
index 4d89de8061375918d3cf1530f02cbe2f8a1f2997..bde7e6312c9b313939ac95e1407ff01751f2cb79 100644 (file)
@@ -141,6 +141,8 @@ mksyntax.dSYM mksignames.o mailcheck.o make_cmd.o mksignames mksyntax
 
 mksyntax mksignames make_cmd.o mailcheck.o mksignames.o mksyntax.dSYM
 mksyntax.dSYM mksignames.o mailcheck.o make_cmd.o mksignames mksyntax
+aa ab ac
+ac ab aa
 argv[1] = <a>
 argv[2] = <abc>
 argv[3] = <abd>
index ff50efa408e9f6f442b0eff9d89de643f304b8fb..7f8a722e9c0de13d7997adb0ed3c8bbed7bbefe4 100644 (file)
@@ -65,5 +65,13 @@ echo m*
 GLOBSORT=-size
 echo m*
 
+# all zero-length files, so secondary sort on name
+touch aa ab ac
+GLOBSORT=size
+echo a*
+# secondary sorting preserves reverse ordering
+GLOBSORT=-size
+echo a*
+
 cd $OLDPWD
 rm -rf $TDIR
index 4c54aa12730b9444fb80bd31747b7609431b7e7b..aec3715c67d929c89a94cd1bde18c88ea36a3ca6 100644 (file)
@@ -16,7 +16,7 @@ LANG=C
 
 SHELLSTART=$(date +%s)
 SECS=1275250155
-export TZ=EST5EDT
+export TZ=EST5EDT,M3.2.0/2,M11.1.0/2           # ugh
 
 case $SHELLSTART in
 *s*)   SHELLSTART=$EPOCHSECONDS ; DATESECS=false ;;    # take a shot
index 608b647de55dcdc510c70b150b3a5a15aa0867ce..1566626a5718f3f2ffbb877f8f930085d4c9cf4e 100644 (file)
@@ -328,6 +328,36 @@ after unset f1: x = local
 f1: x = local
 after unset f1: x = unset
 1009: after posix f1: x = global
+global initial
+declare -- string
+declare -i int
+declare -a array
+inside init_vars acting on previous scope
+./varenv25.sub: line 26: local: string: not found
+./varenv25.sub: line 26: local: int: not found
+./varenv25.sub: line 26: local: array: not found
+inside foo, after init_vars
+declare -r string="foo"
+declare -ir int="100"
+declare -ar array=([0]="1" [1]="2")
+global after foo
+declare -- string
+declare -i int
+declare -a array
+init_vars2
+./varenv25.sub: line 51: local: int: not found
+foo2, after init_vars2
+declare -ir int="142"
+global after calling foo2
+declare -i int
+inside init_vars acting on previous scope
+./varenv25.sub: line 26: local: string: not found
+./varenv25.sub: line 26: local: int: not found
+./varenv25.sub: line 26: local: array: not found
+global values after foo placeholder
+declare -r string="foo"
+declare -ir int="100"
+declare -ar array=([0]="1" [1]="2")
 a=z
 a=b
 a=z
index 587f83125b69191884a9156fd940de29879c9579..bdc4f2fe1f473c030e883b150626fba4cce9a9f2 100644 (file)
@@ -262,6 +262,7 @@ ${THIS_SH} ./varenv21.sub
 ${THIS_SH} ./varenv22.sub
 ${THIS_SH} ./varenv23.sub
 ${THIS_SH} ./varenv24.sub
+${THIS_SH} ./varenv25.sub
 
 # make sure variable scoping is done right
 tt() { typeset a=b;echo a=$a; };a=z;echo a=$a;tt;echo a=$a
diff --git a/tests/varenv25.sub b/tests/varenv25.sub
new file mode 100644 (file)
index 0000000..d5e145f
--- /dev/null
@@ -0,0 +1,73 @@
+#   This program 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.
+#
+#   This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# post-bash-5.2 changes to make readonly/export operate on arrays at previous
+# local scopes the way they operate on scalars
+
+declare string
+declare -i int
+declare -a array
+
+init_vars ()
+{
+  readonly string="foo"  readonly int=100  readonly array=(1 2)
+  # Print the (hopefully) readonly variables 
+  echo inside init_vars acting on previous scope
+  local -p string int array
+}
+
+echo global initial
+declare -p string int array
+
+# make readonly operate on local variables at a previous context
+foo ()
+{
+  local string  ; local -i int  ; local -a array
+  init_vars
+  echo inside foo, after init_vars
+  local -p string int array
+}
+
+foo
+echo global after foo
+declare -p string int array
+
+unset -f foo
+
+init_vars2 ()
+{
+  readonly int=100+42
+  echo init_vars2
+  local -p int         # previous scope, not local here
+}
+
+foo2 ()
+{
+  local -i int
+  init_vars2
+  echo foo2, after init_vars2
+  local -p int
+}
+foo2
+
+echo global after calling foo2
+declare -p int
+
+foo3()
+{
+  init_vars
+}
+
+foo3
+echo global values after foo placeholder
+declare -p string int array