]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
fix for subshells resetting job stats; new hook for rewriting part of completion...
authorChet Ramey <chet.ramey@case.edu>
Thu, 5 Oct 2023 13:02:27 +0000 (09:02 -0400)
committerChet Ramey <chet.ramey@case.edu>
Thu, 5 Oct 2023 13:02:27 +0000 (09:02 -0400)
18 files changed:
CWRU/CWRU.chlog
POSIX
bashline.c
builtins/type.def
doc/bash.info
doc/bashref.info
doc/bashref.texi
doc/version.texi
jobs.c
lib/readline/complete.c
lib/readline/doc/rltech.texi
lib/readline/doc/version.texi
lib/readline/readline.h
tests/func.right
tests/func5.sub
tests/lastpipe.right
tests/printf.right
tests/printf6.sub

index 63145c3dcd96887461a1b62dacd1cc2e6204c057..f298c057337ffc1817429341518971be65c9a8e8 100644 (file)
@@ -7603,7 +7603,7 @@ test.h
 
 execute_cmd.c
        - execute_cond_node: call cond_test instead of binary_test or unary_test.
-         From a report and patch fro Grisha Levit <grishalevit@gmail.com>
+         From a report and patch from Grisha Levit <grishalevit@gmail.com>
 
 doc/bash.1,doc/bashref.texi
        - hash: add some text about the mutual exclusivity of the -t, -p, and
@@ -7705,3 +7705,32 @@ builtins/history.def
 subst.c
        - array_length_reference: include the open bracket in the error message
          passed to err_badarraysub; it looks cleaner
+
+                                  10/2
+                                  ----
+jobs.c
+       - delete_all_jobs: if we are clearing the jobs list, reset the stats
+         about running and dead jobs and child processes
+         Report from Koichi Murase <myoga.murase@gmail.com>
+
+                                  10/4
+                                  ----
+lib/readline/complete.c
+       - rl_completion_rewrite_hook: rewrite hook applied to the completion
+         word before comparing against the possible completions from the
+         file system (modified by rl_filename_rewrite_hook)
+       - rl_filename_completion_function: call rl_completion_rewrite_hook,
+         if set by the calling application, on the filename portion of the
+         word to be completed
+
+lib/readline/readline.h
+       - rl_completion_rewrite_hook: extern declaration
+
+bashline.c
+       - bash_set_filename_hooks: set rl_completion_rewrite_hook to
+         bash_filename_rewrite_hook now that we've separated them
+         From a report and patch from Grisha Levit <grishalevit@gmail.com>;
+         original report from Stefan H. Holek <stefan@epy.co.at>
+
+lib/readline/doc/rltech.texi
+       - rl_completion_rewrite_hook: document
diff --git a/POSIX b/POSIX
index b6d410a0f40f3af5f24157658c588f8edbddd388..2018afa885c2cc91d4d645b74a6c403f15e9c29b 100644 (file)
--- a/POSIX
+++ b/POSIX
@@ -98,7 +98,7 @@ The following list is what's changed when 'POSIX mode' is in effect:
      command name, rather than on all assignment statements on the line.
 
   12. The default history file is '~/.sh_history' (this is the default
-     value of '$HISTFILE').
+     value the shell assigns to '$HISTFILE').
 
   13. Redirection operators do not perform filename expansion on the
      word in the redirection unless the shell is interactive.
@@ -119,7 +119,8 @@ The following list is what's changed when 'POSIX mode' is in effect:
      whose name contains one or more slashes.
 
   18. POSIX special builtins are found before shell functions during
-     command lookup.
+     command lookup, including output printed by the 'type' and
+     'command' builtins.
 
   19. When printing shell function definitions (e.g., by 'type'), Bash
      does not print the 'function' keyword.
@@ -171,7 +172,8 @@ The following list is what's changed when 'POSIX mode' is in effect:
 
   29. A non-interactive shell exits with an error status if the
      iteration variable in a 'for' statement or the selection variable
-     in a 'select' statement is a readonly variable.
+     in a 'select' statement is a readonly variable or has an invalid
+     name.
 
   30. Non-interactive shells exit if FILENAME in '.'  FILENAME is not
      found.
@@ -316,7 +318,12 @@ The following list is what's changed when 'POSIX mode' is in effect:
   66. The 'test' builtin compares strings using the current locale when
      processing the '<' and '>' binary operators.
 
-  67. Command substitutions don't set the '?' special parameter.  The
+  67. The 'test' builtin's '-t' unary primary requires an argument.
+     Historical versions of 'test' made the argument optional in certain
+     cases, and Bash attempts to accommodate those for backwards
+     compatibility.
+
+  68. Command substitutions don't set the '?' special parameter.  The
      exit status of a simple command without a command word is still the
      exit status of the last command substitution that occurred while
      evaluating the variable assignments and redirections in that
index 2c0ffaa80f742ab4150132e76ea189402f11ec1a..1667b48d667dbafa3e59ded0143a86dc5cb9d2d9 100644 (file)
@@ -3338,6 +3338,7 @@ bashline_set_filename_hooks (void)
   set_directory_hook ();
 
   rl_filename_rewrite_hook = bash_filename_rewrite_hook;
+  rl_completion_rewrite_hook = bash_filename_rewrite_hook;
   rl_filename_stat_hook = bash_filename_stat_hook;
 }
 
index a0d31929883a8d206a14f6bcf1775dc60926df52..6eaa3f03fe704250cd6f8bac5ad6c872d88e9095 100644 (file)
@@ -1,7 +1,7 @@
 This file is type.def, from which is created type.c.
 It implements the builtin "type" in Bash.
 
-Copyright (C) 1987-2022 Free Software Foundation, Inc.
+Copyright (C) 1987-2023 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -64,6 +64,7 @@ $END
 #include "../bashintl.h"
 
 #include "../shell.h"
+#include "../builtins.h"
 #include "../parser.h"
 #include "../execute_cmd.h"
 #include "../findcmd.h"
