]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
change `read -d' on a tty when the delimiter is not a newline to set the terminal...
authorChet Ramey <chet.ramey@case.edu>
Fri, 30 Jan 2026 21:43:46 +0000 (16:43 -0500)
committerChet Ramey <chet.ramey@case.edu>
Fri, 30 Jan 2026 21:43:46 +0000 (16:43 -0500)
34 files changed:
CWRU/CWRU.chlog
array.c
array.h
array2.c
builtins/fc.def
builtins/read.def
doc/bash.html
doc/bash.info
doc/bash.pdf
doc/bashref.aux
doc/bashref.bt
doc/bashref.bts
doc/bashref.cp
doc/bashref.cps
doc/bashref.fn
doc/bashref.fns
doc/bashref.html
doc/bashref.info
doc/bashref.log
doc/bashref.pdf
doc/bashref.texi
doc/bashref.toc
doc/builtins.pdf
eval.c
examples/scripts/nohup.sh
general.c
include/shtty.h
lib/readline/NEW/xxx-autocomplete [deleted file]
lib/readline/doc/rluser.info [deleted file]
lib/readline/examples/rl-test-timeout [deleted file]
lib/readline/examples/rl-timeout.c [deleted file]
lib/readline/examples/x [deleted file]
lib/sh/shtty.c
variables.c

index 17d982b04bb8ee537ad00f09d7956d1072ec27a0..d6aaa5cfe7892b7ab947ae36b2e038f8b187fc8f 100644 (file)
@@ -12619,3 +12619,52 @@ subst.c
 lib/sh/shtty.c,include/shtty.h
        - ttseteol, ttfd_seteol, tt_seteol: new functions to set the tty's
          EOL character to something other than a newline
+
+builtins/read.def
+       - read_builtin: if the `-d' option is supplied, neither `-n' nor `-N'
+         is supplied, and the input is a tty, use tt_seteol to set the tty
+         end-of-input-line delimiter to whatever the option argument is. This
+         means we don't put the terminal into non-canonical mode and only
+         issue one read(2) call. This also means that the normal canonical
+         input processing (erase char, erase line, etc.) takes place. This
+         will have to be revisited if the -d option is ever extended to
+         multibyte characters. The behavior of a delimiter character that
+         can appear as part of a multibyte character in some non-UTF-8
+         locale needs to be tested as well.
+       - read_mbchar: handle unbuffered_read == 3 (read -d on a tty)
+         From a suggestion by Robert Elz <kre@munnari.oz.au> back in 9/2025
+
+                                  1/29
+                                  ----
+general.c
+       - default_columns: use strtol and check the return values instead of
+         using atoi on $COLUMNS
+
+variables.c
+       - sv_optind: use strtol and check the return values instead of using
+         atoi on $OPTIND. This means that setting OPTIND to a non-numeric
+         value is a no-op
+       - sv_opterr: use strtol and check the return values instead of using
+         atoi on $OPTERR. This means that setting OPTERR to a non-numeric
+         value sets sh_opterr to the default (1)
+       - sv_childmax: use strtol instead of atoi to convert $MAXCHILD. This
+         means a conversion error is the same as 0
+
+eval.c
+       - read_command: use strtol and check the return values instead of using
+         atoi on $TMOUT. This means that setting TMOUT to a non-numeric
+         value is a no-op
+
+builtins/fc.def
+       - fc_gethnum: use strtol instead of using atoi on the numeric argument
+
+                                  1/30
+                                  ----
+array.c,array2.c
+       - array_subslice: return a string with the elements of an array between
+         specified start and end indices, inclusive. A variant of
+         array_subrange, but does not return a specified number of elements.
+         Not used yet, but could be used for another array parameter
+         expansion, like ksh93's array[s..e]
+
+
diff --git a/array.c b/array.c
index dbfe9096801ce96b991f9b50014d5a0271f16ec1..54a80268baca6d0e6e88dc9c2aee198f7c7f8707 100644 (file)
--- a/array.c
+++ b/array.c
@@ -9,7 +9,7 @@
  * chet@ins.cwru.edu
  */
 
-/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2026 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -415,6 +415,48 @@ array_subrange (ARRAY *a, arrayind_t start, arrayind_t nelem, int starsub, int q
        return t;
 }
 
+char *
+array_subslice (ARRAY *a, arrayind_t start, arrayind_t end, int starsub, int quoted, int pflags)
+{
+       ARRAY           *a2;
+       ARRAY_ELEMENT   *h, *p;
+       arrayind_t      i;
+       char            *t;
+       WORD_LIST       *wl;
+
+       p = a ? array_head (a) : 0;
+       if (p == 0 || array_empty (a) || start > array_max_index(a))
+               return ((char *)NULL);
+
+       /*
+        * Find element with index START.  If START corresponds to an unset
+        * element (arrays can be sparse), use the first element whose index
+        * is >= START.  If START is < 0, we count START indices back from
+        * the end of A (not elements, even with sparse arrays -- START is an
+        * index).
+        */
+       for (p = element_forw(p); p != array_head(a) && start > element_index(p); p = element_forw(p))
+               ;
+
+       if (p == a->head)
+               return ((char *)NULL);
+
+       /* Starting at P, find END. */
+       for (i = element_index(p), h = p; p != a->head && end > element_index(p); p = element_forw(p))
+               ;
+
+       a2 = array_slice(a, h, p);
+
+       wl = array_to_word_list(a2);
+       array_dispose(a2);
+       if (wl == 0)
+               return (char *)NULL;
+       t = string_list_pos_params(starsub ? '*' : '@', wl, quoted, pflags);    /* XXX */
+       dispose_words(wl);
+
+       return t;
+}
+
 char *
 array_patsub (ARRAY *a, char *pat, char *rep, int mflags)
 {
diff --git a/array.h b/array.h
index 47712e88ad24174f5bde0550eb3f8b5942a69013..472bac3abc7aca1af8919fe9faab695fb673c766 100644 (file)
--- a/array.h
+++ b/array.h
@@ -87,6 +87,7 @@ extern ARRAY  *array_dequote_escapes (ARRAY *);
 extern ARRAY   *array_remove_quoted_nulls (ARRAY *);
 
 extern char    *array_subrange (ARRAY *, arrayind_t, arrayind_t, int, int, int);
+extern char    *array_subslice (ARRAY *, arrayind_t, arrayind_t, int, int, int);
 extern char    *array_patsub (ARRAY *, char *, char *, int);
 extern char    *array_modcase (ARRAY *, char *, int, int);
 
index 49745cc95f8aa1585e6d5d9d8915b8a35a16ab65..08f0f2b8bed59cdadd0b234f97d1db8d689b2c84 100644 (file)
--- a/array2.c
+++ b/array2.c
@@ -9,7 +9,7 @@
  * chet@ins.cwru.edu
  */
 
-/* Copyright (C) 1997-2023 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2026 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 
 #define ARRAY_MAX_DOUBLE       16777216
 
+#ifndef amin
+#  define amin(a, b)    ((a) < (b) ? (a) : (b))
+#endif
+#ifndef amax
+#  define amax(a, b)    ((a) > (b) ? (a) : (b))
+#endif          
+
 static ARRAY_ELEMENT **array_copy_elements (ARRAY *);
 static char *array_to_string_internal (ARRAY *, arrayind_t, arrayind_t, char *, int);
 
@@ -535,6 +542,48 @@ array_subrange (ARRAY *a, arrayind_t start, arrayind_t nelem, int starsub, int q
        return t;
 }
 
+char *
+array_subslice (ARRAY *a, arrayind_t start, arrayind_t end, int starsub, int quoted, int pflags)
+{
+       ARRAY           *a2;
+       arrayind_t      s, e;
+       int             i;
+       char            *t;
+       WORD_LIST       *wl;
+
+       if (array_empty (a) || start > array_max_index(a))
+               return ((char *)NULL);
+
+       /*
+        * Find element with index START.  If START corresponds to an unset
+        * element (arrays can be sparse), use the first element whose index
+        * is >= START.  If START is < 0, we count START indices back from
+        * the end of A (not elements, even with sparse arrays -- START is an
+        * index).
+        */
+       for (s = start; s <= a->max_index && a->elements[s] == 0; s++)
+               ;
+
+       if (s > a->max_index)
+               return ((char *)NULL);
+
+       /* Find the element with index END. If END corresponds to an unset
+          element, use the first element whose index is <= END. If END is
+          greater than max_index, use max_index*/
+       for (e = amin(end, a->max_index); e >= 0 && a->elements[e] == 0; e--)
+               ;
+       a2 = array_slice(a, s, e);
+
+       wl = array_to_word_list(a2);
+       array_dispose(a2);
+       if (wl == 0)
+               return (char *)NULL;
+       t = string_list_pos_params(starsub ? '*' : '@', wl, quoted, pflags);    /* XXX */
+       dispose_words(wl);
+
+       return t;
+}
+
 char *
 array_patsub (ARRAY *a, char *pat, char *rep, int mflags)
 {
index 0187d43bc26e49dfb981193a6d2259a82f06dbae..781b000deed7478b0694492813a96c9f89060d22 100644 (file)
@@ -641,7 +641,7 @@ fc_gethnum (char *command, HIST_ENTRY **hlist, int mode)
 
   if (s && DIGIT(*s))
     {
-      n = atoi (s);
+      n = (int)strtol (s, (char **)NULL, 10);
       n *= sign;
 
       /* We want to return something that is an offset to HISTORY_BASE. */
index 88c9be8b7fd84a62326b2118386402d6fa36af2a..70e08126d6d830f7e10b0224425c0aa90111cbd6 100644 (file)
@@ -1,7 +1,7 @@
 This file is read.def, from which is created read.c.
 It implements the builtin "read" in Bash.
 
-Copyright (C) 1987-2025 Free Software Foundation, Inc.
+Copyright (C) 1987-2026 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -249,7 +249,7 @@ read_builtin (WORD_LIST *list)
 {
   char *varname;
   int nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2, nflag;
-  size_t size;
+  size_t input_string_size;
   volatile int i;
   int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul;
   int edit, use_bash_completion;
@@ -279,7 +279,7 @@ read_builtin (WORD_LIST *list)
   FILE *save_instream;
 #endif
 
-  USE_VAR(size);
+  USE_VAR(input_string_size);
   USE_VAR(i);
   USE_VAR(pass_next);
   USE_VAR(print_ps2);
@@ -421,6 +421,8 @@ read_builtin (WORD_LIST *list)
     {
       int ct;          /* change terminal settings */
 
+      /* XXX - revisit this now that bash doesn't change terminal settings if
+        the delimiter is not a newline. */
       ct = (nflag || delim != '\n') && isatty (fd);
       return (check_read_input (fd, ct) ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
     }
@@ -460,7 +462,7 @@ read_builtin (WORD_LIST *list)
   for (skip_ctlesc = skip_ctlnul = 0, e = ifs_chars; *e; e++)
     skip_ctlesc |= *e == CTLESC, skip_ctlnul |= *e == CTLNUL;
 
-  input_string = (char *)xmalloc (size = 112); /* XXX was 128 */
+  input_string = (char *)xmalloc (input_string_size = 496);    /* XXX was 128 */
   input_string[0] = '\0';
 
   pass_next = 0;       /* Non-zero signifies last char was backslash. */
@@ -616,13 +618,24 @@ read_builtin (WORD_LIST *list)
 #endif
       if (input_is_tty)
        {
+         int rc;
+
          /* ttsave() */
          termsave.fd = fd;
          ttgetattr (fd, &ttattrs);
          termsave.attrs = ttattrs;
 
-         ttset = ttattrs;        
-         if ((silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset)) < 0)
+         ttset = ttattrs;
+
+         if (nchars > 0)
+           rc = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset);
+         else          /* delim != '\n' */
+           {
+             rc = silent ? tt_setnoecho (&ttset) : 0;
+             if (rc >= 0)
+               rc = ttfd_seteol (fd, &ttset, delim);
+           }
+         if (rc < 0)
            sh_ttyerror (1);
          tty_modified = 1;
          add_unwind_protect (uw_ttyrestore, &termsave);
@@ -690,12 +703,11 @@ read_builtin (WORD_LIST *list)
   /* These only matter if edit == 0 */
   if ((nchars > 0) && (input_is_tty == 0) && ignore_delim)     /* read -N */
     unbuffered_read = 2;
-#if 0
-  else if ((nchars > 0) || (delim != '\n') || input_is_pipe)
-#else
-  else if (((nchars > 0 || delim != '\n') && input_is_tty) || input_is_pipe)
+  else if ((nchars > 0 && input_is_tty) || input_is_pipe)      /* read -n */
     unbuffered_read = 1;
-#endif
+  else if (delim != '\n' && input_is_tty)                      /* read -d */
+    unbuffered_read = 3;
+
   if (prompt && edit == 0)
     {
       fprintf (stderr, "%s", prompt);
@@ -759,9 +771,11 @@ read_builtin (WORD_LIST *list)
       if (tmsec > 0 || tmusec > 0)
        sigprocmask (SIG_SETMASK, &chldset, &prevset);
 #endif
-      if (unbuffered_read == 2)
+      if (unbuffered_read == 2)                        /* read -N */
        retval = posixly_correct ? zreadintr (fd, &c, 1) : zreadn (fd, &c, nchars - nr);
-      else if (unbuffered_read)
+      else if (unbuffered_read == 3)           /* read -d on a tty */
+       retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c);
+      else if (unbuffered_read)                        /* read -n or input_is_pipe */
        retval = posixly_correct ? zreadintr (fd, &c, 1) : zread (fd, &c, 1);
       else
        retval = posixly_correct ? zreadcintr (fd, &c) : zreadc (fd, &c);
@@ -811,10 +825,10 @@ read_builtin (WORD_LIST *list)
        check_read_timeout ();
 
       /* XXX -- use i + mb_cur_max (at least 4) for multibyte/read_mbchar */
-      if (i + (mb_cur_max > 4 ? mb_cur_max : 4) >= size)
+      if (i + (mb_cur_max > 4 ? mb_cur_max : 4) >= input_string_size)
        {
          char *x;
-         x = (char *)xrealloc (input_string, size += 128);
+         x = (char *)xrealloc (input_string, input_string_size += 512);
 
 #if 0
          /* This is, in theory, undefined behavior, since input_string may
@@ -1213,6 +1227,8 @@ read_mbchar (int fd, char *string, int ind, int ch, int delim, int unbuffered)
          /* We don't want to be interrupted during a multibyte char read */
          if (unbuffered == 2)
            r = zreadn (fd, &c, 1);
+         else if (unbuffered == 3)
+           r = zreadc (fd, &c);
          else if (unbuffered)
            r = zread (fd, &c, 1);
          else
index 2f8fc02afbee833a014e86323abcac7fbc15114e..25507f7f2623af52f86e8a977cd7a56234126f3a 100644 (file)
@@ -1,5 +1,5 @@
 <!-- Creator     : groff version 1.23.0 -->
-<!-- CreationDate: Wed Dec 31 13:23:39 2025 -->
+<!-- CreationDate: Thu Jan 29 13:25:46 2026 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -133,7 +133,7 @@ Bourne-Again SHell</p>
 
 
 <p style="margin-left:9%; margin-top: 1em">Bash is
-Copyright (C) 1989-2025 by the Free Software Foundation,
+Copyright (C) 1989-2026 by the Free Software Foundation,
 Inc.</p>
 
 <h2>DESCRIPTION
@@ -881,11 +881,17 @@ a semicolon to delimit commands.</p>
 
 <p style="margin-left:9%; margin-top: 1em">If a command is
 terminated by the control operator <b>&amp;</b>, the shell
-executes the command in the <i>background</i> in a subshell.
-The shell does not wait for the command to finish, and the
-return status is 0. These are referred to as
-<i>asynchronous</i> commands. Commands separated or
-terminated by <b>;</b> (or an equivalent
+executes the command asynchronously in a subshell. This is
+known as executing a command in the <i>background</i>, and
+these are referred to as <i>asynchronous</i> commands. The
+shell does not wait for the command to finish, and the
+return status is 0. When job control is not active, the
+standard input for asynchronous commands, in the absence of
+any explicit redirections involving the standard input, is
+redirected from <i>/dev/null</i>.</p>
+
+<p style="margin-left:9%; margin-top: 1em">Commands
+separated or terminated by <b>;</b> (or an equivalent
 <b>&lt;newline&gt;</b>) are executed sequentially; the shell
 waits for each command to terminate in turn.</p>
 
@@ -4607,12 +4613,13 @@ removed.</p>
 
 <p style="margin-left:9%; margin-top: 1em">The character
 <i>c</i> following the open brace must be a space, tab,
-newline, or <b>|</b>, and the close brace must be in a
-position where a reserved word may appear (i.e., preceded by
-a command terminator such as semicolon). <b>Bash</b> allows
-the close brace to be joined to the remaining characters in
-the word without being followed by a shell metacharacter as
-a reserved word would usually require.</p>
+newline, &ldquo;|&rdquo;, or &ldquo;;&rdquo;; and the close
+brace must be in a position where a reserved word may appear
+(i.e., preceded by a command terminator such as semicolon).
+<b>Bash</b> allows the close brace to be joined to the
+remaining characters in the word without being followed by a
+shell metacharacter as a reserved word would usually
+require.</p>
 
 <p style="margin-left:9%; margin-top: 1em">Any side effects
 of <i>command</i> take effect immediately in the current
@@ -4629,7 +4636,15 @@ execution environment, including the positional parameters,
 is shared with the caller.</p>
 
 <p style="margin-left:9%; margin-top: 1em">If the first
-character following the open brace is a <b>|</b>, the
+character following the open brace is a &ldquo;;&rdquo;, the
+construct behaves like the form above but preserves any
+trailing newlines in the output of <i>command</i> instead of
+removing them. This form is useful when the trailing
+newlines are significant and should not be stripped from the
+command&rsquo;s output.</p>
+
+<p style="margin-left:9%; margin-top: 1em">If the first
+character following the open brace is a &ldquo;|&rdquo;, the
 construct expands to the value of the <b>REPLY</b> shell
 variable after <i>command</i> executes, without removing any
 trailing newlines, and the standard output of <i>command</i>
@@ -6593,9 +6608,10 @@ in posix mode.</p>
 <p style="margin-left:9%; margin-top: 1em">If a command is
 followed by a <b>&amp;</b> and job control is not active,
 the default standard input for the command is the empty file
-<i>/dev/null</i>. Otherwise, the invoked command inherits
-the file descriptors of the calling shell as modified by
-redirections.</p>
+<i>/dev/null</i>, unless the command has an explicit
+redirection involving the standard input. Otherwise, the
+invoked command inherits the file descriptors of the calling
+shell as modified by redirections.</p>
 
 <h2>ENVIRONMENT
 <a name="ENVIRONMENT"></a>
@@ -8872,8 +8888,9 @@ facilities to extract the last word, as if the
 (M&minus;C&minus;e)</b></p>
 
 <p style="margin-left:18%;">Expand the line by performing
-shell word expansions. This performs alias and history
-expansion, <b>$</b>'<i>string</i>' and
+shell word expansions, treating the line as a single shell
+word. This performs alias and history expansion,
+<b>$</b>'<i>string</i>' and
 <b>$</b>&quot;<i>string</i>&quot; quoting, tilde expansion,
 parameter and variable expansion, arithmetic expansion,
 command and process substitution, word splitting, and quote
@@ -8882,6 +8899,27 @@ substitution. See <b><small>HISTORY EXPANSION</small></b>
 below for a description of history expansion.</p>
 
 
+<p style="margin-left:9%;"><b>shell&minus;expand&minus;and&minus;requote&minus;line
+()</b></p>
+
+<p style="margin-left:18%;">Expand the line by performing
+shell word expansions, splitting the line into shell words
+in the same way as for programmable completion. This
+performs alias and history expansion,
+<b>$</b>'<i>string</i>' and
+<b>$</b>&quot;<i>string</i>&quot; quoting, tilde expansion,
+parameter and variable expansion, arithmetic expansion,
+command and process substitution, word splitting, and quote
+removal on each word, then quotes the resulting words if
+necessary to prevent further expansion. An explicit argument
+suppresses command and process substitution and quotes each
+resultant word. As usual, double-quoting a word will
+suppress word splitting. This can be useful when combined
+with suppressing command substitution, for instance, so the
+words in the command substitution aren&rsquo;t quoted
+individually.</p>
+
+
 <p style="margin-left:9%;"><b>history&minus;expand&minus;line
 (M&minus;^)</b></p>
 
index 762bd0a12f1e8db980dd58b0c85ebde0fb3644e0..df5767c5ded72afce6701d46a8064d58019e055d 100644 (file)
@@ -7662,7 +7662,10 @@ that allow shell escapes are particularly vulnerable), changing the
 current directory to a non-writable directory other than ‘$HOME’ after
 login, not allowing the restricted shell to execute shell scripts, and
 cleaning the environment of variables that cause some commands to modify
-their behavior (e.g., ‘VISUAL’ or ‘PAGER’).
+their behavior (e.g., ‘VISUAL’ or ‘PAGER’).  When setting up a
+restricted environment like this, it's important not to install or allow
+symbolic links in the new current directory, since those could be used
+to circumvent restrictions on writing to files.
 
    Modern systems provide more secure ways to implement a restricted
 environment, such as ‘jails’, ‘zones’, or ‘containers’.
@@ -13801,62 +13804,62 @@ Node: The Directory Stack\7f330317
 Node: Directory Stack Builtins\7f331114
 Node: Controlling the Prompt\7f335559
 Node: The Restricted Shell\7f338443
-Node: Bash POSIX Mode\7f341325
-Node: Shell Compatibility Mode\7f360741
-Node: Job Control\7f369748
-Node: Job Control Basics\7f370205
-Node: Job Control Builtins\7f376573
-Node: Job Control Variables\7f383361
-Node: Command Line Editing\7f384592
-Node: Introduction and Notation\7f386295
-Node: Readline Interaction\7f388647
-Node: Readline Bare Essentials\7f389835
-Node: Readline Movement Commands\7f391643
-Node: Readline Killing Commands\7f392639
-Node: Readline Arguments\7f394662
-Node: Searching\7f395752
-Node: Readline Init File\7f397995
-Node: Readline Init File Syntax\7f399298
-Node: Conditional Init Constructs\7f426249
-Node: Sample Init File\7f430634
-Node: Bindable Readline Commands\7f433754
-Node: Commands For Moving\7f435292
-Node: Commands For History\7f437756
-Node: Commands For Text\7f443147
-Node: Commands For Killing\7f447272
-Node: Numeric Arguments\7f450060
-Node: Commands For Completion\7f451212
-Node: Keyboard Macros\7f456908
-Node: Miscellaneous Commands\7f457609
-Node: Readline vi Mode\7f465152
-Node: Programmable Completion\7f466129
-Node: Programmable Completion Builtins\7f475865
-Node: A Programmable Completion Example\7f487602
-Node: Using History Interactively\7f492947
-Node: Bash History Facilities\7f493628
-Node: Bash History Builtins\7f497363
-Node: History Interaction\7f504958
-Node: Event Designators\7f509908
-Node: Word Designators\7f511486
-Node: Modifiers\7f513878
-Node: Installing Bash\7f515815
-Node: Basic Installation\7f516931
-Node: Compilers and Options\7f520807
-Node: Compiling For Multiple Architectures\7f521557
-Node: Installation Names\7f523310
-Node: Specifying the System Type\7f525544
-Node: Sharing Defaults\7f526290
-Node: Operation Controls\7f527004
-Node: Optional Features\7f528023
-Node: Reporting Bugs\7f540746
-Node: Major Differences From The Bourne Shell\7f542103
-Node: GNU Free Documentation License\7f563530
-Node: Indexes\7f588707
-Node: Builtin Index\7f589158
-Node: Reserved Word Index\7f596256
-Node: Variable Index\7f598701
-Node: Function Index\7f616114
-Node: Concept Index\7f630247
+Node: Bash POSIX Mode\7f341536
+Node: Shell Compatibility Mode\7f360952
+Node: Job Control\7f369959
+Node: Job Control Basics\7f370416
+Node: Job Control Builtins\7f376784
+Node: Job Control Variables\7f383572
+Node: Command Line Editing\7f384803
+Node: Introduction and Notation\7f386506
+Node: Readline Interaction\7f388858
+Node: Readline Bare Essentials\7f390046
+Node: Readline Movement Commands\7f391854
+Node: Readline Killing Commands\7f392850
+Node: Readline Arguments\7f394873
+Node: Searching\7f395963
+Node: Readline Init File\7f398206
+Node: Readline Init File Syntax\7f399509
+Node: Conditional Init Constructs\7f426460
+Node: Sample Init File\7f430845
+Node: Bindable Readline Commands\7f433965
+Node: Commands For Moving\7f435503
+Node: Commands For History\7f437967
+Node: Commands For Text\7f443358
+Node: Commands For Killing\7f447483
+Node: Numeric Arguments\7f450271
+Node: Commands For Completion\7f451423
+Node: Keyboard Macros\7f457119
+Node: Miscellaneous Commands\7f457820
+Node: Readline vi Mode\7f465363
+Node: Programmable Completion\7f466340
+Node: Programmable Completion Builtins\7f476076
+Node: A Programmable Completion Example\7f487813
+Node: Using History Interactively\7f493158
+Node: Bash History Facilities\7f493839
+Node: Bash History Builtins\7f497574
+Node: History Interaction\7f505169
+Node: Event Designators\7f510119
+Node: Word Designators\7f511697
+Node: Modifiers\7f514089
+Node: Installing Bash\7f516026
+Node: Basic Installation\7f517142
+Node: Compilers and Options\7f521018
+Node: Compiling For Multiple Architectures\7f521768
+Node: Installation Names\7f523521
+Node: Specifying the System Type\7f525755
+Node: Sharing Defaults\7f526501
+Node: Operation Controls\7f527215
+Node: Optional Features\7f528234
+Node: Reporting Bugs\7f540957
+Node: Major Differences From The Bourne Shell\7f542314
+Node: GNU Free Documentation License\7f563741
+Node: Indexes\7f588918
+Node: Builtin Index\7f589369
+Node: Reserved Word Index\7f596467
+Node: Variable Index\7f598912
+Node: Function Index\7f616325
+Node: Concept Index\7f630458
 \1f
 End Tag Table
 
index c861b55f4810ace55b2f2309219924d61b41a941..bfbb05a91d1048a35000cd8f38ef8d44c00181a3 100644 (file)
Binary files a/doc/bash.pdf and b/doc/bash.pdf differ
index dc5bd7d7f9fe435f23c7463e71d7b41af710ee46..9e025c4bd895515b4760f907e47e9d69b230e41f 100644 (file)
@@ -60,9 +60,9 @@
 @xrdef{Compound Commands-pg}{11}
 @xrdef{Looping Constructs-title}{Looping Constructs}
 @xrdef{Looping Constructs-snt}{Section@tie 3.2.5.1}
+@xrdef{Looping Constructs-pg}{12}
 @xrdef{Conditional Constructs-title}{Conditional Constructs}
 @xrdef{Conditional Constructs-snt}{Section@tie 3.2.5.2}
-@xrdef{Looping Constructs-pg}{12}
 @xrdef{Conditional Constructs-pg}{13}
 @xrdef{Command Grouping-title}{Grouping Commands}
 @xrdef{Command Grouping-snt}{Section@tie 3.2.5.3}
 @xrdef{Command Substitution-pg}{36}
 @xrdef{Arithmetic Expansion-title}{Arithmetic Expansion}
 @xrdef{Arithmetic Expansion-snt}{Section@tie 3.5.5}
+@xrdef{Arithmetic Expansion-pg}{37}
 @xrdef{Process Substitution-title}{Process Substitution}
 @xrdef{Process Substitution-snt}{Section@tie 3.5.6}
-@xrdef{Arithmetic Expansion-pg}{37}
 @xrdef{Word Splitting-title}{Word Splitting}
 @xrdef{Word Splitting-snt}{Section@tie 3.5.7}
 @xrdef{Process Substitution-pg}{38}
 @xrdef{Command Execution Environment-title}{Command Execution Environment}
 @xrdef{Command Execution Environment-snt}{Section@tie 3.7.3}
 @xrdef{Command Search and Execution-pg}{46}
-@xrdef{Command Execution Environment-pg}{46}
+@xrdef{Command Execution Environment-pg}{47}
 @xrdef{Environment-title}{Environment}
 @xrdef{Environment-snt}{Section@tie 3.7.4}
 @xrdef{Exit Status-title}{Exit Status}
 @xrdef{Bash POSIX Mode-pg}{116}
 @xrdef{Shell Compatibility Mode-title}{Shell Compatibility Mode}
 @xrdef{Shell Compatibility Mode-snt}{Section@tie 6.12}
-@xrdef{Shell Compatibility Mode-pg}{121}
+@xrdef{Shell Compatibility Mode-pg}{122}
 @xrdef{Job Control-title}{Job Control}
 @xrdef{Job Control-snt}{Chapter@tie 7}
 @xrdef{Job Control Basics-title}{Job Control Basics}
index 27c0dcf015280ce935cd4d56f2fbb81633d2792e..c7a7f16e3f8f7a2c6cf736841819eb601fa3b187 100644 (file)
@@ -55,7 +55,7 @@
 \entry{disown}{128}{\code {disown}}
 \entry{suspend}{128}{\code {suspend}}
 \entry{compgen}{161}{\code {compgen}}
-\entry{complete}{161}{\code {complete}}
+\entry{complete}{162}{\code {complete}}
 \entry{compopt}{165}{\code {compopt}}
 \entry{fc}{169}{\code {fc}}
 \entry{history}{170}{\code {history}}
index e7b501c51c3ac7aa81db2f87de28cdddaf05c92e..0296157d5de8c60ba54d51394af0a9af834ea627 100644 (file)
@@ -16,7 +16,7 @@
 \entry{\code {cd}}{53}
 \entry{\code {command}}{63}
 \entry{\code {compgen}}{161}
-\entry{\code {complete}}{161}
+\entry{\code {complete}}{162}
 \entry{\code {compopt}}{165}
 \entry{\code {continue}}{54}
 \initial {D}
index 80005c3b0dd3693d135e300e2f8e1c93953fbcd4..431e3ba78a040c95538e688c299632fdfa8846bb 100644 (file)
@@ -70,7 +70,7 @@
 \entry{command expansion}{45}{command expansion}
 \entry{command execution}{46}{command execution}
 \entry{command search}{46}{command search}
-\entry{execution environment}{46}{execution environment}
+\entry{execution environment}{47}{execution environment}
 \entry{environment}{48}{environment}
 \entry{exit status}{48}{exit status}
 \entry{signal handling}{49}{signal handling}
@@ -99,8 +99,8 @@
 \entry{restricted shell}{115}{restricted shell}
 \entry{POSIX description}{116}{POSIX description}
 \entry{POSIX Mode}{117}{POSIX Mode}
-\entry{Compatibility Level}{121}{Compatibility Level}
-\entry{Compatibility Mode}{121}{Compatibility Mode}
+\entry{Compatibility Level}{122}{Compatibility Level}
+\entry{Compatibility Mode}{122}{Compatibility Mode}
 \entry{job control}{125}{job control}
 \entry{foreground}{125}{foreground}
 \entry{background}{125}{background}
index 5be074b0c5c5612464afb43f7345e210b801985d..ae331a6e7c919d8e18316b069eed6ae860b39ba8 100644 (file)
@@ -31,8 +31,8 @@
 \entry{commands, shell}{9}
 \entry{commands, simple}{10}
 \entry{comments, shell}{9}
-\entry{Compatibility Level}{121}
-\entry{Compatibility Mode}{121}
+\entry{Compatibility Level}{122}
+\entry{Compatibility Mode}{122}
 \entry{completion builtins}{161}
 \entry{conditional arithmetic operator}{108}
 \entry{configuration}{175}
@@ -46,7 +46,7 @@
 \entry{environment}{48}
 \entry{evaluation, arithmetic}{107}
 \entry{event designators}{172}
-\entry{execution environment}{46}
+\entry{execution environment}{47}
 \entry{exit status}{3, 48}
 \entry{expansion}{25}
 \entry{expansion, arithmetic}{37}
index 085b67902c1ff293203dfde6787ddb26d05316bc..fd2e5855d038c745ba8e48bb768ed8f9073f13cd 100644 (file)
 \entry{glob-expand-word (C-x *)}{157}{\code {glob-expand-word (C-x *)}}
 \entry{glob-list-expansions (C-x g)}{157}{\code {glob-list-expansions (C-x g)}}
 \entry{shell-expand-line (M-C-e)}{157}{\code {shell-expand-line (M-C-e)}}
-\entry{history-expand-line (M-^)}{157}{\code {history-expand-line (M-^)}}
+\entry{shell-expand-and-requote-line ()}{157}{\code {shell-expand-and-requote-line ()}}
+\entry{history-expand-line (M-^)}{158}{\code {history-expand-line (M-^)}}
 \entry{magic-space ()}{158}{\code {magic-space ()}}
 \entry{alias-expand-line ()}{158}{\code {alias-expand-line ()}}
 \entry{history-and-alias-expand-line ()}{158}{\code {history-and-alias-expand-line ()}}
index 8a3822804980f34f1e95c8530770d464fedeef23..ed1685caa8f7d341834a2a5cd9266526e9a4989e 100644 (file)
@@ -62,7 +62,7 @@
 \entry{\code {glob-list-expansions (C-x g)}}{157}
 \initial {H}
 \entry{\code {history-and-alias-expand-line ()}}{158}
-\entry{\code {history-expand-line (M-^)}}{157}
+\entry{\code {history-expand-line (M-^)}}{158}
 \entry{\code {history-search-backward ()}}{149}
 \entry{\code {history-search-forward ()}}{149}
 \entry{\code {history-substring-search-backward ()}}{149}
 \entry{\code {set-mark (C-@)}}{156}
 \entry{\code {shell-backward-kill-word ()}}{152}
 \entry{\code {shell-backward-word (M-C-b)}}{147}
+\entry{\code {shell-expand-and-requote-line ()}}{157}
 \entry{\code {shell-expand-line (M-C-e)}}{157}
 \entry{\code {shell-forward-word (M-C-f)}}{147}
 \entry{\code {shell-kill-word (M-C-d)}}{152}
index 9f1985339e7b83649d5eb9a69c56133fdfd5900e..883dac9f2e71a2a1caae239f5208d985a97dbc03 100644 (file)
@@ -4,13 +4,13 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <!-- This text is a brief description of the features that are present in
-the Bash shell (version 5.3, 26 December 2025).
+the Bash shell (version 5.3, 14 January 2026).
 
-This is Edition 5.3, last updated 26 December 2025,
+This is Edition 5.3, last updated 14 January 2026,
 of The GNU Bash Reference Manual,
 for Bash, Version 5.3.
 
-Copyright © 1988-2025 Free Software Foundation, Inc.
+Copyright © 1988-2026 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -69,7 +69,6 @@ ul.toc-numbered-mark {list-style: none}
 
 
 
-
 <div class="top-level-extent" id="Top">
 <div class="nav-panel">
 <p>
@@ -78,10 +77,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
 <h1 class="top" id="Bash-Features-1"><span>Bash Features<a class="copiable-link" href="#Bash-Features-1"> &para;</a></span></h1>
 
 <p>This text is a brief description of the features that are present in
-the Bash shell (version 5.3, 26 December 2025).
+the Bash shell (version 5.3, 14 January 2026).
 The Bash home page is <a class="url" href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
 </p>
-<p>This is Edition 5.3, last updated 26 December 2025,
+<p>This is Edition 5.3, last updated 14 January 2026,
 of <cite class="cite">The GNU Bash Reference Manual</cite>,
 for <code class="code">Bash</code>, Version 5.3.
 </p>
@@ -1223,8 +1222,9 @@ and these are referred to as <em class="dfn">asynchronous</em> commands.
 The shell does not wait for the command to finish, and the return
 status is 0 (true).
 When job control is not active (see <a class="pxref" href="#Job-Control">Job Control</a>),
-the standard input for asynchronous commands, in the absence of any
-explicit redirections, is redirected from <code class="code">/dev/null</code>.
+the standard input for asynchronous commands,
+in the absence of any explicit redirections involving the standard input,
+is redirected from <samp class="file">/dev/null</samp>.
 </p>
 <p>Commands separated or terminated by 
 &lsquo;<samp class="samp">;</samp>&rsquo; (or equivalent <code class="code">newline</code>)
@@ -3296,7 +3296,8 @@ the parentheses make up the command; none are treated specially.
 and captures its output, again with trailing newlines removed.
 </p>
 <p>The character <var class="var">c</var> following the open brace must be a space, tab,
-newline, or &lsquo;<samp class="samp">|</samp>&rsquo;, and the close brace must be in a position
+newline, &lsquo;<samp class="samp">|</samp>&rsquo;, or &lsquo;<samp class="samp">;</samp>&rsquo;;
+and the close brace must be in a position
 where a reserved word may appear (i.e., preceded by a command terminator
 such as semicolon).
 Bash allows the close brace to be joined to the remaining characters in
@@ -3315,8 +3316,17 @@ function is executing, and the <code class="code">return</code> builtin forces
 however, the rest of the execution environment,
 including the positional parameters, is shared with the caller.
 </p>
-<p>If the first character following the open brace
-is a &lsquo;<samp class="samp">|</samp>&rsquo;, the construct expands to the
+<p>If the first character following the open brace is a
+&lsquo;<samp class="samp">;</samp>&rsquo;,
+the construct behaves like the form above but
+preserves any trailing newlines in the output of <var class="var">command</var>
+instead of removing them.
+This form is useful when the trailing newlines are significant
+and should not be stripped from the command&rsquo;s output.
+</p>
+<p>If the first character following the open brace is a
+&lsquo;<samp class="samp">|</samp>&rsquo;,
+the construct expands to the
 value of the <code class="code">REPLY</code> shell variable after <var class="var">command</var> executes,
 without removing any trailing newlines,
 and the standard output of <var class="var">command</var> remains the same as in the
@@ -4351,7 +4361,8 @@ See the description of the <code class="code">inherit_errexit</code> shell optio
 in <small class="sc">POSIX</small> mode.
 </p>
 <p>If a command is followed by a &lsquo;<samp class="samp">&amp;</samp>&rsquo; and job control is not active, the
-default standard input for the command is the empty file <samp class="file">/dev/null</samp>.
+default standard input for the command is the empty file <samp class="file">/dev/null</samp>,
+unless the command has an explicit redirection involving the standard input.
 Otherwise, the invoked command inherits the file descriptors of the calling
 shell as modified by redirections.
 </p>
@@ -10186,6 +10197,9 @@ directory to a non-writable directory other than <code class="env">$HOME</code>
 not allowing the restricted shell to execute shell scripts, and cleaning
 the environment of variables that cause some commands to modify their
 behavior (e.g., <code class="env">VISUAL</code> or <code class="env">PAGER</code>).
+When setting up a restricted environment like this, it&rsquo;s important not
+to install or allow symbolic links in the new current directory, since
+those could be used to circumvent restrictions on writing to files.
 </p>
 <p>Modern systems provide more secure ways to implement a restricted environment,
 such as <code class="code">jails</code>, <code class="code">zones</code>, or <code class="code">containers</code>.
@@ -10263,7 +10277,8 @@ The Bash <em class="dfn">posix mode</em> changes the Bash
 behavior in these areas so that it conforms more strictly
 to the standard.
 </p>
-<p>Starting Bash with the <samp class="option">--posix</samp> command-line option or executing
+<p>Starting Bash with the <samp class="option">--posix</samp> or <samp class="option">-o posix</samp>
+command-line option or executing
 &lsquo;<samp class="samp">set -o posix</samp>&rsquo; while Bash is running will cause Bash to conform more
 closely to the <small class="sc">POSIX</small> standard by changing the behavior to
 match that specified by <small class="sc">POSIX</small> in areas where the Bash default differs.
@@ -10359,6 +10374,15 @@ This is also available with &lsquo;<samp class="samp">shopt -s checkhash</samp>&
 command hash table, even if it returns it as a (last-ditch) result
 from a <code class="env">$PATH</code> search.
 
+</li><li> Normally, when job control is not enabled,
+the shell implicitly redirects the standard input of
+asynchronous commands from <samp class="file">/dev/null</samp>.
+A redirection to the standard input in this command inhibits this
+implicit redirection.
+In <small class="sc">POSIX</small> mode, a redirection that redirects file descriptor 0
+to itself (e.g., &lsquo;<samp class="samp">&lt;&amp;0</samp>&rsquo;) does not count as a redirection that
+overrides the implicit redirection from <samp class="file">/dev/null</samp>.
+
 </li><li> The message printed by the job control code and builtins when a job
 exits with a non-zero status is &ldquo;Done(status)&rdquo;.
 
@@ -13512,13 +13536,34 @@ pathname expansion.
 </p>
 </dd>
 <dt><a id="index-shell_002dexpand_002dline-_0028M_002dC_002de_0029"></a><span><code class="code">shell-expand-line (M-C-e)</code><a class="copiable-link" href="#index-shell_002dexpand_002dline-_0028M_002dC_002de_0029"> &para;</a></span></dt>
-<dd><p>Expand the line by performing shell word expansions.  
+<dd><p>Expand the line by performing shell word expansions,
+treating the line as a single shell word.
+This performs alias and history expansion,
+$&rsquo;<var class="var">string</var>&rsquo; and $&quot;<var class="var">string</var>&quot; quoting,
+tilde expansion, parameter and variable expansion, arithmetic expansion,
+command and process substitution,
+word splitting, and quote removal.
+An explicit argument suppresses command and process substitution and
+treats the line as if it were quoted as part of a here-document.
+</p>
+</dd>
+<dt><a id="index-shell_002dexpand_002dand_002drequote_002dline-_0028_0029"></a><span><code class="code">shell-expand-and-requote-line ()</code><a class="copiable-link" href="#index-shell_002dexpand_002dand_002drequote_002dline-_0028_0029"> &para;</a></span></dt>
+<dd><p>Expand the line by performing shell word expansions,
+splitting the line into shell words in the same way as for
+programmable completion.
 This performs alias and history expansion,
 $&rsquo;<var class="var">string</var>&rsquo; and $&quot;<var class="var">string</var>&quot; quoting,
 tilde expansion, parameter and variable expansion, arithmetic expansion,
 command and process substitution,
-word splitting, and quote removal.  
-An explicit argument suppresses command and process substitution.
+word splitting, and quote removal
+on each word, then quotes the resulting words if necessary to
+prevent further expansion.
+An explicit argument suppresses command and process substitution
+and quotes each resultant word.
+As usual, double-quoting a word will suppress word splitting.
+This can be useful when combined with suppressing command substitution,
+for instance, so the words in the command substitution aren&rsquo;t
+quoted individually.
 </p>
 </dd>
 <dt><a id="index-history_002dexpand_002dline-_0028M_002d_005e_0029"></a><span><code class="code">history-expand-line (M-^)</code><a class="copiable-link" href="#index-history_002dexpand_002dline-_0028M_002d_005e_0029"> &para;</a></span></dt>
@@ -17604,6 +17649,7 @@ Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previ
 <tr><td></td><td class="printindex-index-entry"><a href="#index-set_002dmark-_0028C_002d_0040_0029"><code>set-mark (C-@)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
 <tr><td></td><td class="printindex-index-entry"><a href="#index-shell_002dbackward_002dkill_002dword-_0028_0029"><code>shell-backward-kill-word ()</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr>
 <tr><td></td><td class="printindex-index-entry"><a href="#index-shell_002dbackward_002dword-_0028M_002dC_002db_0029"><code>shell-backward-word (M-C-b)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a href="#index-shell_002dexpand_002dand_002drequote_002dline-_0028_0029"><code>shell-expand-and-requote-line ()</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
 <tr><td></td><td class="printindex-index-entry"><a href="#index-shell_002dexpand_002dline-_0028M_002dC_002de_0029"><code>shell-expand-line (M-C-e)</code></a></td><td class="printindex-index-section"><a href="#Miscellaneous-Commands">Miscellaneous Commands</a></td></tr>
 <tr><td></td><td class="printindex-index-entry"><a href="#index-shell_002dforward_002dword-_0028M_002dC_002df_0029"><code>shell-forward-word (M-C-f)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Moving">Commands For Moving</a></td></tr>
 <tr><td></td><td class="printindex-index-entry"><a href="#index-shell_002dkill_002dword-_0028M_002dC_002dd_0029"><code>shell-kill-word (M-C-d)</code></a></td><td class="printindex-index-section"><a href="#Commands-For-Killing">Commands For Killing</a></td></tr>
index 989e3f60959fdf913e9746d0591981205ce9a96c..c3af797c66e57cf5bc84d1db0cd4343e276f8987 100644 (file)
@@ -7663,7 +7663,10 @@ that allow shell escapes are particularly vulnerable), changing the
 current directory to a non-writable directory other than ‘$HOME’ after
 login, not allowing the restricted shell to execute shell scripts, and
 cleaning the environment of variables that cause some commands to modify
-their behavior (e.g., ‘VISUAL’ or ‘PAGER’).
+their behavior (e.g., ‘VISUAL’ or ‘PAGER’).  When setting up a
+restricted environment like this, it's important not to install or allow
+symbolic links in the new current directory, since those could be used
+to circumvent restrictions on writing to files.
 
    Modern systems provide more secure ways to implement a restricted
 environment, such as ‘jails’, ‘zones’, or ‘containers’.
@@ -13802,62 +13805,62 @@ Node: The Directory Stack\7f330536
 Node: Directory Stack Builtins\7f331336
 Node: Controlling the Prompt\7f335784
 Node: The Restricted Shell\7f338671
-Node: Bash POSIX Mode\7f341556
-Node: Shell Compatibility Mode\7f360975
-Node: Job Control\7f369985
-Node: Job Control Basics\7f370445
-Node: Job Control Builtins\7f376816
-Node: Job Control Variables\7f383607
-Node: Command Line Editing\7f384841
-Node: Introduction and Notation\7f386547
-Node: Readline Interaction\7f388902
-Node: Readline Bare Essentials\7f390093
-Node: Readline Movement Commands\7f391904
-Node: Readline Killing Commands\7f392903
-Node: Readline Arguments\7f394929
-Node: Searching\7f396022
-Node: Readline Init File\7f398268
-Node: Readline Init File Syntax\7f399574
-Node: Conditional Init Constructs\7f426528
-Node: Sample Init File\7f430916
-Node: Bindable Readline Commands\7f434039
-Node: Commands For Moving\7f435580
-Node: Commands For History\7f438047
-Node: Commands For Text\7f443441
-Node: Commands For Killing\7f447569
-Node: Numeric Arguments\7f450360
-Node: Commands For Completion\7f451515
-Node: Keyboard Macros\7f457214
-Node: Miscellaneous Commands\7f457918
-Node: Readline vi Mode\7f465464
-Node: Programmable Completion\7f466444
-Node: Programmable Completion Builtins\7f476183
-Node: A Programmable Completion Example\7f487923
-Node: Using History Interactively\7f493271
-Node: Bash History Facilities\7f493955
-Node: Bash History Builtins\7f497693
-Node: History Interaction\7f505291
-Node: Event Designators\7f510244
-Node: Word Designators\7f511825
-Node: Modifiers\7f514220
-Node: Installing Bash\7f516160
-Node: Basic Installation\7f517279
-Node: Compilers and Options\7f521158
-Node: Compiling For Multiple Architectures\7f521911
-Node: Installation Names\7f523667
-Node: Specifying the System Type\7f525904
-Node: Sharing Defaults\7f526653
-Node: Operation Controls\7f527370
-Node: Optional Features\7f528392
-Node: Reporting Bugs\7f541118
-Node: Major Differences From The Bourne Shell\7f542478
-Node: GNU Free Documentation License\7f563908
-Node: Indexes\7f589088
-Node: Builtin Index\7f589542
-Node: Reserved Word Index\7f596643
-Node: Variable Index\7f599091
-Node: Function Index\7f616507
-Node: Concept Index\7f630643
+Node: Bash POSIX Mode\7f341767
+Node: Shell Compatibility Mode\7f361186
+Node: Job Control\7f370196
+Node: Job Control Basics\7f370656
+Node: Job Control Builtins\7f377027
+Node: Job Control Variables\7f383818
+Node: Command Line Editing\7f385052
+Node: Introduction and Notation\7f386758
+Node: Readline Interaction\7f389113
+Node: Readline Bare Essentials\7f390304
+Node: Readline Movement Commands\7f392115
+Node: Readline Killing Commands\7f393114
+Node: Readline Arguments\7f395140
+Node: Searching\7f396233
+Node: Readline Init File\7f398479
+Node: Readline Init File Syntax\7f399785
+Node: Conditional Init Constructs\7f426739
+Node: Sample Init File\7f431127
+Node: Bindable Readline Commands\7f434250
+Node: Commands For Moving\7f435791
+Node: Commands For History\7f438258
+Node: Commands For Text\7f443652
+Node: Commands For Killing\7f447780
+Node: Numeric Arguments\7f450571
+Node: Commands For Completion\7f451726
+Node: Keyboard Macros\7f457425
+Node: Miscellaneous Commands\7f458129
+Node: Readline vi Mode\7f465675
+Node: Programmable Completion\7f466655
+Node: Programmable Completion Builtins\7f476394
+Node: A Programmable Completion Example\7f488134
+Node: Using History Interactively\7f493482
+Node: Bash History Facilities\7f494166
+Node: Bash History Builtins\7f497904
+Node: History Interaction\7f505502
+Node: Event Designators\7f510455
+Node: Word Designators\7f512036
+Node: Modifiers\7f514431
+Node: Installing Bash\7f516371
+Node: Basic Installation\7f517490
+Node: Compilers and Options\7f521369
+Node: Compiling For Multiple Architectures\7f522122
+Node: Installation Names\7f523878
+Node: Specifying the System Type\7f526115
+Node: Sharing Defaults\7f526864
+Node: Operation Controls\7f527581
+Node: Optional Features\7f528603
+Node: Reporting Bugs\7f541329
+Node: Major Differences From The Bourne Shell\7f542689
+Node: GNU Free Documentation License\7f564119
+Node: Indexes\7f589299
+Node: Builtin Index\7f589753
+Node: Reserved Word Index\7f596854
+Node: Variable Index\7f599302
+Node: Function Index\7f616718
+Node: Concept Index\7f630854
 \1f
 End Tag Table
 
index 84bd52e3581ef20af57ddfc7b8f97f1a687a081f..744613ec8eb6c641e8bdbccc5baa5172c51fd231 100644 (file)
@@ -1,12 +1,12 @@
-This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2025/MacPorts 2025.74524_1) (preloaded format=pdfetex 2025.9.16)  31 DEC 2025 13:23
+This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2025/MacPorts 2025.74524_1) (preloaded format=pdfetex 2025.9.16)  29 JAN 2026 13:25
 entering extended mode
  restricted \write18 enabled.
  file:line:error style messages enabled.
  %&-line parsing enabled.
-**\input /usr/local/src/bash/bash-20251226/doc/bashref.texi \input /usr/local/s
-rc/bash/bash-20251226/doc/bashref.texi
-(/usr/local/src/bash/bash-20251226/doc/bashref.texi
-(/usr/local/src/bash/bash-20251226/doc/texinfo.tex
+**\input /usr/local/src/bash/bash-20260123/doc/bashref.texi \input /usr/local/s
+rc/bash/bash-20260123/doc/bashref.texi
+(/usr/local/src/bash/bash-20260123/doc/bashref.texi
+(/usr/local/src/bash/bash-20260123/doc/texinfo.tex
 Loading texinfo [version 2015-11-22.14]:
 \outerhsize=\dimen16
 \outervsize=\dimen17
@@ -162,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-20251226/doc/version.texi) [1{/opt/local/var/db/texmf
+(/usr/local/src/bash/bash-20260123/doc/version.texi) [1{/opt/local/var/db/texmf
 /fonts/map/pdftex/updmap/pdftex.map}] [2]
-(/usr/local/build/bash/bash-20251226/doc/bashref.toc [-1] [-2] [-3]) [-4]
-(/usr/local/build/bash/bash-20251226/doc/bashref.toc)
-(/usr/local/build/bash/bash-20251226/doc/bashref.toc) Chapter 1
+(/usr/local/build/bash/bash-20260123/doc/bashref.toc [-1] [-2] [-3]) [-4]
+(/usr/local/build/bash/bash-20260123/doc/bashref.toc)
+(/usr/local/build/bash/bash-20260123/doc/bashref.toc) Chapter 1
 \openout0 = `bashref.toc'.
 
 
