mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-09 21:20:50 +02:00
commit bash-20180608 snapshot
This commit is contained in:
@@ -15490,3 +15490,39 @@ bashhist.c
|
||||
- load_history: use HISTSIZE_DEFAULT (still defaults to "500") to set
|
||||
the initial value of $HISTSIZE. HISTSIZE_DEFAULT can be overridden
|
||||
in config-top.h
|
||||
|
||||
6/4
|
||||
---
|
||||
configure.ac
|
||||
- make sure we link against an external readline library that's at
|
||||
least version 8
|
||||
|
||||
6/8
|
||||
---
|
||||
pcomplete.h
|
||||
- INITIALWORD: internal compspec name for programmable completion on
|
||||
the initial (usually the command) word
|
||||
|
||||
bashline.c
|
||||
- attempt_shell_completion: if we are in a command position and the
|
||||
user has defined a compspec for INITIALWORD, use programmable
|
||||
completion to complete command words. Original patch from
|
||||
Luca Boccassi <bluca@debian.org>
|
||||
|
||||
lib/readline/doc/rluser.texi,builtins/complete.def,doc/bash.1
|
||||
- make it clearer that -D takes precedence over -E when supplied as
|
||||
options to `complete', not when they are applied during completion
|
||||
|
||||
builtins/complete.def
|
||||
- complete_builtin,compgen_builtin: add support for -I option
|
||||
- print_one_completion,print_compopts: display -I when appropriate
|
||||
|
||||
lib/readline/doc/rluser.texi,doc/bash.1
|
||||
- complete,compgen: document new -I option and its effect
|
||||
|
||||
6/10
|
||||
----
|
||||
lib/readline/histfile.c
|
||||
- read_history_range: don't apply the heuristic and try to append a
|
||||
history line to an existing history entry if we don't have any
|
||||
history entries. Bug and fix from Edward Huff <ejhuff@gmail.com>
|
||||
|
||||
+10
-1
@@ -1426,6 +1426,7 @@ attempt_shell_completion (text, start, end)
|
||||
char **matches, *command_separator_chars;
|
||||
#if defined (PROGRAMMABLE_COMPLETION)
|
||||
int have_progcomps, was_assignment;
|
||||
COMPSPEC *iw_compspec;
|
||||
#endif
|
||||
|
||||
command_separator_chars = COMMAND_SEPARATORS;
|
||||
@@ -1510,7 +1511,9 @@ attempt_shell_completion (text, start, end)
|
||||
#if defined (PROGRAMMABLE_COMPLETION)
|
||||
/* Attempt programmable completion. */
|
||||
have_progcomps = prog_completion_enabled && (progcomp_size () > 0);
|
||||
if (matches == 0 && (in_command_position == 0 || text[0] == '\0') &&
|
||||
iw_compspec = progcomp_search (INITIALWORD);
|
||||
if (matches == 0 &&
|
||||
(in_command_position == 0 || text[0] == '\0' || (in_command_position && iw_compspec)) &&
|
||||
current_prompt_string == ps1_prompt)
|
||||
{
|
||||
int s, e, s1, e1, os, foundcs;
|
||||
@@ -1599,6 +1602,12 @@ attempt_shell_completion (text, start, end)
|
||||
}
|
||||
else
|
||||
foundcs = 0;
|
||||
|
||||
/* If we have defined a compspec for the initial (command) word, call
|
||||
it and process the results like any other programmable completion. */
|
||||
if (in_command_position && foundcs == 0 && iw_compspec)
|
||||
prog_complete_matches = programmable_completions (INITIALWORD, text, s, e, &foundcs);
|
||||
|
||||
FREE (n);
|
||||
/* XXX - if we found a COMPSPEC for the command, just return whatever
|
||||
the programmable completion code returns, and disable the default
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* braces.c -- code for doing word expansion in curly braces. */
|
||||
|
||||
/* Copyright (C) 1987-2012 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -778,7 +778,9 @@ array_concat (arr1, arr2)
|
||||
len1 = strvec_len (arr1);
|
||||
len2 = strvec_len (arr2);
|
||||
|
||||
result = (char **)xmalloc ((1 + (len1 * len2)) * sizeof (char *));
|
||||
result = (char **)malloc ((1 + (len1 * len2)) * sizeof (char *));
|
||||
if (result == 0)
|
||||
return (result);
|
||||
|
||||
len = 0;
|
||||
for (i = 0; i < len1; i++)
|
||||
|
||||
+54
-18
@@ -23,7 +23,7 @@ $PRODUCES complete.c
|
||||
$BUILTIN complete
|
||||
$DEPENDS_ON PROGRAMMABLE_COMPLETION
|
||||
$FUNCTION complete_builtin
|
||||
$SHORT_DOC complete [-abcdefgjksuv] [-pr] [-DE] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]
|
||||
$SHORT_DOC complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]
|
||||
Specify how arguments are to be completed by Readline.
|
||||
|
||||
For each NAME, specify how arguments are to be completed. If no options
|
||||
@@ -38,10 +38,12 @@ Options:
|
||||
without any specific completion defined
|
||||
-E apply the completions and actions to "empty" commands --
|
||||
completion attempted on a blank line
|
||||
-I apply the completions and actions to the intial (usually the
|
||||
command) word
|
||||
|
||||
When completion is attempted, the actions are applied in the order the
|
||||
uppercase-letter options are listed above. The -D option takes
|
||||
precedence over -E.
|
||||
uppercase-letter options are listed above. If multiple options are supplied,
|
||||
the -D option takes precedence over -E, and both take precedence over -I.
|
||||
|
||||
Exit Status:
|
||||
Returns success unless an invalid option is supplied or an error occurs.
|
||||
@@ -79,6 +81,7 @@ struct _optflags {
|
||||
int rflag;
|
||||
int Dflag;
|
||||
int Eflag;
|
||||
int Iflag;
|
||||
};
|
||||
|
||||
static int find_compact __P((char *));
|
||||
@@ -195,7 +198,7 @@ build_actions (list, flagp, actp, optp)
|
||||
opt_given = 0;
|
||||
|
||||
reset_internal_getopt ();
|
||||
while ((opt = internal_getopt (list, "abcdefgjko:prsuvA:G:W:P:S:X:F:C:DE")) != -1)
|
||||
while ((opt = internal_getopt (list, "abcdefgjko:prsuvA:G:W:P:S:X:F:C:DEI")) != -1)
|
||||
{
|
||||
opt_given = 1;
|
||||
switch (opt)
|
||||
@@ -307,6 +310,18 @@ build_actions (list, flagp, actp, optp)
|
||||
builtin_usage ();
|
||||
return (EX_USAGE);
|
||||
}
|
||||
case 'I':
|
||||
if (flagp)
|
||||
{
|
||||
flagp->Iflag = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sh_invalidopt ("-I");
|
||||
builtin_usage ();
|
||||
return (EX_USAGE);
|
||||
}
|
||||
case 'F':
|
||||
Farg = list_optarg;
|
||||
break;
|
||||
@@ -355,7 +370,8 @@ complete_builtin (list)
|
||||
return (EXECUTION_SUCCESS);
|
||||
}
|
||||
|
||||
opt_given = oflags.pflag = oflags.rflag = oflags.Dflag = oflags.Eflag = 0;
|
||||
opt_given = oflags.pflag = oflags.rflag = 0;
|
||||
oflags.Dflag = oflags.Eflag = oflags.Iflag = 0;
|
||||
|
||||
acts = copts = (unsigned long)0L;
|
||||
Garg = Warg = Parg = Sarg = Xarg = Farg = Carg = (char *)NULL;
|
||||
@@ -370,8 +386,14 @@ complete_builtin (list)
|
||||
|
||||
list = loptend;
|
||||
|
||||
wl = oflags.Dflag ? make_word_list (make_bare_word (DEFAULTCMD), (WORD_LIST *)NULL)
|
||||
: (oflags.Eflag ? make_word_list (make_bare_word (EMPTYCMD), (WORD_LIST *)NULL) : 0);
|
||||
if (oflags.Dflag)
|
||||
wl = make_word_list (make_bare_word (DEFAULTCMD), (WORD_LIST *)NULL);
|
||||
else if (oflags.Eflag)
|
||||
wl = make_word_list (make_bare_word (EMPTYCMD), (WORD_LIST *)NULL);
|
||||
else if (oflags.Iflag)
|
||||
wl = make_word_list (make_bare_word (INITIALWORD), (WORD_LIST *)NULL);
|
||||
else
|
||||
wl = (WORD_LIST *)NULL;
|
||||
|
||||
/* -p overrides everything else */
|
||||
if (oflags.pflag || (list == 0 && opt_given == 0))
|
||||
@@ -564,10 +586,12 @@ print_one_completion (cmd, cs)
|
||||
/* simple arguments that don't require quoting */
|
||||
PRINTARG (cs->funcname, "-F");
|
||||
|
||||
if (STREQ (cmd, EMPTYCMD))
|
||||
printf ("-E\n");
|
||||
else if (STREQ (cmd, DEFAULTCMD))
|
||||
if (STREQ (cmd, DEFAULTCMD))
|
||||
printf ("-D\n");
|
||||
else if (STREQ (cmd, EMPTYCMD))
|
||||
printf ("-E\n");
|
||||
else if (STREQ (cmd, INITIALWORD))
|
||||
printf ("-I\n");
|
||||
else
|
||||
printf ("%s\n", cmd);
|
||||
|
||||
@@ -608,10 +632,12 @@ print_compopts (cmd, cs, full)
|
||||
PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
|
||||
}
|
||||
|
||||
if (STREQ (cmd, EMPTYCMD))
|
||||
printf ("-E\n");
|
||||
else if (STREQ (cmd, DEFAULTCMD))
|
||||
if (STREQ (cmd, DEFAULTCMD))
|
||||
printf ("-D\n");
|
||||
else if (STREQ (cmd, EMPTYCMD))
|
||||
printf ("-E\n");
|
||||
else if (STREQ (cmd, INITIALWORD))
|
||||
printf ("-I\n");
|
||||
else
|
||||
printf ("%s\n", cmd);
|
||||
}
|
||||
@@ -769,7 +795,7 @@ compgen_builtin (list)
|
||||
$BUILTIN compopt
|
||||
$DEPENDS_ON PROGRAMMABLE_COMPLETION
|
||||
$FUNCTION compopt_builtin
|
||||
$SHORT_DOC compopt [-o|+o option] [-DE] [name ...]
|
||||
$SHORT_DOC compopt [-o|+o option] [-DEI] [name ...]
|
||||
Modify or display completion options.
|
||||
|
||||
Modify the completion options for each NAME, or, if no NAMEs are supplied,
|
||||
@@ -780,6 +806,7 @@ Options:
|
||||
-o option Set completion option OPTION for each NAME
|
||||
-D Change options for the "default" command completion
|
||||
-E Change options for the "empty" command completion
|
||||
-I Change options for completion on the initial word
|
||||
|
||||
Using `+o' instead of `-o' turns off the specified option.
|
||||
|
||||
@@ -800,7 +827,7 @@ int
|
||||
compopt_builtin (list)
|
||||
WORD_LIST *list;
|
||||
{
|
||||
int opts_on, opts_off, *opts, opt, oind, ret, Dflag, Eflag;
|
||||
int opts_on, opts_off, *opts, opt, oind, ret, Dflag, Eflag, Iflag;
|
||||
WORD_LIST *l, *wl;
|
||||
COMPSPEC *cs;
|
||||
|
||||
@@ -808,7 +835,7 @@ compopt_builtin (list)
|
||||
ret = EXECUTION_SUCCESS;
|
||||
|
||||
reset_internal_getopt ();
|
||||
while ((opt = internal_getopt (list, "+o:DE")) != -1)
|
||||
while ((opt = internal_getopt (list, "+o:DEI")) != -1)
|
||||
{
|
||||
opts = (list_opttype == '-') ? &opts_on : &opts_off;
|
||||
|
||||
@@ -829,6 +856,9 @@ compopt_builtin (list)
|
||||
case 'E':
|
||||
Eflag = 1;
|
||||
break;
|
||||
case 'I':
|
||||
Iflag = 1;
|
||||
break;
|
||||
CASE_HELPOPT;
|
||||
default:
|
||||
builtin_usage ();
|
||||
@@ -837,8 +867,14 @@ compopt_builtin (list)
|
||||
}
|
||||
list = loptend;
|
||||
|
||||
wl = Dflag ? make_word_list (make_bare_word (DEFAULTCMD), (WORD_LIST *)NULL)
|
||||
: (Eflag ? make_word_list (make_bare_word (EMPTYCMD), (WORD_LIST *)NULL) : 0);
|
||||
if (Dflag)
|
||||
wl = make_word_list (make_bare_word (DEFAULTCMD), (WORD_LIST *)NULL);
|
||||
else if (Eflag)
|
||||
wl = make_word_list (make_bare_word (EMPTYCMD), (WORD_LIST *)NULL);
|
||||
else if (Iflag)
|
||||
wl = make_word_list (make_bare_word (INITIALWORD), (WORD_LIST *)NULL);
|
||||
else
|
||||
wl = (WORD_LIST *)NULL;
|
||||
|
||||
if (list == 0 && wl == 0)
|
||||
{
|
||||
|
||||
@@ -5404,7 +5404,7 @@ fi
|
||||
|
||||
|
||||
case "$ac_cv_rl_version" in
|
||||
7*|8*|9*) ;;
|
||||
8*|9*) ;;
|
||||
*) opt_with_installed_readline=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: installed readline library is too old to be linked with bash" >&5
|
||||
$as_echo "$as_me: WARNING: installed readline library is too old to be linked with bash" >&2;}
|
||||
|
||||
+1
-1
@@ -550,7 +550,7 @@ then
|
||||
RL_LIB_READLINE_VERSION
|
||||
|
||||
case "$ac_cv_rl_version" in
|
||||
7*|8*|9*) ;;
|
||||
8*|9*) ;;
|
||||
*) opt_with_installed_readline=no
|
||||
AC_MSG_WARN([installed readline library is too old to be linked with bash])
|
||||
AC_MSG_WARN([using private bash version])
|
||||
|
||||
+1679
-1665
File diff suppressed because it is too large
Load Diff
+15
-5
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet.ramey@case.edu
|
||||
.\"
|
||||
.\" Last Change: Sat May 19 21:48:08 EDT 2018
|
||||
.\" Last Change: Fri Jun 8 16:15:23 EDT 2018
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2018 May 19" "GNU Bash 5.0"
|
||||
.TH BASH 1 "2018 June 8" "GNU Bash 5.0"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -7647,12 +7647,12 @@ will be displayed.
|
||||
The return value is true unless an invalid option is supplied, or no
|
||||
matches were generated.
|
||||
.TP
|
||||
\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DE\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP]
|
||||
\fBcomplete\fP [\fB\-abcdefgjksuv\fP] [\fB\-o\fP \fIcomp-option\fP] [\fB\-DEI\fP] [\fB\-A\fP \fIaction\fP] [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP]
|
||||
.br
|
||||
[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP]
|
||||
.PD 0
|
||||
.TP
|
||||
\fBcomplete\fP \fB\-pr\fP [\fB\-DE\fP] [\fIname\fP ...]
|
||||
\fBcomplete\fP \fB\-pr\fP [\fB\-DEI\fP] [\fIname\fP ...]
|
||||
.PD
|
||||
Specify how arguments to each \fIname\fP should be completed.
|
||||
If the \fB\-p\fP option is supplied, or if no options are supplied,
|
||||
@@ -7667,6 +7667,12 @@ on a command for which no completion has previously been defined.
|
||||
The \fB\-E\fP option indicates that the remaining options and actions should
|
||||
apply to ``empty'' command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
The \fB\-I\fP option indicates that the remaining options and actions should
|
||||
apply to completion on the inital non-assignment word on the line, or after
|
||||
a command delimiter such as \fB;\fP or \fB|\fP, which is usually command
|
||||
name completion.
|
||||
If multiple options are supplied, the \fB\-D\fP option takes precedence
|
||||
over \fB\-E\fP, and both take precedence of \fB\-I\fP.
|
||||
.sp 1
|
||||
The process of applying these completion specifications when word completion
|
||||
is attempted is described above under \fBProgrammable Completion\fP.
|
||||
@@ -7862,7 +7868,7 @@ a \fIname\fP for which no specification exists, or
|
||||
an error occurs adding a completion specification.
|
||||
.RE
|
||||
.TP
|
||||
\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DE\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP]
|
||||
\fBcompopt\fP [\fB\-o\fP \fIoption\fP] [\fB\-DEI\fP] [\fB+o\fP \fIoption\fP] [\fIname\fP]
|
||||
Modify completion options for each \fIname\fP according to the
|
||||
\fIoption\fPs, or for the
|
||||
currently-executing completion if no \fIname\fPs are supplied.
|
||||
@@ -7876,6 +7882,10 @@ on a command for which no completion has previously been defined.
|
||||
The \fB\-E\fP option indicates that the remaining options should
|
||||
apply to ``empty'' command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
The \fB\-I\fP option indicates that the remaining options should
|
||||
apply to completion on the inital non-assignment word on the line,
|
||||
or after a command delimiter such as \fB;\fP or \fB|\fP, which is usually
|
||||
command name completion.
|
||||
.sp 1
|
||||
The return value is true unless an invalid option is supplied, an attempt
|
||||
is made to modify the options for a \fIname\fP for which no completion
|
||||
|
||||
+29
-12
@@ -3,7 +3,7 @@
|
||||
</HEAD>
|
||||
<BODY><TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2018 March 15<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2018 June 8<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR><A HREF="#index">Index</A>
|
||||
@@ -1738,7 +1738,14 @@ is null, the parameters are joined without intervening separators.
|
||||
<DT><B>@</B>
|
||||
|
||||
<DD>
|
||||
Expands to the positional parameters, starting from one. When the
|
||||
Expands to the positional parameters, starting from one.
|
||||
In contexts where word splitting is performed, this expands each
|
||||
positional parameter to a separate word; if not within double
|
||||
quotes, these words are subject to word splitting.
|
||||
In contexts where word splitting is not performed,
|
||||
this expands to a single word
|
||||
with each positional parameter separated by a space.
|
||||
When the
|
||||
expansion occurs within double quotes, each parameter expands to a
|
||||
separate word. That is, "<B>$@</B>" is equivalent to
|
||||
"<B>$1</B>" "<B>$2</B>" ...
|
||||
@@ -2634,7 +2641,7 @@ Similar to
|
||||
<FONT SIZE=-1><B>BASH_ENV</B>;
|
||||
|
||||
</FONT>
|
||||
used when the shell is invoked in POSIX mode.
|
||||
used when the shell is invoked in <I>posix mode</I>.
|
||||
<DT><B>EXECIGNORE</B>
|
||||
|
||||
<DD>
|
||||
@@ -6125,7 +6132,7 @@ cannot affect the shell's execution environment.
|
||||
<P>
|
||||
|
||||
Subshells spawned to execute command substitutions inherit the value of
|
||||
the <B>-e</B> option from the parent shell. When not in <I>posix</I> mode,
|
||||
the <B>-e</B> option from the parent shell. When not in <I>posix mode</I>,
|
||||
<B>bash</B> clears the <B>-e</B> option in such subshells.
|
||||
<P>
|
||||
|
||||
@@ -9745,12 +9752,12 @@ will be displayed.
|
||||
<P>
|
||||
The return value is true unless an invalid option is supplied, or no
|
||||
matches were generated.
|
||||
<DT><B>complete</B> [<B>-abcdefgjksuv</B>] [<B>-o</B> <I>comp-option</I>] [<B>-DE</B>] [<B>-A</B> <I>action</I>] [<B>-G</B> <I>globpat</I>] [<B>-W</B> <I>wordlist</I>] [<B>-F</B> <I>function</I>] [<B>-C</B> <I>command</I>]<DD>
|
||||
<DT><B>complete</B> [<B>-abcdefgjksuv</B>] [<B>-o</B> <I>comp-option</I>] [<B>-DEI</B>] [<B>-A</B> <I>action</I>] [<B>-G</B> <I>globpat</I>] [<B>-W</B> <I>wordlist</I>] [<B>-F</B> <I>function</I>] [<B>-C</B> <I>command</I>]<DD>
|
||||
<BR>
|
||||
|
||||
[<B>-X</B> <I>filterpat</I>] [<B>-P</B> <I>prefix</I>] [<B>-S</B> <I>suffix</I>] <I>name</I> [<I>name ...</I>]
|
||||
|
||||
<DT><B>complete</B> <B>-pr</B> [<B>-DE</B>] [<I>name</I> ...]<DD>
|
||||
<DT><B>complete</B> <B>-pr</B> [<B>-DEI</B>] [<I>name</I> ...]<DD>
|
||||
|
||||
Specify how arguments to each <I>name</I> should be completed.
|
||||
If the <B>-p</B> option is supplied, or if no options are supplied,
|
||||
@@ -9765,6 +9772,12 @@ on a command for which no completion has previously been defined.
|
||||
The <B>-E</B> option indicates that the remaining options and actions should
|
||||
apply to ``empty'' command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
The <B>-I</B> option indicates that the remaining options and actions should
|
||||
apply to completion on the inital non-assignment word on the line, or after
|
||||
a command delimiter such as <B>;</B> or <B>|</B>, which is usually command
|
||||
name completion.
|
||||
If multiple options are supplied, the <B>-D</B> option takes precedence
|
||||
over <B>-E</B>, and both take precedence of <B>-I</B>.
|
||||
<P>
|
||||
The process of applying these completion specifications when word completion
|
||||
is attempted is described above under <B>Programmable Completion</B>.
|
||||
@@ -9995,7 +10008,7 @@ a <I>name</I> for which no specification exists, or
|
||||
an error occurs adding a completion specification.
|
||||
</DL>
|
||||
|
||||
<DT><B>compopt</B> [<B>-o</B> <I>option</I>] [<B>-DE</B>] [<B>+o</B> <I>option</I>] [<I>name</I>]<DD>
|
||||
<DT><B>compopt</B> [<B>-o</B> <I>option</I>] [<B>-DEI</B>] [<B>+o</B> <I>option</I>] [<I>name</I>]<DD>
|
||||
Modify completion options for each <I>name</I> according to the
|
||||
<I>option</I>s, or for the
|
||||
currently-executing completion if no <I>name</I>s are supplied.
|
||||
@@ -10009,6 +10022,10 @@ on a command for which no completion has previously been defined.
|
||||
The <B>-E</B> option indicates that the remaining options should
|
||||
apply to ``empty'' command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
The <B>-I</B> option indicates that the remaining options should
|
||||
apply to completion on the inital non-assignment word on the line,
|
||||
or after a command delimiter such as <B>;</B> or <B>|</B>, which is usually
|
||||
command name completion.
|
||||
<P>
|
||||
The return value is true unless an invalid option is supplied, an attempt
|
||||
is made to modify the options for a <I>name</I> for which no completion
|
||||
@@ -11727,7 +11744,7 @@ Without options, the name and value of each shell variable are displayed
|
||||
in a format that can be reused as input
|
||||
for setting or resetting the currently-set variables.
|
||||
Read-only variables cannot be reset.
|
||||
In <I>posix</I> mode, only shell variables are listed.
|
||||
In <I>posix mode</I>, only shell variables are listed.
|
||||
The output is sorted according to the current locale.
|
||||
When options are specified, they set or unset shell attributes.
|
||||
Any arguments remaining after option processing are treated
|
||||
@@ -12444,7 +12461,7 @@ interrupt; previous versions continue with the next command in the list.
|
||||
If set,
|
||||
<B>bash</B>,
|
||||
|
||||
when in <I>posix</I> mode, treats a single quote in a double-quoted
|
||||
when in <I>posix mode</I>, treats a single quote in a double-quoted
|
||||
parameter expansion as a special character. The single quotes must match
|
||||
(an even number) and the characters between the single quotes are considered
|
||||
quoted. This is the behavior of posix mode through version 4.1.
|
||||
@@ -13426,7 +13443,7 @@ and
|
||||
<B>-u</B>,
|
||||
|
||||
which are unscaled values;
|
||||
and, when in Posix mode,
|
||||
and, when in posix mode,
|
||||
<B>-c</B>
|
||||
|
||||
and
|
||||
@@ -13852,7 +13869,7 @@ There may be only one active coprocess at a time.
|
||||
<HR>
|
||||
<TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash 5.0<TH ALIGN=CENTER width=33%>2018 March 15<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash 5.0<TH ALIGN=CENTER width=33%>2018 June 8<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
@@ -13958,6 +13975,6 @@ There may be only one active coprocess at a time.
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by man2html from bash.1.<BR>
|
||||
Time: 19 March 2018 09:43:32 EDT
|
||||
Time: 08 June 2018 16:16:11 EDT
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
+224
-193
@@ -2,9 +2,9 @@ This is bash.info, produced by makeinfo version 6.5 from
|
||||
bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
Bash shell (version 5.0, 15 March 2018).
|
||||
Bash shell (version 5.0, 8 June 2018).
|
||||
|
||||
This is Edition 5.0, last updated 15 March 2018, of 'The GNU Bash
|
||||
This is Edition 5.0, last updated 8 June 2018, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.0.
|
||||
|
||||
Copyright (C) 1988-2018 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.0, 15 March 2018). The Bash home page is
|
||||
Bash shell (version 5.0, 8 June 2018). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.0, last updated 15 March 2018, of 'The GNU Bash
|
||||
This is Edition 5.0, last updated 8 June 2018, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.0.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -768,7 +768,9 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev:
|
||||
'case'
|
||||
The syntax of the 'case' command is:
|
||||
|
||||
case WORD in [ [(] PATTERN [| PATTERN]...) COMMAND-LIST ;;]... esac
|
||||
case WORD in
|
||||
[ [(] PATTERN [| PATTERN]...) COMMAND-LIST ;;]...
|
||||
esac
|
||||
|
||||
'case' will selectively execute the COMMAND-LIST corresponding to
|
||||
the first PATTERN that matches WORD. The match is performed
|
||||
@@ -883,8 +885,8 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev:
|
||||
'shopt' in *note The Shopt Builtin::) is enabled, the match is
|
||||
performed without regard to the case of alphabetic characters. The
|
||||
return value is 0 if the string matches ('==') or does not match
|
||||
('!=')the pattern, and 1 otherwise. Any part of the pattern may be
|
||||
quoted to force the quoted portion to be matched as a string.
|
||||
('!=') the pattern, and 1 otherwise. Any part of the pattern may
|
||||
be quoted to force the quoted portion to be matched as a string.
|
||||
|
||||
An additional binary operator, '=~', is available, with the same
|
||||
precedence as '==' and '!='. When it is used, the string to the
|
||||
@@ -1103,7 +1105,8 @@ read from a file (in this case, filenames listed one per line):
|
||||
done < file | process-output
|
||||
|
||||
with a more compact syntax reminiscent of lambdas:
|
||||
cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" | process-output
|
||||
cat list | parallel "do-something1 {} config-{} ; do-something2 < {}" |
|
||||
process-output
|
||||
|
||||
Parallel provides a built-in mechanism to remove filename extensions,
|
||||
which lends itself to batch file transformations or renaming:
|
||||
@@ -1118,10 +1121,18 @@ take arguments from the command line; the above can also be written as
|
||||
|
||||
If a command generates output, you may want to preserve the input
|
||||
order in the output. For instance, the following command
|
||||
{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel traceroute
|
||||
{
|
||||
echo foss.org.my ;
|
||||
echo debian.org ;
|
||||
echo freenetproject.org ;
|
||||
} | parallel traceroute
|
||||
will display as output the traceroute invocation that finishes first.
|
||||
Adding the '-k' option
|
||||
{ echo foss.org.my ; echo debian.org; echo freenetproject.org; } | parallel -k traceroute
|
||||
{
|
||||
echo foss.org.my ;
|
||||
echo debian.org ;
|
||||
echo freenetproject.org ;
|
||||
} | parallel -k traceroute
|
||||
will ensure that the output of 'traceroute foss.org.my' is displayed
|
||||
first.
|
||||
|
||||
@@ -1406,15 +1417,21 @@ only be referenced; assignment to them is not allowed.
|
||||
is null, the parameters are joined without intervening separators.
|
||||
|
||||
'@'
|
||||
($@) Expands to the positional parameters, starting from one. When
|
||||
the expansion occurs within double quotes, each parameter expands
|
||||
to a separate word. That is, '"$@"' is equivalent to '"$1" "$2"
|
||||
...'. If the double-quoted expansion occurs within a word, the
|
||||
expansion of the first parameter is joined with the beginning part
|
||||
of the original word, and the expansion of the last parameter is
|
||||
joined with the last part of the original word. When there are no
|
||||
positional parameters, '"$@"' and '$@' expand to nothing (i.e.,
|
||||
they are removed).
|
||||
($@) Expands to the positional parameters, starting from one. In
|
||||
contexts where word splitting is performed, this expands each
|
||||
positional parameter to a separate word; if not within double
|
||||
quotes, these words are subject to word splitting. In contexts
|
||||
where word splitting is not performed, this expands to a single
|
||||
word with each positional parameter separated by a space. When the
|
||||
expansion occurs within double quotes, and word splitting is
|
||||
performed, each parameter expands to a separate word. That is,
|
||||
'"$@"' is equivalent to '"$1" "$2" ...'. If the double-quoted
|
||||
expansion occurs within a word, the expansion of the first
|
||||
parameter is joined with the beginning part of the original word,
|
||||
and the expansion of the last parameter is joined with the last
|
||||
part of the original word. When there are no positional
|
||||
parameters, '"$@"' and '$@' expand to nothing (i.e., they are
|
||||
removed).
|
||||
|
||||
'#'
|
||||
($#) Expands to the number of positional parameters in decimal.
|
||||
@@ -3662,8 +3679,8 @@ standard.
|
||||
Exit a login shell, returning a status of N to the shell's parent.
|
||||
|
||||
'mapfile'
|
||||
mapfile [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD]
|
||||
[-C CALLBACK] [-c QUANTUM] [ARRAY]
|
||||
mapfile [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT]
|
||||
[-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY]
|
||||
|
||||
Read lines from the standard input into the indexed array variable
|
||||
ARRAY, or from file descriptor FD if the '-u' option is supplied.
|
||||
@@ -3846,8 +3863,8 @@ standard.
|
||||
Read input from file descriptor FD.
|
||||
|
||||
'readarray'
|
||||
readarray [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD]
|
||||
[-C CALLBACK] [-c QUANTUM] [ARRAY]
|
||||
readarray [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT]
|
||||
[-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY]
|
||||
|
||||
Read lines from the standard input into the indexed array variable
|
||||
ARRAY, or from file descriptor FD if the '-u' option is supplied.
|
||||
@@ -5228,7 +5245,7 @@ Variables::).
|
||||
as the sole input. If set, the value denotes the number of
|
||||
consecutive 'EOF' characters that can be read as the first
|
||||
character on an input line before the shell will exit. If the
|
||||
variable exists but does not have a numeric value (or has no value)
|
||||
variable exists but does not have a numeric value, or has no value,
|
||||
then the default is 10. If the variable does not exist, then 'EOF'
|
||||
signifies the end of input to the shell. This is only in effect
|
||||
for interactive shells.
|
||||
@@ -5484,9 +5501,12 @@ File: bash.info, Node: Invoking Bash, Next: Bash Startup Files, Up: Bash Feat
|
||||
6.1 Invoking Bash
|
||||
=================
|
||||
|
||||
bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...]
|
||||
bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] -c STRING [ARGUMENT ...]
|
||||
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...]
|
||||
bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o OPTION]
|
||||
[-O SHOPT_OPTION] [ARGUMENT ...]
|
||||
bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o OPTION]
|
||||
[-O SHOPT_OPTION] -c STRING [ARGUMENT ...]
|
||||
bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION]
|
||||
[-O SHOPT_OPTION] [ARGUMENT ...]
|
||||
|
||||
All of the single-character options used with the 'set' builtin
|
||||
(*note The Set Builtin::) can be used as options when the shell is
|
||||
@@ -5832,8 +5852,8 @@ several ways.
|
||||
9. In the absence of any traps, Bash ignores 'SIGTERM' (*note
|
||||
Signals::).
|
||||
|
||||
10. In the absence of any traps, 'SIGINT' is caught and handled
|
||||
((*note Signals::). 'SIGINT' will interrupt some shell builtins.
|
||||
10. In the absence of any traps, 'SIGINT' is caught and handled (*note
|
||||
Signals::). 'SIGINT' will interrupt some shell builtins.
|
||||
|
||||
11. An interactive login shell sends a 'SIGHUP' to all jobs on exit if
|
||||
the 'huponexit' shell option has been enabled (*note Signals::).
|
||||
@@ -6453,7 +6473,8 @@ of commands executed during the current shell session.
|
||||
|
||||
After the string is decoded, it is expanded via parameter expansion,
|
||||
command substitution, arithmetic expansion, and quote removal, subject
|
||||
to the value of the 'promptvars' shell option (*note Bash Builtins::).
|
||||
to the value of the 'promptvars' shell option (*note The Shopt
|
||||
Builtin::).
|
||||
|
||||
|
||||
File: bash.info, Node: The Restricted Shell, Next: Bash POSIX Mode, Prev: Controlling the Prompt, Up: Bash Features
|
||||
@@ -7374,7 +7395,7 @@ Variable Settings
|
||||
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.
|
||||
and completion. The default value is 'off'.
|
||||
|
||||
'completion-prefix-display-length'
|
||||
The length in characters of the common prefix of a list of
|
||||
@@ -7650,7 +7671,7 @@ Key Bindings
|
||||
Meta-Rubout: backward-kill-word
|
||||
Control-o: "> output"
|
||||
|
||||
In the above example, 'C-u' is bound to the function
|
||||
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
|
||||
@@ -8141,7 +8162,7 @@ File: bash.info, Node: Commands For Text, Next: Commands For Killing, Prev: C
|
||||
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
|
||||
was bound to 'self-insert' instead of executing any editing
|
||||
commands.
|
||||
|
||||
'transpose-chars (C-t)'
|
||||
@@ -8737,10 +8758,10 @@ happening.
|
||||
no matches were generated.
|
||||
|
||||
'complete'
|
||||
complete [-abcdefgjksuv] [-o COMP-OPTION] [-DE] [-A ACTION] [-G GLOBPAT] [-W WORDLIST]
|
||||
[-F FUNCTION] [-C COMMAND] [-X FILTERPAT]
|
||||
complete [-abcdefgjksuv] [-o COMP-OPTION] [-DEI] [-A ACTION] [-G GLOBPAT]
|
||||
[-W WORDLIST] [-F FUNCTION] [-C COMMAND] [-X FILTERPAT]
|
||||
[-P PREFIX] [-S SUFFIX] NAME [NAME ...]
|
||||
complete -pr [-DE] [NAME ...]
|
||||
complete -pr [-DEI] [NAME ...]
|
||||
|
||||
Specify how arguments to each NAME should be completed. If the
|
||||
'-p' option is supplied, or if no options are supplied, existing
|
||||
@@ -8753,10 +8774,16 @@ happening.
|
||||
completion has previously been defined. The '-E' option indicates
|
||||
that the remaining options and actions should apply to "empty"
|
||||
command completion; that is, completion attempted on a blank line.
|
||||
The '-I' option indicates that the remaining options and actions
|
||||
should apply to completion on the inital non-assignment word on the
|
||||
line, or after a command delimiter such as ';' or '|', which is
|
||||
usually command name completion. If multiple options are supplied,
|
||||
the '-D' option takes precedence over '-E', and both take
|
||||
precedence over '-I'.
|
||||
|
||||
The process of applying these completion specifications when word
|
||||
completion is attempted is described above (*note Programmable
|
||||
Completion::). The '-D' option takes precedence over '-E'.
|
||||
Completion::).
|
||||
|
||||
Other options, if specified, have the following meanings. The
|
||||
arguments to the '-G', '-W', and '-X' options (and, if necessary,
|
||||
@@ -8783,7 +8810,7 @@ happening.
|
||||
'filenames'
|
||||
Tell Readline that the compspec generates filenames, so
|
||||
it can perform any filename-specific processing (like
|
||||
adding a slash to directory names quoting special
|
||||
adding a slash to directory names, quoting special
|
||||
characters, or suppressing trailing spaces). This option
|
||||
is intended to be used with shell functions specified
|
||||
with '-F'.
|
||||
@@ -8936,7 +8963,7 @@ happening.
|
||||
completion specification.
|
||||
|
||||
'compopt'
|
||||
compopt [-o OPTION] [-DE] [+o OPTION] [NAME]
|
||||
compopt [-o OPTION] [-DEI] [+o OPTION] [NAME]
|
||||
Modify completion options for each NAME according to the OPTIONs,
|
||||
or for the currently-executing completion if no NAMEs are supplied.
|
||||
If no OPTIONs are given, display the completion options for each
|
||||
@@ -8947,9 +8974,13 @@ happening.
|
||||
command for which no completion has previously been defined. The
|
||||
'-E' option indicates that the remaining options should apply to
|
||||
"empty" command completion; that is, completion attempted on a
|
||||
blank line.
|
||||
blank line. The '-I' option indicates that the remaining options
|
||||
should apply to completion on the inital non-assignment word on the
|
||||
line, or after a command delimiter such as ';' or '|', which is
|
||||
usually command name completion.
|
||||
|
||||
The '-D' option takes precedence over '-E'.
|
||||
If multiple options are supplied, the '-D' option takes precedence
|
||||
over '-E', and both take precedence over '-I'
|
||||
|
||||
The return value is true unless an invalid option is supplied, an
|
||||
attempt is made to modify the options for a NAME for which no
|
||||
@@ -8993,7 +9024,7 @@ retrieves the completions from there when the function returns.
|
||||
local cur _skipdot _cdpath
|
||||
local i j k
|
||||
|
||||
# Tilde expansion, with side effect of expanding tilde to full pathname
|
||||
# Tilde expansion, which also expands tilde to full pathname
|
||||
case "$2" in
|
||||
\~*) eval cur="$2" ;;
|
||||
*) cur=$2 ;;
|
||||
@@ -9760,8 +9791,8 @@ and linked, rather than changing run-time features.
|
||||
|
||||
'--enable-largefile'
|
||||
Enable support for large files
|
||||
(http://www.sas.com/standards/large_file/x_open.20Mar96.html) if
|
||||
the operating system requires special compiler options to build
|
||||
(http://www.unix.org/version2/whatsnew/lfs20mar.html) if the
|
||||
operating system requires special compiler options to build
|
||||
programs which can access large files. This is enabled by default,
|
||||
if the operating system provides large file support.
|
||||
|
||||
@@ -10881,7 +10912,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* complete: Programmable Completion Builtins.
|
||||
(line 30)
|
||||
* compopt: Programmable Completion Builtins.
|
||||
(line 229)
|
||||
(line 235)
|
||||
* continue: Bourne Shell Builtins.
|
||||
(line 85)
|
||||
* declare: Bash Builtins. (line 148)
|
||||
@@ -10966,9 +10997,9 @@ D.2 Index of Shell Reserved Words
|
||||
|
||||
* !: Pipelines. (line 9)
|
||||
* [[: Conditional Constructs.
|
||||
(line 122)
|
||||
(line 124)
|
||||
* ]]: Conditional Constructs.
|
||||
(line 122)
|
||||
(line 124)
|
||||
* {: Command Grouping. (line 21)
|
||||
* }: Command Grouping. (line 21)
|
||||
* case: Conditional Constructs.
|
||||
@@ -10990,7 +11021,7 @@ D.2 Index of Shell Reserved Words
|
||||
* in: Conditional Constructs.
|
||||
(line 28)
|
||||
* select: Conditional Constructs.
|
||||
(line 80)
|
||||
(line 82)
|
||||
* then: Conditional Constructs.
|
||||
(line 7)
|
||||
* time: Pipelines. (line 9)
|
||||
@@ -11006,24 +11037,24 @@ D.3 Parameter and Variable Index
|
||||
| ||||