@@ -209,7 +210,7 @@ type_builtin (WORD_LIST *list)
 int
 describe_command (char *command, int dflags)
 {
-  int found, i, found_file, f, all;
+  int found, i, found_file, f, all, skipbuiltin;
   char *full_path, *x, *pathlist;
   SHELL_VAR *func;
 #if defined (ALIAS)
@@ -258,6 +259,24 @@ describe_command (char *command, int dflags)
        return (1);
     }
 
+  /* In posix mode, we find special builtins before shell functions. */
+  /* find_shell_builtin sets current_builtin as a side effect */
+  skipbuiltin = 0;
+  if (posixly_correct && (dflags & CDESC_FORCE_PATH) == 0 && find_shell_builtin (command) != 0 && (current_builtin->flags & SPECIAL_BUILTIN))
+    {
+      if (dflags & CDESC_TYPE)
+       puts ("builtin"); 
+      else if (dflags & CDESC_SHORTDESC)
+       printf (_("%s is a special shell builtin\n"), command);
+      else if (dflags & CDESC_REUSABLE)
+       printf ("%s\n", command);
+
+      skipbuiltin = found = 1;
+
+      if (all == 0)
+       return (1);
+    }
+
   /* Command is a function? */
   if (((dflags & (CDESC_FORCE_PATH|CDESC_NOFUNCS)) == 0) && (func = find_function (command)))
     {
@@ -284,13 +303,14 @@ describe_command (char *command, int dflags)
     }
 
   /* Command is a builtin? */
-  if (((dflags & CDESC_FORCE_PATH) == 0) && find_shell_builtin (command))
+  /* find_shell_builtin sets current_builtin as a side effect */
+  if (skipbuiltin == 0 && ((dflags & CDESC_FORCE_PATH) == 0) && find_shell_builtin (command))
     {
       if (dflags & CDESC_TYPE)
        puts ("builtin");
       else if (dflags & CDESC_SHORTDESC)
        {
-         if (posixly_correct && find_special_builtin (command) != 0)
+         if (posixly_correct && (current_builtin->flags & SPECIAL_BUILTIN))
            printf (_("%s is a special shell builtin\n"), command);
          else
            printf (_("%s is a shell builtin\n"), command);
index e32020b588041141dc0dc20a48236758c46a19c5..002986f5d25957fa9b72c7cba17a4c18bd6eeacc 100644 (file)
@@ -1,9 +1,9 @@
 This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 13 September 2023).
+Bash shell (version 5.3, 2 October 2023).
 
-   This is Edition 5.3, last updated 13 September 2023, of 'The GNU Bash
+   This is Edition 5.3, last updated 2 October 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.3.
 
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
 *************
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 13 September 2023).  The Bash home page is
+Bash shell (version 5.3, 2 October 2023).  The Bash home page is
 <http://www.gnu.org/software/bash/>.
 
-   This is Edition 5.3, last updated 13 September 2023, of 'The GNU Bash
+   This is Edition 5.3, last updated 2 October 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.3.
 
    Bash contains features that appear in other popular shells, and some
@@ -7356,7 +7356,8 @@ startup files.
      whose name contains one or more slashes.
 
   18. POSIX special builtins are found before shell functions during
-     command lookup.
+     command lookup, including output printed by the 'type' and
+     'command' builtins.
 
   19. When printing shell function definitions (e.g., by 'type'), Bash
      does not print the 'function' keyword.
@@ -7408,7 +7409,8 @@ startup files.
 
   29. A non-interactive shell exits with an error status if the
      iteration variable in a 'for' statement or the selection variable
-     in a 'select' statement is a readonly variable.
+     in a 'select' statement is a readonly variable or has an invalid
+     name.
 
   30. Non-interactive shells exit if FILENAME in '.'  FILENAME is not
      found.
@@ -12873,138 +12875,138 @@ D.5 Concept Index
 
 \1f
 Tag Table:
