add more characters to inhibit history expansion; allow asynchronous !' and time' commands without a pipeline

This commit is contained in:
Chet Ramey
2023-08-11 10:32:40 -04:00
parent 1d0c4ceb49
commit 85b466d64f
14 changed files with 3107 additions and 2925 deletions
+22
View File
@@ -7389,3 +7389,25 @@ lib/readline/bind.c
that are, e.g., \M-\C-@ (128) into \e followed by a NUL, resulting
in truncated key sequences. Just don't honor convert-meta in this
case
8/8
---
bashhist.c
- bash_history_no_expand_chars: add the rest of the shell
metacharacters so we don't get empty history events; tcsh does more
or less the same thing
Inspired by a report from Emanuele Torre <torreemanuele6@gmail.com>
8/9
---
parse.y
- grammar: change bare `time' and `!' productions to use nullcmd_terminator,
which is a list_terminator or a `&' to allow things like `time &'
and `! &' which the original version of POSIX interp 267 (the one
I implemented) says we should support
8/11
----
config.h.in
- added a number of new symbols to support importing a newer version
of lib/intl from gnulib/gettext
+3
View File
@@ -803,6 +803,9 @@ pathnames.h: Makefile $(srcdir)/pathnames.h.in
fi
@${RM} pathnames.tmp
$(SDIR)/bashbug.sh: $(SDIR)/bashbug.sh.in
CONFIG_FILES=$(SDIR)/bashbug.sh CONFIG_HEADERS= $(SHELL) ./config.status
# comment out for distribution
$(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/config.h.in
cd $(srcdir) && autoconf
+8
View File
@@ -193,6 +193,10 @@ int hist_verify;
int dont_save_function_defs;
#if defined (BANG_HISTORY)
/* The usual history no-expand characters plus the shell metacharacters that
would result in an empty history event. */
static char *bash_history_no_expand_chars = " \t\n\r=;&|()<>";
static int bash_history_inhibit_expansion (char *, int);
#endif
#if defined (READLINE)
@@ -230,6 +234,7 @@ bash_history_inhibit_expansion (char *string, int i)
else if (i > 1 && string[i - 1] == '$' && string[i] == '!')
return (1);
#if defined (EXTENDED_GLOB)
/* This is on all the time now; see bash_history_no_expand_characters above */
else if (extended_glob && i > 1 && string[i+1] == '(' && member (')', string + i + 2))
return (1);
#endif
@@ -271,6 +276,7 @@ bash_initialize_history (void)
history_search_delimiter_chars = ";&()|<>";
#if defined (BANG_HISTORY)
history_inhibit_expansion_function = bash_history_inhibit_expansion;
history_no_expand_chars = bash_history_no_expand_chars;
sv_histchars ("histchars");
#endif
}
@@ -282,6 +288,7 @@ bash_history_reinit (int interact)
history_expansion = (interact == 0) ? histexp_flag : HISTEXPAND_DEFAULT;
history_expansion_inhibited = (interact == 0) ? 1 - histexp_flag : 0; /* changed in bash_history_enable() */
history_inhibit_expansion_function = bash_history_inhibit_expansion;
history_no_expand_chars = bash_history_no_expand_chars;
#endif
remember_on_history = enable_history_list;
}
@@ -302,6 +309,7 @@ bash_history_enable (void)
#if defined (BANG_HISTORY)
history_expansion_inhibited = 0;
history_inhibit_expansion_function = bash_history_inhibit_expansion;
history_no_expand_chars = bash_history_no_expand_chars;
#endif
sv_history_control ("HISTCONTROL");
sv_histignore ("HISTIGNORE");
+83 -1
View File
@@ -1,6 +1,6 @@
/* config.h -- Configuration file for bash. */
/* Copyright (C) 1987-2009,2011-2012,2013-2019 Free Software Foundation, Inc.
/* Copyright (C) 1987-2009,2011-2012,2013-2023 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -1190,6 +1190,32 @@
/* Additional defines for configuring lib/intl, maintained by autoscan/autoheader */
/* System characteristics */
#undef HAVE_LC_MESSAGE
#undef HAVE_LOCALE_NULL
#undef HAVE_NAMELESS_LOCALES
#undef HAVE_PER_THREAD_LOCALE
#undef HAVE_SOLARIS114_LOCALES
/* Compiler characteristics */
#undef FLEXIBLE_ARRAY_MEMBER
#undef HAVE_VISIBILITY
#undef HAVE_BUILTIN_EXPECT
#undef HAVE_WEAK_SYMBOLS
#define _GL_ATTRIBUTE_MALLOC
#define _GL_ATTRIBUTE_DEALLOC_FREE
#define _GL_ATTRIBUTE_FALLTHROUGH
#define _GL_ATTRIBUTE_PURE
#define _GL_UNUSED
#define _GL_INLINE_HEADER_BEGIN
#define _GL_INLINE_HEADER_END
#define _GL_EXTERN_INLINE
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
@@ -1199,15 +1225,38 @@
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
#undef HAVE_INTTYPES_H_WITH_UINTMAX
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
#undef HAVE_STDINT_H_WITH_UINTMAX
/* Define if you have the <stdio_ext.h> header file. */
#undef HAVE_STDIO_EXT_H
/* Define if you have the <threads.h> header file. */
#undef HAVE_THREADS_H
/* Declarations */
#undef HAVE_DECL_FEOF_UNLOCKED
#undef HAVE_DECL_FGETS_UNLOCKED
#undef HAVE_DECL__SNPRINTF
#undef HAVE_DECL__SNWPRINTF
/* Define if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
#undef HAVE_GETUID
#undef HAVE_GETEUID
#undef HAVE_GETGID
#undef HAVE_GETEGID
#undef HAVE_GETLOCALENAME_L
#undef HAVE_GOOD_USELOCALE
#undef HAVE_ICONV
/* Define if you have the `localeconv' function. */
#undef HAVE_LOCALECONV
@@ -1229,9 +1278,22 @@
/* Define if you have the `nanosleep' function. */
#undef HAVE_NANOSLEEP
/* Define if you have the `newlocale' function. */
#undef HAVE_NEWLOCALE
/* Define if you have the `nl_langinfo' function. */
#undef HAVE_NL_LANGINFO
#undef HAVE_POSIX_PRINTF
#undef HAVE_PTHREAD_API
#undef HAVE_PTHREAD_MUTEX_RECURSIVE
#undef HAVE_PTHREAD_RWLOCK
#undef HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
#undef HAVE_SNPRINTF_RETVAL_C99
#undef HAVE_SNPRINTF_TRUNCATION_C99
/* Define if you have the `stpcpy' function. */
#undef HAVE_STPCPY
@@ -1241,6 +1303,18 @@
/* Define if you have the `strdup' function. */
#undef HAVE_STRDUP
#undef HAVE_TSEARCH
/* Define if you have the `uselocale' function. */
#undef HAVE_USELOCALE
#undef HAVE_WORKING_USELOCALE
#undef HAVE_WCSLEN
#undef HAVE_WCSNLEN
/* Define if you have the `wprintf' function. */
#undef HAVE_WPRINTF
/* Define if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
@@ -1250,6 +1324,14 @@
/* Define if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
#undef HAVE___FSETLOCKING
/* macOS specific defines */
#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
#undef HAVE_CFPREFERENCESCOPYAPPVALUE
/* End additions for lib/intl */
#include "config-bot.h"
+1822 -1820
View File
File diff suppressed because it is too large Load Diff
+15 -6
View File
@@ -5,14 +5,14 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Wed Aug 2 16:03:53 EDT 2023
.\" Last Change: Thu Aug 10 10:49:52 EDT 2023
.\"
.\" bash_builtins, strip all but Built-Ins section
.\" avoid a warning about an undefined register
.\" .if !rzY .nr zY 0
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2023 August 2" "GNU Bash 5.3"
.TH BASH 1 "2023 August 10" "GNU Bash 5.3"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -7552,12 +7552,18 @@ The second is to select portions of that line for inclusion into
the current one.
The line selected from the history is the \fIevent\fP,
and the portions of that line that are acted upon are \fIwords\fP.
Various \fImodifiers\fP are available to manipulate the selected words.
The \fIevent designator\fP selects the event, the optional
\fIword designator\fP selects words from the event, and
various optional \fImodifiers\fP are available to manipulate the
selected words.
The line is broken into words in the same fashion as when reading input,
so that several \fImetacharacter\fP-separated words surrounded by
quotes are considered one word.
.PP
History expansions are introduced by the appearance of the
history expansion character, which is \^\fB!\fP\^ by default.
History expansions may appear anywhere in the input, but do not nest.
.PP
Only backslash (\^\fB\e\fP\^) and single quotes can quote
the history expansion character, but the history expansion character is
also treated as quoted if it immediately precedes the closing double quote
@@ -7565,9 +7571,8 @@ in a double-quoted string.
.PP
Several characters inhibit history expansion if found immediately
following the history expansion character, even if it is unquoted:
space, tab, newline, carriage return, and \fB=\fP.
If the \fBextglob\fP shell option is enabled, \fB(\fP will also
inhibit expansion.
space, tab, newline, carriage return, \fB=\fP,
and the other shell metacharacters defined above.
.PP
Several shell options settable with the
.B shopt
@@ -7616,6 +7621,10 @@ writing the history file.
.SS Event Designators
An event designator is a reference to a command line entry in the
history list.
The event designator
consists of the portion of the word beginning with the history
expansion character and ending with the word designator if present,
or the end of the word.
Unless the reference is absolute, events are relative to the current
position in the history list.
.PP
+40 -21
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 July 26<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2023 August 2<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -1027,7 +1027,7 @@ indices. The element of
</FONT>
with index <I>n</I> is the portion of the
string matching the <I>n</I>th parenthesized subexpression.
Bash sets
<B>Bash</B> sets
<FONT SIZE=-1><B>BASH_REMATCH</B>
</FONT>
@@ -2784,7 +2784,7 @@ A sample value is
<DD>
Set the number of exited child status values for the shell to remember.
Bash will not allow this value to be decreased below a POSIX-mandated
<B>Bash</B> will not allow this value to be decreased below a POSIX-mandated
minimum, and there is a maximum value (currently 8192) that this may
not exceed.
The minimum value is system-dependent.
@@ -2965,8 +2965,10 @@ The name of the file in which command history is saved (see
<FONT SIZE=-1><B>HISTORY</B>
</FONT>
below). The default value is <I>ti/.bash_history</I>. If unset, the
command history is not saved when a shell exits.
below).
<B>Bash</B> assigns a default value of <I>ti/.bash_history</I>.
If <B>HISTFILE</B> is unset or null,
the command history is not saved when a shell exits.
<DT><B>HISTFILESIZE</B>
<DD>
@@ -3966,13 +3968,13 @@ and
and the shell assigns the expanded value.
<P>
Bash also performs tilde expansion on words satisfying the conditions of
variable assignments (as described above under
<B>Bash</B> also performs tilde expansion on words satisfying the conditions
of variable assignments (as described above under
<FONT SIZE=-1><B>PARAMETERS</B>)
</FONT>
when they appear as arguments to simple commands.
Bash does not do this, except for the <I>declaration</I> commands listed
<B>Bash</B> does not do this, except for the <I>declaration</I> commands listed
above, when in <I>posix mode</I>.
<A NAME="lbBB">&nbsp;</A>
<H4>Parameter Expansion</H4>
@@ -9434,8 +9436,8 @@ If
<FONT SIZE=-1><B>HISTFILE</B>
</FONT>
is unset, or if the history file is unwritable, the history is
not saved.
is unset or null,
or if the history file is unwritable, the history is not saved.
If the
<FONT SIZE=-1><B>HISTTIMEFORMAT</B>
@@ -9486,7 +9488,7 @@ and
<FONT SIZE=-1><B>HISTIGNORE</B>
</FONT>
variables may be set to cause the shell to save only a subset of the
variables are used to cause the shell to save only a subset of the
commands entered.
The
<B>cmdhist</B>
@@ -9560,7 +9562,8 @@ in a double-quoted string.
Several characters inhibit history expansion if found immediately
following the history expansion character, even if it is unquoted:
space, tab, newline, carriage return, and <B>=</B>.
space, tab, newline, carriage return,
<B>=</B>, <B>;</B>, <B>&amp;</B>, and <B>|</B>.
If the <B>extglob</B> shell option is enabled, <B>(</B> will also
inhibit expansion.
<P>
@@ -10018,7 +10021,7 @@ or was started without job control.
<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] [<B>-q</B> <I>function</I>] [<B>-u</B> <I>function</I>] [<B>-r</B> <I>keyseq</I>]<DD>
<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <B>-f</B> <I>filename</I><DD>
<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <B>-x</B> <I>keyseq</I>:<I>shell-command</I><DD>
<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <B>-x</B> <I>keyseq</I>[:] <I>shell-command</I><DD>
<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <I>keyseq</I>:<I>function-name</I><DD>
<DT><B>bind</B> [<B>-m</B> <I>keymap</I>] <I>keyseq</I>:<I>readline-command</I><DD>
<DT><B>bind</B> <I>readline-command-line</I><DD>
@@ -10111,11 +10114,20 @@ Unbind all keys bound to the named <I>function</I>.
<DD>
Remove any current binding for <I>keyseq</I>.
<DT><B>-x </B><I>keyseq</I>:<I>shell-command</I>
<DT><B>-x </B><I>keyseq</I>[: ]<I>shell-command</I>
<DD>
Cause <I>shell-command</I> to be executed whenever <I>keyseq</I> is
entered.
The separator between <I>keyseq</I> and <I>shell-command</I> is either
whitespace or a colon optionally followed by whitespace.
If the separator is whitespace, <I>shell-command</I>
must be enclosed in double quotes and <B>readline</B> expands any of its
special backslash-escapes in <I>shell-command</I> before saving it.
If the separator is a colon, any enclosing double quotes are optional, and
<B>readline</B> does not expand the command string before saving it.
Since the entire key binding expression must be a single argument, it
should be enclosed in quotes.
When <I>shell-command</I> is executed, the shell sets the
<FONT SIZE=-1><B>READLINE_LINE</B>
@@ -11099,7 +11111,7 @@ from shared object
<I>filename</I>,
on systems that support dynamic loading.
Bash will use the value of the <B>BASH_LOADABLES_PATH</B> variable as a
<B>Bash</B> will use the value of the <B>BASH_LOADABLES_PATH</B> variable as a
colon-separated list of directories in which to search for <I>filename</I>.
The default is system-dependent.
The
@@ -11637,7 +11649,14 @@ name of the history file; if not, the value of
<FONT SIZE=-1><B>HISTFILE</B>
</FONT>
is used. Options, if supplied, have the following meanings:
is used.
If <I>filename</I> is not supplied and
<FONT SIZE=-1><B>HISTFILE</B>
</FONT>
is unset or null, the <B>-a, -n, -r,</B> and <B>-w</B> options
have no effect.
Options, if supplied, have the following meanings:
<DL COMPACT><DT><DD>
<DL COMPACT>
@@ -14578,7 +14597,7 @@ corresponding to the <B>compat</B><I>NN</I> option, like 42) determines the
compatibility level.
<P>
Starting with bash-4.4, Bash has begun deprecating older compatibility
Starting with bash-4.4, <B>bash</B> has begun deprecating older compatibility
levels.
Eventually, the options will be removed in favor of
<FONT SIZE=-1><B>BASH_COMPAT</B>.
@@ -14639,7 +14658,7 @@ entire list)
the <B>&lt;</B> and <B>&gt;</B> operators to the <B>[[</B> command do not
consider the current locale when comparing strings; they use ASCII
ordering.
Bash versions prior to bash-4.1 use ASCII collation and
<B>Bash</B> versions prior to bash-4.1 use ASCII collation and
<I>strcmp</I>(3);
bash-4.1 and later use the current locale's collation sequence and
@@ -15067,7 +15086,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2023 July 26<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 5.3<TH ALIGN=CENTER width=33%>2023 August 2<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -15173,7 +15192,7 @@ There may be only one active coprocess at a time.
<DT><A HREF="#lbDI">BUGS</A><DD>
</DL>
<HR>
This document was created by man2html from /usr/local/src/bash/bash-20230724/doc/bash.1.<BR>
Time: 27 July 2023 13:45:03 EDT
This document was created by man2html from /usr/local/src/bash/bash-20230808/doc/bash.1.<BR>
Time: 09 August 2023 10:01:14 EDT
</BODY>
</HTML>
+213 -208
View File
@@ -1,9 +1,9 @@
This is bash.info, produced by makeinfo version 6.8 from bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 31 July 2023).
Bash shell (version 5.3, 2 August 2023).
This is Edition 5.3, last updated 31 July 2023, of 'The GNU Bash
This is Edition 5.3, last updated 2 August 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -26,10 +26,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 31 July 2023). The Bash home page is
Bash shell (version 5.3, 2 August 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 31 July 2023, of 'The GNU Bash
This is Edition 5.3, last updated 2 August 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -4742,8 +4742,8 @@ parameters, or to display the names and values of shell variables.
user and group ids.
'-r'
Enable restricted shell mode. This option cannot be unset
once it has been set.
Enable restricted shell mode (*note The Restricted Shell::).
This option cannot be unset once it has been set.
'-t'
Exit after reading and executing one command.
@@ -5753,8 +5753,9 @@ Variables::).
regardless of the value of 'HISTCONTROL'.
'HISTFILE'
The name of the file to which the command history is saved. The
default value is '~/.bash_history'.
The name of the file to which the command history is saved. Bash
assigns a default value of '~/.bash_history'. If 'HISTFILE' is
unset or null, the command history is not saved when a shell exits.
'HISTFILESIZE'
The maximum number of lines contained in the history file. When
@@ -6174,7 +6175,8 @@ single-character options to be recognized.
POSIX Mode::, for a description of the Bash POSIX mode.
'--restricted'
Make the shell a restricted shell (*note The Restricted Shell::).
Equivalent to '-r'. Make the shell a restricted shell (*note The
Restricted Shell::).
'--verbose'
Equivalent to '-v'. Print shell input lines as they're read.
@@ -6907,7 +6909,7 @@ index of -1 refers to the last element.
Referencing an array variable without a subscript is equivalent to
referencing with a subscript of 0. Any reference to a variable using a
valid subscript is legal, and 'bash' will create an array if necessary.
valid subscript is legal, and Bash will create an array if necessary.
An array variable is considered set if a subscript has been assigned
a value. The null string is a valid value.
@@ -7318,7 +7320,7 @@ startup files.
command name, rather than on all assignment statements on the line.
12. The default history file is '~/.sh_history' (this is the default
value of '$HISTFILE').
value the shell assigns to '$HISTFILE').
13. Redirection operators do not perform filename expansion on the
word in the redirection unless the shell is interactive.
@@ -7538,7 +7540,7 @@ startup files.
67. The 'test' builtin's '-t' unary primary requires an argument.
Historical versions of 'test' made the argument optional in certain
cases, and bash attempts to accommodate those for backwards
cases, and Bash attempts to accommodate those for backwards
compatibility.
68. Command substitutions don't set the '?' special parameter. The
@@ -10241,9 +10243,9 @@ no more than the number of lines specified by the value of the
last '$HISTSIZE' lines are copied from the history list to the file
named by '$HISTFILE'. If the 'histappend' shell option is set (*note
Bash Builtins::), the lines are appended to the history file, otherwise
the history file is overwritten. If 'HISTFILE' is unset, or if the
history file is unwritable, the history is not saved. After saving the
history, the history file is truncated to contain no more than
the history file is overwritten. If 'HISTFILE' is unset or null, or if
the history file is unwritable, the history is not saved. After saving
the history, the history file is truncated to contain no more than
'$HISTFILESIZE' lines. If 'HISTFILESIZE' is unset, or set to null, a
non-numeric value, or a numeric value less than zero, the history file
is not truncated.
@@ -10254,7 +10256,7 @@ history comment character. When the history file is read, lines
beginning with the history comment character followed immediately by a
digit are interpreted as timestamps for the following history entry.
The builtin command 'fc' may be used to list or edit and re-execute a
The 'fc' builtin command may be used to list or edit and re-execute a
portion of the history list. The 'history' builtin may be used to
display or modify the history list and manipulate the history file.
When using command-line editing, search commands are available in each
@@ -10262,7 +10264,7 @@ editing mode that provide access to the history list (*note Commands For
History::).
The shell allows control over which commands are saved on the history
list. The 'HISTCONTROL' and 'HISTIGNORE' variables may be set to cause
list. The 'HISTCONTROL' and 'HISTIGNORE' variables are used to cause
the shell to save only a subset of the commands entered. The 'cmdhist'
shell option, if enabled, causes the shell to attempt to save each line
of a multi-line command in the same history entry, adding semicolons
@@ -10382,6 +10384,7 @@ history file.
If a FILENAME argument is supplied when any of the '-w', '-r',
'-a', or '-n' options is used, Bash uses FILENAME as the history
file. If not, then the value of the 'HISTFILE' variable is used.
If 'HISTFILE' is unset or null, these options have no effect.
The return value is 0 unless an invalid option is encountered, an
error occurs while reading or writing the history file, an invalid
@@ -10469,8 +10472,8 @@ the current position in the history list.
'!'
Start a history substitution, except when followed by a space, tab,
the end of the line, '=' or '(' (when the 'extglob' shell option is
enabled using the 'shopt' builtin).
the end of the line, '=', ';', '&', '|', or '(' (when the 'extglob'
shell option is enabled using the 'shopt' builtin).
'!N'
Refer to command line N.
@@ -10505,12 +10508,14 @@ File: bash.info, Node: Word Designators, Next: Modifiers, Prev: Event Designa
9.3.2 Word Designators
----------------------
Word designators are used to select desired words from the event. A ':'
separates the event specification from the word designator. It may be
omitted if the word designator begins with a '^', '$', '*', '-', or '%'.
Words are numbered from the beginning of the line, with the first word
being denoted by 0 (zero). Words are inserted into the current line
separated by single spaces.
Word designators are used to select desired words from the event. They
are optional; if the word designator isn't supplied, the history
expansion uses the entire event. A ':' separates the event
specification from the word designator. It may be omitted if the word
designator begins with a '^', '$', '*', '-', or '%'. Words are numbered
from the beginning of the line, with the first word being denoted by 0
(zero). Words are inserted into the current line separated by single
spaces.
For example,
@@ -12342,52 +12347,52 @@ D.3 Parameter and Variable Index
* HISTCMD: Bash Variables. (line 420)
* HISTCONTROL: Bash Variables. (line 426)
* HISTFILE: Bash Variables. (line 442)
* HISTFILESIZE: Bash Variables. (line 446)
* HISTIGNORE: Bash Variables. (line 457)
* HISTFILESIZE: Bash Variables. (line 447)
* HISTIGNORE: Bash Variables. (line 458)
* history-preserve-point: Readline Init File Syntax.
(line 214)
* history-size: Readline Init File Syntax.
(line 220)
* HISTSIZE: Bash Variables. (line 477)
* HISTTIMEFORMAT: Bash Variables. (line 484)
* HISTSIZE: Bash Variables. (line 478)
* HISTTIMEFORMAT: Bash Variables. (line 485)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 229)
* HOSTFILE: Bash Variables. (line 492)
* HOSTNAME: Bash Variables. (line 503)
* HOSTTYPE: Bash Variables. (line 506)
* HOSTFILE: Bash Variables. (line 493)
* HOSTNAME: Bash Variables. (line 504)
* HOSTTYPE: Bash Variables. (line 507)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 509)
* IGNOREEOF: Bash Variables. (line 510)
* input-meta: Readline Init File Syntax.
(line 238)
* INPUTRC: Bash Variables. (line 519)
* INSIDE_EMACS: Bash Variables. (line 523)
* INPUTRC: Bash Variables. (line 520)
* INSIDE_EMACS: Bash Variables. (line 524)
* isearch-terminators: Readline Init File Syntax.
(line 248)
* keymap: Readline Init File Syntax.
(line 255)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 529)
* LC_ALL: Bash Variables. (line 533)
* LC_COLLATE: Bash Variables. (line 537)
* LC_CTYPE: Bash Variables. (line 544)
* LANG <1>: Bash Variables. (line 530)
* LC_ALL: Bash Variables. (line 534)
* LC_COLLATE: Bash Variables. (line 538)
* LC_CTYPE: Bash Variables. (line 545)
* LC_MESSAGES: Creating Internationalized Scripts.
(line 51)
* LC_MESSAGES <1>: Bash Variables. (line 549)
* LC_NUMERIC: Bash Variables. (line 553)
* LC_TIME: Bash Variables. (line 557)
* LINENO: Bash Variables. (line 561)
* LINES: Bash Variables. (line 566)
* MACHTYPE: Bash Variables. (line 572)
* LC_MESSAGES <1>: Bash Variables. (line 550)
* LC_NUMERIC: Bash Variables. (line 554)
* LC_TIME: Bash Variables. (line 558)
* LINENO: Bash Variables. (line 562)
* LINES: Bash Variables. (line 567)
* MACHTYPE: Bash Variables. (line 573)
* MAIL: Bourne Shell Variables.
(line 22)
* MAILCHECK: Bash Variables. (line 576)
* MAILCHECK: Bash Variables. (line 577)
* MAILPATH: Bourne Shell Variables.
(line 27)
* MAPFILE: Bash Variables. (line 584)
* MAPFILE: Bash Variables. (line 585)
* mark-modified-lines: Readline Init File Syntax.
(line 285)
* mark-symlinked-directories: Readline Init File Syntax.
@@ -12398,46 +12403,46 @@ D.3 Parameter and Variable Index
(line 302)
* meta-flag: Readline Init File Syntax.
(line 238)
* OLDPWD: Bash Variables. (line 588)
* OLDPWD: Bash Variables. (line 589)
* OPTARG: Bourne Shell Variables.
(line 34)
* OPTERR: Bash Variables. (line 591)
* OPTERR: Bash Variables. (line 592)
* OPTIND: Bourne Shell Variables.
(line 38)
* OSTYPE: Bash Variables. (line 595)
* OSTYPE: Bash Variables. (line 596)
* output-meta: Readline Init File Syntax.
(line 307)
* page-completions: Readline Init File Syntax.
(line 315)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 598)
* POSIXLY_CORRECT: Bash Variables. (line 603)
* PPID: Bash Variables. (line 613)
* PROMPT_COMMAND: Bash Variables. (line 617)
* PROMPT_DIRTRIM: Bash Variables. (line 623)
* PS0: Bash Variables. (line 629)
* PIPESTATUS: Bash Variables. (line 599)
* POSIXLY_CORRECT: Bash Variables. (line 604)
* PPID: Bash Variables. (line 614)
* PROMPT_COMMAND: Bash Variables. (line 618)
* PROMPT_DIRTRIM: Bash Variables. (line 624)
* PS0: Bash Variables. (line 630)
* PS1: Bourne Shell Variables.
(line 48)
* PS2: Bourne Shell Variables.
(line 53)
* PS3: Bash Variables. (line 634)
* PS4: Bash Variables. (line 639)
* PWD: Bash Variables. (line 647)
* RANDOM: Bash Variables. (line 650)
* READLINE_ARGUMENT: Bash Variables. (line 656)
* READLINE_LINE: Bash Variables. (line 660)
* READLINE_MARK: Bash Variables. (line 664)
* READLINE_POINT: Bash Variables. (line 670)
* REPLY: Bash Variables. (line 674)
* PS3: Bash Variables. (line 635)
* PS4: Bash Variables. (line 640)
* PWD: Bash Variables. (line 648)
* RANDOM: Bash Variables. (line 651)
* READLINE_ARGUMENT: Bash Variables. (line 657)
* READLINE_LINE: Bash Variables. (line 661)
* READLINE_MARK: Bash Variables. (line 665)
* READLINE_POINT: Bash Variables. (line 671)
* REPLY: Bash Variables. (line 675)
* revert-all-at-newline: Readline Init File Syntax.
(line 325)
* search-ignore-case: Readline Init File Syntax.
(line 332)
* SECONDS: Bash Variables. (line 677)
* SHELL: Bash Variables. (line 686)
* SHELLOPTS: Bash Variables. (line 691)
* SHLVL: Bash Variables. (line 700)
* SECONDS: Bash Variables. (line 678)
* SHELL: Bash Variables. (line 687)
* SHELLOPTS: Bash Variables. (line 692)
* SHLVL: Bash Variables. (line 701)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 337)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -12446,15 +12451,15 @@ D.3 Parameter and Variable Index
(line 352)
* skip-completed-text: Readline Init File Syntax.
(line 358)
* SRANDOM: Bash Variables. (line 705)
* SRANDOM: Bash Variables. (line 706)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 714)
* TMOUT: Bash Variables. (line 752)
* TMPDIR: Bash Variables. (line 764)
* UID: Bash Variables. (line 768)
* TIMEFORMAT: Bash Variables. (line 715)
* TMOUT: Bash Variables. (line 753)
* TMPDIR: Bash Variables. (line 765)
* UID: Bash Variables. (line 769)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 371)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -12765,7 +12770,7 @@ D.5 Concept Index
* installation: Basic Installation. (line 6)
* interaction, readline: Readline Interaction.
(line 6)
* interactive shell: Invoking Bash. (line 131)
* interactive shell: Invoking Bash. (line 132)
* interactive shell <1>: Interactive Shells. (line 6)
* internationalization: Locale Translation. (line 6)
* internationalized scripts: Creating Internationalized Scripts.
@@ -12778,7 +12783,7 @@ D.5 Concept Index
* killing text: Readline Killing Commands.
(line 6)
* localization: Locale Translation. (line 6)
* login shell: Invoking Bash. (line 128)
* login shell: Invoking Bash. (line 129)
* matching, pattern: Pattern Matching. (line 6)
* metacharacter: Definitions. (line 46)
* name: Definitions. (line 51)
@@ -12844,138 +12849,138 @@ D.5 Concept Index