-(/usr/local/build/bash/bash-20251226/doc/bashref.aux)
+(/usr/local/build/bash/bash-20260123/doc/bashref.aux)
 \openout1 = `bashref.aux'.
 
  [1] Chapter 2 [2]
@@ -232,7 +232,7 @@ exlive/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [21] [22] [23] [24]
  [52]
 [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67]
 [68] [69] [70] [71] [72] [73]
-Overfull \hbox (38.26585pt too wide) in paragraph at lines 5952--5952
+Overfull \hbox (38.26585pt too wide) in paragraph at lines 5964--5964
  []@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [
 -] [@textttsl ar-gu-ment []@texttt ][] 
 
@@ -245,7 +245,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5952--5952
 .etc.
 
 
-Overfull \hbox (38.26585pt too wide) in paragraph at lines 5953--5953
+Overfull \hbox (38.26585pt too wide) in paragraph at lines 5965--5965
  []@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [
 -] [@textttsl ar-gu-ment []@texttt ][] 
 
@@ -265,7 +265,7 @@ Chapter 7 [124] [125] [126] [127] [128]
 texinfo.tex: doing @include of rluser.texi
 
 
-(/usr/local/src/bash/bash-20251226/lib/readline/doc/rluser.texi Chapter 8
+(/usr/local/src/bash/bash-20260123/lib/readline/doc/rluser.texi Chapter 8
 [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140]
 Underfull \hbox (badness 7540) in paragraph at lines 969--975
  []@textrm In the ex-am-ple above, @textttsl C-u[] @textrm is bound to the func
@@ -314,10 +314,10 @@ gnored[]
 texinfo.tex: doing @include of hsuser.texi
 
 
-(/usr/local/src/bash/bash-20251226/lib/readline/doc/hsuser.texi Chapter 9
+(/usr/local/src/bash/bash-20260123/lib/readline/doc/hsuser.texi Chapter 9
 [167] [168] [169] [170] [171] [172] [173]) Chapter 10 [174] [175] [176]
 [177] [178]
-Underfull \hbox (badness 10000) in paragraph at lines 10767--10776
+Underfull \hbox (badness 10000) in paragraph at lines 10793--10802
 []@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem
 entation[]@textrm '[],
 
@@ -330,7 +330,7 @@ entation[]@textrm '[],
 .etc.
 
 
-Underfull \hbox (badness 10000) in paragraph at lines 10767--10776
+Underfull \hbox (badness 10000) in paragraph at lines 10793--10802
 @textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t
 extrm '[], `@texttt strict-posix-default[]@textrm '[], and
 