-Node: Top\7f896
-Node: Introduction\7f2815
-Node: What is Bash?\7f3028
-Node: What is a shell?\7f4139
-Node: Definitions\7f6674
-Node: Basic Shell Features\7f9622
-Node: Shell Syntax\7f10838
-Node: Shell Operation\7f11861
-Node: Quoting\7f13151
-Node: Escape Character\7f14452
-Node: Single Quotes\7f14934
-Node: Double Quotes\7f15279
-Node: ANSI-C Quoting\7f16554
-Node: Locale Translation\7f17863
-Node: Creating Internationalized Scripts\7f19171
-Node: Comments\7f23285
-Node: Shell Commands\7f23900
-Node: Reserved Words\7f24835
-Node: Simple Commands\7f25588
-Node: Pipelines\7f26239
-Node: Lists\7f29222
-Node: Compound Commands\7f31014
-Node: Looping Constructs\7f32023
-Node: Conditional Constructs\7f34515
-Node: Command Grouping\7f49000
-Node: Coprocesses\7f50475
-Node: GNU Parallel\7f53135
-Node: Shell Functions\7f54049
-Node: Shell Parameters\7f61931
-Node: Positional Parameters\7f66316
-Node: Special Parameters\7f67215
-Node: Shell Expansions\7f70426
-Node: Brace Expansion\7f72511
-Node: Tilde Expansion\7f75242
-Node: Shell Parameter Expansion\7f77860
-Node: Command Substitution\7f96450
-Node: Arithmetic Expansion\7f99911
-Node: Process Substitution\7f100876
-Node: Word Splitting\7f101993
-Node: Filename Expansion\7f104038
-Node: Pattern Matching\7f106968
-Node: Quote Removal\7f111967
-Node: Redirections\7f112259
-Node: Executing Commands\7f121949
-Node: Simple Command Expansion\7f122616
-Node: Command Search and Execution\7f124723
-Node: Command Execution Environment\7f127107
-Node: Environment\7f130139
-Node: Exit Status\7f131799
-Node: Signals\7f133580
-Node: Shell Scripts\7f137026
-Node: Shell Builtin Commands\7f140050
-Node: Bourne Shell Builtins\7f142085
-Node: Bash Builtins\7f165474
-Node: Modifying Shell Behavior\7f198410
-Node: The Set Builtin\7f198752
-Node: The Shopt Builtin\7f209723
-Node: Special Builtins\7f225858
-Node: Shell Variables\7f226834
-Node: Bourne Shell Variables\7f227268
-Node: Bash Variables\7f229369
-Node: Bash Features\7f264425
-Node: Invoking Bash\7f265435
-Node: Bash Startup Files\7f271471
-Node: Interactive Shells\7f276599
-Node: What is an Interactive Shell?\7f277007
-Node: Is this Shell Interactive?\7f277653
-Node: Interactive Shell Behavior\7f278465
-Node: Bash Conditional Expressions\7f282091
-Node: Shell Arithmetic\7f287001
-Node: Aliases\7f289959
-Node: Arrays\7f292850
-Node: The Directory Stack\7f299481
-Node: Directory Stack Builtins\7f300262
-Node: Controlling the Prompt\7f304519
-Node: The Restricted Shell\7f307481
-Node: Bash POSIX Mode\7f310088
-Node: Shell Compatibility Mode\7f326246
-Node: Job Control\7f334487
-Node: Job Control Basics\7f334944
-Node: Job Control Builtins\7f339943
-Node: Job Control Variables\7f345735
-Node: Command Line Editing\7f346888
-Node: Introduction and Notation\7f348556
-Node: Readline Interaction\7f350176
-Node: Readline Bare Essentials\7f351364
-Node: Readline Movement Commands\7f353150
-Node: Readline Killing Commands\7f354107
-Node: Readline Arguments\7f356025
-Node: Searching\7f357066
-Node: Readline Init File\7f359249
-Node: Readline Init File Syntax\7f360507
-Node: Conditional Init Constructs\7f384529
-Node: Sample Init File\7f388722
-Node: Bindable Readline Commands\7f391843
-Node: Commands For Moving\7f393044
-Node: Commands For History\7f395092
-Node: Commands For Text\7f400083
-Node: Commands For Killing\7f404058
-Node: Numeric Arguments\7f406759
-Node: Commands For Completion\7f407895
-Node: Keyboard Macros\7f412083
-Node: Miscellaneous Commands\7f412768
-Node: Readline vi Mode\7f418803
-Node: Programmable Completion\7f419707
-Node: Programmable Completion Builtins\7f427484
-Node: A Programmable Completion Example\7f438601
-Node: Using History Interactively\7f443846
-Node: Bash History Facilities\7f444527
-Node: Bash History Builtins\7f447535
-Node: History Interaction\7f452623
-Node: Event Designators\7f456433
-Node: Word Designators\7f457968
-Node: Modifiers\7f459830
-Node: Installing Bash\7f461635
-Node: Basic Installation\7f462769
-Node: Compilers and Options\7f466488
-Node: Compiling For Multiple Architectures\7f467226
-Node: Installation Names\7f468915
-Node: Specifying the System Type\7f471021
-Node: Sharing Defaults\7f471735
-Node: Operation Controls\7f472405
-Node: Optional Features\7f473360
-Node: Reporting Bugs\7f484576
-Node: Major Differences From The Bourne Shell\7f485907
-Node: GNU Free Documentation License\7f502762
-Node: Indexes\7f527936
-Node: Builtin Index\7f528387
-Node: Reserved Word Index\7f535485
-Node: Variable Index\7f537930
-Node: Function Index\7f555061
-Node: Concept Index\7f568779
+Node: Top\7f890
+Node: Introduction\7f2803
+Node: What is Bash?\7f3016
+Node: What is a shell?\7f4127
+Node: Definitions\7f6662
+Node: Basic Shell Features\7f9610
+Node: Shell Syntax\7f10826
+Node: Shell Operation\7f11849
+Node: Quoting\7f13139
+Node: Escape Character\7f14440
+Node: Single Quotes\7f14922
+Node: Double Quotes\7f15267
+Node: ANSI-C Quoting\7f16542
+Node: Locale Translation\7f17851
+Node: Creating Internationalized Scripts\7f19159
+Node: Comments\7f23273
+Node: Shell Commands\7f23888
+Node: Reserved Words\7f24823
+Node: Simple Commands\7f25576
+Node: Pipelines\7f26227
+Node: Lists\7f29210
+Node: Compound Commands\7f31002
+Node: Looping Constructs\7f32011
+Node: Conditional Constructs\7f34503
+Node: Command Grouping\7f48988
+Node: Coprocesses\7f50463
+Node: GNU Parallel\7f53123
+Node: Shell Functions\7f54037
+Node: Shell Parameters\7f61919
+Node: Positional Parameters\7f66304
+Node: Special Parameters\7f67203
+Node: Shell Expansions\7f70414
+Node: Brace Expansion\7f72499
+Node: Tilde Expansion\7f75230
+Node: Shell Parameter Expansion\7f77848
+Node: Command Substitution\7f96438
+Node: Arithmetic Expansion\7f99899
+Node: Process Substitution\7f100864
+Node: Word Splitting\7f101981
+Node: Filename Expansion\7f104026
+Node: Pattern Matching\7f106956
+Node: Quote Removal\7f111955
+Node: Redirections\7f112247
+Node: Executing Commands\7f121937
+Node: Simple Command Expansion\7f122604
+Node: Command Search and Execution\7f124711
+Node: Command Execution Environment\7f127095
+Node: Environment\7f130127
+Node: Exit Status\7f131787
+Node: Signals\7f133568
+Node: Shell Scripts\7f137014
+Node: Shell Builtin Commands\7f140038
+Node: Bourne Shell Builtins\7f142073
+Node: Bash Builtins\7f165462
+Node: Modifying Shell Behavior\7f198398
+Node: The Set Builtin\7f198740
+Node: The Shopt Builtin\7f209711
+Node: Special Builtins\7f225846
+Node: Shell Variables\7f226822
+Node: Bourne Shell Variables\7f227256
+Node: Bash Variables\7f229357
+Node: Bash Features\7f264413
+Node: Invoking Bash\7f265423
+Node: Bash Startup Files\7f271459
+Node: Interactive Shells\7f276587
+Node: What is an Interactive Shell?\7f276995
+Node: Is this Shell Interactive?\7f277641
+Node: Interactive Shell Behavior\7f278453
+Node: Bash Conditional Expressions\7f282079
+Node: Shell Arithmetic\7f286989
+Node: Aliases\7f289947
+Node: Arrays\7f292838
+Node: The Directory Stack\7f299469
+Node: Directory Stack Builtins\7f300250
+Node: Controlling the Prompt\7f304507
+Node: The Restricted Shell\7f307469
+Node: Bash POSIX Mode\7f310076
+Node: Shell Compatibility Mode\7f326330
+Node: Job Control\7f334571
+Node: Job Control Basics\7f335028
+Node: Job Control Builtins\7f340027
+Node: Job Control Variables\7f345819
+Node: Command Line Editing\7f346972
+Node: Introduction and Notation\7f348640
+Node: Readline Interaction\7f350260
+Node: Readline Bare Essentials\7f351448
+Node: Readline Movement Commands\7f353234
+Node: Readline Killing Commands\7f354191
+Node: Readline Arguments\7f356109
+Node: Searching\7f357150
+Node: Readline Init File\7f359333
+Node: Readline Init File Syntax\7f360591
+Node: Conditional Init Constructs\7f384613
+Node: Sample Init File\7f388806
+Node: Bindable Readline Commands\7f391927
+Node: Commands For Moving\7f393128
+Node: Commands For History\7f395176
+Node: Commands For Text\7f400167
+Node: Commands For Killing\7f404142
+Node: Numeric Arguments\7f406843
+Node: Commands For Completion\7f407979
+Node: Keyboard Macros\7f412167
+Node: Miscellaneous Commands\7f412852
+Node: Readline vi Mode\7f418887
+Node: Programmable Completion\7f419791
+Node: Programmable Completion Builtins\7f427568
+Node: A Programmable Completion Example\7f438685
+Node: Using History Interactively\7f443930
+Node: Bash History Facilities\7f444611
+Node: Bash History Builtins\7f447619
+Node: History Interaction\7f452707
+Node: Event Designators\7f456517
+Node: Word Designators\7f458052
+Node: Modifiers\7f459914
+Node: Installing Bash\7f461719
+Node: Basic Installation\7f462853
+Node: Compilers and Options\7f466572
+Node: Compiling For Multiple Architectures\7f467310
+Node: Installation Names\7f468999
+Node: Specifying the System Type\7f471105
+Node: Sharing Defaults\7f471819
+Node: Operation Controls\7f472489
+Node: Optional Features\7f473444
+Node: Reporting Bugs\7f484660
+Node: Major Differences From The Bourne Shell\7f485991
+Node: GNU Free Documentation License\7f502846
+Node: Indexes\7f528020
+Node: Builtin Index\7f528471
+Node: Reserved Word Index\7f535569
+Node: Variable Index\7f538014
+Node: Function Index\7f555145
+Node: Concept Index\7f568863
 \1f
 End Tag Table
 