Tag Table:
Node: Top886
Node: Introduction2795
Node: What is Bash?3008
Node: What is a shell?4119
Node: Definitions6654
Node: Basic Shell Features9602
Node: Shell Syntax10818
Node: Shell Operation11841
Node: Quoting13131
Node: Escape Character14432
Node: Single Quotes14914
Node: Double Quotes15259
Node: ANSI-C Quoting16534
Node: Locale Translation17843
Node: Creating Internationalized Scripts19151
Node: Comments23265
Node: Shell Commands23880
Node: Reserved Words24815
Node: Simple Commands25568
Node: Pipelines26219
Node: Lists29202
Node: Compound Commands30994
Node: Looping Constructs32003
Node: Conditional Constructs34495
Node: Command Grouping48980
Node: Coprocesses50455
Node: GNU Parallel53115
Node: Shell Functions54029
Node: Shell Parameters61911
Node: Positional Parameters66296
Node: Special Parameters67195
Node: Shell Expansions70406
Node: Brace Expansion72491
Node: Tilde Expansion75222
Node: Shell Parameter Expansion77840
Node: Command Substitution96430
Node: Arithmetic Expansion99891
Node: Process Substitution100856
Node: Word Splitting101973
Node: Filename Expansion104018
Node: Pattern Matching106948
Node: Quote Removal111947
Node: Redirections112239
Node: Executing Commands121929
Node: Simple Command Expansion122596
Node: Command Search and Execution124703
Node: Command Execution Environment127087
Node: Environment130119
Node: Exit Status131779
Node: Signals133560
Node: Shell Scripts137006
Node: Shell Builtin Commands140030
Node: Bourne Shell Builtins142065
Node: Bash Builtins165198
Node: Modifying Shell Behavior197841
Node: The Set Builtin198183
Node: The Shopt Builtin209124
Node: Special Builtins225259
Node: Shell Variables226235
Node: Bourne Shell Variables226669
Node: Bash Variables228770
Node: Bash Features263724
Node: Invoking Bash264734
Node: Bash Startup Files270744
Node: Interactive Shells275872
Node: What is an Interactive Shell?276280
Node: Is this Shell Interactive?276926
Node: Interactive Shell Behavior277738
Node: Bash Conditional Expressions281364
Node: Shell Arithmetic286003
Node: Aliases288961
Node: Arrays291852
Node: The Directory Stack298412
Node: Directory Stack Builtins299193
Node: Controlling the Prompt303450
Node: The Restricted Shell306412
Node: Bash POSIX Mode309019
Node: Shell Compatibility Mode325159
Node: Job Control333400
Node: Job Control Basics333857
Node: Job Control Builtins338856
Node: Job Control Variables344648
Node: Command Line Editing345801
Node: Introduction and Notation347469
Node: Readline Interaction349089
Node: Readline Bare Essentials350277
Node: Readline Movement Commands352063
Node: Readline Killing Commands353020
Node: Readline Arguments354938
Node: Searching355979
Node: Readline Init File358162
Node: Readline Init File Syntax359420
Node: Conditional Init Constructs383442
Node: Sample Init File387635
Node: Bindable Readline Commands390756
Node: Commands For Moving391957
Node: Commands For History394005
Node: Commands For Text398996
Node: Commands For Killing402971
Node: Numeric Arguments405672
Node: Commands For Completion406808
Node: Keyboard Macros410996
Node: Miscellaneous Commands411681
Node: Readline vi Mode417716
Node: Programmable Completion418620
Node: Programmable Completion Builtins426397
Node: A Programmable Completion Example437514
Node: Using History Interactively442759
Node: Bash History Facilities443440
Node: Bash History Builtins446442
Node: History Interaction451463
Node: Event Designators455080
Node: Word Designators456431
Node: Modifiers458188
Node: Installing Bash459993
Node: Basic Installation461127
Node: Compilers and Options464846
Node: Compiling For Multiple Architectures465584
Node: Installation Names467273
Node: Specifying the System Type469379
Node: Sharing Defaults470093
Node: Operation Controls470763
Node: Optional Features471718
Node: Reporting Bugs482934
Node: Major Differences From The Bourne Shell484265
Node: GNU Free Documentation License501111
Node: Indexes526285
Node: Builtin Index526736
Node: Reserved Word Index533834
Node: Variable Index536279
Node: Function Index553410
Node: Concept Index567128
Node: Top888
Node: Introduction2799
Node: What is Bash?3012
Node: What is a shell?4123
Node: Definitions6658
Node: Basic Shell Features9606
Node: Shell Syntax10822
Node: Shell Operation11845
Node: Quoting13135
Node: Escape Character14436
Node: Single Quotes14918
Node: Double Quotes15263
Node: ANSI-C Quoting16538
Node: Locale Translation17847
Node: Creating Internationalized Scripts19155
Node: Comments23269
Node: Shell Commands23884
Node: Reserved Words24819
Node: Simple Commands25572
Node: Pipelines26223
Node: Lists29206
Node: Compound Commands30998
Node: Looping Constructs32007
Node: Conditional Constructs34499
Node: Command Grouping48984
Node: Coprocesses50459
Node: GNU Parallel53119
Node: Shell Functions54033
Node: Shell Parameters61915
Node: Positional Parameters66300
Node: Special Parameters67199
Node: Shell Expansions70410
Node: Brace Expansion72495
Node: Tilde Expansion75226
Node: Shell Parameter Expansion77844
Node: Command Substitution96434
Node: Arithmetic Expansion99895
Node: Process Substitution100860
Node: Word Splitting101977
Node: Filename Expansion104022
Node: Pattern Matching106952
Node: Quote Removal111951
Node: Redirections112243
Node: Executing Commands121933
Node: Simple Command Expansion122600
Node: Command Search and Execution124707
Node: Command Execution Environment127091
Node: Environment130123
Node: Exit Status131783
Node: Signals133564
Node: Shell Scripts137010
Node: Shell Builtin Commands140034
Node: Bourne Shell Builtins142069
Node: Bash Builtins165202
Node: Modifying Shell Behavior197845
Node: The Set Builtin198187
Node: The Shopt Builtin209158
Node: Special Builtins225293
Node: Shell Variables226269
Node: Bourne Shell Variables226703
Node: Bash Variables228804
Node: Bash Features263860
Node: Invoking Bash264870
Node: Bash Startup Files270906
Node: Interactive Shells276034
Node: What is an Interactive Shell?276442
Node: Is this Shell Interactive?277088
Node: Interactive Shell Behavior277900
Node: Bash Conditional Expressions281526
Node: Shell Arithmetic286165
Node: Aliases289123
Node: Arrays292014
Node: The Directory Stack298572
Node: Directory Stack Builtins299353
Node: Controlling the Prompt303610
Node: The Restricted Shell306572
Node: Bash POSIX Mode309179
Node: Shell Compatibility Mode325337
Node: Job Control333578
Node: Job Control Basics334035
Node: Job Control Builtins339034
Node: Job Control Variables344826
Node: Command Line Editing345979
Node: Introduction and Notation347647
Node: Readline Interaction349267
Node: Readline Bare Essentials350455
Node: Readline Movement Commands352241
Node: Readline Killing Commands353198
Node: Readline Arguments355116
Node: Searching356157
Node: Readline Init File358340
Node: Readline Init File Syntax359598
Node: Conditional Init Constructs383620
Node: Sample Init File387813
Node: Bindable Readline Commands390934
Node: Commands For Moving392135
Node: Commands For History394183
Node: Commands For Text399174
Node: Commands For Killing403149
Node: Numeric Arguments405850
Node: Commands For Completion406986
Node: Keyboard Macros411174
Node: Miscellaneous Commands411859
Node: Readline vi Mode417894
Node: Programmable Completion418798
Node: Programmable Completion Builtins426575
Node: A Programmable Completion Example437692
Node: Using History Interactively442937
Node: Bash History Facilities443618
Node: Bash History Builtins446626
Node: History Interaction451714
Node: Event Designators455331
Node: Word Designators456698
Node: Modifiers458560
Node: Installing Bash460365
Node: Basic Installation461499
Node: Compilers and Options465218
Node: Compiling For Multiple Architectures465956
Node: Installation Names467645
Node: Specifying the System Type469751
Node: Sharing Defaults470465
Node: Operation Controls471135
Node: Optional Features472090
Node: Reporting Bugs483306
Node: Major Differences From The Bourne Shell484637
Node: GNU Free Documentation License501483
Node: Indexes526657
Node: Builtin Index527108
Node: Reserved Word Index534206
Node: Variable Index536651
Node: Function Index553782
Node: Concept Index567500