@@ -347,13 +347,13 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and
 texinfo.tex: doing @include of fdl.texi
 
 
-(/usr/local/src/bash/bash-20251226/doc/fdl.texi [192] [193] [194] [195]
+(/usr/local/src/bash/bash-20260123/doc/fdl.texi [192] [193] [194] [195]
 [196] [197] [198]) Appendix D [199] [200] [201] [202] [203] [204] [205]
 [206] [207] [208] ) 
 Here is how much of TeX's memory you used:
  4116 strings out of 495820
  47662 string characters out of 6170887
- 145127 words of memory out of 5000000
+ 145125 words of memory out of 5000000
  5053 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
@@ -374,10 +374,10 @@ fonts/type1/public/amsfonts/cm/cmti10.pfb></opt/local/share/texmf-texlive/fonts
 lic/amsfonts/cm/cmtt9.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm
 -super/sfrm1095.pfb></opt/local/share/texmf-texlive/fonts/type1/public/cm-super
 /sfrm1440.pfb>
-Output written on bashref.pdf (214 pages, 811602 bytes).
+Output written on bashref.pdf (214 pages, 813195 bytes).
 PDF statistics:
- 2947 PDF objects out of 2984 (max. 8388607)
- 2685 compressed objects within 27 object streams
+ 2948 PDF objects out of 2984 (max. 8388607)
+ 2686 compressed objects within 27 object streams
  342 named destinations out of 1000 (max. 500000)
  1157 words of extra memory for PDF output out of 10000 (max. 10000000)
 