index 784e867ad9da7560c86c326b61736b6cd769ca45..b808c6d12574ad29f154cf064025244cc3a8975d 100644 (file)
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.8 from
 bashref.texi.
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 13 September 2023).
+Bash shell (version 5.3, 2 October 2023).
 
-   This is Edition 5.3, last updated 13 September 2023, of 'The GNU Bash
+   This is Edition 5.3, last updated 2 October 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.3.
 
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
 *************
 
 This text is a brief description of the features that are present in the
-Bash shell (version 5.3, 13 September 2023).  The Bash home page is
+Bash shell (version 5.3, 2 October 2023).  The Bash home page is
 <http://www.gnu.org/software/bash/>.
 
-   This is Edition 5.3, last updated 13 September 2023, of 'The GNU Bash
+   This is Edition 5.3, last updated 2 October 2023, of 'The GNU Bash
 Reference Manual', for 'Bash', Version 5.3.
 
    Bash contains features that appear in other popular shells, and some
@@ -7357,7 +7357,8 @@ startup files.
      whose name contains one or more slashes.
 
   18. POSIX special builtins are found before shell functions during
-     command lookup.
+     command lookup, including output printed by the 'type' and
+     'command' builtins.
 
   19. When printing shell function definitions (e.g., by 'type'), Bash
      does not print the 'function' keyword.
@@ -7409,7 +7410,8 @@ startup files.
 
   29. A non-interactive shell exits with an error status if the
      iteration variable in a 'for' statement or the selection variable
-     in a 'select' statement is a readonly variable.
+     in a 'select' statement is a readonly variable or has an invalid
+     name.
 
   30. Non-interactive shells exit if FILENAME in '.'  FILENAME is not
      found.
@@ -12874,138 +12876,138 @@ D.5 Concept Index
 
 \1f
 Tag Table:
