use name as GLOBSORT secondary sort key; new GLOBSORT sort specifier: `numeric'; let readonly and export work on local variables at previous scopes for both array and scalar variables

This commit is contained in:
Chet Ramey
2024-06-21 10:51:53 -04:00
parent 886e4e68be
commit ad1f497a84
29 changed files with 621 additions and 372 deletions
+138 -129
View 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 Builtins234611
Node: Shell Variables235603
Node: Bourne Shell Variables236040
Node: Bash Variables238236
Node: Bash Features274856
Node: Invoking Bash275873
Node: Bash Startup Files282275
Node: Interactive Shells287590
Node: What is an Interactive Shell?288001
Node: Is this Shell Interactive?288670
Node: Interactive Shell Behavior289497
Node: Bash Conditional Expressions293254
Node: Shell Arithmetic298431
Node: Aliases301516
Node: Arrays304474
Node: The Directory Stack311276
Node: Directory Stack Builtins312076
Node: Controlling the Prompt316528
Node: The Restricted Shell319669
Node: Bash POSIX Mode322459
Node: Shell Compatibility Mode339973
Node: Job Control348995
Node: Job Control Basics349455
Node: Job Control Builtins354632
Node: Job Control Variables360595
Node: Command Line Editing361775
Node: Introduction and Notation363482
Node: Readline Interaction365129
Node: Readline Bare Essentials366320
Node: Readline Movement Commands368141
Node: Readline Killing Commands369141
Node: Readline Arguments371122
Node: Searching372182
Node: Readline Init File374414
Node: Readline Init File Syntax375699
Node: Conditional Init Constructs400640
Node: Sample Init File405008
Node: Bindable Readline Commands408132
Node: Commands For Moving409360
Node: Commands For History411590
Node: Commands For Text416798
Node: Commands For Killing420935
Node: Numeric Arguments423739
Node: Commands For Completion424894
Node: Keyboard Macros429213
Node: Miscellaneous Commands429917
Node: Readline vi Mode436574
Node: Programmable Completion437529
Node: Programmable Completion Builtins445489
Node: A Programmable Completion Example457058
Node: Using History Interactively462406
Node: Bash History Facilities463090
Node: Bash History Builtins466205
Node: History Interaction471451
Node: Event Designators475779
Node: Word Designators477365
Node: Modifiers479354
Node: Installing Bash481266
Node: Basic Installation482403
Node: Compilers and Options486285
Node: Compiling For Multiple Architectures487038
Node: Installation Names488790
Node: Specifying the System Type491027
Node: Sharing Defaults491776
Node: Operation Controls492493
Node: Optional Features493515
Node: Reporting Bugs505320
Node: Major Differences From The Bourne Shell506672
Node: GNU Free Documentation License526410
Node: Indexes551590
Node: Builtin Index552044
Node: Reserved Word Index559145
Node: Variable Index561593
Node: Function Index578727
Node: Concept Index592586
Node: Bash Features275404
Node: Invoking Bash276421
Node: Bash Startup Files282823
Node: Interactive Shells288138
Node: What is an Interactive Shell?288549
Node: Is this Shell Interactive?289218
Node: Interactive Shell Behavior290045
Node: Bash Conditional Expressions293802
Node: Shell Arithmetic298979
Node: Aliases302064
Node: Arrays305022
Node: The Directory Stack311824
Node: Directory Stack Builtins312624
Node: Controlling the Prompt317076
Node: The Restricted Shell320217
Node: Bash POSIX Mode323007
Node: Shell Compatibility Mode340521
Node: Job Control349543
Node: Job Control Basics350003
Node: Job Control Builtins355180
Node: Job Control Variables361143
Node: Command Line Editing362323
Node: Introduction and Notation364030
Node: Readline Interaction365677
Node: Readline Bare Essentials366868
Node: Readline Movement Commands368689
Node: Readline Killing Commands369689
Node: Readline Arguments371670
Node: Searching372730
Node: Readline Init File374962
Node: Readline Init File Syntax376247
Node: Conditional Init Constructs401188
Node: Sample Init File405556
Node: Bindable Readline Commands408680
Node: Commands For Moving409908
Node: Commands For History412138
Node: Commands For Text417346
Node: Commands For Killing421483
Node: Numeric Arguments424287
Node: Commands For Completion425442
Node: Keyboard Macros429761
Node: Miscellaneous Commands430465
Node: Readline vi Mode437122
Node: Programmable Completion438077
Node: Programmable Completion Builtins446037
Node: A Programmable Completion Example457606
Node: Using History Interactively462954
Node: Bash History Facilities463638
Node: Bash History Builtins466753
Node: History Interaction471999
Node: Event Designators476327
Node: Word Designators477913
Node: Modifiers479902
Node: Installing Bash481814
Node: Basic Installation482951
Node: Compilers and Options486833
Node: Compiling For Multiple Architectures487586
Node: Installation Names489338
Node: Specifying the System Type491575
Node: Sharing Defaults492324
Node: Operation Controls493041
Node: Optional Features494063
Node: Reporting Bugs505868
Node: Major Differences From The Bourne Shell507220
Node: GNU Free Documentation License526958
Node: Indexes552138
Node: Builtin Index552592
Node: Reserved Word Index559693
Node: Variable Index562141
Node: Function Index579275
Node: Concept Index593134

End Tag Table