index 1987acd948610f0d1a25ae37856ad062eeea9753..ecf3add52c8b5a6c3f833c431395bb3e91b77826 100644 (file)
Binary files a/doc/bashref.pdf and b/doc/bashref.pdf differ
index 83a36b398afaa4336098bc5b524d61690c2abf67..3cc53c9ec824dd3c73d65055d3bde7a9ed7caf2c 100644 (file)
@@ -9188,6 +9188,9 @@ directory to a non-writable directory other than @env{$HOME} after login,
 not allowing the restricted shell to execute shell scripts, and cleaning
 the environment of variables that cause some commands to modify their
 behavior (e.g., @env{VISUAL} or @env{PAGER}).
+When setting up a restricted environment like this, it's important not
+to install or allow symbolic links in the new current directory, since
+those could be used to circumvent restrictions on writing to files.
 
 Modern systems provide more secure ways to implement a restricted environment,
 such as @code{jails}, @code{zones}, or @code{containers}.
index a2be1443f8ec3545afcf8a1929bfe7b0cbcf8e9d..b6aefea7f717b5d212f040b0f7725e4a8e06d0a4 100644 (file)
 @numsubsecentry{Redirecting Output}{3.6.2}{}{43}
 @numsubsecentry{Appending Redirected Output}{3.6.3}{}{43}
 @numsubsecentry{Redirecting Standard Output and Standard Error}{3.6.4}{}{43}
-@numsubsecentry{Appending Standard Output and Standard Error}{3.6.5}{}{43}
+@numsubsecentry{Appending Standard Output and Standard Error}{3.6.5}{}{44}
 @numsubsecentry{Here Documents}{3.6.6}{}{44}
 @numsubsecentry{Here Strings}{3.6.7}{}{44}
-@numsubsecentry{Duplicating File Descriptors}{3.6.8}{}{44}
+@numsubsecentry{Duplicating File Descriptors}{3.6.8}{}{45}
 @numsubsecentry{Moving File Descriptors}{3.6.9}{}{45}
 @numsubsecentry{Opening File Descriptors for Reading and Writing}{3.6.10}{}{45}
 @numsecentry{Executing Commands}{3.7}{Executing Commands}{45}
 @numsubsecentry{Simple Command Expansion}{3.7.1}{Simple Command Expansion}{45}
 @numsubsecentry{Command Search and Execution}{3.7.2}{Command Search and Execution}{46}
-@numsubsecentry{Command Execution Environment}{3.7.3}{Command Execution Environment}{46}
+@numsubsecentry{Command Execution Environment}{3.7.3}{Command Execution Environment}{47}
 @numsubsecentry{Environment}{3.7.4}{Environment}{48}
 @numsubsecentry{Exit Status}{3.7.5}{Exit Status}{48}
 @numsubsecentry{Signals}{3.7.6}{Signals}{49}
@@ -85,7 +85,7 @@
 @numsecentry{Bash and POSIX}{6.11}{Bash POSIX Mode}{116}
 @numsubsecentry{What is POSIX?}{6.11.1}{}{116}
 @numsubsecentry{Bash POSIX Mode}{6.11.2}{}{117}
-@numsecentry{Shell Compatibility Mode}{6.12}{Shell Compatibility Mode}{121}
+@numsecentry{Shell Compatibility Mode}{6.12}{Shell Compatibility Mode}{122}
 @numchapentry{Job Control}{7}{Job Control}{125}
 @numsecentry{Job Control Basics}{7.1}{Job Control Basics}{125}
 @numsecentry{Job Control Builtins}{7.2}{Job Control Builtins}{126}
index ba8cca4858bde4294af886c7638a82dab4ae1dce..2393a3ae43d3144794be672bb39fb55dfed127a0 100644 (file)
Binary files a/doc/builtins.pdf and b/doc/builtins.pdf differ
diff --git a/eval.c b/eval.c
index 13334457ac5f8919d060140a9e7d0ae5a6bfd2a8..5e01cc5636e6db90b5af85f74f32e98d232a6127 100644 (file)
--- a/eval.c
+++ b/eval.c
@@ -1,6 +1,6 @@
 /* eval.c -- reading and evaluating commands. */
 