-Node: Top\7f899
-Node: Introduction\7f2821
-Node: What is Bash?\7f3037
-Node: What is a shell?\7f4151
-Node: Definitions\7f6689
-Node: Basic Shell Features\7f9640
-Node: Shell Syntax\7f10859
-Node: Shell Operation\7f11885
-Node: Quoting\7f13178
-Node: Escape Character\7f14482
-Node: Single Quotes\7f14967
-Node: Double Quotes\7f15315
-Node: ANSI-C Quoting\7f16593
-Node: Locale Translation\7f17905
-Node: Creating Internationalized Scripts\7f19216
-Node: Comments\7f23333
-Node: Shell Commands\7f23951
-Node: Reserved Words\7f24889
-Node: Simple Commands\7f25645
-Node: Pipelines\7f26299
-Node: Lists\7f29285
-Node: Compound Commands\7f31080
-Node: Looping Constructs\7f32092
-Node: Conditional Constructs\7f34587
-Node: Command Grouping\7f49075
-Node: Coprocesses\7f50553
-Node: GNU Parallel\7f53216
-Node: Shell Functions\7f54133
-Node: Shell Parameters\7f62018
-Node: Positional Parameters\7f66406
-Node: Special Parameters\7f67308
-Node: Shell Expansions\7f70522
-Node: Brace Expansion\7f72610
-Node: Tilde Expansion\7f75344
-Node: Shell Parameter Expansion\7f77965
-Node: Command Substitution\7f96558
-Node: Arithmetic Expansion\7f100022
-Node: Process Substitution\7f100990
-Node: Word Splitting\7f102110
-Node: Filename Expansion\7f104158
-Node: Pattern Matching\7f107091
-Node: Quote Removal\7f112093
-Node: Redirections\7f112388
-Node: Executing Commands\7f122081
-Node: Simple Command Expansion\7f122751
-Node: Command Search and Execution\7f124861
-Node: Command Execution Environment\7f127248
-Node: Environment\7f130283
-Node: Exit Status\7f131946
-Node: Signals\7f133730
-Node: Shell Scripts\7f137179
-Node: Shell Builtin Commands\7f140206
-Node: Bourne Shell Builtins\7f142244
-Node: Bash Builtins\7f165636
-Node: Modifying Shell Behavior\7f198575
-Node: The Set Builtin\7f198920
-Node: The Shopt Builtin\7f209894
-Node: Special Builtins\7f226032
-Node: Shell Variables\7f227011
-Node: Bourne Shell Variables\7f227448
-Node: Bash Variables\7f229552
-Node: Bash Features\7f264611
-Node: Invoking Bash\7f265624
-Node: Bash Startup Files\7f271663
-Node: Interactive Shells\7f276794
-Node: What is an Interactive Shell?\7f277205
-Node: Is this Shell Interactive?\7f277854
-Node: Interactive Shell Behavior\7f278669
-Node: Bash Conditional Expressions\7f282298
-Node: Shell Arithmetic\7f287211
-Node: Aliases\7f290172
-Node: Arrays\7f293066
-Node: The Directory Stack\7f299700
-Node: Directory Stack Builtins\7f300484
-Node: Controlling the Prompt\7f304744
-Node: The Restricted Shell\7f307709
-Node: Bash POSIX Mode\7f310319
-Node: Shell Compatibility Mode\7f326480
-Node: Job Control\7f334724
-Node: Job Control Basics\7f335184
-Node: Job Control Builtins\7f340186
-Node: Job Control Variables\7f345981
-Node: Command Line Editing\7f347137
-Node: Introduction and Notation\7f348808
-Node: Readline Interaction\7f350431
-Node: Readline Bare Essentials\7f351622
-Node: Readline Movement Commands\7f353411
-Node: Readline Killing Commands\7f354371
-Node: Readline Arguments\7f356292
-Node: Searching\7f357336
-Node: Readline Init File\7f359522
-Node: Readline Init File Syntax\7f360783
-Node: Conditional Init Constructs\7f384808
-Node: Sample Init File\7f389004
-Node: Bindable Readline Commands\7f392128
-Node: Commands For Moving\7f393332
-Node: Commands For History\7f395383
-Node: Commands For Text\7f400377
-Node: Commands For Killing\7f404355
-Node: Numeric Arguments\7f407059
-Node: Commands For Completion\7f408198
-Node: Keyboard Macros\7f412389
-Node: Miscellaneous Commands\7f413077
-Node: Readline vi Mode\7f419115
-Node: Programmable Completion\7f420022
-Node: Programmable Completion Builtins\7f427802
-Node: A Programmable Completion Example\7f438922
-Node: Using History Interactively\7f444170
-Node: Bash History Facilities\7f444854
-Node: Bash History Builtins\7f447865
-Node: History Interaction\7f452956
-Node: Event Designators\7f456769
-Node: Word Designators\7f458307
-Node: Modifiers\7f460172
-Node: Installing Bash\7f461980
-Node: Basic Installation\7f463117
-Node: Compilers and Options\7f466839
-Node: Compiling For Multiple Architectures\7f467580
-Node: Installation Names\7f469272
-Node: Specifying the System Type\7f471381
-Node: Sharing Defaults\7f472098
-Node: Operation Controls\7f472771
-Node: Optional Features\7f473729
-Node: Reporting Bugs\7f484948
-Node: Major Differences From The Bourne Shell\7f486282
-Node: GNU Free Documentation License\7f503140
-Node: Indexes\7f528317
-Node: Builtin Index\7f528771
-Node: Reserved Word Index\7f535872
-Node: Variable Index\7f538320
-Node: Function Index\7f555454
-Node: Concept Index\7f569175
+Node: Top\7f893
+Node: Introduction\7f2809
+Node: What is Bash?\7f3025
+Node: What is a shell?\7f4139
+Node: Definitions\7f6677
+Node: Basic Shell Features\7f9628
+Node: Shell Syntax\7f10847
+Node: Shell Operation\7f11873
+Node: Quoting\7f13166
+Node: Escape Character\7f14470
+Node: Single Quotes\7f14955
+Node: Double Quotes\7f15303
+Node: ANSI-C Quoting\7f16581
+Node: Locale Translation\7f17893
+Node: Creating Internationalized Scripts\7f19204
+Node: Comments\7f23321
+Node: Shell Commands\7f23939
+Node: Reserved Words\7f24877
+Node: Simple Commands\7f25633
+Node: Pipelines\7f26287
+Node: Lists\7f29273
+Node: Compound Commands\7f31068
+Node: Looping Constructs\7f32080
+Node: Conditional Constructs\7f34575
+Node: Command Grouping\7f49063
+Node: Coprocesses\7f50541
+Node: GNU Parallel\7f53204
+Node: Shell Functions\7f54121
+Node: Shell Parameters\7f62006
+Node: Positional Parameters\7f66394
+Node: Special Parameters\7f67296
+Node: Shell Expansions\7f70510
+Node: Brace Expansion\7f72598
+Node: Tilde Expansion\7f75332
+Node: Shell Parameter Expansion\7f77953
+Node: Command Substitution\7f96546
+Node: Arithmetic Expansion\7f100010
+Node: Process Substitution\7f100978
+Node: Word Splitting\7f102098
+Node: Filename Expansion\7f104146
+Node: Pattern Matching\7f107079
+Node: Quote Removal\7f112081
+Node: Redirections\7f112376
+Node: Executing Commands\7f122069
+Node: Simple Command Expansion\7f122739
+Node: Command Search and Execution\7f124849
+Node: Command Execution Environment\7f127236
+Node: Environment\7f130271
+Node: Exit Status\7f131934
+Node: Signals\7f133718
+Node: Shell Scripts\7f137167
+Node: Shell Builtin Commands\7f140194
+Node: Bourne Shell Builtins\7f142232
+Node: Bash Builtins\7f165624
+Node: Modifying Shell Behavior\7f198563
+Node: The Set Builtin\7f198908
+Node: The Shopt Builtin\7f209882
+Node: Special Builtins\7f226020
+Node: Shell Variables\7f226999
+Node: Bourne Shell Variables\7f227436
+Node: Bash Variables\7f229540
+Node: Bash Features\7f264599
+Node: Invoking Bash\7f265612
+Node: Bash Startup Files\7f271651
+Node: Interactive Shells\7f276782
+Node: What is an Interactive Shell?\7f277193
+Node: Is this Shell Interactive?\7f277842
+Node: Interactive Shell Behavior\7f278657
+Node: Bash Conditional Expressions\7f282286
+Node: Shell Arithmetic\7f287199
+Node: Aliases\7f290160
+Node: Arrays\7f293054
+Node: The Directory Stack\7f299688
+Node: Directory Stack Builtins\7f300472
+Node: Controlling the Prompt\7f304732
+Node: The Restricted Shell\7f307697
+Node: Bash POSIX Mode\7f310307
+Node: Shell Compatibility Mode\7f326564
+Node: Job Control\7f334808
+Node: Job Control Basics\7f335268
+Node: Job Control Builtins\7f340270
+Node: Job Control Variables\7f346065
+Node: Command Line Editing\7f347221
+Node: Introduction and Notation\7f348892
+Node: Readline Interaction\7f350515
+Node: Readline Bare Essentials\7f351706
+Node: Readline Movement Commands\7f353495
+Node: Readline Killing Commands\7f354455
+Node: Readline Arguments\7f356376
+Node: Searching\7f357420
+Node: Readline Init File\7f359606
+Node: Readline Init File Syntax\7f360867
+Node: Conditional Init Constructs\7f384892
+Node: Sample Init File\7f389088
+Node: Bindable Readline Commands\7f392212
+Node: Commands For Moving\7f393416
+Node: Commands For History\7f395467
+Node: Commands For Text\7f400461
+Node: Commands For Killing\7f404439
+Node: Numeric Arguments\7f407143
+Node: Commands For Completion\7f408282
+Node: Keyboard Macros\7f412473
+Node: Miscellaneous Commands\7f413161
+Node: Readline vi Mode\7f419199
+Node: Programmable Completion\7f420106
+Node: Programmable Completion Builtins\7f427886
+Node: A Programmable Completion Example\7f439006
+Node: Using History Interactively\7f444254
+Node: Bash History Facilities\7f444938
+Node: Bash History Builtins\7f447949
+Node: History Interaction\7f453040
+Node: Event Designators\7f456853
+Node: Word Designators\7f458391
+Node: Modifiers\7f460256
+Node: Installing Bash\7f462064
+Node: Basic Installation\7f463201
+Node: Compilers and Options\7f466923
+Node: Compiling For Multiple Architectures\7f467664
+Node: Installation Names\7f469356
+Node: Specifying the System Type\7f471465
+Node: Sharing Defaults\7f472182
+Node: Operation Controls\7f472855
+Node: Optional Features\7f473813
+Node: Reporting Bugs\7f485032
+Node: Major Differences From The Bourne Shell\7f486366
+Node: GNU Free Documentation License\7f503224
+Node: Indexes\7f528401
+Node: Builtin Index\7f528855
+Node: Reserved Word Index\7f535956
+Node: Variable Index\7f538404
+Node: Function Index\7f555538
+Node: Concept Index\7f569259
 \1f
 End Tag Table
 