End Tag Table
+213 -208
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.8 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 31 July 2023).
Bash shell (version 5.3, 2 August 2023).
This is Edition 5.3, last updated 31 July 2023, of 'The GNU Bash
This is Edition 5.3, last updated 2 August 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@@ -27,10 +27,10 @@ Bash Features
*************
This text is a brief description of the features that are present in the
Bash shell (version 5.3, 31 July 2023). The Bash home page is
Bash shell (version 5.3, 2 August 2023). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 5.3, last updated 31 July 2023, of 'The GNU Bash
This is Edition 5.3, last updated 2 August 2023, of 'The GNU Bash
Reference Manual', for 'Bash', Version 5.3.
Bash contains features that appear in other popular shells, and some
@@ -4743,8 +4743,8 @@ parameters, or to display the names and values of shell variables.
user and group ids.
'-r'
Enable restricted shell mode. This option cannot be unset
once it has been set.
Enable restricted shell mode (*note The Restricted Shell::).
This option cannot be unset once it has been set.
'-t'
Exit after reading and executing one command.
@@ -5754,8 +5754,9 @@ Variables::).
regardless of the value of 'HISTCONTROL'.
'HISTFILE'
The name of the file to which the command history is saved. The
default value is '~/.bash_history'.
The name of the file to which the command history is saved. Bash
assigns a default value of '~/.bash_history'. If 'HISTFILE' is
unset or null, the command history is not saved when a shell exits.
'HISTFILESIZE'
The maximum number of lines contained in the history file. When
@@ -6175,7 +6176,8 @@ single-character options to be recognized.
POSIX Mode::, for a description of the Bash POSIX mode.
'--restricted'
Make the shell a restricted shell (*note The Restricted Shell::).
Equivalent to '-r'. Make the shell a restricted shell (*note The
Restricted Shell::).
'--verbose'
Equivalent to '-v'. Print shell input lines as they're read.
@@ -6908,7 +6910,7 @@ index of -1 refers to the last element.
Referencing an array variable without a subscript is equivalent to
referencing with a subscript of 0. Any reference to a variable using a
valid subscript is legal, and 'bash' will create an array if necessary.
valid subscript is legal, and Bash will create an array if necessary.
An array variable is considered set if a subscript has been assigned
a value. The null string is a valid value.
@@ -7319,7 +7321,7 @@ startup files.
command name, rather than on all assignment statements on the line.
12. The default history file is '~/.sh_history' (this is the default
value of '$HISTFILE').
value the shell assigns to '$HISTFILE').
13. Redirection operators do not perform filename expansion on the
word in the redirection unless the shell is interactive.
@@ -7539,7 +7541,7 @@ startup files.
67. The 'test' builtin's '-t' unary primary requires an argument.
Historical versions of 'test' made the argument optional in certain
cases, and bash attempts to accommodate those for backwards
cases, and Bash attempts to accommodate those for backwards
compatibility.
68. Command substitutions don't set the '?' special parameter. The
@@ -10242,9 +10244,9 @@ no more than the number of lines specified by the value of the
last '$HISTSIZE' lines are copied from the history list to the file
named by '$HISTFILE'. If the 'histappend' shell option is set (*note
Bash Builtins::), the lines are appended to the history file, otherwise
the history file is overwritten. If 'HISTFILE' is unset, or if the
history file is unwritable, the history is not saved. After saving the
history, the history file is truncated to contain no more than
the history file is overwritten. If 'HISTFILE' is unset or null, or if
the history file is unwritable, the history is not saved. After saving
the history, the history file is truncated to contain no more than
'$HISTFILESIZE' lines. If 'HISTFILESIZE' is unset, or set to null, a
non-numeric value, or a numeric value less than zero, the history file
is not truncated.
@@ -10255,7 +10257,7 @@ history comment character. When the history file is read, lines
beginning with the history comment character followed immediately by a
digit are interpreted as timestamps for the following history entry.
The builtin command 'fc' may be used to list or edit and re-execute a
The 'fc' builtin command may be used to list or edit and re-execute a
portion of the history list. The 'history' builtin may be used to
display or modify the history list and manipulate the history file.
When using command-line editing, search commands are available in each
@@ -10263,7 +10265,7 @@ editing mode that provide access to the history list (*note Commands For
History::).
The shell allows control over which commands are saved on the history
list. The 'HISTCONTROL' and 'HISTIGNORE' variables may be set to cause
list. The 'HISTCONTROL' and 'HISTIGNORE' variables are used to cause
the shell to save only a subset of the commands entered. The 'cmdhist'
shell option, if enabled, causes the shell to attempt to save each line
of a multi-line command in the same history entry, adding semicolons
@@ -10383,6 +10385,7 @@ history file.
If a FILENAME argument is supplied when any of the '-w', '-r',
'-a', or '-n' options is used, Bash uses FILENAME as the history
file. If not, then the value of the 'HISTFILE' variable is used.
If 'HISTFILE' is unset or null, these options have no effect.
The return value is 0 unless an invalid option is encountered, an
error occurs while reading or writing the history file, an invalid
@@ -10470,8 +10473,8 @@ the current position in the history list.
'!'
Start a history substitution, except when followed by a space, tab,
the end of the line, '=' or '(' (when the 'extglob' shell option is
enabled using the 'shopt' builtin).
the end of the line, '=', ';', '&', '|', or '(' (when the 'extglob'
shell option is enabled using the 'shopt' builtin).
'!N'
Refer to command line N.
@@ -10506,12 +10509,14 @@ File: bashref.info, Node: Word Designators, Next: Modifiers, Prev: Event Desi
9.3.2 Word Designators
----------------------
Word designators are used to select desired words from the event. A ':'
separates the event specification from the word designator. It may be
omitted if the word designator begins with a '^', '$', '*', '-', or '%'.
Words are numbered from the beginning of the line, with the first word
being denoted by 0 (zero). Words are inserted into the current line
separated by single spaces.
Word designators are used to select desired words from the event. They
are optional; if the word designator isn't supplied, the history
expansion uses the entire event. A ':' separates the event
specification from the word designator. It may be omitted if the word
designator begins with a '^', '$', '*', '-', or '%'. Words are numbered
from the beginning of the line, with the first word being denoted by 0
(zero). Words are inserted into the current line separated by single
spaces.
For example,
@@ -12343,52 +12348,52 @@ D.3 Parameter and Variable Index
* HISTCMD: Bash Variables. (line 420)
* HISTCONTROL: Bash Variables. (line 426)
* HISTFILE: Bash Variables. (line 442)
* HISTFILESIZE: Bash Variables. (line 446)
* HISTIGNORE: Bash Variables. (line 457)
* HISTFILESIZE: Bash Variables. (line 447)
* HISTIGNORE: Bash Variables. (line 458)
* history-preserve-point: Readline Init File Syntax.
(line 214)
* history-size: Readline Init File Syntax.
(line 220)
* HISTSIZE: Bash Variables. (line 477)
* HISTTIMEFORMAT: Bash Variables. (line 484)
* HISTSIZE: Bash Variables. (line 478)
* HISTTIMEFORMAT: Bash Variables. (line 485)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 229)
* HOSTFILE: Bash Variables. (line 492)
* HOSTNAME: Bash Variables. (line 503)
* HOSTTYPE: Bash Variables. (line 506)
* HOSTFILE: Bash Variables. (line 493)
* HOSTNAME: Bash Variables. (line 504)
* HOSTTYPE: Bash Variables. (line 507)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 509)
* IGNOREEOF: Bash Variables. (line 510)
* input-meta: Readline Init File Syntax.
(line 238)
* INPUTRC: Bash Variables. (line 519)
* INSIDE_EMACS: Bash Variables. (line 523)
* INPUTRC: Bash Variables. (line 520)
* INSIDE_EMACS: Bash Variables. (line 524)
* isearch-terminators: Readline Init File Syntax.
(line 248)
* keymap: Readline Init File Syntax.
(line 255)
* LANG: Creating Internationalized Scripts.
(line 51)
* LANG <1>: Bash Variables. (line 529)
* LC_ALL: Bash Variables. (line 533)
* LC_COLLATE: Bash Variables. (line 537)
* LC_CTYPE: Bash Variables. (line 544)
* LANG <1>: Bash Variables. (line 530)
* LC_ALL: Bash Variables. (line 534)
* LC_COLLATE: Bash Variables. (line 538)
* LC_CTYPE: Bash Variables. (line 545)
* LC_MESSAGES: Creating Internationalized Scripts.
(line 51)
* LC_MESSAGES <1>: Bash Variables. (line 549)
* LC_NUMERIC: Bash Variables. (line 553)
* LC_TIME: Bash Variables. (line 557)
* LINENO: Bash Variables. (line 561)
* LINES: Bash Variables. (line 566)
* MACHTYPE: Bash Variables. (line 572)
* LC_MESSAGES <1>: Bash Variables. (line 550)
* LC_NUMERIC: Bash Variables. (line 554)
* LC_TIME: Bash Variables. (line 558)
* LINENO: Bash Variables. (line 562)
* LINES: Bash Variables. (line 567)
* MACHTYPE: Bash Variables. (line 573)
* MAIL: Bourne Shell Variables.
(line 22)
* MAILCHECK: Bash Variables. (line 576)
* MAILCHECK: Bash Variables. (line 577)
* MAILPATH: Bourne Shell Variables.
(line 27)
* MAPFILE: Bash Variables. (line 584)
* MAPFILE: Bash Variables. (line 585)
* mark-modified-lines: Readline Init File Syntax.
(line 285)
* mark-symlinked-directories: Readline Init File Syntax.
@@ -12399,46 +12404,46 @@ D.3 Parameter and Variable Index
(line 302)
* meta-flag: Readline Init File Syntax.
(line 238)
* OLDPWD: Bash Variables. (line 588)
* OLDPWD: Bash Variables. (line 589)
* OPTARG: Bourne Shell Variables.
(line 34)
* OPTERR: Bash Variables. (line 591)
* OPTERR: Bash Variables. (line 592)
* OPTIND: Bourne Shell Variables.
(line 38)
* OSTYPE: Bash Variables. (line 595)
* OSTYPE: Bash Variables. (line 596)
* output-meta: Readline Init File Syntax.
(line 307)
* page-completions: Readline Init File Syntax.
(line 315)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 598)
* POSIXLY_CORRECT: Bash Variables. (line 603)
* PPID: Bash Variables. (line 613)
* PROMPT_COMMAND: Bash Variables. (line 617)
* PROMPT_DIRTRIM: Bash Variables. (line 623)
* PS0: Bash Variables. (line 629)
* PIPESTATUS: Bash Variables. (line 599)
* POSIXLY_CORRECT: Bash Variables. (line 604)
* PPID: Bash Variables. (line 614)
* PROMPT_COMMAND: Bash Variables. (line 618)
* PROMPT_DIRTRIM: Bash Variables. (line 624)
* PS0: Bash Variables. (line 630)
* PS1: Bourne Shell Variables.
(line 48)
* PS2: Bourne Shell Variables.
(line 53)
* PS3: Bash Variables. (line 634)
* PS4: Bash Variables. (line 639)
* PWD: Bash Variables. (line 647)
* RANDOM: Bash Variables. (line 650)
* READLINE_ARGUMENT: Bash Variables. (line 656)
* READLINE_LINE: Bash Variables. (line 660)
* READLINE_MARK: Bash Variables. (line 664)
* READLINE_POINT: Bash Variables. (line 670)
* REPLY: Bash Variables. (line 674)
* PS3: Bash Variables. (line 635)
* PS4: Bash Variables. (line 640)
* PWD: Bash Variables. (line 648)
* RANDOM: Bash Variables. (line 651)
* READLINE_ARGUMENT: Bash Variables. (line 657)
* READLINE_LINE: Bash Variables. (line 661)
* READLINE_MARK: Bash Variables. (line 665)
* READLINE_POINT: Bash Variables. (line 671)
* REPLY: Bash Variables. (line 675)
* revert-all-at-newline: Readline Init File Syntax.
(line 325)
* search-ignore-case: Readline Init File Syntax.
(line 332)
* SECONDS: Bash Variables. (line 677)
* SHELL: Bash Variables. (line 686)
* SHELLOPTS: Bash Variables. (line 691)
* SHLVL: Bash Variables. (line 700)
* SECONDS: Bash Variables. (line 678)
* SHELL: Bash Variables. (line 687)
* SHELLOPTS: Bash Variables. (line 692)
* SHLVL: Bash Variables. (line 701)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 337)
* show-all-if-unmodified: Readline Init File Syntax.
@@ -12447,15 +12452,15 @@ D.3 Parameter and Variable Index
(line 352)
* skip-completed-text: Readline Init File Syntax.
(line 358)
* SRANDOM: Bash Variables. (line 705)
* SRANDOM: Bash Variables. (line 706)
* TEXTDOMAIN: Creating Internationalized Scripts.
(line 51)
* TEXTDOMAINDIR: Creating Internationalized Scripts.
(line 51)
* TIMEFORMAT: Bash Variables. (line 714)
* TMOUT: Bash Variables. (line 752)
* TMPDIR: Bash Variables. (line 764)
* UID: Bash Variables. (line 768)
* TIMEFORMAT: Bash Variables. (line 715)
* TMOUT: Bash Variables. (line 753)
* TMPDIR: Bash Variables. (line 765)
* UID: Bash Variables. (line 769)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 371)
* vi-ins-mode-string: Readline Init File Syntax.
@@ -12766,7 +12771,7 @@ D.5 Concept Index
* installation: Basic Installation. (line 6)
* interaction, readline: Readline Interaction.
(line 6)
* interactive shell: Invoking Bash. (line 131)
* interactive shell: Invoking Bash. (line 132)
* interactive shell <1>: Interactive Shells. (line 6)
* internationalization: Locale Translation. (line 6)
* internationalized scripts: Creating Internationalized Scripts.
@@ -12779,7 +12784,7 @@ D.5 Concept Index
* killing text: Readline Killing Commands.
(line 6)
* localization: Locale Translation. (line 6)
* login shell: Invoking Bash. (line 128)
* login shell: Invoking Bash. (line 129)
* matching, pattern: Pattern Matching. (line 6)
* metacharacter: Definitions. (line 46)
* name: Definitions. (line 51)
@@ -12845,138 +12850,138 @@ D.5 Concept Index