-/* Copyright (C) 1996-2025 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2026 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -385,6 +385,7 @@ read_command (void)
   SHELL_VAR *tmout_var;
   int tmout_len, result;
   SigHandler *old_alrm;
+  char *t, *e;
 
   set_current_prompt_level (1);
   global_command = (COMMAND *)NULL;
@@ -400,8 +401,9 @@ read_command (void)
 
       if (tmout_var && var_isset (tmout_var))
        {
-         tmout_len = atoi (value_cell (tmout_var));
-         if (tmout_len > 0)
+         t = value_cell (tmout_var);
+         tmout_len = (int)strtol (t, &e, 10);
+         if (e != t && *e == '\0' && tmout_len > 0)
            {
              old_alrm = set_signal_handler (SIGALRM, alrm_catcher);
              alarm (tmout_len);
index 299e4a05b7ff9cc887bbfdd0a631156f3afbf7b3..9e0b3843317ee4a9d87e7bad73e0abaf167a186b 100644 (file)
@@ -1,6 +1,22 @@
+#   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/>.
+#
+
+# Toy nohup implementation
+
 (
        if [ -t 1 ]; then
-               exec 1>>nohup.out || exec 1>>~/nohup.out
+               command exec 1>>nohup.out || exec 1>>~/nohup.out
        fi
        if [ -t 2 ]; then
                exec 2>&1
index 75239024f0f5cc0d653503f6513bbef343cd8bc5..647d1470e4afc959bf719235e03fc187d0b19444 100644 (file)
--- a/general.c
+++ b/general.c
@@ -1459,15 +1459,15 @@ conf_standard_path (void)
 int
 default_columns (void)
 {
-  char *v;
+  char *v, *e;
   int c;
 
   c = -1;
   v = get_string_value ("COLUMNS");
   if (v && *v)
     {
-      c = atoi (v);
-      if (c > 0)
+      c = (int)strtol (v, &e, 10);
+      if (e != v && *e == '\0' && c > 0)
        return c;
     }
 
index e68f4193e8bab043ec7a471c39a5bcf211e241d0..b3931d83419e7ffda7a1b364013d71cc3a87b751 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2020,2022 Free Software Foundation, Inc. */
+/* Copyright (C) 1999-2026 Free Software Foundation, Inc. */
 
 /* This file is part of GNU Bash, the Bourne Again SHell.
 
diff --git a/lib/readline/NEW/xxx-autocomplete b/lib/readline/NEW/xxx-autocomplete
deleted file mode 100644 (file)
index fdc2ad0..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#if defined (READLINE_AUTOCOMPLETE)
-/* Return the list of completions for the text between START and END.
-   FOUND_QUOTE is non-zero if we're completing a quoted word; if so,
-   QUOTE_CHAR is the delimiter.  If NONTRIVIAL_P is nonzero, it gets
-   set to a flag saying whether or not the completion added anything
-   to the word.  Not part of rl_complete_internal because it's too
-   hard to separate functions without postprocess_matches possibly being
-   called twice; here to support the autocompletion code. */
-char **
-_rl_generate_completions (start, end, found_quote, quote_char, nontrivial_p)
-     int start, end, found_quote, quote_char, *nontrivial_p;
-{
-  rl_compentry_func_t *our_func;
-  char *text;
-  char **matches;
-
-  our_func = rl_completion_entry_function
-               ? rl_completion_entry_function
-               : rl_filename_completion_function;
-  text = rl_copy_text (start, end);
-  matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
-
-  /* *nontrivial_p is set if the common prefix adds something to the word
-     being completed. */
-  if (nontrivial_p)
-    *nontrivial_p = matches && strcmp (text, matches[0]) != 0;
-
-  free (text);
-
-  /* Postprocess the matches */
-  if (matches == 0)
-    return (char **)0;
-
-  if (postprocess_matches (&matches, rl_filename_completion_desired) == 0)
-    return (char **)0;
-
-  return 0;
-}
-#endif
diff --git a/lib/readline/doc/rluser.info b/lib/readline/doc/rluser.info
deleted file mode 100644 (file)
index ea82096..0000000
+++ /dev/null
@@ -1,1648 +0,0 @@
-This is rluser.info, produced by makeinfo version 7.1 from rluser.texi.
-
-\1f
-File: rluser.info,  Node: Command Line Editing
-
-1 Command Line Editing
-**********************
-
-This chapter describes the basic features of the GNU command line
-editing interface.
-
-* Menu:
-
-* Introduction and Notation::  Notation used in this text.
-* Readline Interaction::       The minimum set of commands for editing a line.
-* Readline Init File::         Customizing Readline from a user's view.
-* Bindable Readline Commands:: A description of most of the Readline commands
-                               available for binding
-* Readline vi Mode::           A short description of how to make Readline
-                               behave like the vi editor.
-
-\1f
-File: rluser.info,  Node: Introduction and Notation,  Next: Readline Interaction,  Up: Command Line Editing
-
-1.1 Introduction to Line Editing
-================================
-
-The following paragraphs use Emacs style to describe the notation used
-to represent keystrokes.
-
-   The text ‘C-k’ is read as 'Control-K' and describes the character
-produced when the <k> key is pressed while the Control key is depressed.
-
-   The text ‘M-k’ is read as 'Meta-K' and describes the character
-produced when the Meta key (if you have one) is depressed, and the <k>
-key is pressed (a “meta character”), then both are released.  The Meta
-key is labeled <ALT> or <Option> on many keyboards.  On keyboards with
-two keys labeled <ALT> (usually to either side of the space bar), the
-<ALT> on the left side is generally set to work as a Meta key.  One of
-the <ALT> keys may also be configured as some other modifier, such as a
-Compose key for typing accented characters.
-
-   On some keyboards, the Meta key modifier produces characters with the
-eighth bit (0200) set.  You can use the ‘enable-meta-key’ variable to
-control whether or not it does this, if the keyboard allows it.  On many
-others, the terminal or terminal emulator converts the metafied key to a
-key sequence beginning with <ESC> as described in the next paragraph.
-
-   If you do not have a Meta or <ALT> key, or another key working as a
-Meta key, you can generally achieve the latter effect by typing <ESC>
-_first_, and then typing <k>.  The <ESC> character is known as the “meta
-prefix”).
-
-   Either process is known as “metafying” the <k> key.
-
-   If your Meta key produces a key sequence with the <ESC> meta prefix,
-you can make ‘M-key’ key bindings you specify (see ‘Key Bindings’ in
-*note Readline Init File Syntax::) do the same thing by setting the
-‘force-meta-prefix’ variable.
-
-   The text ‘M-C-k’ is read as 'Meta-Control-k' and describes the
-character produced by metafying ‘C-k’.
-
-   In addition, several keys have their own names.  Specifically, <DEL>,
-<ESC>, <LFD>, <SPC>, <RET>, and <TAB> all stand for themselves when seen
-in this text, or in an init file (*note Readline Init File::).  If your
-keyboard lacks a <LFD> key, typing <C-j> will output the appropriate
-character.  The <RET> key may be labeled <Return> or <Enter> on some
-keyboards.
-
-\1f
-File: rluser.info,  Node: Readline Interaction,  Next: Readline Init File,  Prev: Introduction and Notation,  Up: Command Line Editing
-
-1.2 Readline Interaction
-========================
-
-Often during an interactive session you type in a long line of text,
-only to notice that the first word on the line is misspelled.  The
-Readline library gives you a set of commands for manipulating the text
-as you type it in, allowing you to just fix your typo, and not forcing
-you to retype the majority of the line.  Using these editing commands,
-you move the cursor to the place that needs correction, and delete or
-insert the text of the corrections.  Then, when you are satisfied with
-the line, you simply press <RET>.  You do not have to be at the end of
-the line to press <RET>; the entire line is accepted regardless of the
-location of the cursor within the line.
-
-* Menu:
-
-* Readline Bare Essentials::   The least you need to know about Readline.
-* Readline Movement Commands:: Moving about the input line.
-* Readline Killing Commands::  How to delete text, and how to get it back!
-* Readline Arguments::         Giving numeric arguments to commands.
-* Searching::                  Searching through previous lines.
-
-\1f
-File: rluser.info,  Node: Readline Bare Essentials,  Next: Readline Movement Commands,  Up: Readline Interaction
-
-1.2.1 Readline Bare Essentials
-------------------------------
-
-In order to enter characters into the line, simply type them.  The typed
-character appears where the cursor was, and then the cursor moves one
-space to the right.  If you mistype a character, you can use your erase
-character to back up and delete the mistyped character.
-
-   Sometimes you may mistype a character, and not notice the error until
-you have typed several other characters.  In that case, you can type
-‘C-b’ to move the cursor to the left, and then correct your mistake.
-Afterwards, you can move the cursor to the right with ‘C-f’.
-
-   When you add text in the middle of a line, you will notice that
-characters to the right of the cursor are 'pushed over' to make room for
-the text that you have inserted.  Likewise, when you delete text behind
-the cursor, characters to the right of the cursor are 'pulled back' to
-fill in the blank space created by the removal of the text.  These are
-the bare essentials for editing the text of an input line:
-
-‘C-b’
-     Move back one character.
-‘C-f’
-     Move forward one character.
-<DEL> or <Backspace>
-     Delete the character to the left of the cursor.
-‘C-d’
-     Delete the character underneath the cursor.
-Printing characters
-     Insert the character into the line at the cursor.
-‘C-_’ or ‘C-x C-u’
-     Undo the last editing command.  You can undo all the way back to an
-     empty line.
-
-Depending on your configuration, the <Backspace> key might be set to
-delete the character to the left of the cursor and the <DEL> key set to
-delete the character underneath the cursor, like ‘C-d’, rather than the
-character to the left of the cursor.
-
-\1f
-File: rluser.info,  Node: Readline Movement Commands,  Next: Readline Killing Commands,  Prev: Readline Bare Essentials,  Up: Readline Interaction
-
-1.2.2 Readline Movement Commands
---------------------------------
-
-The above table describes the most basic keystrokes that you need in
-order to do editing of the input line.  For your convenience, many other
-commands are available in addition to ‘C-b’, ‘C-f’, ‘C-d’, and <DEL>.
-Here are some commands for moving more rapidly within the line.
-
-‘C-a’
-     Move to the start of the line.
-‘C-e’
-     Move to the end of the line.
-‘M-f’
-     Move forward a word, where a word is composed of letters and
-     digits.
-‘M-b’
-     Move backward a word.
-‘C-l’
-     Clear the screen, reprinting the current line at the top.
-
-   Notice how ‘C-f’ moves forward a character, while ‘M-f’ moves forward
-a word.  It is a loose convention that control keystrokes operate on
-characters while meta keystrokes operate on words.
-
-\1f
-File: rluser.info,  Node: Readline Killing Commands,  Next: Readline Arguments,  Prev: Readline Movement Commands,  Up: Readline Interaction
-
-1.2.3 Readline Killing Commands
--------------------------------
-
-“Killing” text means to delete the text from the line, but to save it
-away for later use, usually by “yanking” (re-inserting) it back into the
-line.  ('Cut' and 'paste' are more recent jargon for 'kill' and 'yank'.)
-
-   If the description for a command says that it 'kills' text, then you
-can be sure that you can get the text back in a different (or the same)
-place later.
-
-   When you use a kill command, the text is saved in a “kill-ring”.  Any
-number of consecutive kills save all of the killed text together, so
-that when you yank it back, you get it all.  The kill ring is not line
-specific; the text that you killed on a previously typed line is
-available to be yanked back later, when you are typing another line.
-
-   Here is the list of commands for killing text.
-
-‘C-k’
-     Kill the text from the current cursor position to the end of the
-     line.
-
-‘M-d’
-     Kill from the cursor to the end of the current word, or, if between
-     words, to the end of the next word.  Word boundaries are the same
-     as those used by ‘M-f’.
-
-‘M-<DEL>’
-     Kill from the cursor to the start of the current word, or, if
-     between words, to the start of the previous word.  Word boundaries
-     are the same as those used by ‘M-b’.
-
-‘C-w’
-     Kill from the cursor to the previous whitespace.  This is different
-     than ‘M-<DEL>’ because the word boundaries differ.
-
-   Here is how to “yank” the text back into the line.  Yanking means to
-copy the most-recently-killed text from the kill buffer into the line at
-the current cursor position.
-
-‘C-y’
-     Yank the most recently killed text back into the buffer at the
-     cursor.
-
-‘M-y’
-     Rotate the kill-ring, and yank the new top.  You can only do this
-     if the prior command is ‘C-y’ or ‘M-y’.
-
-\1f
-File: rluser.info,  Node: Readline Arguments,  Next: Searching,  Prev: Readline Killing Commands,  Up: Readline Interaction
-
-1.2.4 Readline Arguments
-------------------------
-
-You can pass numeric arguments to Readline commands.  Sometimes the
-argument acts as a repeat count, other times it is the sign of the
-argument that is significant.  If you pass a negative argument to a
-command which normally acts in a forward direction, that command will
-act in a backward direction.  For example, to kill text back to the
-start of the line, you might type ‘M-- C-k’.
-
-   The general way to pass numeric arguments to a command is to type
-meta digits before the command.  If the first 'digit' typed is a minus
-sign (‘-’), then the sign of the argument will be negative.  Once you
-have typed one meta digit to get the argument started, you can type the
-remainder of the digits, and then the command.  For example, to give the
-‘C-d’ command an argument of 10, you could type ‘M-1 0 C-d’, which will
-delete the next ten characters on the input line.
-
-\1f
-File: rluser.info,  Node: Searching,  Prev: Readline Arguments,  Up: Readline Interaction
-
-1.2.5 Searching for Commands in the History
--------------------------------------------
-
-Readline provides commands for searching through the command history for
-lines containing a specified string.  There are two search modes:
-“incremental” and “non-incremental”.
-
-   Incremental searches begin before the user has finished typing the
-search string.  As each character of the search string is typed,
-Readline displays the next entry from the history matching the string
-typed so far.  An incremental search requires only as many characters as
-needed to find the desired history entry.  When using emacs editing
-mode, type ‘C-r’ to search backward in the history for a particular
-string.  Typing ‘C-s’ searches forward through the history.  The
-characters present in the value of the ‘isearch-terminators’ variable
-are used to terminate an incremental search.  If that variable has not
-been assigned a value, the <ESC> and ‘C-J’ characters will terminate an
-incremental search.  ‘C-g’ will abort an incremental search and restore
-the original line.  When the search is terminated, the history entry
-containing the search string becomes the current line.
-
-   To find other matching entries in the history list, type ‘C-r’ or
-‘C-s’ as appropriate.  This will search backward or forward in the
-history for the next entry matching the search string typed so far.  Any
-other key sequence bound to a Readline command will terminate the search
-and execute that command.  For instance, a <RET> will terminate the
-search and accept the line, thereby executing the command from the
-history list.  A movement command will terminate the search, make the
-last line found the current line, and begin editing.
-
-   Readline remembers the last incremental search string.  If two ‘C-r’s
-are typed without any intervening characters defining a new search
-string, Readline uses any remembered search string.
-
-   Non-incremental searches read the entire search string before
-starting to search for matching history entries.  The search string may
-be typed by the user or be part of the contents of the current line.
-
-\1f
-File: rluser.info,  Node: Readline Init File,  Next: Bindable Readline Commands,  Prev: Readline Interaction,  Up: Command Line Editing
-
-1.3 Readline Init File
-======================
-
-Although the Readline library comes with a set of Emacs-like keybindings
-installed by default, it is possible to use a different set of
-keybindings.  Any user can customize programs that use Readline by
-putting commands in an “inputrc” file, conventionally in their home
-directory.  The name of this file is taken from the value of the
-environment variable ‘INPUTRC’.  If that variable is unset, the default
-is ‘~/.inputrc’.  If that file does not exist or cannot be read,
-Readline looks for ‘/etc/inputrc’.
-
-   When a program which uses the Readline library starts up, Readline
-reads the init file and sets any variables and key bindings it contains.
-
-   In addition, the ‘C-x C-r’ command re-reads this init file, thus
-incorporating any changes that you might have made to it.
-
-* Menu:
-
-* Readline Init File Syntax::  Syntax for the commands in the inputrc file.
-* Conditional Init Constructs::        Conditional key bindings in the inputrc file.
-* Sample Init File::           An example inputrc file.
-
-\1f
-File: rluser.info,  Node: Readline Init File Syntax,  Next: Conditional Init Constructs,  Up: Readline Init File
-
-1.3.1 Readline Init File Syntax
--------------------------------
-
-There are only a few basic constructs allowed in the Readline init file.
-Blank lines are ignored.  Lines beginning with a ‘#’ are comments.
-Lines beginning with a ‘$’ indicate conditional constructs (*note
-Conditional Init Constructs::).  Other lines denote variable settings
-and key bindings.
-
-Variable Settings
-     You can modify the run-time behavior of Readline by altering the
-     values of variables in Readline using the ‘set’ command within the
-     init file.  The syntax is simple:
-
-          set VARIABLE VALUE
-
-     Here, for example, is how to change from the default Emacs-like key
-     binding to use ‘vi’ line editing commands:
-
-          set editing-mode vi
-
-     Variable names and values, where appropriate, are recognized
-     without regard to case.  Unrecognized variable names are ignored.
-
-     Boolean variables (those that can be set to on or off) are set to
-     on if the value is null or empty, ON (case-insensitive), or 1.  Any
-     other value results in the variable being set to off.
-
-     A great deal of run-time behavior is changeable with the following
-     variables.
-
-     ‘active-region-start-color’
-          A string variable that controls the text color and background
-          when displaying the text in the active region (see the
-          description of ‘enable-active-region’ below).  This string
-          must not take up any physical character positions on the
-          display, so it should consist only of terminal escape
-          sequences.  It is output to the terminal before displaying the
-          text in the active region.  This variable is reset to the
-          default value whenever the terminal type changes.  The default
-          value is the string that puts the terminal in standout mode,
-          as obtained from the terminal's terminfo description.  A
-          sample value might be ‘\e[01;33m’.
-
-     ‘active-region-end-color’
-          A string variable that "undoes" the effects of
-          ‘active-region-start-color’ and restores "normal" terminal
-          display appearance after displaying text in the active region.
-          This string must not take up any physical character positions
-          on the display, so it should consist only of terminal escape
-          sequences.  It is output to the terminal after displaying the
-          text in the active region.  This variable is reset to the
-          default value whenever the terminal type changes.  The default
-          value is the string that restores the terminal from standout
-          mode, as obtained from the terminal's terminfo description.  A
-          sample value might be ‘\e[0m’.
-
-     ‘bell-style’
-          Controls what happens when Readline wants to ring the terminal
-          bell.  If set to ‘none’, Readline never rings the bell.  If
-          set to ‘visible’, Readline uses a visible bell if one is
-          available.  If set to ‘audible’ (the default), Readline
-          attempts to ring the terminal's bell.
-
-     ‘bind-tty-special-chars’
-          If set to ‘on’ (the default), Readline attempts to bind the
-          control characters that are treated specially by the kernel's
-          terminal driver to their Readline equivalents.  These override
-          the default Readline bindings described here.  Type ‘stty -a’
-          at a Bash prompt to see your current terminal settings,
-          including the special control characters (usually ‘cchars’).
-
-     ‘blink-matching-paren’
-          If set to ‘on’, Readline attempts to briefly move the cursor
-          to an opening parenthesis when a closing parenthesis is
-          inserted.  The default is ‘off’.
-
-     ‘colored-completion-prefix’
-          If set to ‘on’, when listing completions, Readline displays
-          the common prefix of the set of possible completions using a
-          different color.  The color definitions are taken from the
-          value of the ‘LS_COLORS’ environment variable.  If there is a
-          color definition in ‘LS_COLORS’ for the custom suffix
-          ‘readline-colored-completion-prefix’, Readline uses this color
-          for the common prefix instead of its default.  The default is
-          ‘off’.
-
-     ‘colored-stats’
-          If set to ‘on’, Readline displays possible completions using
-          different colors to indicate their file type.  The color
-          definitions are taken from the value of the ‘LS_COLORS’
-          environment variable.  The default is ‘off’.
-
-     ‘comment-begin’
-          The string to insert at the beginning of the line by the
-          ‘insert-comment’ command.  The default value is ‘"#"’.
-
-     ‘completion-display-width’
-          The number of screen columns used to display possible matches
-          when performing completion.  The value is ignored if it is
-          less than 0 or greater than the terminal screen width.  A
-          value of 0 will cause matches to be displayed one per line.
-          The default value is -1.
-
-     ‘completion-ignore-case’
-          If set to ‘on’, Readline performs filename matching and
-          completion in a case-insensitive fashion.  The default value
-          is ‘off’.
-
-     ‘completion-map-case’
-          If set to ‘on’, and COMPLETION-IGNORE-CASE is enabled,
-          Readline treats hyphens (‘-’) and underscores (‘_’) as
-          equivalent when performing case-insensitive filename matching
-          and completion.  The default value is ‘off’.
-
-     ‘completion-prefix-display-length’
-          The maximum length in characters of the common prefix of a
-          list of possible completions that is displayed without
-          modification.  When set to a value greater than zero, Readline
-          replaces common prefixes longer than this value with an
-          ellipsis when displaying possible completions.
-
-     ‘completion-query-items’
-          The number of possible completions that determines when the
-          user is asked whether the list of possibilities should be
-          displayed.  If the number of possible completions is greater
-          than or equal to this value, Readline will ask whether or not
-          the user wishes to view them; otherwise, Readline simply lists
-          the completions.  This variable must be set to an integer
-          value greater than or equal to zero.  A zero value means
-          Readline should never ask; negative values are treated as
-          zero.  The default limit is ‘100’.
-
-     ‘convert-meta’
-          If set to ‘on’, Readline will convert characters it reads that
-          have the eighth bit set to an ASCII key sequence by clearing
-          the eighth bit and prefixing an <ESC> character, converting
-          them to a meta-prefixed key sequence.  The default value is
-          ‘on’, but Readline will set it to ‘off’ if the locale contains
-          characters whose encodings may include bytes with the eighth
-          bit set.  This variable is dependent on the ‘LC_CTYPE’ locale
-          category, and may change if the locale changes.  This variable
-          also affects key bindings; see the description of
-          ‘force-meta-prefix’ below.
-
-     ‘disable-completion’
-          If set to ‘On’, Readline will inhibit word completion.
-          Completion characters will be inserted into the line as if
-          they had been mapped to ‘self-insert’.  The default is ‘off’.
-
-     ‘echo-control-characters’
-          When set to ‘on’, on operating systems that indicate they
-          support it, Readline echoes a character corresponding to a
-          signal generated from the keyboard.  The default is ‘on’.
-
-     ‘editing-mode’
-          The ‘editing-mode’ variable controls the default set of key
-          bindings.  By default, Readline starts up in emacs editing
-          mode, where the keystrokes are most similar to Emacs.  This
-          variable can be set to either ‘emacs’ or ‘vi’.
-
-     ‘emacs-mode-string’
-          If the SHOW-MODE-IN-PROMPT variable is enabled, this string is
-          displayed immediately before the last line of the primary
-          prompt when emacs editing mode is active.  The value is
-          expanded like a key binding, so the standard set of meta- and
-          control- prefixes and backslash escape sequences is available.
-          The ‘\1’ and ‘\2’ escapes begin and end sequences of
-          non-printing characters, which can be used to embed a terminal
-          control sequence into the mode string.  The default is ‘@’.
-
-     ‘enable-active-region’
-          “point” is the current cursor position, and “mark” refers to a
-          saved cursor position (*note Commands For Moving::).  The text
-          between the point and mark is referred to as the “region”.
-          When this variable is set to ‘On’, Readline allows certain
-          commands to designate the region as “active”.  When the region
-          is active, Readline highlights the text in the region using
-          the value of the ‘active-region-start-color’, which defaults
-          to the string that enables the terminal's standout mode.  The
-          active region shows the text inserted by bracketed-paste and
-          any matching text found by incremental and non-incremental
-          history searches.  The default is ‘On’.
-
-     ‘enable-bracketed-paste’
-          When set to ‘On’, Readline configures the terminal to insert
-          each paste into the editing buffer as a single string of
-          characters, instead of treating each character as if it had
-          been read from the keyboard.  This is called putting the
-          terminal into “bracketed paste mode”; it prevents Readline
-          from executing any editing commands bound to key sequences
-          appearing in the pasted text.  The default is ‘On’.
-
-     ‘enable-keypad’
-          When set to ‘on’, Readline will try to enable the application
-          keypad when it is called.  Some systems need this to enable
-          the arrow keys.  The default is ‘off’.
-
-     ‘enable-meta-key’
-          When set to ‘on’, Readline will try to enable any meta
-          modifier key the terminal claims to support when it is called.
-          On many terminals, the Meta key is used to send eight-bit
-          characters; this variable checks for the terminal capability
-          that indicates the terminal can enable and disable a mode that
-          sets the eighth bit of a character (0200) if the Meta key is
-          held down when the character is typed (a meta character).  The
-          default is ‘on’.
-
-     ‘expand-tilde’
-          If set to ‘on’, Readline attempts tilde expansion when it
-          attempts word completion.  The default is ‘off’.
-
-     ‘force-meta-prefix’
-          If set to ‘on’, Readline modifies its behavior when binding
-          key sequences containing ‘\M-’ or ‘Meta-’ (see ‘Key Bindings’
-          in *note Readline Init File Syntax::) by converting a key
-          sequence of the form ‘\M-’C or ‘Meta-’C to the two-character
-          sequence ‘ESC’ C (adding the meta prefix).  If
-          ‘force-meta-prefix’ is set to ‘off’ (the default), Readline
-          uses the value of the ‘convert-meta’ variable to determine
-          whether to perform this conversion: if ‘convert-meta’ is ‘on’,
-          Readline performs the conversion described above; if it is
-          ‘off’, Readline converts C to a meta character by setting the
-          eighth bit (0200).  The default is ‘off’.
-
-     ‘history-preserve-point’
-          If set to ‘on’, the history code attempts to place the point
-          (the current cursor position) at the same location on each
-          history line retrieved with ‘previous-history’ or
-          ‘next-history’.  The default is ‘off’.
-
-     ‘history-size’
-          Set the maximum number of history entries saved in the history
-          list.  If set to zero, any existing history entries are
-          deleted and no new entries are saved.  If set to a value less
-          than zero, the number of history entries is not limited.  By
-          default, the number of history entries is not limited.  If you
-          try to set HISTORY-SIZE to a non-numeric value, the maximum
-          number of history entries will be set to 500.
-
-     ‘horizontal-scroll-mode’
-          Setting this variable to ‘on’ means that the text of the lines
-          being edited will scroll horizontally on a single screen line
-          when the lines are longer than the width of the screen,
-          instead of wrapping onto a new screen line.  This variable is
-          automatically set to ‘on’ for terminals of height 1.  By
-          default, this variable is set to ‘off’.
-
-     ‘input-meta’
-          If set to ‘on’, Readline will enable eight-bit input (that is,
-          it will not clear the eighth bit in the characters it reads),
-          regardless of what the terminal claims it can support.  The
-          default value is ‘off’, but Readline will set it to ‘on’ if
-          the locale contains characters whose encodings may include
-          bytes with the eighth bit set.  This variable is dependent on
-          the ‘LC_CTYPE’ locale category, and its value may change if
-          the locale changes.  The name ‘meta-flag’ is a synonym for
-          ‘input-meta’.
-
-     ‘isearch-terminators’
-          The string of characters that should terminate an incremental
-          search without subsequently executing the character as a
-          command (*note Searching::).  If this variable has not been
-          given a value, the characters <ESC> and ‘C-J’ will terminate
-          an incremental search.
-
-     ‘keymap’
-          Sets Readline's idea of the current keymap for key binding
-          commands.  Built-in ‘keymap’ names are ‘emacs’,
-          ‘emacs-standard’, ‘emacs-meta’, ‘emacs-ctlx’, ‘vi’, ‘vi-move’,
-          ‘vi-command’, and ‘vi-insert’.  ‘vi’ is equivalent to
-          ‘vi-command’ (‘vi-move’ is also a synonym); ‘emacs’ is
-          equivalent to ‘emacs-standard’.  Applications may add
-          additional names.  The default value is ‘emacs’; the value of
-          the ‘editing-mode’ variable also affects the default keymap.
-
-     ‘keyseq-timeout’
-          Specifies the duration Readline will wait for a character when
-          reading an ambiguous key sequence (one that can form a
-          complete key sequence using the input read so far, or can take
-          additional input to complete a longer key sequence).  If
-          Readline doesn't receive any input within the timeout, it will
-          use the shorter but complete key sequence.  Readline uses this
-          value to determine whether or not input is available on the
-          current input source (‘rl_instream’ by default).  The value is
-          specified in milliseconds, so a value of 1000 means that
-          Readline will wait one second for additional input.  If this
-          variable is set to a value less than or equal to zero, or to a
-          non-numeric value, Readline will wait until another key is
-          pressed to decide which key sequence to complete.  The default
-          value is ‘500’.
-
-     ‘mark-directories’
-          If set to ‘on’, completed directory names have a slash
-          appended.  The default is ‘on’.
-
-     ‘mark-modified-lines’
-          When this variable is set to ‘on’, Readline will to display an
-          asterisk (‘*’) at the start of history lines which have been
-          modified.  This variable is ‘off’ by default.
-
-     ‘mark-symlinked-directories’
-          If set to ‘on’, completed names which are symbolic links to
-          directories have a slash appended, subject to the value of
-          ‘mark-directories’.  The default is ‘off’.
-
-     ‘match-hidden-files’
-          This variable, when set to ‘on’, forces Readline to match
-          files whose names begin with a ‘.’ (hidden files) when
-          performing filename completion.  If set to ‘off’, the user
-          must include the leading ‘.’ in the filename to be completed.
-          This variable is ‘on’ by default.
-
-     ‘menu-complete-display-prefix’
-          If set to ‘on’, menu completion displays the common prefix of
-          the list of possible completions (which may be empty) before
-          cycling through the list.  The default is ‘off’.
-
-     ‘output-meta’
-          If set to ‘on’, Readline will display characters with the
-          eighth bit set directly rather than as a meta-prefixed escape
-          sequence.  The default is ‘off’, but Readline will set it to
-          ‘on’ if the locale contains characters whose encodings may
-          include bytes with the eighth bit set.  This variable is
-          dependent on the ‘LC_CTYPE’ locale category, and its value may
-          change if the locale changes.
-
-     ‘page-completions’
-          If set to ‘on’, Readline uses an internal ‘more’-like pager to
-          display a screenful of possible completions at a time.  This
-          variable is ‘on’ by default.
-
-     ‘prefer-visible-bell’
-          See ‘bell-style’.
-
-     ‘print-completions-horizontally’
-          If set to ‘on’, Readline will display completions with matches
-          sorted horizontally in alphabetical order, rather than down
-          the screen.  The default is ‘off’.
-
-     ‘revert-all-at-newline’
-          If set to ‘on’, Readline will undo all changes to history
-          lines before returning when executing ‘accept-line’.  By
-          default, history lines may be modified and retain individual
-          undo lists across calls to ‘readline()’.  The default is
-          ‘off’.
-
-     ‘search-ignore-case’
-          If set to ‘on’, Readline performs incremental and
-          non-incremental history list searches in a case-insensitive
-          fashion.  The default value is ‘off’.
-
-     ‘show-all-if-ambiguous’
-          This alters the default behavior of the completion functions.
-          If set to ‘on’, words which have more than one possible
-          completion cause the matches to be listed immediately instead
-          of ringing the bell.  The default value is ‘off’.
-
-     ‘show-all-if-unmodified’
-          This alters the default behavior of the completion functions
-          in a fashion similar to SHOW-ALL-IF-AMBIGUOUS.  If set to
-          ‘on’, words which have more than one possible completion
-          without any possible partial completion (the possible
-          completions don't share a common prefix) cause the matches to
-          be listed immediately instead of ringing the bell.  The
-          default value is ‘off’.
-
-     ‘show-mode-in-prompt’
-          If set to ‘on’, add a string to the beginning of the prompt
-          indicating the editing mode: emacs, vi command, or vi
-          insertion.  The mode strings are user-settable (e.g.,
-          EMACS-MODE-STRING).  The default value is ‘off’.
-
-     ‘skip-completed-text’
-          If set to ‘on’, this alters the default completion behavior
-          when inserting a single match into the line.  It's only active
-          when performing completion in the middle of a word.  If
-          enabled, Readline does not insert characters from the
-          completion that match characters after point in the word being
-          completed, so portions of the word following the cursor are
-          not duplicated.  For instance, if this is enabled, attempting
-          completion when the cursor is after the first ‘e’ in
-          ‘Makefile’ will result in ‘Makefile’ rather than
-          ‘Makefilefile’, assuming there is a single possible
-          completion.  The default value is ‘off’.
-
-     ‘vi-cmd-mode-string’
-          If the SHOW-MODE-IN-PROMPT variable is enabled, this string is
-          displayed immediately before the last line of the primary
-          prompt when vi editing mode is active and in command mode.
-          The value is expanded like a key binding, so the standard set
-          of meta- and control- prefixes and backslash escape sequences
-          is available.  The ‘\1’ and ‘\2’ escapes begin and end
-          sequences of non-printing characters, which can be used to
-          embed a terminal control sequence into the mode string.  The
-          default is ‘(cmd)’.
-
-     ‘vi-ins-mode-string’
-          If the SHOW-MODE-IN-PROMPT variable is enabled, this string is
-          displayed immediately before the last line of the primary
-          prompt when vi editing mode is active and in insertion mode.
-          The value is expanded like a key binding, so the standard set
-          of meta- and control- prefixes and backslash escape sequences
-          is available.  The ‘\1’ and ‘\2’ escapes begin and end
-          sequences of non-printing characters, which can be used to
-          embed a terminal control sequence into the mode string.  The
-          default is ‘(ins)’.
-
-     ‘visible-stats’
-          If set to ‘on’, a character denoting a file's type is appended
-          to the filename when listing possible completions.  The
-          default is ‘off’.
-
-Key Bindings
-     The syntax for controlling key bindings in the init file is simple.
-     First you need to find the name of the command that you want to
-     change.  The following sections contain tables of the command name,
-     the default keybinding, if any, and a short description of what the
-     command does.
-
-     Once you know the name of the command, simply place on a line in
-     the init file the name of the key you wish to bind the command to,
-     a colon, and then the name of the command.  There can be no space
-     between the key name and the colon - that will be interpreted as
-     part of the key name.  The name of the key can be expressed in
-     different ways, depending on what you find most comfortable.
-
-     In addition to command names, Readline allows keys to be bound to a
-     string that is inserted when the key is pressed (a MACRO).  The
-     difference between a macro and a command is that a macro is
-     enclosed in single or double quotes.
-
-     KEYNAME: FUNCTION-NAME or MACRO
-          KEYNAME is the name of a key spelled out in English.  For
-          example:
-               Control-u: universal-argument
-               Meta-Rubout: backward-kill-word
-               Control-o: "> output"
-
-          In the example above, ‘C-u’ is bound to the function
-          ‘universal-argument’, ‘M-DEL’ is bound to the function
-          ‘backward-kill-word’, and ‘C-o’ is bound to run the macro
-          expressed on the right hand side (that is, to insert the text
-          ‘> output’ into the line).
-
-          This key binding syntax recognizes a number of symbolic
-          character names: DEL, ESC, ESCAPE, LFD, NEWLINE, RET, RETURN,
-          RUBOUT (a destructive backspace), SPACE, SPC, and TAB.
-
-     "KEYSEQ": FUNCTION-NAME or MACRO
-          KEYSEQ differs from KEYNAME above in that strings denoting an
-          entire key sequence can be specified, by placing the key
-          sequence in double quotes.  Some GNU Emacs style key escapes
-          can be used, as in the following example, but none of the
-          special character names are recognized.
-
-               "\C-u": universal-argument
-               "\C-x\C-r": re-read-init-file
-               "\e[11~": "Function Key 1"
-
-          In the above example, ‘C-u’ is again bound to the function
-          ‘universal-argument’ (just as it was in the first example),
-          ‘‘C-x’ ‘C-r’’ is bound to the function ‘re-read-init-file’,
-          and ‘<ESC> <[> <1> <1> <~>’ is bound to insert the text
-          ‘Function Key 1’.
-
-     The following GNU Emacs style escape sequences are available when
-     specifying key sequences:
-
-     ‘\C-’
-          A control prefix.
-     ‘\M-’
-          Adding the meta prefix or converting the following character
-          to a meta character, as described above under
-          ‘force-meta-prefix’ (see ‘Variable Settings’ in *note Readline
-          Init File Syntax::).
-     ‘\e’
-          An escape character.
-     ‘\\’
-          Backslash.
-     ‘\"’
-          <">, a double quotation mark.
-     ‘\'’
-          <'>, a single quote or apostrophe.
-
-     In addition to the GNU Emacs style escape sequences, a second set
-     of backslash escapes is available:
-
-     ‘\a’
-          alert (bell)
-     ‘\b’
-          backspace
-     ‘\d’
-          delete
-     ‘\f’
-          form feed
-     ‘\n’
-          newline
-     ‘\r’
-          carriage return
-     ‘\t’
-          horizontal tab
-     ‘\v’
-          vertical tab
-     ‘\NNN’
-          The eight-bit character whose value is the octal value NNN
-          (one to three digits).
-     ‘\xHH’
-          The eight-bit character whose value is the hexadecimal value
-          HH (one or two hex digits).
-
-     When entering the text of a macro, single or double quotes must be
-     used to indicate a macro definition.  Unquoted text is assumed to
-     be a function name.  Tthe backslash escapes described above are
-     expanded in the macro body.  Backslash will quote any other
-     character in the macro text, including ‘"’ and ‘'’.  For example,
-     the following binding will make ‘‘C-x’ \’ insert a single ‘\’ into
-     the line:
-          "\C-x\\": "\\"
-
-\1f
-File: rluser.info,  Node: Conditional Init Constructs,  Next: Sample Init File,  Prev: Readline Init File Syntax,  Up: Readline Init File
-
-1.3.2 Conditional Init Constructs
----------------------------------
-
-Readline implements a facility similar in spirit to the conditional
-compilation features of the C preprocessor which allows key bindings and
-variable settings to be performed as the result of tests.  There are
-four parser directives available.
-
-‘$if’
-     The ‘$if’ construct allows bindings to be made based on the editing
-     mode, the terminal being used, or the application using Readline.
-     The text of the test, after any comparison operator, extends to the
-     end of the line; unless otherwise noted, no characters are required
-     to isolate it.
-
-     ‘mode’
-          The ‘mode=’ form of the ‘$if’ directive is used to test
-          whether Readline is in ‘emacs’ or ‘vi’ mode.  This may be used
-          in conjunction with the ‘set keymap’ command, for instance, to
-          set bindings in the ‘emacs-standard’ and ‘emacs-ctlx’ keymaps
-          only if Readline is starting out in ‘emacs’ mode.
-
-     ‘term’
-          The ‘term=’ form may be used to include terminal-specific key
-          bindings, perhaps to bind the key sequences output by the
-          terminal's function keys.  The word on the right side of the
-          ‘=’ is tested against both the full name of the terminal and
-          the portion of the terminal name before the first ‘-’.  This
-          allows ‘xterm’ to match both ‘xterm’ and ‘xterm-256color’, for
-          instance.
-
-     ‘version’
-          The ‘version’ test may be used to perform comparisons against
-          specific Readline versions.  The ‘version’ expands to the
-          current Readline version.  The set of comparison operators
-          includes ‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, and ‘>’.  The
-          version number supplied on the right side of the operator
-          consists of a major version number, an optional decimal point,
-          and an optional minor version (e.g., ‘7.1’).  If the minor
-          version is omitted, it defaults to ‘0’.  The operator may be
-          separated from the string ‘version’ and from the version
-          number argument by whitespace.  The following example sets a
-          variable if the Readline version being used is 7.0 or newer:
-               $if version >= 7.0
-               set show-mode-in-prompt on
-               $endif
-
-     ‘application’
-          The APPLICATION construct is used to include
-          application-specific settings.  Each program using the
-          Readline library sets the APPLICATION NAME, and you can test
-          for a particular value.  This could be used to bind key
-          sequences to functions useful for a specific program.  For
-          instance, the following command adds a key sequence that
-          quotes the current or previous word in Bash:
-               $if Bash
-               # Quote the current or previous word
-               "\C-xq": "\eb\"\ef\""
-               $endif
-
-     ‘variable’
-          The VARIABLE construct provides simple equality tests for
-          Readline variables and values.  The permitted comparison
-          operators are ‘=’, ‘==’, and ‘!=’.  The variable name must be
-          separated from the comparison operator by whitespace; the
-          operator may be separated from the value on the right hand
-          side by whitespace.  String and boolean variables may be
-          tested.  Boolean variables must be tested against the values
-          ON and OFF.  The following example is equivalent to the
-          ‘mode=emacs’ test described above:
-               $if editing-mode == emacs
-               set show-mode-in-prompt on
-               $endif
-
-‘$else’
-     Commands in this branch of the ‘$if’ directive are executed if the
-     test fails.
-
-‘$endif’
-     This command, as seen in the previous example, terminates an ‘$if’
-     command.
-
-‘$include’
-     This directive takes a single filename as an argument and reads
-     commands and key bindings from that file.  For example, the
-     following directive reads from ‘/etc/inputrc’:
-          $include /etc/inputrc
-
-\1f
-File: rluser.info,  Node: Sample Init File,  Prev: Conditional Init Constructs,  Up: Readline Init File
-
-1.3.3 Sample Init File
-----------------------
-
-Here is an example of an INPUTRC file.  This illustrates key binding,
-variable assignment, and conditional syntax.
-
-     # This file controls the behaviour of line input editing for
-     # programs that use the GNU Readline library.  Existing
-     # programs include FTP, Bash, and GDB.
-     #
-     # You can re-read the inputrc file with C-x C-r.
-     # Lines beginning with '#' are comments.
-     #
-     # First, include any system-wide bindings and variable
-     # assignments from /etc/Inputrc
-     $include /etc/Inputrc
-
-     #
-     # Set various bindings for emacs mode.
-
-     set editing-mode emacs
-
-     $if mode=emacs
-
-     Meta-Control-h:   backward-kill-word      Text after the function name is ignored
-
-     #
-     # Arrow keys in keypad mode
-     #
-     #"\M-OD":        backward-char
-     #"\M-OC":        forward-char
-     #"\M-OA":        previous-history
-     #"\M-OB":        next-history
-     #
-     # Arrow keys in ANSI mode
-     #
-     "\M-[D":        backward-char
-     "\M-[C":        forward-char
-     "\M-[A":        previous-history
-     "\M-[B":        next-history
-     #
-     # Arrow keys in 8 bit keypad mode
-     #
-     #"\M-\C-OD":       backward-char
-     #"\M-\C-OC":       forward-char
-     #"\M-\C-OA":       previous-history
-     #"\M-\C-OB":       next-history
-     #
-     # Arrow keys in 8 bit ANSI mode
-     #
-     #"\M-\C-[D":       backward-char
-     #"\M-\C-[C":       forward-char
-     #"\M-\C-[A":       previous-history
-     #"\M-\C-[B":       next-history
-
-     C-q: quoted-insert
-
-     $endif
-
-     # An old-style binding.  This happens to be the default.
-     TAB: complete
-
-     # Macros that are convenient for shell interaction
-     $if Bash
-     # edit the path
-     "\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
-     # prepare to type a quoted word --
-     # insert open and close double quotes
-     # and move to just after the open quote
-     "\C-x\"": "\"\"\C-b"
-     # insert a backslash (testing backslash escapes
-     # in sequences and macros)
-     "\C-x\\": "\\"
-     # Quote the current or previous word
-     "\C-xq": "\eb\"\ef\""
-     # Add a binding to refresh the line, which is unbound
-     "\C-xr": redraw-current-line
-     # Edit variable on current line.
-     "\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
-     $endif
-
-     # use a visible bell if one is available
-     set bell-style visible
-
-     # don't strip characters to 7 bits when reading
-     set input-meta on
-
-     # allow iso-latin1 characters to be inserted rather
-     # than converted to prefix-meta sequences
-     set convert-meta off
-
-     # display characters with the eighth bit set directly
-     # rather than as meta-prefixed characters
-     set output-meta on
-
-     # if there are 150 or more possible completions for a word,
-     # ask whether or not the user wants to see all of them
-     set completion-query-items 150
-
-     # For FTP
-     $if Ftp
-     "\C-xg": "get \M-?"
-     "\C-xt": "put \M-?"
-     "\M-.": yank-last-arg
-     $endif
-
-\1f
-File: rluser.info,  Node: Bindable Readline Commands,  Next: Readline vi Mode,  Prev: Readline Init File,  Up: Command Line Editing
-
-1.4 Bindable Readline Commands
-==============================
-
-* Menu:
-
-* Commands For Moving::                Moving about the line.
-* Commands For History::       Getting at previous lines.
-* Commands For Text::          Commands for changing text.
-* Commands For Killing::       Commands for killing and yanking.
-* Numeric Arguments::          Specifying numeric arguments, repeat counts.
-* Commands For Completion::    Getting Readline to do the typing for you.
-* Keyboard Macros::            Saving and re-executing typed characters
-* Miscellaneous Commands::     Other miscellaneous commands.
-
-This section describes Readline commands that may be bound to key
-sequences.  Command names without an accompanying key sequence are
-unbound by default.
-
-   In the following descriptions, “point” refers to the current cursor
-position, and “mark” refers to a cursor position saved by the ‘set-mark’
-command.  The text between the point and mark is referred to as the
-“region”.  Readline has the concept of an _active region_: when the
-region is active, Readline redisplay highlights the region using the
-value of the ‘active-region-start-color’ variable.  The
-‘enable-active-region’ variable turns this on and off.  Several commands
-set the region to active; those are noted below.
-
-\1f
-File: rluser.info,  Node: Commands For Moving,  Next: Commands For History,  Up: Bindable Readline Commands
-
-1.4.1 Commands For Moving
--------------------------
-
-‘beginning-of-line (C-a)’
-     Move to the start of the current line.  This may also be bound to
-     the Home key on some keyboards.
-
-‘end-of-line (C-e)’
-     Move to the end of the line.  This may also be bound to the End key
-     on some keyboards.
-
-‘forward-char (C-f)’
-     Move forward a character.
-
-‘backward-char (C-b)’
-     Move back a character.
-
-‘forward-word (M-f)’
-     Move forward to the end of the next word.  Words are composed of
-     letters and digits.
-
-‘backward-word (M-b)’
-     Move back to the start of the current or previous word.  Words are
-     composed of letters and digits.
-
-‘previous-screen-line ()’
-     Attempt to move point to the same physical screen column on the
-     previous physical screen line.  This will not have the desired
-     effect if the current Readline line does not take up more than one
-     physical line or if point is not greater than the length of the
-     prompt plus the screen width.
-
-‘next-screen-line ()’
-     Attempt to move point to the same physical screen column on the
-     next physical screen line.  This will not have the desired effect
-     if the current Readline line does not take up more than one
-     physical line or if the length of the current Readline line is not
-     greater than the length of the prompt plus the screen width.
-
-‘clear-display (M-C-l)’
-     Clear the screen and, if possible, the terminal's scrollback
-     buffer, then redraw the current line, leaving the current line at
-     the top of the screen.
-
-‘clear-screen (C-l)’
-     Clear the screen, then redraw the current line, leaving the current
-     line at the top of the screen.
-
-‘redraw-current-line ()’
-     Refresh the current line.  By default, this is unbound.
-
-\1f
-File: rluser.info,  Node: Commands For History,  Next: Commands For Text,  Prev: Commands For Moving,  Up: Bindable Readline Commands
-
-1.4.2 Commands For Manipulating The History
--------------------------------------------
-
-‘accept-line (Newline or Return)’
-     Accept the line regardless of where the cursor is.  If this line is
-     non-empty, you can add it to the history list using
-     ‘add_history()’.  If this line is a modified history line, then
-     restore the history line to its original state.
-
-‘previous-history (C-p)’
-     Move 'back' through the history list, fetching the previous
-     command.
-
-‘next-history (C-n)’
-     Move 'forward' through the history list, fetching the next command.
-
-‘beginning-of-history (M-<)’
-     Move to the first line in the history.
-
-‘end-of-history (M->)’
-     Move to the end of the input history, i.e., the line currently
-     being entered.
-
-‘reverse-search-history (C-r)’
-     Search backward starting at the current line and moving 'up'
-     through the history as necessary.  This is an incremental search.
-     This command sets the region to the matched text and activates the
-     region.
-
-‘forward-search-history (C-s)’
-     Search forward starting at the current line and moving 'down'
-     through the history as necessary.  This is an incremental search.
-     This command sets the region to the matched text and activates the
-     region.
-
-‘non-incremental-reverse-search-history (M-p)’
-     Search backward starting at the current line and moving 'up'
-     through the history as necessary using a non-incremental search for
-     a string supplied by the user.  The search string may match
-     anywhere in a history line.
-
-‘non-incremental-forward-search-history (M-n)’
-     Search forward starting at the current line and moving 'down'
-     through the history as necessary using a non-incremental search for
-     a string supplied by the user.  The search string may match
-     anywhere in a history line.
-
-‘history-search-backward ()’
-     Search backward through the history for the string of characters
-     between the start of the current line and the point.  The search
-     string must match at the beginning of a history line.  This is a
-     non-incremental search.  By default, this command is unbound, but
-     may be bound to the Page Down key on some keyboards.
-
-‘history-search-forward ()’
-     Search forward through the history for the string of characters
-     between the start of the current line and the point.  The search
-     string must match at the beginning of a history line.  This is a
-     non-incremental search.  By default, this command is unbound, but
-     may be bound to the Page Up key on some keyboards.
-
-‘history-substring-search-backward ()’
-     Search backward through the history for the string of characters
-     between the start of the current line and the point.  The search
-     string may match anywhere in a history line.  This is a
-     non-incremental search.  By default, this command is unbound.
-
-‘history-substring-search-forward ()’
-     Search forward through the history for the string of characters
-     between the start of the current line and the point.  The search
-     string may match anywhere in a history line.  This is a
-     non-incremental search.  By default, this command is unbound.
-
-‘yank-nth-arg (M-C-y)’
-     Insert the first argument to the previous command (usually the
-     second word on the previous line) at point.  With an argument N,
-     insert the Nth word from the previous command (the words in the
-     previous command begin with word 0).  A negative argument inserts
-     the Nth word from the end of the previous command.  Once the
-     argument N is computed, this uses the history expansion facilities
-     to extract the Nth word, as if the ‘!N’ history expansion had been
-     specified.
-
-‘yank-last-arg (M-. or M-_)’
-     Insert last argument to the previous command (the last word of the
-     previous history entry).  With a numeric argument, behave exactly
-     like ‘yank-nth-arg’.  Successive calls to ‘yank-last-arg’ move back
-     through the history list, inserting the last word (or the word
-     specified by the argument to the first call) of each line in turn.
-     Any numeric argument supplied to these successive calls determines
-     the direction to move through the history.  A negative argument
-     switches the direction through the history (back or forward).  This
-     uses the history expansion facilities to extract the last word, as
-     if the ‘!$’ history expansion had been specified.
-
-‘operate-and-get-next (C-o)’
-     Accept the current line for return to the calling application as if
-     a newline had been entered, and fetch the next line relative to the
-     current line from the history for editing.  A numeric argument, if
-     supplied, specifies the history entry to use instead of the current
-     line.
-
-‘fetch-history ()’
-     With a numeric argument, fetch that entry from the history list and
-     make it the current line.  Without an argument, move back to the
-     first entry in the history list.
-
-\1f
-File: rluser.info,  Node: Commands For Text,  Next: Commands For Killing,  Prev: Commands For History,  Up: Bindable Readline Commands
-
-1.4.3 Commands For Changing Text
---------------------------------
-
-‘end-of-file (usually C-d)’
-     The character indicating end-of-file as set, for example, by
-     ‘stty’.  If this character is read when there are no characters on
-     the line, and point is at the beginning of the line, Readline
-     interprets it as the end of input and returns EOF.
-
-‘delete-char (C-d)’
-     Delete the character at point.  If this function is bound to the
-     same character as the tty EOF character, as ‘C-d’ commonly is, see
-     above for the effects.  This may also be bound to the Delete key on
-     some keyboards.
-
-‘backward-delete-char (Rubout)’
-     Delete the character behind the cursor.  A numeric argument means
-     to kill the characters, saving them on the kill ring, instead of
-     deleting them.
-
-‘forward-backward-delete-char ()’
-     Delete the character under the cursor, unless the cursor is at the
-     end of the line, in which case the character behind the cursor is
-     deleted.  By default, this is not bound to a key.
-
-‘quoted-insert (C-q or C-v)’
-     Add the next character typed to the line verbatim.  This is how to
-     insert key sequences like ‘C-q’, for example.
-
-‘tab-insert (M-<TAB>)’
-     Insert a tab character.
-
-‘self-insert (a, b, A, 1, !, ...)’
-     Insert the character typed.
-
-‘bracketed-paste-begin ()’
-     This function is intended to be bound to the "bracketed paste"
-     escape sequence sent by some terminals, and such a binding is
-     assigned by default.  It allows Readline to insert the pasted text
-     as a single unit without treating each character as if it had been
-     read from the keyboard.  The characters are inserted as if each one
-     was bound to ‘self-insert’ instead of executing any editing
-     commands.
-
-     Bracketed paste sets the region (the characters between point and
-     the mark) to the inserted text.  It sets the _active region_.
-
-‘transpose-chars (C-t)’
-     Drag the character before the cursor forward over the character at
-     the cursor, moving the cursor forward as well.  If the insertion
-     point is at the end of the line, then this transposes the last two
-     characters of the line.  Negative arguments have no effect.
-
-‘transpose-words (M-t)’
-     Drag the word before point past the word after point, moving point
-     past that word as well.  If the insertion point is at the end of
-     the line, this transposes the last two words on the line.
-
-‘upcase-word (M-u)’
-     Uppercase the current (or following) word.  With a negative
-     argument, uppercase the previous word, but do not move the cursor.
-
-‘downcase-word (M-l)’
-     Lowercase the current (or following) word.  With a negative
-     argument, lowercase the previous word, but do not move the cursor.
-
-‘capitalize-word (M-c)’
-     Capitalize the current (or following) word.  With a negative
-     argument, capitalize the previous word, but do not move the cursor.
-
-‘overwrite-mode ()’
-     Toggle overwrite mode.  With an explicit positive numeric argument,
-     switches to overwrite mode.  With an explicit non-positive numeric
-     argument, switches to insert mode.  This command affects only
-     ‘emacs’ mode; ‘vi’ mode does overwrite differently.  Each call to
-     ‘readline()’ starts in insert mode.
-
-     In overwrite mode, characters bound to ‘self-insert’ replace the
-     text at point rather than pushing the text to the right.
-     Characters bound to ‘backward-delete-char’ replace the character
-     before point with a space.
-
-     By default, this command is unbound, but may be bound to the Insert
-     key on some keyboards.
-
-\1f
-File: rluser.info,  Node: Commands For Killing,  Next: Numeric Arguments,  Prev: Commands For Text,  Up: Bindable Readline Commands
-
-1.4.4 Killing And Yanking
--------------------------
-
-‘kill-line (C-k)’
-     Kill the text from point to the end of the current line.  With a
-     negative numeric argument, kill backward from the cursor to the
-     beginning of the line.
-
-‘backward-kill-line (C-x Rubout)’
-     Kill backward from the cursor to the beginning of the current line.
-     With a negative numeric argument, kill forward from the cursor to
-     the end of the line.
-
-‘unix-line-discard (C-u)’
-     Kill backward from the cursor to the beginning of the current line.
-
-‘kill-whole-line ()’
-     Kill all characters on the current line, no matter where point is.
-     By default, this is unbound.
-
-‘kill-word (M-d)’
-     Kill from point to the end of the current word, or if between
-     words, to the end of the next word.  Word boundaries are the same
-     as ‘forward-word’.
-
-‘backward-kill-word (M-<DEL>)’
-     Kill the word behind point.  Word boundaries are the same as
-     ‘backward-word’.
-
-‘unix-word-rubout (C-w)’
-     Kill the word behind point, using white space as a word boundary,
-     saving the killed text on the kill-ring.
-
-‘unix-filename-rubout ()’
-     Kill the word behind point, using white space and the slash
-     character as the word boundaries, saving the killed text on the
-     kill-ring.
-
-‘delete-horizontal-space ()’
-     Delete all spaces and tabs around point.  By default, this is
-     unbound.
-
-‘kill-region ()’
-     Kill the text in the current region.  By default, this command is
-     unbound.
-
-‘copy-region-as-kill ()’
-     Copy the text in the region to the kill buffer, so it can be yanked
-     right away.  By default, this command is unbound.
-
-‘copy-backward-word ()’
-     Copy the word before point to the kill buffer.  The word boundaries
-     are the same as ‘backward-word’.  By default, this command is
-     unbound.
-
-‘copy-forward-word ()’
-     Copy the word following point to the kill buffer.  The word
-     boundaries are the same as ‘forward-word’.  By default, this
-     command is unbound.
-
-‘yank (C-y)’
-     Yank the top of the kill ring into the buffer at point.
-
-‘yank-pop (M-y)’
-     Rotate the kill-ring, and yank the new top.  You can only do this
-     if the prior command is ‘yank’ or ‘yank-pop’.
-
-\1f
-File: rluser.info,  Node: Numeric Arguments,  Next: Commands For Completion,  Prev: Commands For Killing,  Up: Bindable Readline Commands
-
-1.4.5 Specifying Numeric Arguments
-----------------------------------
-
-‘digit-argument (M-0, M-1, ... M--)’
-     Add this digit to the argument already accumulating, or start a new
-     argument.  ‘M--’ starts a negative argument.
-
-‘universal-argument ()’
-     This is another way to specify an argument.  If this command is
-     followed by one or more digits, optionally with a leading minus
-     sign, those digits define the argument.  If the command is followed
-     by digits, executing ‘universal-argument’ again ends the numeric
-     argument, but is otherwise ignored.  As a special case, if this
-     command is immediately followed by a character that is neither a
-     digit nor minus sign, the argument count for the next command is
-     multiplied by four.  The argument count is initially one, so
-     executing this function the first time makes the argument count
-     four, a second time makes the argument count sixteen, and so on.
-     By default, this is not bound to a key.
-
-\1f
-File: rluser.info,  Node: Commands For Completion,  Next: Keyboard Macros,  Prev: Numeric Arguments,  Up: Bindable Readline Commands
-
-1.4.6 Letting Readline Type For You
------------------------------------
-
-‘complete (<TAB>)’
-     Attempt to perform completion on the text before point.  The actual
-     completion performed is application-specific.  The default is
-     filename completion.
-
-‘possible-completions (M-?)’
-     List the possible completions of the text before point.  When
-     displaying completions, Readline sets the number of columns used
-     for display to the value of ‘completion-display-width’, the value
-     of the environment variable ‘COLUMNS’, or the screen width, in that
-     order.
-
-‘insert-completions (M-*)’
-     Insert all completions of the text before point that would have
-     been generated by ‘possible-completions’, separated by a space.
-
-‘menu-complete ()’
-     Similar to ‘complete’, but replaces the word to be completed with a
-     single match from the list of possible completions.  Repeatedly
-     executing ‘menu-complete’ steps through the list of possible
-     completions, inserting each match in turn.  At the end of the list
-     of completions, ‘menu-complete’ rings the bell (subject to the
-     setting of ‘bell-style’) and restores the original text.  An
-     argument of N moves N positions forward in the list of matches; a
-     negative argument moves backward through the list.  This command is
-     intended to be bound to <TAB>, but is unbound by default.
-
-‘menu-complete-backward ()’
-     Identical to ‘menu-complete’, but moves backward through the list
-     of possible completions, as if ‘menu-complete’ had been given a
-     negative argument.  This command is unbound by default.
-
-‘export-completions ()’
-     Perform completion on the word before point as described above and
-     write the list of possible completions to Readline's output stream
-     using the following format, writing information on separate lines:
-
-          The number of matches;
-          The word being completed;
-          S:E, where S and E are the start and end offsets of the word
-          in the readline line buffer; then
-          Each match, one per line
-
-     If there are no matches, the first line will be 0, and this command
-     will not print any output after the S:E. If there is only a single
-     match, this prints a single line containing it.  If there is more
-     than one match, this prints the common prefix of the matches, which
-     may be empty, on the first line after the S:E, then the matches on
-     subsequent lines.  In this case, N will include the first line with
-     the common prefix.
-
-     The user or application should be able to accommodate the
-     possibility of a blank line.  The intent is that the user or
-     application reads N lines after the line containing S:E. This
-     command is unbound by default.
-
-‘delete-char-or-list ()’
-     Deletes the character under the cursor if not at the beginning or
-     end of the line (like ‘delete-char’).  At the end of the line, it
-     behaves identically to ‘possible-completions’.  This command is
-     unbound by default.
-
-\1f
-File: rluser.info,  Node: Keyboard Macros,  Next: Miscellaneous Commands,  Prev: Commands For Completion,  Up: Bindable Readline Commands
-
-1.4.7 Keyboard Macros
----------------------
-
-‘start-kbd-macro (C-x ()’
-     Begin saving the characters typed into the current keyboard macro.
-
-‘end-kbd-macro (C-x ))’
-     Stop saving the characters typed into the current keyboard macro
-     and save the definition.
-
-‘call-last-kbd-macro (C-x e)’
-     Re-execute the last keyboard macro defined, by making the
-     characters in the macro appear as if typed at the keyboard.
-
-‘print-last-kbd-macro ()’
-     Print the last keyboard macro defined in a format suitable for the
-     INPUTRC file.
-
-\1f
-File: rluser.info,  Node: Miscellaneous Commands,  Prev: Keyboard Macros,  Up: Bindable Readline Commands
-
-1.4.8 Some Miscellaneous Commands
----------------------------------
-
-‘re-read-init-file (C-x C-r)’
-     Read in the contents of the INPUTRC file, and incorporate any
-     bindings or variable assignments found there.
-
-‘abort (C-g)’
-     Abort the current editing command and ring the terminal's bell
-     (subject to the setting of ‘bell-style’).
-
-‘do-lowercase-version (M-A, M-B, M-X, ...)’
-     If the metafied character X is upper case, run the command that is
-     bound to the corresponding metafied lower case character.  The
-     behavior is undefined if X is already lower case.
-
-‘prefix-meta (<ESC>)’
-     Metafy the next character typed.  Typing ‘<ESC> f’ is equivalent to
-     typing ‘M-f’.
-
-‘undo (C-_ or C-x C-u)’
-     Incremental undo, separately remembered for each line.
-
-‘revert-line (M-r)’
-     Undo all changes made to this line.  This is like executing the
-     ‘undo’ command enough times to get back to the initial state.
-
-‘tilde-expand (M-~)’
-     Perform tilde expansion on the current word.
-
-‘set-mark (C-@)’
-     Set the mark to the point.  If a numeric argument is supplied, set
-     the mark to that position.
-
-‘exchange-point-and-mark (C-x C-x)’
-     Swap the point with the mark.  Set the current cursor position to
-     the saved position, then set the mark to the old cursor position.
-
-‘character-search (C-])’
-     Read a character and move point to the next occurrence of that
-     character.  A negative argument searches for previous occurrences.
-
-‘character-search-backward (M-C-])’
-     Read a character and move point to the previous occurrence of that
-     character.  A negative argument searches for subsequent
-     occurrences.
-
-‘skip-csi-sequence ()’
-     Read enough characters to consume a multi-key sequence such as
-     those defined for keys like Home and End.  CSI sequences begin with
-     a Control Sequence Indicator (CSI), usually ESC-[.  If this
-     sequence is bound to "\e[", keys producing CSI sequences will have
-     no effect unless explicitly bound to a Readline command, instead of
-     inserting stray characters into the editing buffer.  This is
-     unbound by default, but usually bound to ESC-[.
-
-‘insert-comment (M-#)’
-     Without a numeric argument, insert the value of the ‘comment-begin’
-     variable at the beginning of the current line.  If a numeric
-     argument is supplied, this command acts as a toggle: if the
-     characters at the beginning of the line do not match the value of
-     ‘comment-begin’, insert the value; otherwise delete the characters
-     in ‘comment-begin’ from the beginning of the line.  In either case,
-     the line is accepted as if a newline had been typed.
-
-‘dump-functions ()’
-     Print all of the functions and their key bindings to the Readline
-     output stream.  If a numeric argument is supplied, the output is
-     formatted in such a way that it can be made part of an INPUTRC
-     file.  This command is unbound by default.
-
-‘dump-variables ()’
-     Print all of the settable variables and their values to the
-     Readline output stream.  If a numeric argument is supplied, the
-     output is formatted in such a way that it can be made part of an
-     INPUTRC file.  This command is unbound by default.
-
-‘dump-macros ()’
-     Print all of the Readline key sequences bound to macros and the
-     strings they output to the Readline output stream.  If a numeric
-     argument is supplied, the output is formatted in such a way that it
-     can be made part of an INPUTRC file.  This command is unbound by
-     default.
-
-‘execute-named-command (M-x)’
-     Read a bindable Readline command name from the input and execute
-     the function to which it's bound, as if the key sequence to which
-     it was bound appeared in the input.  If this function is supplied
-     with a numeric argument, it passes that argument to the function it
-     executes.
-
-‘emacs-editing-mode (C-e)’
-     When in ‘vi’ command mode, this causes a switch to ‘emacs’ editing
-     mode.
-
-‘vi-editing-mode (M-C-j)’
-     When in ‘emacs’ editing mode, this causes a switch to ‘vi’ editing
-     mode.
-
-\1f
-File: rluser.info,  Node: Readline vi Mode,  Prev: Bindable Readline Commands,  Up: Command Line Editing
-
-1.5 Readline vi Mode
-====================
-
-While the Readline library does not have a full set of ‘vi’ editing
-functions, it does contain enough to allow simple editing of the line.
-The Readline ‘vi’ mode behaves as specified in the ‘sh’ description in
-the POSIX standard.
-
-   In order to switch interactively between ‘emacs’ and ‘vi’ editing
-modes, use the command ‘M-C-j’ (bound to emacs-editing-mode when in ‘vi’
-mode and to vi-editing-mode in ‘emacs’ mode).  The Readline default is
-‘emacs’ mode.
-
-   When you enter a line in ‘vi’ mode, you are already placed in
-'insertion' mode, as if you had typed an ‘i’.  Pressing <ESC> switches
-you into 'command' mode, where you can edit the text of the line with
-the standard ‘vi’ movement keys, move to previous history lines with ‘k’
-and subsequent lines with ‘j’, and so forth.
-
-
-\1f
-Tag Table:
-Node: Command Line Editing\7f73
-Node: Introduction and Notation\7f663
-Node: Readline Interaction\7f3017
-Node: Readline Bare Essentials\7f4207
-Node: Readline Movement Commands\7f6017
-Node: Readline Killing Commands\7f7015
-Node: Readline Arguments\7f9040
-Node: Searching\7f10099
-Node: Readline Init File\7f12328
-Node: Readline Init File Syntax\7f13524
-Node: Conditional Init Constructs\7f39914
-Node: Sample Init File\7f44301
-Node: Bindable Readline Commands\7f47424
-Node: Commands For Moving\7f48806
-Node: Commands For History\7f50734
-Node: Commands For Text\7f55937
-Node: Commands For Killing\7f59780
-Node: Numeric Arguments\7f62234
-Node: Commands For Completion\7f63388
-Node: Keyboard Macros\7f66630
-Node: Miscellaneous Commands\7f67333
-Node: Readline vi Mode\7f71655
-\1f
-End Tag Table
-
-\1f
-Local Variables:
-coding: utf-8
-End:
diff --git a/lib/readline/examples/rl-test-timeout b/lib/readline/examples/rl-test-timeout
deleted file mode 100644 (file)
index 2c9de1a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-./rl-timeout readline1 0.5
-./rl-timeout readline2 0.25
-
-./rl-timeout callback1 0.5
-./rl-timeout callback2 0.5
-
diff --git a/lib/readline/examples/rl-timeout.c b/lib/readline/examples/rl-timeout.c
deleted file mode 100644 (file)
index b8a24ba..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-/* rl-timeout: test various readline builtin timeouts. */
-
-/* Copyright (C) 2021 Free Software Foundation, Inc.
-
-   This file is part of the GNU Readline Library (Readline), a library for
-   reading lines of text with interactive input and history editing.
-
-   Readline 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.
-
-   Readline 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 readline.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-/* Standard include files. stdio.h is required. */
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <limits.h>
-
-/* Used for select(2) */
-#include <sys/types.h>
-#include <sys/select.h>
-
-#include <errno.h>
-#include <stdio.h>
-
-/* Standard readline include files. */
-#if defined (READLINE_LIBRARY)
-#  include "readline.h"
-#  include "history.h"
-#else
-#  include <readline/readline.h>
-#  include <readline/history.h>
-#endif
-
-extern int errno;
-
-static void cb_linehandler (char *);
-
-int timeout_secs = 1, timeout_usecs = 0;
-int running;
-const char *prompt = "rl-timeout$ ";
-
-/* **************************************************************** */
-/*                                                                 */
-/* Example 1: readline () with rl_readline_state                   */
-/*                                                                 */
-/* **************************************************************** */
-
-void
-rltest_timeout_readline1 ()
-{
-  const char *temp;
-
-  rl_set_timeout (timeout_secs, timeout_usecs);
-  temp = readline (prompt);
-  if (RL_ISSTATE (RL_STATE_TIMEOUT))
-    printf ("timeout\n");
-  else if (temp == NULL)
-    printf ("no input line\n");
-  else
-    printf ("input line: %s\n", temp);
-  free ((void *) temp);
-}
-
-/* **************************************************************** */
-/*                                                                 */
-/* Example 2: readline () with rl_timeout_event_hook               */
-/*                                                                 */
-/* **************************************************************** */
-
-static int
-timeout_handler ()
-{
-  printf ("timeout\n");
-  return READERR;
-}
-
-void
-rltest_timeout_readline2 ()
-{
-  const char *temp;
-
-  rl_set_timeout (timeout_secs, timeout_usecs);
-  rl_timeout_event_hook = timeout_handler;
-  temp = readline (prompt);
-  if (temp == NULL)
-    printf ("no input line\n");
-  else
-    printf ("input line: %s\n", temp);
-  free ((void *)temp);
-}
-
-/* **************************************************************** */
-/*                                                                 */
-/* Example 3: rl_callback_* () with rl_timeout_remaining           */
-/*                                                                 */
-/* **************************************************************** */
-
-/* Callback function called for each line when accept-line executed, EOF
-   seen, or EOF character read.  This sets a flag and returns; it could
-   also call exit(3). */
-static void
-cb_linehandler (char *line)
-{
-  /* Can use ^D (stty eof) or `exit' to exit. */
-  if (line == NULL || strcmp (line, "exit") == 0)
-    {
-      if (line == 0)
-       printf ("\n");
-      printf ("exit\n");
-      /* This function needs to be called to reset the terminal settings,
-        and calling it from the line handler keeps one extra prompt from
-        being displayed. */
-      rl_callback_handler_remove ();
-
-      running = 0;
-    }
-  else
-    {
-      if (*line)
-       add_history (line);
-      printf ("input line: %s\n", line);
-      free (line);
-    }
-}
-
-void
-rltest_timeout_callback1 ()
-{
-  fd_set fds;
-  int r;
-  unsigned sec, usec;
-
-  rl_set_timeout (timeout_secs, timeout_usecs);
-  rl_callback_handler_install (prompt, cb_linehandler);
-  running = 1;
-  while (running)
-    {
-      FD_ZERO (&fds);
-      FD_SET (fileno (rl_instream), &fds);
-      r = rl_timeout_remaining (&sec, &usec);
-      if (r == 1)
-       {
-         struct timeval timeout = {sec, usec};
-         r = select (FD_SETSIZE, &fds, NULL, NULL, &timeout);
-       }
-      if (r < 0 && errno != EINTR)
-       {
-         perror ("rl-timeout: select");
-         rl_callback_handler_remove ();
-         break;
-       }
-      else if (r == 0)
-       {
-         printf ("rl-timeout: timeout\n");
-         rl_callback_handler_remove ();
-         break;
-       }
-
-      if (FD_ISSET (fileno (rl_instream), &fds))
-       rl_callback_read_char ();
-    }
-
-  printf ("rl-timeout: Event loop has exited\n");
-}
-
-/* **************************************************************** */
-/*                                                                 */
-/* Example 4: rl_callback_* () with rl_timeout_event_hook          */
-/*                                                                 */
-/* **************************************************************** */
-
-static int
-cb_timeouthandler ()
-{
-  printf ("timeout\n");
-  rl_callback_handler_remove ();
-  running = 0;
-  return READERR;
-}
-
-void
-rltest_timeout_callback2 ()
-{
-  int r;
-
-  rl_set_timeout (timeout_secs, timeout_usecs);
-  rl_timeout_event_hook = cb_timeouthandler;
-  rl_callback_handler_install (prompt, cb_linehandler);
-  running = 1;
-  while (running)
-    rl_callback_read_char ();
-
-  printf ("rl-timeout: Event loop has exited\n");
-}
-
-int
-main (int argc, char **argv)
-{
-  if (argc >= 2)
-    {
-      if (argc >= 3)
-       {
-         double timeout = atof (argv[2]);
-         if (timeout <= 0.0)
-           {
-             fprintf (stderr, "rl-timeout: specify a positive number for timeout.\n");
-             return 2;
-           }
-         else if (timeout > UINT_MAX)
-           {
-             fprintf (stderr, "rl-timeout: timeout too large.\n");
-             return 2;
-           }
-         timeout_secs = (unsigned) timeout;
-         timeout_usecs = (unsigned) ((timeout - timeout_secs) * 1000000 + 0.5);
-       }
-
-      if (strcmp (argv[1], "readline1") == 0)
-       rltest_timeout_readline1 ();
-      else if (strcmp (argv[1], "readline2") == 0)
-       rltest_timeout_readline2 ();
-      else if (strcmp (argv[1], "callback1") == 0)
-       rltest_timeout_callback1 ();
-      else if (strcmp (argv[1], "callback2") == 0)
-       rltest_timeout_callback2 ();
-      else
-       return 2;
-    }
-  else
-    {
-      fprintf (stderr, "usage: rl-timeout [readline1 | readline2 | callback1 | callback2] [timeout]\n");
-      return 2;
-    }
-  return 0;
-}
diff --git a/lib/readline/examples/x b/lib/readline/examples/x
deleted file mode 100644 (file)
index 239dcab..0000000
+++ /dev/null
@@ -1 +0,0 @@
-N   3149)   5/1 To: peggy.gup@c Re: FW: Phone for Mike Dailey   (2413 chars)N   3150)   5/1 Jason Cutcher   RE: Phone for Mike Dailey       (34705 chars)N   3151)   5/1 Wizards         *****SPAM***** Relief           (7291 chars)N   3152)   5/1 FCG Help Desk   Case HD0000002533519, Medium, h (2537 chars)N   3153)   5/1 To: jrw11@case. HD0000002533519                 (2247 chars)N   3154)   5/1 Peggy Watts Gup RE: [tis-staff] Boxes back to m (12903 chars)N   3155)   5/1 Debbie Andrews  [firewall-changes] Firewa
index fb4a98e516918a05ffa1655e3d83545e07d3db0a..38373f9a3f8e9e41d2f34d4557fb6a3be6c3b161 100644 (file)
@@ -2,7 +2,7 @@
  * shtty.c -- abstract interface to the terminal, focusing on capabilities.
  */
 