index 156247ed45a3fefc6206cdb590594b65cc835dd3..62ccdfebeb5e437f3f2e74edafbac0e6b0c64398 100644 (file)
@@ -8528,7 +8528,8 @@ contains one or more slashes.
 
 @item
 @sc{posix} special builtins are found before shell functions
-during command lookup.
+during command lookup, including output printed by the @code{type}
+and @code{command} builtins.
 
 @item
 When printing shell function definitions (e.g., by @code{type}), Bash does
index 391187988c96c8238c81db65ae8ab06312e17545..31183d38893ec2c922e1c02a592ef2feae339125 100644 (file)
@@ -2,10 +2,10 @@
 Copyright (C) 1988-2023 Free Software Foundation, Inc.
 @end ignore
 
-@set LASTCHANGE Wed Sep 13 15:38:31 EDT 2023
+@set LASTCHANGE Mon Oct  2 14:52:49 EDT 2023
 
 @set EDITION 5.3
 @set VERSION 5.3
 
-@set UPDATED 13 September 2023
-@set UPDATED-MONTH September 2023
+@set UPDATED 2 October 2023
+@set UPDATED-MONTH October 2023
diff --git a/jobs.c b/jobs.c
index 7ccacede7f78869a5de11ec608ac3cf3edb771fa..b8373cf57b3dd391e573b0f21d90546f2706a46c 100644 (file)
--- a/jobs.c
+++ b/jobs.c
@@ -4702,7 +4702,8 @@ delete_all_jobs (int running_only)
        {
          free ((char *)jobs);
          js.j_jobslots = 0;
-         js.j_firstj = js.j_lastj = js.j_njobs = 0;
+         js.j_firstj = js.j_lastj = js.j_njobs = js.j_ndead = 0;
+         js.c_reaped = js.c_injobs = js.c_living = 0;
        }
     }
 