Tag Table:
Node: Top889
Node: Introduction2801
Node: What is Bash?3017
Node: What is a shell?4131
Node: Definitions6669
Node: Basic Shell Features9620
Node: Shell Syntax10839
Node: Shell Operation11865
Node: Quoting13158
Node: Escape Character14462
Node: Single Quotes14947
Node: Double Quotes15295
Node: ANSI-C Quoting16573
Node: Locale Translation17885
Node: Creating Internationalized Scripts19196
Node: Comments23313
Node: Shell Commands23931
Node: Reserved Words24869
Node: Simple Commands25625
Node: Pipelines26279
Node: Lists29265
Node: Compound Commands31060
Node: Looping Constructs32072
Node: Conditional Constructs34567
Node: Command Grouping49055
Node: Coprocesses50533
Node: GNU Parallel53196
Node: Shell Functions54113
Node: Shell Parameters61998
Node: Positional Parameters66386
Node: Special Parameters67288
Node: Shell Expansions70502
Node: Brace Expansion72590
Node: Tilde Expansion75324
Node: Shell Parameter Expansion77945
Node: Command Substitution96538
Node: Arithmetic Expansion100002
Node: Process Substitution100970
Node: Word Splitting102090
Node: Filename Expansion104138
Node: Pattern Matching107071
Node: Quote Removal112073
Node: Redirections112368
Node: Executing Commands122061
Node: Simple Command Expansion122731
Node: Command Search and Execution124841
Node: Command Execution Environment127228
Node: Environment130263
Node: Exit Status131926
Node: Signals133710
Node: Shell Scripts137159
Node: Shell Builtin Commands140186
Node: Bourne Shell Builtins142224
Node: Bash Builtins165360
Node: Modifying Shell Behavior198006
Node: The Set Builtin198351
Node: The Shopt Builtin209295
Node: Special Builtins225433
Node: Shell Variables226412
Node: Bourne Shell Variables226849
Node: Bash Variables228953
Node: Bash Features263910
Node: Invoking Bash264923
Node: Bash Startup Files270936
Node: Interactive Shells276067
Node: What is an Interactive Shell?276478
Node: Is this Shell Interactive?277127
Node: Interactive Shell Behavior277942
Node: Bash Conditional Expressions281571
Node: Shell Arithmetic286213
Node: Aliases289174
Node: Arrays292068
Node: The Directory Stack298631
Node: Directory Stack Builtins299415
Node: Controlling the Prompt303675
Node: The Restricted Shell306640
Node: Bash POSIX Mode309250
Node: Shell Compatibility Mode325393
Node: Job Control333637
Node: Job Control Basics334097
Node: Job Control Builtins339099
Node: Job Control Variables344894
Node: Command Line Editing346050
Node: Introduction and Notation347721
Node: Readline Interaction349344
Node: Readline Bare Essentials350535
Node: Readline Movement Commands352324
Node: Readline Killing Commands353284
Node: Readline Arguments355205
Node: Searching356249
Node: Readline Init File358435
Node: Readline Init File Syntax359696
Node: Conditional Init Constructs383721
Node: Sample Init File387917
Node: Bindable Readline Commands391041
Node: Commands For Moving392245
Node: Commands For History394296
Node: Commands For Text399290
Node: Commands For Killing403268
Node: Numeric Arguments405972
Node: Commands For Completion407111
Node: Keyboard Macros411302
Node: Miscellaneous Commands411990
Node: Readline vi Mode418028
Node: Programmable Completion418935
Node: Programmable Completion Builtins426715
Node: A Programmable Completion Example437835
Node: Using History Interactively443083
Node: Bash History Facilities443767
Node: Bash History Builtins446772
Node: History Interaction451796
Node: Event Designators455416
Node: Word Designators456770
Node: Modifiers458530
Node: Installing Bash460338
Node: Basic Installation461475
Node: Compilers and Options465197
Node: Compiling For Multiple Architectures465938
Node: Installation Names467630
Node: Specifying the System Type469739
Node: Sharing Defaults470456
Node: Operation Controls471129
Node: Optional Features472087
Node: Reporting Bugs483306
Node: Major Differences From The Bourne Shell484640
Node: GNU Free Documentation License501489
Node: Indexes526666
Node: Builtin Index527120
Node: Reserved Word Index534221
Node: Variable Index536669
Node: Function Index553803
Node: Concept Index567524
Node: Top891
Node: Introduction2805
Node: What is Bash?3021
Node: What is a shell?4135
Node: Definitions6673
Node: Basic Shell Features9624
Node: Shell Syntax10843
Node: Shell Operation11869
Node: Quoting13162
Node: Escape Character14466
Node: Single Quotes14951
Node: Double Quotes15299
Node: ANSI-C Quoting16577
Node: Locale Translation17889
Node: Creating Internationalized Scripts19200
Node: Comments23317
Node: Shell Commands23935
Node: Reserved Words24873
Node: Simple Commands25629
Node: Pipelines26283
Node: Lists29269
Node: Compound Commands31064
Node: Looping Constructs32076
Node: Conditional Constructs34571
Node: Command Grouping49059
Node: Coprocesses50537
Node: GNU Parallel53200
Node: Shell Functions54117
Node: Shell Parameters62002
Node: Positional Parameters66390
Node: Special Parameters67292
Node: Shell Expansions70506
Node: Brace Expansion72594
Node: Tilde Expansion75328
Node: Shell Parameter Expansion77949
Node: Command Substitution96542
Node: Arithmetic Expansion100006
Node: Process Substitution100974
Node: Word Splitting102094
Node: Filename Expansion104142
Node: Pattern Matching107075
Node: Quote Removal112077
Node: Redirections112372
Node: Executing Commands122065
Node: Simple Command Expansion122735
Node: Command Search and Execution124845
Node: Command Execution Environment127232
Node: Environment130267
Node: Exit Status131930
Node: Signals133714
Node: Shell Scripts137163
Node: Shell Builtin Commands140190
Node: Bourne Shell Builtins142228
Node: Bash Builtins165364
Node: Modifying Shell Behavior198010
Node: The Set Builtin198355
Node: The Shopt Builtin209329
Node: Special Builtins225467
Node: Shell Variables226446
Node: Bourne Shell Variables226883
Node: Bash Variables228987
Node: Bash Features264046
Node: Invoking Bash265059
Node: Bash Startup Files271098
Node: Interactive Shells276229
Node: What is an Interactive Shell?276640
Node: Is this Shell Interactive?277289
Node: Interactive Shell Behavior278104
Node: Bash Conditional Expressions281733
Node: Shell Arithmetic286375
Node: Aliases289336
Node: Arrays292230
Node: The Directory Stack298791
Node: Directory Stack Builtins299575
Node: Controlling the Prompt303835
Node: The Restricted Shell306800
Node: Bash POSIX Mode309410
Node: Shell Compatibility Mode325571
Node: Job Control333815
Node: Job Control Basics334275
Node: Job Control Builtins339277
Node: Job Control Variables345072
Node: Command Line Editing346228
Node: Introduction and Notation347899
Node: Readline Interaction349522
Node: Readline Bare Essentials350713
Node: Readline Movement Commands352502
Node: Readline Killing Commands353462
Node: Readline Arguments355383
Node: Searching356427
Node: Readline Init File358613
Node: Readline Init File Syntax359874
Node: Conditional Init Constructs383899
Node: Sample Init File388095
Node: Bindable Readline Commands391219
Node: Commands For Moving392423
Node: Commands For History394474
Node: Commands For Text399468
Node: Commands For Killing403446
Node: Numeric Arguments406150
Node: Commands For Completion407289
Node: Keyboard Macros411480
Node: Miscellaneous Commands412168
Node: Readline vi Mode418206
Node: Programmable Completion419113
Node: Programmable Completion Builtins426893
Node: A Programmable Completion Example438013
Node: Using History Interactively443261
Node: Bash History Facilities443945
Node: Bash History Builtins446956
Node: History Interaction452047
Node: Event Designators455667
Node: Word Designators457037
Node: Modifiers458902
Node: Installing Bash460710
Node: Basic Installation461847
Node: Compilers and Options465569
Node: Compiling For Multiple Architectures466310
Node: Installation Names468002
Node: Specifying the System Type470111
Node: Sharing Defaults470828
Node: Operation Controls471501
Node: Optional Features472459
Node: Reporting Bugs483678
Node: Major Differences From The Bourne Shell485012
Node: GNU Free Documentation License501861
Node: Indexes527038
Node: Builtin Index527492
Node: Reserved Word Index534593
Node: Variable Index537041
Node: Function Index554175
Node: Concept Index567896