-/* Copyright (C) 1999, 2022 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2022-2026 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
index 2cf482fdec5a1059df326e4c3ca7b2e398f6d95b..ab5f155b66c51b9ac70011b8bd08ad2ca46cd3cd 100644 (file)
@@ -6289,18 +6289,21 @@ void
 sv_optind (const char *name)
 {
   SHELL_VAR *var;
-  char *tt;
+  char *t, *e;
   int s;
 
   var = find_variable ("OPTIND");
-  tt = var ? get_variable_value (var) : (char *)NULL;
+  t = var ? get_variable_value (var) : (char *)NULL;
 
   /* Assume that if var->context < variable_context and variable_context > 0
      then we are restoring the variables's previous state while returning
      from a function. */
-  if (tt && *tt)
+  if (t && *t)
     {
-      s = atoi (tt);
+      s = (int)strtol (t, &e, 10);
+
+      if (e == t || *e != '\0')
+       return;         /* non-numeric value is a no-op */
 
       /* According to POSIX, setting OPTIND=1 resets the internal state
         of getopt (). */
@@ -6315,10 +6318,19 @@ sv_optind (const char *name)
 void
 sv_opterr (const char *name)
 {
-  char *tt;
+  char *tt, *e;
+  int n;
 
   tt = get_string_value ("OPTERR");
-  sh_opterr = (tt && *tt) ? atoi (tt) : 1;
+  if (tt == 0 || *tt == 0)
+    n = 1;
+  else
+    {
+      n = (int)strtol (tt, &e, 10);
+      if (e == tt || *e != '\0')
+       n = 1;
+    }
+  sh_opterr = n;
 }
 
 void
@@ -6583,7 +6595,7 @@ sv_childmax (const char *name)
   int s;
 
   tt = get_string_value (name);
-  s = (tt && *tt) ? atoi (tt) : 0;
+  s = (tt && *tt) ? (int)strtol (tt, (char **)NULL, 10) : 0;
   set_maxchild (s);
 }
 #endif