index 9f170334efc16439197e89d4895c3e9e1fde0723..e2c350128ef9787a6c640720a847779289976a67 100644 (file)
@@ -246,11 +246,24 @@ rl_icppfunc_t *rl_filename_stat_hook = (rl_icppfunc_t *)NULL;
    either return its first argument (if no conversion takes place) or
    newly-allocated memory.  This can, for instance, convert filenames
    between character sets for comparison against what's typed at the
-   keyboard.  The returned value is what is added to the list of
-   matches.  The second argument is the length of the filename to be
-   converted. */
+   keyboard (after its potential modification by rl_completion_rewrite_hook).
+   The returned value is what is added to the list of matches.
+   The second argument is the length of the filename to be converted. */
 rl_dequote_func_t *rl_filename_rewrite_hook = (rl_dequote_func_t *)NULL;
 
+/* If non-zero, this is the address of a function to call before
+   comparing the filename portion of a word to be completed with directory
+   entries from the filesystem. This takes the address of the partial word
+   to be completed, after any rl_filename_dequoting_function has been applied.
+   The function should either return its first argument (if no conversion
+   takes place) or newly-allocated memory. This can, for instance, convert
+   the filename portion of the completion word to a character set suitable
+   for comparison against directory entries read from the filesystem (after
+   their potential modification by rl_filename_rewrite_hook). 
+   The returned value is what is added to the list of matches.
+   The second argument is the length of the filename to be converted. */
+rl_dequote_func_t *rl_completion_rewrite_hook = (rl_dequote_func_t *)NULL;
+
 /* Non-zero means readline completion functions perform tilde expansion. */
 int rl_complete_with_tilde_expansion = 0;
 
@@ -2537,9 +2550,9 @@ rl_filename_completion_function (const char *text, int state)
       filename_len = strlen (filename);
 
       /* Normalize the filename if the application has set a rewrite hook. */