End Tag Table
+642 -641
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2023 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Wed Aug 2 16:03:53 EDT 2023
@set LASTCHANGE Thu Aug 10 10:49:27 EDT 2023
@set EDITION 5.3
@set VERSION 5.3
@set UPDATED 2 August 2023
@set UPDATED 10 August 2023
@set UPDATED-MONTH August 2023
+19 -6
View File
@@ -284,14 +284,21 @@ expansion functions about quoting still in effect from previous lines.
History expansion takes place in two parts. The first is to determine
which line from the history list should be used during substitution.
The second is to select portions of that line for inclusion into the
current one. The line selected from the history is called the
@dfn{event}, and the portions of that line that are acted upon are
called @dfn{words}. Various @dfn{modifiers} are available to manipulate
the selected words. The line is broken into words in the same fashion
current one.
The line selected from the history is called the @dfn{event},
and the portions of that line that are acted upon are called @dfn{words}.
The dfn{event designator} selects the event, the optional
@dfn{word designator} selects words from the event, and
various optional @dfn{modifiers} are available to manipulate the
selected words.
The line is broken into words in the same fashion
that Bash does, so that several words
surrounded by quotes are considered one word.
History expansions are introduced by the appearance of the
history expansion character, which is @samp{!} by default.
History expansions may appear anywhere in the input, but do not nest.
History expansion implements shell-like quoting conventions:
a backslash can be used to remove the special handling for the next character;
@@ -349,6 +356,9 @@ An event designator is a reference to a command line entry in the
history list.
Unless the reference is absolute, events are relative to the current
position in the history list.
The event designator consists of the portion of the word beginning
with the history expansion character, and ending with the word designator
if one is present, or the end of the word.
@cindex history events
@table @asis
@@ -356,8 +366,9 @@ position in the history list.
@item @code{!}
@ifset BashFeatures
Start a history substitution, except when followed by a space, tab,
the end of the line, @samp{=} or @samp{(} (when the
@code{extglob} shell option is enabled using the @code{shopt} builtin).
the end of the line, @samp{=},
or the rest of the shell metacharacters defined above
(@pxref{Definitions}).
@end ifset
@ifclear BashFeatures
Start a history substitution, except when followed by a space, tab,
@@ -402,6 +413,8 @@ The entire command line typed so far.
@subsection Word Designators
Word designators are used to select desired words from the event.
They are optional; if the word designator isn't supplied, the history
expansion uses the entire event.
A @samp{:} separates the event specification from the word designator. It
may be omitted if the word designator begins with a @samp{^}, @samp{$},
@samp{*}, @samp{-}, or @samp{%}. Words are numbered from the beginning
+23 -10
View File
@@ -410,6 +410,7 @@ static FILE *yyerrstream;
%type <pattern> pattern_list case_clause_sequence case_clause
%type <number> timespec
%type <number> list_terminator simple_list_terminator
%type <number> nullcmd_terminator
%start inputunit
@@ -1266,6 +1267,12 @@ list_terminator:'\n'
{ $$ = yacc_EOF; }
;
nullcmd_terminator: list_terminator
{ $$ = $1; }
| '&'
{ $$ = '&'; }
;
newline_list:
| newline_list '\n'
;
@@ -1358,15 +1365,16 @@ pipeline_command: pipeline
$2->flags |= $1;
$$ = $2;
}
| timespec list_terminator
| timespec nullcmd_terminator
{
ELEMENT x;
/* POSIX interp 267 */
/* Boy, this is unclean. `time' by itself can
time a null command. We cheat and push a
newline back if the list_terminator was a newline
to avoid the double-newline problem (one to
terminate this, one to terminate the command) */
newline back if the nullcmd_terminator was a
newline to avoid the double-newline problem (one
to terminate this, one to terminate the command) */
x.word = 0;
x.redirect = 0;
$$ = make_simple_command (x, (COMMAND *)NULL, line_number);
@@ -1376,18 +1384,21 @@ pipeline_command: pipeline
token_to_read = '\n';
else if ($2 == ';')
token_to_read = ';';
else if ($2 == '&')
token_to_read = '&';
parser_state &= ~PST_REDIRLIST; /* make_simple_command sets this */
}
| BANG list_terminator
| BANG nullcmd_terminator
{
ELEMENT x;
/* POSIX interp 267 */
/* This is just as unclean. Posix says that `!'
by itself should be equivalent to `false'.
We cheat and push a
newline back if the list_terminator was a newline
to avoid the double-newline problem (one to
terminate this, one to terminate the command) */
We cheat and push a newline back if the
nullcmd_terminator was a newline to avoid the
double-newline problem (one to terminate this,
one to terminate the command) */
x.word = 0;
x.redirect = 0;
$$ = make_simple_command (x, (COMMAND *)NULL, line_number);
@@ -1395,8 +1406,10 @@ pipeline_command: pipeline
/* XXX - let's cheat and push a newline back */
if ($2 == '\n')
token_to_read = '\n';
if ($2 == ';')
else if ($2 == ';')
token_to_read = ';';
else if ($2 == '&')
token_to_read = '&';
parser_state &= ~PST_REDIRLIST; /* make_simple_command sets this */
}
;
+2 -2
View File
@@ -132,9 +132,9 @@ if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/xemacs ]; then
DEFEDITOR=xemacs
elif [ -x /usr/bin/vim; then
elif [ -x /usr/bin/vim ]; then
DEFEDITOR=vim
elif [ -x /usr/bin/gvim; then
elif [ -x /usr/bin/gvim ]; then
DEFEDITOR=gvim
elif [ -x /usr/bin/nano ]; then
DEFEDITOR=nano