-      if (*filename && rl_filename_rewrite_hook)
+      if (*filename && rl_completion_rewrite_hook)
        {
-         temp = (*rl_filename_rewrite_hook) (filename, filename_len);
+         temp = (*rl_completion_rewrite_hook) (filename, filename_len);
          if (temp != filename)
            {
              xfree (filename);
index 3e136789d869056e0c7779d905b7d10eeafa4cff..8b9bd8c06a1f8875542781f00aef3aa643209151 100644 (file)
@@ -2165,7 +2165,9 @@ The function should not modify the directory argument if it returns 0.
 @deftypevar {rl_dequote_func_t *} rl_filename_rewrite_hook
 If non-zero, this is the address of a function called when reading
 directory entries from the filesystem for completion and comparing
-them to the partial word to be completed.  The function should
+them to the filename portion of the partial word to be completed
+(after its potential modification by @code{rl_completion_rewrite_hook}).
+The function should
 perform any necessary application or system-specific conversion on
 the filename, such as converting between character sets or converting
 from a filesystem format to a character input format.
@@ -2178,6 +2180,24 @@ matches, is added to the list of matches.  Readline will free the
 allocated string.
 @end deftypevar
 
+@deftypevar {rl_dequote_func_t *} rl_completion_rewrite_hook
+If non-zero, this is the address of a function to call before
+comparing the filename portion of a word to be completed with directory
+entries from the filesystem.
+The function takes two arguments: @var{fname}, the filename to be converted,
+after any @code{rl_filename_dequoting_function} has been applied,
+and @var{fnlen}, its length in bytes.
+It must either return its first argument (if no conversion takes place)
+or the converted filename in newly-allocated memory.
+The function should perform any necessary application or system-specific
+conversion on the filename, such as converting between character sets or
+converting from a character input format to some other format.
+Readline compares the converted form against directory entries, after
+their potential modification by @code{rl_filename_rewrite_hook}, and adds
+any matches to the list of matches.
+Readline will free the allocated string.
+@end deftypevar
+
 @deftypevar {rl_compdisp_func_t *} rl_completion_display_matches_hook
 If non-zero, then this is the address of a function to call when
 completing a word would normally display the list of possible matches.
index 19dfe9a27b992f6f1fc16506a11541316fe0e095..f1b82d410383425c224aa35c23e4ba23f97dfaf4 100644 (file)
@@ -5,7 +5,7 @@ Copyright (C) 1988-2023 Free Software Foundation, Inc.
 @set EDITION 8.3
 @set VERSION 8.3
 
-@set UPDATED 31 July 2023
-@set UPDATED-MONTH July 2023
+@set UPDATED 4 October 2023
+@set UPDATED-MONTH October 2023
 
-@set LASTCHANGE Mon Jul 31 10:09:09 EDT 2023
+@set LASTCHANGE Wed Oct  4 10:57:26 EDT 2023
index 0810f97d77fd21f430397d79706cce5adcf8bea2..82b223437e8667c905a9eb1653e0fb95fd133362 100644 (file)
@@ -771,6 +771,19 @@ extern rl_icppfunc_t *rl_filename_stat_hook;
    converted. */
 extern rl_dequote_func_t *rl_filename_rewrite_hook;
 
+/* If non-zero, this is the address of a function to call before
+   comparing the filename portion of a word to be completed with directory
+   entries from the filesystem. This takes the address of the partial word
+   to be completed, after any rl_filename_dequoting_function has been applied.
+   The function should either return its first argument (if no conversion
+   takes place) or newly-allocated memory. This can, for instance, convert
+   the filename portion of the completion word to a character set suitable
+   for comparison against directory entries read from the filesystem (after
+   their potential modification by rl_filename_rewrite_hook). 
+   The returned value is what is added to the list of matches.
+   The second argument is the length of the filename to be converted. */
+extern rl_dequote_func_t *rl_completion_rewrite_hook;
+
 /* Backwards compatibility with previous versions of readline. */
 #define rl_symbolic_link_hook rl_directory_completion_hook
 
index 9cbb34d1c77a46793977a30a24ea344d6bcb05c5..2c83a0fb1e4c4571b80e6a2045624d5596ae5080 100644 (file)
@@ -190,20 +190,59 @@ FUNCNAME: a=2
 { 
     echo $FUNCNAME
 }
+posix mode:
+type
+break is a special shell builtin
+builtin
+command -v
+break
+command -V
+break is a special shell builtin
+type -a
+break is a special shell builtin
 break is a function
 break () 
 { 
-    echo FUNCNAME: $FUNCNAME
+    echo inside function $FUNCNAME
+}
+declare
+break () 
+{ 
+    echo inside function $FUNCNAME
 }
-FUNCNAME: break
+execution
+default mode:
+type
 break is a function
 break () 
 { 
-    echo FUNCNAME: $FUNCNAME
+    echo inside function $FUNCNAME
 }
+function
+command -v
 break
-./func5.sub: line 69: `break': is a special builtin
-./func5.sub: line 75: `!!': not a valid identifier
+command -V
+break is a function
+break () 
+{ 
+    echo inside function $FUNCNAME
+}
+type -a
+break is a function
+break () 
+{ 
+    echo inside function $FUNCNAME
+}
+break is a shell builtin
+declare
+break () 
+{ 
+    echo inside function $FUNCNAME
+}
+execution
+inside function break
+./func5.sub: line 86: `break': is a special builtin
+./func5.sub: line 92: `!!': not a valid identifier
 !! is a function
 !! () 
 { 
index 43e2c5226de14dd31e5c696d1eb0f15fe9aba356..bacb82dbb7f027a47be3311c99109a456fd873c2 100644 (file)
@@ -46,18 +46,35 @@ type '<(:)'
 
 break()
 {
-       echo FUNCNAME: $FUNCNAME
+       echo inside function $FUNCNAME
+}
+
+testfunc()
+{
+       echo type
+       type break
+       type -t break
+       echo command -v
+       command -v break
+       echo command -V
+       command -V break
+
+       echo type -a
+       type -a break
+       echo declare
+       declare -f break
+       echo execution
+       break
 }
 
-type break
-\break
-# you can print them in posix mode
 set -o posix
-# posix mode should find special builtins first
-type break
-declare -F break
+echo posix mode:
+testfunc
+
 set +o posix
-unset -f break
+echo default mode:
+testfunc
+unset -f testfunc break
 
 # but in posix mode, declaring such a function is a fatal error
 ( set -o posix
index 84e1e2ea364f6211edc373f1161cb08fda3d186f..d311d6f8c34b4bd4489f965478821d2157ad5960 100644 (file)
@@ -7,6 +7,7 @@ last = c
 1 -- 0 0 1
 1 -- 0 0 1
 1 -- 0 1 0
+1 42
 lastpipe1.sub returns 14
 A1
 A2
index 9253ef6159b83765e6e9b37779a717a6fb636d23..cf6f77e1cf9e39896a961d54a49e63831f9ac068 100644 (file)
@@ -330,15 +330,28 @@ hello  --
 hello --
 123 --
 6 --
-à²M-^Gಳಿà²M-^Uà³M-^Fà²M-^Wಳà³M-^A
-à²M-^Gಳ
-à²M-^G
-à²M-^Gಳ
-  à²M-^Gಳ
-à²M-^Gಳ  ---
-à²M-^G
-à²M-^G
-à²M-^G
-à²M-^G
-   à²M-^G
-à²M-^G   ---
+0000000 340 262 207 340 262 263 340 262 277 340 262 225 340 263 206 340
+0000010 262 227 340 262 263 340 263 201 012                            
+0000019
+0000000 340 262 207 340 262 263 012                                    
+0000007
+0000000 340 262 207 012                                                
+0000004
+0000000 340 262 207 340 262 263 012                                    
+0000007
+0000000 040 040 340 262 207 340 262 263 012                            
+0000009
+0000000 340 262 207 340 262 263 040 040 055 055 055 012                
+000000c
+0000000 340 262 207 012                                                
+0000004
+0000000 340 262 207 012                                                
+0000004
+0000000 340 262 207 012                                                
+0000004
+0000000 340 262 207 012                                                
+0000004
+0000000 040 040 040 340 262 207 012                                    
+0000007
+0000000 340 262 207 040 040 040 055 055 055 012                        
+000000a
index 09ee689efa070ff57d60c4e78c4c5cf560c9ef33..0dc3b28b11ad06aff9c0fd822ba2f1849c404bf3 100644 (file)
@@ -4,18 +4,18 @@ V=ಇಳಿಕೆಗಳು
 V2=${V:0:2}
 V3=${V:0:1}
 
-printf "%ls\n" "$V"
-printf "%ls\n" "$V2"
-printf "%lc\n" "$V"
-printf "%.2ls\n" "$V"
+printf "%ls\n" "$V" | hexdump -b
+printf "%ls\n" "$V2" | hexdump -b
+printf "%lc\n" "$V" | hexdump -b
+printf "%.2ls\n" "$V" | hexdump -b
 
-printf "%4.2ls\n" "$V"
-printf "%-4.2ls---\n" "$V"
+printf "%4.2ls\n" "$V" | hexdump -b
+printf "%-4.2ls---\n" "$V" | hexdump -b
 
-printf "%ls\n" "$V3"
-printf "%S\n" "$V3"
-printf "%lc\n" "$V3"
-printf "%C\n" "$V3"
+printf "%ls\n" "$V3" | hexdump -b
+printf "%S\n" "$V3" | hexdump -b
+printf "%lc\n" "$V3" | hexdump -b
+printf "%C\n" "$V3" | hexdump -b
 
-printf "%4.2lc\n" "$V3"
-printf "%-4.2lc---\n" "$V3"
+printf "%4.2lc\n" "$V3" | hexdump -b
+printf "%-4.2lc---\n" "$V3" | hexdump -b