mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-23 13:57:58 +02:00
bash-4.3-beta2 overlay
This commit is contained in:
@@ -1,3 +1,57 @@
|
||||
This document details the changes between this version, bash-4.3-beta2, and the
|
||||
previous version, bash-4.3-beta.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed a bug that caused assignment to an unset variable using a negative
|
||||
subscript to result in a segmentation fault.
|
||||
|
||||
b. Fixed a bug that caused assignment to a string variable using a negative
|
||||
subscript to use the incorrect index.
|
||||
|
||||
c. Fixed a bug that caused some strings to be interpreted as invalid
|
||||
extended globbing expressions when used with the help builtin.
|
||||
|
||||
d. Fixed a bug that caused an attempt to trap a signal whose disposition
|
||||
cannot be changed to reference uninitialized memory.
|
||||
|
||||
e. Command completion now skips assignment statements preceding a command
|
||||
name and completes the command.
|
||||
|
||||
f. Fixed a bug that caused `compgen -f' in a non-interactive shell to dump
|
||||
core under certain circumstances.
|
||||
|
||||
g. Fixed a bug that caused the `read -N' to misbehave when the input stream
|
||||
contains 0xff.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
a. Changed message when an incremental search fails to include "failed" in
|
||||
the prompt and display the entire search string instead of just the last
|
||||
matching portion.
|
||||
|
||||
b. Fixed a bug that caused an arrow key typed to an incremental search prompt
|
||||
to process the key sequence incorrectly.
|
||||
|
||||
c. Additional key bindings for arrow keys on MinGW.
|
||||
|
||||
3. New Features in Bash
|
||||
|
||||
a. The help builtin now attempts substring matching (as it did through
|
||||
bash-4.2) if exact string matching fails.
|
||||
|
||||
b. The fc builtin now interprets -0 as the current command line.
|
||||
|
||||
c. Completing directory names containing shell variables now adds a trailing
|
||||
slash if the expanded result is a directory.
|
||||
|
||||
4. New Features in Readline
|
||||
|
||||
a. rl_change_environment: new application-settable variable that controls
|
||||
whether or not Readline modifies the environment (currently readline
|
||||
modifies only LINES and COLUMNS).
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
This document details the changes between this version, bash-4.3-beta, and the
|
||||
previous version, bash-4.3-alpha.
|
||||
|
||||
|
||||
+197
@@ -5087,3 +5087,200 @@ lib/readline/histfile.c
|
||||
backup history file and return a non-zero value
|
||||
- history_truncate_file: if write or close return < 0, make sure we
|
||||
return a non-zero value
|
||||
|
||||
[bash-4.3-beta frozen]
|
||||
|
||||
7/21
|
||||
----
|
||||
lib/readline/isearch.c
|
||||
- rl_display_search: now takes an entire search context flags word as
|
||||
the second argument, instead of just reverse flag; changed callers
|
||||
- rl_display_search: if the search has failed, add `failed ' to the
|
||||
beginning of the search prompt
|
||||
- _rl_isearch_dispatch: if the search has failed, display the entire
|
||||
search string with an indication that the search failed but with the
|
||||
last matching line. Suggested by jidanni@jidanni.org
|
||||
|
||||
command.h
|
||||
- W_ASSIGNINT: new word flag; used internally for make_internal_declare
|
||||
and set by fix_assignment_words
|
||||
|
||||
execute_cmd.c
|
||||
- fix_assignment_words: set W_ASSIGNINT if compound assignment and -i
|
||||
given as option. We don't do anything with the value yet
|
||||
|
||||
subst.c
|
||||
- shell_expand_word_list: rework the way the option list that is
|
||||
passed to make_internal_declare is created
|
||||
|
||||
8/1
|
||||
---
|
||||
doc/{bash.1,bashref.texi}
|
||||
- minor changes to description of $! based on a report from Chris
|
||||
Down <chris@chrisdown.name>
|
||||
|
||||
arrayfunc.c
|
||||
- assign_array_element_internal: before trying to get an array's max
|
||||
index to process a negative subscript, make sure the array exists.
|
||||
Bug report from Geir Hauge <geir.hauge@gmail.com>
|
||||
|
||||
8/2
|
||||
---
|
||||
arrayfunc.c
|
||||
- assign_array_element_internal: before using array_max_index() when
|
||||
processing a negative subscript, make sure the variable is an array.
|
||||
if it's not, use 0 as array_max_index assuming it's a string.
|
||||
Fixes bug report from Geir Hauge <geir.hauge@gmail.com>
|
||||
|
||||
8/3
|
||||
---
|
||||
Makefile.in
|
||||
- pcomplete.o: add dependency on $(DEFDIR)/builtext.h. Suggested by
|
||||
Curtis Doty <curtis@greenkey.net>
|
||||
|
||||
8/5
|
||||
---
|
||||
lib/glob/sm_loop.c
|
||||
- strcompare: short-circuit and return FNM_NOMATCH if the lengths of the
|
||||
pattern and string (pe - p and se - s, respectively) are not equal
|
||||
- strcompare: don't bother trying to set *pe or *se to '\0' if that's
|
||||
what they already are. Fixes bug reported by Geir Hauge
|
||||
<geir.hauge@gmail.com>
|
||||
|
||||
8/6
|
||||
---
|
||||
doc/{bash.1,bashref.texi},builtins/hash.def,lib/readline/doc/rluser.texi
|
||||
- minor typo changes from Geir Hauge <geir.hauge@gmail.com>
|
||||
|
||||
bultins/help.def
|
||||
- show_longdoc: avoid trying to translate the empty string because it
|
||||
often translates to some boilerplate about the project and
|
||||
translation. Report and fix from Geir Hauge <geir.hauge@gmail.com>
|
||||
|
||||
8/8
|
||||
---
|
||||
builtins/help.def
|
||||
- help_builtin: try two passes through the list of help topics for each
|
||||
argument: one doing exact string matching and one, if the first pass
|
||||
fails to find a match, doing string prefix matching like previous
|
||||
versions. This prevents `help read' from matching both `read' and
|
||||
`readonly', but allows `help r' to match everything beginning with
|
||||
`r'. Inspired by report from Geir Hauge <geir.hauge@gmail.com>
|
||||
|
||||
8/13
|
||||
----
|
||||
builtins/fc.def
|
||||
- fc_builtin,fc_gethnum: calculate `real' end of the history list and
|
||||
use it if -0 is specified as the beginning or end of the history
|
||||
range to list. Doesn't work for fc -e or fc -s by design. Feature
|
||||
requested by Mike Fied <micfied@gmail.com>
|
||||
|
||||
8/16
|
||||
----
|
||||
trap.c
|
||||
- _run_trap_internal: use {save,restore}_parser_state instead of
|
||||
{save,restore}_token_state. It's more comprehensive
|
||||
|
||||
8/23
|
||||
----
|
||||
doc/bash.1
|
||||
- disown: remove repeated text. Report and fix from Thomas Hood
|
||||
<jdthood@gmail.com>
|
||||
|
||||
8/25
|
||||
----
|
||||
lib/readline/rltty.c
|
||||
- set_special_char: fix prototype (last arg is rl_command_func_t *)
|
||||
|
||||
sig.c
|
||||
- set_signal_handler: return oact.sa_handler only if sigaction
|
||||
succeeds; if it doesn't, return SIG_DFL (reasonable default). From
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=911404
|
||||
|
||||
bashline.c
|
||||
- attempt_shell_completion: fix to skip assignment statements preceding
|
||||
command name even if there are no programmable completions defined.
|
||||
From https://bugzilla.redhat.com/show_bug.cgi?id=994659
|
||||
- attempt_shell_completion: if still completing command word following
|
||||
assignment statements, do command completion even if programmable
|
||||
completion defined for partial command name entered so far
|
||||
|
||||
8/26
|
||||
----
|
||||
pcomplete.c
|
||||
- pcomp_filename_completion_function: make sure rl_filename_dequoting_function
|
||||
is non-NULL before trying to call it. Bug and fix from
|
||||
Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
bashline.c
|
||||
- bash_command_name_stat_hook: if *name is not something we're going
|
||||
to look up in $PATH (absolute_program(*name) != 0), just call the
|
||||
usual bash_filename_stat_hook and return those results. This makes
|
||||
completions like $PWD/exam[TAB] add a trailing slash
|
||||
|
||||
9/2
|
||||
---
|
||||
builtins/read.def
|
||||
- read_builtin: before comparing what we read to the delim, make sure
|
||||
we are not supposed to be ignoring the delimiter (read -N). We
|
||||
set the delim to -1, but it's possible to read a character whose
|
||||
int value ends up being between -1 and -128. Fixes bug
|
||||
reported by Stephane Chazelas <stephane.chazelas@gmail.com>
|
||||
|
||||
doc/{bash.1,bashref.texi}
|
||||
- word splitting: crib some language from Posix to make it clear that
|
||||
characters in IFS are treated as field *terminators*, not field
|
||||
*separators*. Addresses issue raised by DJ Mills
|
||||
<danielmills1@gmail.com>
|
||||
|
||||
lib/readline/{util.c,rldefs.h}
|
||||
- _rl_stricmp,_rl_strnicmp: now take const char * string arguments;
|
||||
changed prototype declarations
|
||||
|
||||
9/5
|
||||
---
|
||||
doc/{bash.1,bashref.texi}
|
||||
- [[: modify description of pattern matching to make it clear that the
|
||||
match is performed as if the extglob option were enabled. From Red
|
||||
Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=1002078
|
||||
|
||||
9/12
|
||||
----
|
||||
lib/readline/isearch.c
|
||||
- _rl_isearch_dispatch: if we read an ESC and it's supposed to
|
||||
terminate the search, make sure we check for typeahead with
|
||||
_rl_pushed_input_available, since installing a hook function causes
|
||||
typeahead to be collected in `ibuffer' (input.c). If there is any,
|
||||
make sure we still use the ESC as a prefix character. Bug and fix
|
||||
from Mike Miller <mtmiller@ieee.org>
|
||||
|
||||
9/16
|
||||
----
|
||||
builtins/{caller,cd,kill,pushd,wait}.def
|
||||
- builtin_usage(): make sure call to this sets return status to
|
||||
EX_USAGE
|
||||
|
||||
9/18
|
||||
----
|
||||
terminal.c
|
||||
- rl_change_environment: new application-settable variable; if non-
|
||||
zero (the default), readline will modify LINES and COLUMNS in the
|
||||
environment when it handles SIGWINCH
|
||||
- _rl_get_screen_size: if rl_change_environment is non-zero, use setenv
|
||||
to modify LINES and COLUMNS environment variables
|
||||
|
||||
readline.h
|
||||
- rl_change_environment: new extern declaration for applications
|
||||
|
||||
9/22
|
||||
----
|
||||
configure.ac
|
||||
- relstatus: bumped version to bash-4.3-beta2
|
||||
|
||||
9/24
|
||||
----
|
||||
|
||||
lib/readline/readline.c
|
||||
- bind_arrow_keys_internal: added more key bindings for the numeric key
|
||||
pad arrow keys on mingw32. Patch from Pierre Muller
|
||||
<pierre.muller@ics-cnrs.unistra.fr>
|
||||
|
||||
@@ -335,6 +335,12 @@ unless the operating system does not provide the necessary support.
|
||||
Set the default value of the EXTGLOB shell option described above
|
||||
under *note The Shopt Builtin:: to be enabled.
|
||||
|
||||
`--enable-glob-asciirange-default'
|
||||
Set the default value of the GLOBASCIIRANGES shell option described
|
||||
above under *note The Shopt Builtin:: to be enabled. This
|
||||
controls the behavior of character ranges when used in pattern
|
||||
matching bracket expressions.
|
||||
|
||||
`--enable-help-builtin'
|
||||
Include the `help' builtin, which displays help on shell builtins
|
||||
and variables (*note Bash Builtins::).
|
||||
|
||||
@@ -801,6 +801,7 @@ tests/array11.sub f
|
||||
tests/array12.sub f
|
||||
tests/array13.sub f
|
||||
tests/array14.sub f
|
||||
tests/array15.sub f
|
||||
tests/array-at-star f
|
||||
tests/array2.right f
|
||||
tests/assoc.tests f
|
||||
|
||||
@@ -1141,6 +1141,7 @@ pcomplete.o: ${BASHINCDIR}/stdc.h hashlib.h pcomplete.h shell.h syntax.h
|
||||
pcomplete.o: bashjmp.h command.h general.h xmalloc.h error.h variables.h arrayfunc.h conftypes.h quit.h
|
||||
pcomplete.o: unwind_prot.h dispose_cmd.h make_cmd.h subst.h sig.h pathnames.h
|
||||
pcomplete.o: externs.h ${BASHINCDIR}/maxpath.h execute_cmd.h
|
||||
pcomplete.o: ${DEFDIR}/builtext.h
|
||||
|
||||
# library support files
|
||||
|
||||
|
||||
@@ -110,6 +110,14 @@ gg. The brace expansion code now treats a failed sequence expansion as a
|
||||
|
||||
hh. Shells started to run process substitutions now run any trap set on EXIT.
|
||||
|
||||
ii. The help builtin now attempts substring matching (as it did through
|
||||
bash-4.2) if exact string matching fails.
|
||||
|
||||
jj. The fc builtin now interprets -0 as the current command line.
|
||||
|
||||
kk. Completing directory names containing shell variables now adds a trailing
|
||||
slash if the expanded result is a directory.
|
||||
|
||||
2. New Features in Readline
|
||||
|
||||
a. Readline is now more responsive to SIGHUP and other fatal signals when
|
||||
@@ -165,6 +173,10 @@ n. New application-settable variable: rl_signal_event_hook; function that is
|
||||
called when readline is reading terminal input and read(2) is interrupted
|
||||
by a signal. Currently not called for SIGHUP or SIGTERM.
|
||||
|
||||
o. rl_change_environment: new application-settable variable that controls
|
||||
whether or not Readline modifies the environment (currently readline
|
||||
modifies only LINES and COLUMNS).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
This is a terse description of the new features added to bash-4.2 since
|
||||
the release of bash-4.1. As always, the manual page (doc/bash.1) is
|
||||
|
||||
+2
-2
@@ -306,8 +306,8 @@ assign_array_element_internal (entry, name, vname, sub, sublen, value, flags)
|
||||
{
|
||||
ind = array_expand_index (entry, sub, sublen);
|
||||
/* negative subscripts to indexed arrays count back from end */
|
||||
if (ind < 0)
|
||||
ind = array_max_index (array_cell (entry)) + 1 + ind;
|
||||
if (entry && ind < 0)
|
||||
ind = (array_p (entry) ? array_max_index (array_cell (entry)) : 0) + 1 + ind;
|
||||
if (ind < 0)
|
||||
{
|
||||
err_badarraysub (name);
|
||||
|
||||
+33
-6
@@ -1374,6 +1374,9 @@ attempt_shell_completion (text, start, end)
|
||||
{
|
||||
int in_command_position, ti, saveti, qc, dflags;
|
||||
char **matches, *command_separator_chars;
|
||||
#if defined (PROGRAMMABLE_COMPLETION)
|
||||
int have_progcomps, was_assignment;
|
||||
#endif
|
||||
|
||||
command_separator_chars = COMMAND_SEPARATORS;
|
||||
matches = (char **)NULL;
|
||||
@@ -1448,8 +1451,8 @@ 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') &&
|
||||
prog_completion_enabled && (progcomp_size () > 0) &&
|
||||
current_prompt_string == ps1_prompt)
|
||||
{
|
||||
int s, e, s1, e1, os, foundcs;
|
||||
@@ -1474,23 +1477,42 @@ attempt_shell_completion (text, start, end)
|
||||
n = find_cmd_name (s, &s1, &e1);
|
||||
s = e1 + 1;
|
||||
}
|
||||
while (assignment (n, 0));
|
||||
while (was_assignment = assignment (n, 0));
|
||||
s = s1; /* reset to index where name begins */
|
||||
|
||||
/* s == index of where command name begins (reset above)
|
||||
e == end of current command, may be end of line
|
||||
s1 = index of where command name begins
|
||||
e1 == index of where command name ends
|
||||
start == index of where word to be completed begins
|
||||
end == index of where word to be completed ends
|
||||
if (s == start) we are doing command word completion for sure
|
||||
if (e1 == end) we are at the end of the command name and completing it */
|
||||
if (start == 0 && end == 0 && e != 0 && text[0] == '\0') /* beginning of non-empty line */
|
||||
foundcs = 0;
|
||||
else if (start == end && start == s1 && e != 0 && e1 > end) /* beginning of command name, leading whitespace */
|
||||
foundcs = 0;
|
||||
else if (e == 0 && e == s && text[0] == '\0') /* beginning of empty line */
|
||||
else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */
|
||||
prog_complete_matches = programmable_completions ("_EmptycmD_", text, s, e, &foundcs);
|
||||
else if (start == end && text[0] == '\0' && s1 > start && whitespace (rl_line_buffer[start]))
|
||||
foundcs = 0; /* whitespace before command name */
|
||||
else if (e > s && assignment (n, 0) == 0)
|
||||
prog_complete_matches = programmable_completions (n, text, s, e, &foundcs);
|
||||
else if (e > s && was_assignment == 0 && e1 == end && rl_line_buffer[e] == 0 && whitespace (rl_line_buffer[e-1]) == 0)
|
||||
{
|
||||
/* not assignment statement, but still want to perform command
|
||||
completion if we are composing command word. */
|
||||
foundcs = 0;
|
||||
in_command_position = s == start && STREQ (n, text); /* XXX */
|
||||
}
|
||||
else if (e > s && was_assignment == 0 && have_progcomps)
|
||||
{
|
||||
prog_complete_matches = programmable_completions (n, text, s, e, &foundcs);
|
||||
/* command completion if programmable completion fails */
|
||||
in_command_position = s == start && STREQ (n, text); /* XXX */
|
||||
}
|
||||
else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0)
|
||||
{
|
||||
foundcs = 0; /* empty command name following assignments */
|
||||
in_command_position = 1;
|
||||
in_command_position = was_assignment;
|
||||
}
|
||||
else if (s == start && e == end && STREQ (n, text) && start > 0)
|
||||
{
|
||||
@@ -1650,6 +1672,11 @@ bash_command_name_stat_hook (name)
|
||||
{
|
||||
char *cname, *result;
|
||||
|
||||
/* If it's not something we're going to look up in $PATH, just call the
|
||||
normal filename stat hook. */
|
||||
if (absolute_program (*name))
|
||||
return (bash_filename_stat_hook (name));
|
||||
|
||||
cname = *name;
|
||||
/* XXX - we could do something here with converting aliases, builtins,
|
||||
and functions into something that came out as executable, but we don't. */
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ This file is caller.def, from which is created caller.c. It implements the
|
||||
builtin "caller" in Bash.
|
||||
|
||||
Copyright (C) 2002-2008 Rocky Bernstein for Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -121,7 +122,7 @@ caller_builtin (list)
|
||||
{
|
||||
sh_invalidnum (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
|
||||
return (EXECUTION_SUCCESS);
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
This file is cd.def, from which is created cd.c. It implements the
|
||||
builtins "cd" and "pwd" in Bash.
|
||||
|
||||
Copyright (C) 1987-2011 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -219,7 +219,7 @@ cd_builtin (list)
|
||||
break;
|
||||
default:
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
}
|
||||
list = loptend;
|
||||
@@ -404,7 +404,7 @@ pwd_builtin (list)
|
||||
break;
|
||||
default:
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
}
|
||||
list = loptend;
|
||||
|
||||
+18
-3
@@ -173,7 +173,7 @@ fc_builtin (list)
|
||||
register int i;
|
||||
register char *sep;
|
||||
int numbering, reverse, listing, execute;
|
||||
int histbeg, histend, last_hist, retval, opt, rh;
|
||||
int histbeg, histend, last_hist, retval, opt, rh, real_last;
|
||||
FILE *stream;
|
||||
REPL *rlist, *rl;
|
||||
char *ename, *command, *newcom, *fcedit;
|
||||
@@ -303,6 +303,14 @@ fc_builtin (list)
|
||||
rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list);
|
||||
last_hist = i - rh - hist_last_line_added;
|
||||
|
||||
/* Make sure that real_last is calculated the same way here and in
|
||||
fc_gethnum. The return value from fc_gethnum is treated specially if
|
||||
it is == real_last and we are listing commands. */
|
||||
real_last = i;
|
||||
/* back up from the end to the last non-null history entry */
|
||||
while (hlist[real_last] == 0 && real_last > 0)
|
||||
real_last--;
|
||||
|
||||
/* XXX */
|
||||
if (i == last_hist && hlist[last_hist] == 0)
|
||||
while (last_hist >= 0 && hlist[last_hist] == 0)
|
||||
@@ -320,6 +328,8 @@ fc_builtin (list)
|
||||
|
||||
if (list)
|
||||
histend = fc_gethnum (list->word->word, hlist);
|
||||
else if (histbeg == real_last)
|
||||
histend = listing ? real_last : histbeg;
|
||||
else
|
||||
histend = listing ? last_hist : histbeg;
|
||||
}
|
||||
@@ -475,7 +485,7 @@ fc_gethnum (command, hlist)
|
||||
HIST_ENTRY **hlist;
|
||||
{
|
||||
int sign, n, clen, rh;
|
||||
register int i, j, last_hist;
|
||||
register int i, j, last_hist, real_last;
|
||||
register char *s;
|
||||
|
||||
sign = 1;
|
||||
@@ -503,12 +513,17 @@ fc_gethnum (command, hlist)
|
||||
if (last_hist < 0)
|
||||
return (-1);
|
||||
|
||||
real_last = i;
|
||||
i = last_hist;
|
||||
|
||||
/* No specification defaults to most recent command. */
|
||||
if (command == NULL)
|
||||
return (i);
|
||||
|
||||
/* back up from the end to the last non-null history entry */
|
||||
while (hlist[real_last] == 0 && real_last > 0)
|
||||
real_last--;
|
||||
|
||||
/* Otherwise, there is a specification. It can be a number relative to
|
||||
the current position, or an absolute history number. */
|
||||
s = command;
|
||||
@@ -533,7 +548,7 @@ fc_gethnum (command, hlist)
|
||||
return (n < 0 ? 0 : n);
|
||||
}
|
||||
else if (n == 0)
|
||||
return (i);
|
||||
return ((sign == -1) ? real_last : i);
|
||||
else
|
||||
{
|
||||
n -= history_base;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
This file is hash.def, from which is created hash.c.
|
||||
It implements the builtin "hash" in Bash.
|
||||
|
||||
Copyright (C) 1987-2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -31,7 +31,7 @@ no arguments are given, information about remembered commands is displayed.
|
||||
Options:
|
||||
-d forget the remembered location of each NAME
|
||||
-l display in a format that may be reused as input
|
||||
-p pathname use PATHNAME is the full pathname of NAME
|
||||
-p pathname use PATHNAME as the full pathname of NAME
|
||||
-r forget all remembered locations
|
||||
-t print the remembered location of each NAME, preceding
|
||||
each location with the corresponding NAME if multiple
|
||||
|
||||
+34
-20
@@ -1,7 +1,7 @@
|
||||
This file is help.def, from which is created help.c.
|
||||
It implements the builtin "help" in Bash.
|
||||
|
||||
Copyright (C) 1987-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -92,7 +92,7 @@ help_builtin (list)
|
||||
{
|
||||
register int i;
|
||||
char *pattern, *name;
|
||||
int plen, match_found, sflag, dflag, mflag;
|
||||
int plen, match_found, sflag, dflag, mflag, m, pass, this_found;
|
||||
|
||||
dflag = sflag = mflag = 0;
|
||||
reset_internal_getopt ();
|
||||
@@ -137,29 +137,43 @@ help_builtin (list)
|
||||
pattern = list->word->word;
|
||||
plen = strlen (pattern);
|
||||
|
||||
for (i = 0; name = shell_builtins[i].name; i++)
|
||||
for (pass = 1, this_found = 0; pass < 3; pass++)
|
||||
{
|
||||
QUIT;
|
||||
if ((strcmp (pattern, name) == 0) ||
|
||||
(strmatch (pattern, name, FNMATCH_EXTFLAG) != FNM_NOMATCH))
|
||||
for (i = 0; name = shell_builtins[i].name; i++)
|
||||
{
|
||||
match_found++;
|
||||
if (dflag)
|
||||
{
|
||||
show_desc (name, i);
|
||||
continue;
|
||||
}
|
||||
else if (mflag)
|
||||
{
|
||||
show_manpage (name, i);
|
||||
continue;
|
||||
}
|
||||
QUIT;
|
||||
|
||||
printf ("%s: %s\n", name, _(shell_builtins[i].short_doc));
|
||||
/* First pass: look for exact string or pattern matches.
|
||||
Second pass: look for prefix matches like bash-4.2 */
|
||||
if (pass == 1)
|
||||
m = (strcmp (pattern, name) == 0) ||
|
||||
(strmatch (pattern, name, FNMATCH_EXTFLAG) != FNM_NOMATCH);
|
||||
else
|
||||
m = strncmp (pattern, name, plen) == 0;
|
||||
|
||||
if (sflag == 0)
|
||||
show_longdoc (i);
|
||||
if (m)
|
||||
{
|
||||
this_found = 1;
|
||||
match_found++;
|
||||
if (dflag)
|
||||
{
|
||||
show_desc (name, i);
|
||||
continue;
|
||||
}
|
||||
else if (mflag)
|
||||
{
|
||||
show_manpage (name, i);
|
||||
continue;
|
||||
}
|
||||
|
||||
printf ("%s: %s\n", name, _(shell_builtins[i].short_doc));
|
||||
|
||||
if (sflag == 0)
|
||||
show_longdoc (i);
|
||||
}
|
||||
}
|
||||
if (pass == 1 && this_found == 1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -94,7 +94,7 @@ kill_builtin (list)
|
||||
if (list == 0)
|
||||
{
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
|
||||
any_succeeded = listing = saw_signal = 0;
|
||||
@@ -139,7 +139,7 @@ kill_builtin (list)
|
||||
else if (ISOPTION (word, '?'))
|
||||
{
|
||||
builtin_usage ();
|
||||
return (EXECUTION_SUCCESS);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
/* If this is a signal specification then process it. We only process
|
||||
the first one seen; other arguments may signify process groups (e.g,
|
||||
@@ -168,7 +168,7 @@ kill_builtin (list)
|
||||
if (list == 0)
|
||||
{
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
|
||||
while (list)
|
||||
|
||||
+7
-7
@@ -228,7 +228,7 @@ pushd_builtin (list)
|
||||
{
|
||||
sh_invalidnum (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
|
||||
if (direction == '-')
|
||||
@@ -245,7 +245,7 @@ pushd_builtin (list)
|
||||
{
|
||||
sh_invalidopt (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
else
|
||||
break;
|
||||
@@ -339,7 +339,7 @@ popd_builtin (list)
|
||||
{
|
||||
sh_invalidnum (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
which_word = list->word->word;
|
||||
}
|
||||
@@ -347,13 +347,13 @@ popd_builtin (list)
|
||||
{
|
||||
sh_invalidopt (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
else if (*list->word->word)
|
||||
{
|
||||
builtin_error (_("%s: invalid argument"), list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
else
|
||||
break;
|
||||
@@ -432,7 +432,7 @@ dirs_builtin (list)
|
||||
{
|
||||
sh_invalidnum (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
sign = (*list->word->word == '+') ? 1 : -1;
|
||||
desired_index = get_dirstack_index (i, sign, &index_flag);
|
||||
@@ -441,7 +441,7 @@ dirs_builtin (list)
|
||||
{
|
||||
sh_invalidopt (list->word->word);
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -639,7 +639,7 @@ read_builtin (list)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((unsigned char)c == delim)
|
||||
if (ignore_delim == 0 && (unsigned char)c == delim)
|
||||
break;
|
||||
|
||||
if (c == '\0' && delim != '\0')
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
This file is wait.def, from which is created wait.c.
|
||||
It implements the builtin "wait" in Bash.
|
||||
|
||||
Copyright (C) 1987-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -112,7 +112,7 @@ wait_builtin (list)
|
||||
#endif
|
||||
default:
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
return (EX_USAGE);
|
||||
}
|
||||
}
|
||||
list = loptend;
|
||||
|
||||
@@ -100,6 +100,7 @@ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select,
|
||||
#define W_ARRAYIND 0x1000000 /* word is an array index being expanded */
|
||||
#define W_ASSNGLOBAL 0x2000000 /* word is a global assignment to declare (declare/typeset -g) */
|
||||
#define W_NOBRACE 0x4000000 /* Don't perform brace expansion */
|
||||
#define W_ASSIGNINT 0x8000000 /* word is an integer assignment to declare */
|
||||
|
||||
/* Possible values for subshell_environment */
|
||||
#define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# From configure.ac for Bash 4.3, version 4.059.
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for bash 4.3-beta.
|
||||
# Generated by GNU Autoconf 2.69 for bash 4.3-beta2.
|
||||
#
|
||||
# Report bugs to <bug-bash@gnu.org>.
|
||||
#
|
||||
@@ -581,8 +581,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bash'
|
||||
PACKAGE_TARNAME='bash'
|
||||
PACKAGE_VERSION='4.3-beta'
|
||||
PACKAGE_STRING='bash 4.3-beta'
|
||||
PACKAGE_VERSION='4.3-beta2'
|
||||
PACKAGE_STRING='bash 4.3-beta2'
|
||||
PACKAGE_BUGREPORT='bug-bash@gnu.org'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1393,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures bash 4.3-beta to adapt to many kinds of systems.
|
||||
\`configure' configures bash 4.3-beta2 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1458,7 +1458,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bash 4.3-beta:";;
|
||||
short | recursive ) echo "Configuration of bash 4.3-beta2:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1650,7 +1650,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bash configure 4.3-beta
|
||||
bash configure 4.3-beta2
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2359,7 +2359,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bash $as_me 4.3-beta, which was
|
||||
It was created by bash $as_me 4.3-beta2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2753,7 +2753,7 @@ ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
BASHVERS=4.3
|
||||
RELSTATUS=beta
|
||||
RELSTATUS=beta2
|
||||
|
||||
case "$RELSTATUS" in
|
||||
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
|
||||
@@ -16539,7 +16539,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by bash $as_me 4.3-beta, which was
|
||||
This file was extended by bash $as_me 4.3-beta2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -16605,7 +16605,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
bash config.status 4.3-beta
|
||||
bash config.status 4.3-beta2
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
AC_REVISION([for Bash 4.3, version 4.059])dnl
|
||||
|
||||
define(bashvers, 4.3)
|
||||
define(relstatus, beta)
|
||||
define(relstatus, beta2)
|
||||
|
||||
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
|
||||
|
||||
|
||||
+18
-19
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Sat Jul 13 13:32:19 EDT 2013
|
||||
.\" Last Change: Mon Sep 2 12:21:48 EDT 2013
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2013 July 13" "GNU Bash 4.3"
|
||||
.TH BASH 1 "2013 September 2" "GNU Bash 4.3"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -709,7 +709,8 @@ lexicographically using the current locale.
|
||||
.if n .sp 1
|
||||
When the \fB==\fP and \fB!=\fP operators are used, the string to the
|
||||
right of the operator is considered a pattern and matched according
|
||||
to the rules described below under \fBPattern Matching\fP.
|
||||
to the rules described below under \fBPattern Matching\fP,
|
||||
as if the \fBextglob\fP shell option were enabled.
|
||||
The \fB=\fP operator is equivalent to \fB==\fP.
|
||||
If the shell option
|
||||
.B nocasematch
|
||||
@@ -1360,8 +1361,12 @@ expands to the process ID of the current shell, not the
|
||||
subshell.
|
||||
.TP
|
||||
.B !
|
||||
Expands to the process ID of the most recently executed background
|
||||
(asynchronous) command.
|
||||
Expands to the process ID of the job most recently placed into the
|
||||
background, whether executed as an asynchronous command or using
|
||||
the \fBbg\fP builtin (see
|
||||
.SM
|
||||
.B "JOB CONTROL"
|
||||
below).
|
||||
.TP
|
||||
.B 0
|
||||
Expands to the name of the shell or shell script. This is set at
|
||||
@@ -2368,7 +2373,7 @@ The value of \fIp\fP determines whether or not the fraction is
|
||||
included.
|
||||
.IP
|
||||
If this variable is not set, \fBbash\fP acts as if it had the
|
||||
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\e\t%3lS\(aq\fP.
|
||||
value \fB$\(aq\enreal\et%3lR\enuser\et%3lU\ensys\ett%3lS\(aq\fP.
|
||||
If the value is null, no timing information is displayed.
|
||||
A trailing newline is added when the format string is displayed.
|
||||
.PD 0
|
||||
@@ -3190,7 +3195,8 @@ The shell treats each character of
|
||||
.SM
|
||||
.B IFS
|
||||
as a delimiter, and splits the results of the other
|
||||
expansions into words on these characters. If
|
||||
expansions into words using these characters as field terminators.
|
||||
If
|
||||
.SM
|
||||
.B IFS
|
||||
is unset, or its
|
||||
@@ -6371,7 +6377,7 @@ completion function would load completions dynamically:
|
||||
.br
|
||||
}
|
||||
.br
|
||||
complete -D -F _completion_loader
|
||||
complete -D -F _completion_loader -o bashdefault -o default
|
||||
.br
|
||||
\fP
|
||||
.SH HISTORY
|
||||
@@ -7565,8 +7571,8 @@ Without options, remove each
|
||||
from the table of active jobs.
|
||||
If
|
||||
.I jobspec
|
||||
is not present, and neither \fB\-a\fP nor \fB\-r\fP is supplied,
|
||||
the shell's notion of the \fIcurrent job\fP is used.
|
||||
is not present, and neither the \fB\-a\fP nor the \fB\-r\fP option
|
||||
is supplied, the \fIcurrent job\fP is used.
|
||||
If the \fB\-h\fP option is given, each
|
||||
.I jobspec
|
||||
is not removed from the table, but is marked so that
|
||||
@@ -7577,13 +7583,6 @@ is not sent to the job if the shell receives a
|
||||
.BR SIGHUP .
|
||||
If no
|
||||
.I jobspec
|
||||
is present, and neither the
|
||||
.B \-a
|
||||
nor the
|
||||
.B \-r
|
||||
option is supplied, the \fIcurrent job\fP is used.
|
||||
If no
|
||||
.I jobspec
|
||||
is supplied, the
|
||||
.B \-a
|
||||
option means to remove or mark all jobs; the
|
||||
@@ -10077,7 +10076,7 @@ subsequently reset. The exit status is true unless a
|
||||
.I name
|
||||
is readonly.
|
||||
.TP
|
||||
\fBwait\fP [\fB\--n\fP] [\fIn ...\fP]
|
||||
\fBwait\fP [\fB\-n\fP] [\fIn ...\fP]
|
||||
Wait for each specified child process and return its termination status.
|
||||
Each
|
||||
.I n
|
||||
@@ -10087,7 +10086,7 @@ in that job's pipeline are waited for. If
|
||||
.I n
|
||||
is not given, all currently active child processes
|
||||
are waited for, and the return status is zero.
|
||||
If the \fB\--n\fP option is supplied, \fBwait\fP waits for any job to
|
||||
If the \fB\-n\fP option is supplied, \fBwait\fP waits for any job to
|
||||
terminate and returns its exit status.
|
||||
If
|
||||
.I n
|
||||
|
||||
+225
-202
@@ -2,10 +2,10 @@ This is bashref.info, produced by makeinfo version 4.13 from
|
||||
/usr/homes/chet/src/bash/src/doc/bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 4.2, 2 March 2013).
|
||||
the Bash shell (version 4.3, 2 September 2013).
|
||||
|
||||
This is Edition 4.2, last updated 2 March 2013, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.2.
|
||||
This is Edition 4.3, last updated 2 September 2013, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.3.
|
||||
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
@@ -28,11 +28,11 @@ Bash Features
|
||||
*************
|
||||
|
||||
This text is a brief description of the features that are present in
|
||||
the Bash shell (version 4.2, 2 March 2013). The Bash home page is
|
||||
the Bash shell (version 4.3, 2 September 2013). The Bash home page is
|
||||
`http://www.gnu.org/software/bash/'.
|
||||
|
||||
This is Edition 4.2, last updated 2 March 2013, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.2.
|
||||
This is Edition 4.3, last updated 2 September 2013, of `The GNU Bash
|
||||
Reference Manual', for `Bash', Version 4.3.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
features that only appear in Bash. Some of the shells that Bash has
|
||||
@@ -572,10 +572,11 @@ the input of the next command. That is, each command reads the
|
||||
previous command's output. This connection is performed before any
|
||||
redirections specified by the command.
|
||||
|
||||
If `|&' is used, COMMAND1's standard output and standard error are
|
||||
connected to COMMAND2's standard input through the pipe; it is
|
||||
shorthand for `2>&1 |'. This implicit redirection of the standard
|
||||
error is performed after any redirections specified by the command.
|
||||
If `|&' is used, COMMAND1's standard error, in addition to its
|
||||
standard output, is connected to COMMAND2's standard input through the
|
||||
pipe; it is shorthand for `2>&1 |'. This implicit redirection of the
|
||||
standard error to the standard output is performed after any
|
||||
redirections specified by the command.
|
||||
|
||||
The reserved word `time' causes timing statistics to be printed for
|
||||
the pipeline once it finishes. The statistics currently consist of
|
||||
@@ -881,14 +882,15 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
|
||||
|
||||
When the `==' and `!=' operators are used, the string to the right
|
||||
of the operator is considered a pattern and matched according to
|
||||
the rules described below in *note Pattern Matching::. The `='
|
||||
operator is identical to `=='. If the shell option `nocasematch'
|
||||
(see the description of `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 rules described below in *note Pattern Matching::, as if the
|
||||
`extglob' shell option were enabled. The `=' operator is
|
||||
identical to `=='. If the shell option `nocasematch' (see the
|
||||
description of `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.
|
||||
|
||||
An additional binary operator, `=~', is available, with the same
|
||||
precedence as `==' and `!='. When it is used, the string to the
|
||||
@@ -1101,7 +1103,7 @@ option:
|
||||
|
||||
GNU Parallel can replace certain common idioms that operate on lines
|
||||
read from a file (in this case, filenames listed one per line):
|
||||
while read -r x; do
|
||||
while IFS= read -r x; do
|
||||
do-something1 "$x" "config-$x"
|
||||
do-something2 < "$x"
|
||||
done < file | process-output
|
||||
@@ -1385,8 +1387,9 @@ only be referenced; assignment to them is not allowed.
|
||||
expands to the process ID of the invoking shell, not the subshell.
|
||||
|
||||
`!'
|
||||
Expands to the process ID of the most recently executed background
|
||||
(asynchronous) command.
|
||||
Expands to the process ID of the job most recently placed into the
|
||||
background, whether executed as an asynchronous command or using
|
||||
the `bg' builtin (*note Job Control Builtins::).
|
||||
|
||||
`0'
|
||||
Expands to the name of the shell or shell script. This is set at
|
||||
@@ -1918,8 +1921,10 @@ expansion is:
|
||||
|
||||
The expression is treated as if it were within double quotes, but a
|
||||
double quote inside the parentheses is not treated specially. All
|
||||
tokens in the expression undergo parameter expansion, command
|
||||
substitution, and quote removal. Arithmetic expansions may be nested.
|
||||
tokens in the expression undergo parameter and variable expansion,
|
||||
command substitution, and quote removal. The result is treated as the
|
||||
arithmetic expression to be evaluated. Arithmetic expansions may be
|
||||
nested.
|
||||
|
||||
The evaluation is performed according to the rules listed below
|
||||
(*note Shell Arithmetic::). If the expression is invalid, Bash prints
|
||||
@@ -1962,19 +1967,20 @@ substitution, and arithmetic expansion that did not occur within double
|
||||
quotes for word splitting.
|
||||
|
||||
The shell treats each character of `$IFS' as a delimiter, and splits
|
||||
the results of the other expansions into words on these characters. If
|
||||
`IFS' is unset, or its value is exactly `<space><tab><newline>', the
|
||||
default, then sequences of ` <space>', `<tab>', and `<newline>' at the
|
||||
beginning and end of the results of the previous expansions are
|
||||
ignored, and any sequence of `IFS' characters not at the beginning or
|
||||
end serves to delimit words. If `IFS' has a value other than the
|
||||
default, then sequences of the whitespace characters `space' and `tab'
|
||||
are ignored at the beginning and end of the word, as long as the
|
||||
whitespace character is in the value of `IFS' (an `IFS' whitespace
|
||||
character). Any character in `IFS' that is not `IFS' whitespace, along
|
||||
with any adjacent `IFS' whitespace characters, delimits a field. A
|
||||
sequence of `IFS' whitespace characters is also treated as a delimiter.
|
||||
If the value of `IFS' is null, no word splitting occurs.
|
||||
the results of the other expansions into words using these characters
|
||||
as field terminators. If `IFS' is unset, or its value is exactly
|
||||
`<space><tab><newline>', the default, then sequences of ` <space>',
|
||||
`<tab>', and `<newline>' at the beginning and end of the results of the
|
||||
previous expansions are ignored, and any sequence of `IFS' characters
|
||||
not at the beginning or end serves to delimit words. If `IFS' has a
|
||||
value other than the default, then sequences of the whitespace
|
||||
characters `space' and `tab' are ignored at the beginning and end of the
|
||||
word, as long as the whitespace character is in the value of `IFS' (an
|
||||
`IFS' whitespace character). Any character in `IFS' that is not `IFS'
|
||||
whitespace, along with any adjacent `IFS' whitespace characters,
|
||||
delimits a field. A sequence of `IFS' whitespace characters is also
|
||||
treated as a delimiter. If the value of `IFS' is null, no word
|
||||
splitting occurs.
|
||||
|
||||
Explicit null arguments (`""' or `''') are retained. Unquoted
|
||||
implicit null arguments, resulting from the expansion of parameters
|
||||
@@ -3323,8 +3329,8 @@ POSIX standard.
|
||||
given, then display the values of variables instead.
|
||||
|
||||
The `-p' option will display the attributes and values of each
|
||||
NAME. When `-p' is used with NAME arguments, additional options
|
||||
are ignored.
|
||||
NAME. When `-p' is used with NAME arguments, additional options,
|
||||
other than `-f' and `-F', are ignored.
|
||||
|
||||
When `-p' is supplied without NAME arguments, `declare' will
|
||||
display the attributes and values of all variables having the
|
||||
@@ -3651,15 +3657,16 @@ POSIX standard.
|
||||
separators assigned to the last NAME. If there are fewer words
|
||||
read from the input stream than names, the remaining names are
|
||||
assigned empty values. The characters in the value of the `IFS'
|
||||
variable are used to split the line into words. The backslash
|
||||
character `\' may be used to remove any special meaning for the
|
||||
next character read and for line continuation. If no names are
|
||||
supplied, the line read is assigned to the variable `REPLY'. The
|
||||
return code is zero, unless end-of-file is encountered, `read'
|
||||
times out (in which case the return code is greater than 128), a
|
||||
variable assignment error (such as assigning to a readonly
|
||||
variable) occurs, or an invalid file descriptor is supplied as the
|
||||
argument to `-u'.
|
||||
variable are used to split the line into words using the same
|
||||
rules the shell uses for expansion (described above in *note Word
|
||||
Splitting::). The backslash character `\' may be used to remove
|
||||
any special meaning for the next character read and for line
|
||||
continuation. If no names are supplied, the line read is assigned
|
||||
to the variable `REPLY'. The return code is zero, unless
|
||||
end-of-file is encountered, `read' times out (in which case the
|
||||
return code is greater than 128), a variable assignment error
|
||||
(such as assigning to a readonly variable) occurs, or an invalid
|
||||
file descriptor is supplied as the argument to `-u'.
|
||||
|
||||
Options, if supplied, have the following meanings:
|
||||
|
||||
@@ -4178,11 +4185,14 @@ This builtin allows you to change additional shell optional behavior.
|
||||
`shopt'
|
||||
shopt [-pqsu] [-o] [OPTNAME ...]
|
||||
|
||||
Toggle the values of variables controlling optional shell behavior.
|
||||
With no options, or with the `-p' option, a list of all settable
|
||||
options is displayed, with an indication of whether or not each is
|
||||
set. The `-p' option causes output to be displayed in a form that
|
||||
may be reused as input. Other options have the following meanings:
|
||||
Toggle the values of settings controlling optional shell behavior.
|
||||
The settings can be either those listed below, or, if the `-o'
|
||||
option is used, those available with the `-o' option to the `set'
|
||||
builtin command (*note The Set Builtin::). With no options, or
|
||||
with the `-p' option, a list of all settable options is displayed,
|
||||
with an indication of whether or not each is set. The `-p' option
|
||||
causes output to be displayed in a form that may be reused as
|
||||
input. Other options have the following meanings:
|
||||
|
||||
`-s'
|
||||
Enable (set) each OPTNAME.
|
||||
@@ -4377,12 +4387,13 @@ This builtin allows you to change additional shell optional behavior.
|
||||
option is enabled by default.
|
||||
|
||||
`globasciiranges'
|
||||
If set, range expressions used in pattern matching (*note
|
||||
Pattern Matching::) behave as if in the traditional C locale
|
||||
when performing comparisons. That is, the current locale's
|
||||
collating sequence is not taken into account, so `b' will not
|
||||
collate between `A' and `B', and upper-case and lower-case
|
||||
ASCII characters will collate together.
|
||||
If set, range expressions used in pattern matching bracket
|
||||
expressions (*note Pattern Matching::) behave as if in the
|
||||
traditional C locale when performing comparisons. That is,
|
||||
the current locale's collating sequence is not taken into
|
||||
account, so `b' will not collate between `A' and `B', and
|
||||
upper-case and lower-case ASCII characters will collate
|
||||
together.
|
||||
|
||||
`globstar'
|
||||
If set, the pattern `**' used in a filename expansion context
|
||||
@@ -5481,8 +5492,8 @@ determines it is being run in this fashion, it reads and executes
|
||||
commands from `~/.bashrc', if that file exists and is readable. It
|
||||
will not do this if invoked as `sh'. The `--norc' option may be used
|
||||
to inhibit this behavior, and the `--rcfile' option may be used to
|
||||
force another file to be read, but `rshd' does not generally invoke the
|
||||
shell with those options or allow them to be specified.
|
||||
force another file to be read, but neither `rshd' nor `sshd' generally
|
||||
invoke the shell with those options or allow them to be specified.
|
||||
|
||||
Invoked with unequal effective and real UID/GIDs
|
||||
................................................
|
||||
@@ -5999,6 +6010,12 @@ element.
|
||||
An array variable is considered set if a subscript has been assigned
|
||||
a value. The null string is a valid value.
|
||||
|
||||
It is possible to obtain the keys (indices) of an array as well as
|
||||
the values. ${!NAME[@]} and ${!NAME[*]} expand to the indices assigned
|
||||
in array variable NAME. The treatment when in double quotes is similar
|
||||
to the expansion of the special parameters `@' and `*' within double
|
||||
quotes.
|
||||
|
||||
The `unset' builtin is used to destroy arrays. `unset
|
||||
NAME[SUBSCRIPT]' destroys the array element at index SUBSCRIPT.
|
||||
Negative subscripts to indexed arrays are interpreted as described
|
||||
@@ -6685,7 +6702,7 @@ File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables,
|
||||
occurs or an invalid option is encountered.
|
||||
|
||||
`wait'
|
||||
wait [JOBSPEC or PID ...]
|
||||
wait [-n] [JOBSPEC or PID ...]
|
||||
|
||||
Wait until the child process specified by each process ID PID or
|
||||
job specification JOBSPEC exits and return the exit status of the
|
||||
@@ -6704,9 +6721,9 @@ File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables,
|
||||
If the `-h' option is given, the job is not removed from the table,
|
||||
but is marked so that `SIGHUP' is not sent to the job if the shell
|
||||
receives a `SIGHUP'. If JOBSPEC is not present, and neither the
|
||||
`-a' nor `-r' option is supplied, the current job is used. If no
|
||||
JOBSPEC is supplied, the `-a' option means to remove or mark all
|
||||
jobs; the `-r' option without a JOBSPEC argument restricts
|
||||
`-a' nor the `-r' option is supplied, the current job is used. If
|
||||
no JOBSPEC is supplied, the `-a' option means to remove or mark
|
||||
all jobs; the `-r' option without a JOBSPEC argument restricts
|
||||
operation to running jobs.
|
||||
|
||||
`suspend'
|
||||
@@ -8381,7 +8398,7 @@ default completion function would load completions dynamically:
|
||||
{
|
||||
. "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
|
||||
}
|
||||
complete -D -F _completion_loader
|
||||
complete -D -F _completion_loader -o bashdefault -o default
|
||||
|
||||
|
||||
File: bashref.info, Node: Programmable Completion Builtins, Next: A Programmable Completion Example, Prev: Programmable Completion, Up: Command Line Editing
|
||||
@@ -9513,6 +9530,12 @@ unless the operating system does not provide the necessary support.
|
||||
Set the default value of the EXTGLOB shell option described above
|
||||
under *note The Shopt Builtin:: to be enabled.
|
||||
|
||||
`--enable-glob-asciirange-default'
|
||||
Set the default value of the GLOBASCIIRANGES shell option described
|
||||
above under *note The Shopt Builtin:: to be enabled. This
|
||||
controls the behavior of character ranges when used in pattern
|
||||
matching bracket expressions.
|
||||
|
||||
`--enable-help-builtin'
|
||||
Include the `help' builtin, which displays help on shell builtins
|
||||
and variables (*note Bash Builtins::).
|
||||
@@ -10572,7 +10595,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 196)
|
||||
* read: Bash Builtins. (line 473)
|
||||
* readarray: Bash Builtins. (line 559)
|
||||
* readarray: Bash Builtins. (line 560)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 206)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -10581,7 +10604,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 241)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 568)
|
||||
* source: Bash Builtins. (line 569)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 101)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -10590,12 +10613,12 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 330)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 336)
|
||||
* type: Bash Builtins. (line 573)
|
||||
* typeset: Bash Builtins. (line 605)
|
||||
* ulimit: Bash Builtins. (line 611)
|
||||
* type: Bash Builtins. (line 574)
|
||||
* typeset: Bash Builtins. (line 606)
|
||||
* ulimit: Bash Builtins. (line 612)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 385)
|
||||
* unalias: Bash Builtins. (line 702)
|
||||
* unalias: Bash Builtins. (line 703)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 403)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -10657,10 +10680,10 @@ D.3 Parameter and Variable Index
|
||||
* $: Special Parameters. (line 42)
|
||||
* *: Special Parameters. (line 9)
|
||||
* -: Special Parameters. (line 37)
|
||||
* 0: Special Parameters. (line 50)
|
||||
* 0: Special Parameters. (line 51)
|
||||
* ?: Special Parameters. (line 33)
|
||||
* @: Special Parameters. (line 19)
|
||||
* _: Special Parameters. (line 59)
|
||||
* _: Special Parameters. (line 60)
|
||||
* auto_resume: Job Control Variables.
|
||||
(line 6)
|
||||
* BASH: Bash Variables. (line 13)
|
||||
@@ -11110,134 +11133,134 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top924
|
||||
Node: Introduction2836
|
||||
Node: What is Bash?3064
|
||||
Node: What is a shell?4177
|
||||
Node: Definitions6716
|
||||
Node: Basic Shell Features9634
|
||||
Node: Shell Syntax10853
|
||||
Node: Shell Operation11883
|
||||
Node: Quoting13177
|
||||
Node: Escape Character14480
|
||||
Node: Single Quotes14965
|
||||
Node: Double Quotes15313
|
||||
Node: ANSI-C Quoting16438
|
||||
Node: Locale Translation17682
|
||||
Node: Comments18578
|
||||
Node: Shell Commands19196
|
||||
Node: Simple Commands20068
|
||||
Node: Pipelines20699
|
||||
Node: Lists23398
|
||||
Node: Compound Commands25127
|
||||
Node: Looping Constructs26133
|
||||
Node: Conditional Constructs28596
|
||||
Node: Command Grouping39474
|
||||
Node: Coprocesses40953
|
||||
Node: GNU Parallel42786
|
||||
Node: Shell Functions46767
|
||||
Node: Shell Parameters51851
|
||||
Node: Positional Parameters55980
|
||||
Node: Special Parameters56880
|
||||
Node: Shell Expansions59844
|
||||
Node: Brace Expansion61770
|
||||
Node: Tilde Expansion64551
|
||||
Node: Shell Parameter Expansion66900
|
||||
Node: Command Substitution79194
|
||||
Node: Arithmetic Expansion80527
|
||||
Node: Process Substitution81377
|
||||
Node: Word Splitting82427
|
||||
Node: Filename Expansion84050
|
||||
Node: Pattern Matching86215
|
||||
Node: Quote Removal89915
|
||||
Node: Redirections90210
|
||||
Node: Executing Commands99374
|
||||
Node: Simple Command Expansion100044
|
||||
Node: Command Search and Execution101974
|
||||
Node: Command Execution Environment104311
|
||||
Node: Environment107297
|
||||
Node: Exit Status108956
|
||||
Node: Signals110578
|
||||
Node: Shell Scripts112546
|
||||
Node: Shell Builtin Commands115064
|
||||
Node: Bourne Shell Builtins117092
|
||||
Node: Bash Builtins136868
|
||||
Node: Modifying Shell Behavior164195
|
||||
Node: The Set Builtin164540
|
||||
Node: The Shopt Builtin174866
|
||||
Node: Special Builtins189070
|
||||
Node: Shell Variables190049
|
||||
Node: Bourne Shell Variables190489
|
||||
Node: Bash Variables192520
|
||||
Node: Bash Features219395
|
||||
Node: Invoking Bash220294
|
||||
Node: Bash Startup Files226072
|
||||
Node: Interactive Shells231091
|
||||
Node: What is an Interactive Shell?231501
|
||||
Node: Is this Shell Interactive?232150
|
||||
Node: Interactive Shell Behavior232965
|
||||
Node: Bash Conditional Expressions236253
|
||||
Node: Shell Arithmetic240255
|
||||
Node: Aliases243031
|
||||
Node: Arrays245587
|
||||
Node: The Directory Stack250276
|
||||
Node: Directory Stack Builtins250995
|
||||
Node: Controlling the Prompt253951
|
||||
Node: The Restricted Shell256723
|
||||
Node: Bash POSIX Mode258560
|
||||
Node: Job Control267947
|
||||
Node: Job Control Basics268407
|
||||
Node: Job Control Builtins273126
|
||||
Node: Job Control Variables277588
|
||||
Node: Command Line Editing278746
|
||||
Node: Introduction and Notation280418
|
||||
Node: Readline Interaction282040
|
||||
Node: Readline Bare Essentials283231
|
||||
Node: Readline Movement Commands285020
|
||||
Node: Readline Killing Commands285985
|
||||
Node: Readline Arguments287905
|
||||
Node: Searching288949
|
||||
Node: Readline Init File291135
|
||||
Node: Readline Init File Syntax292282
|
||||
Node: Conditional Init Constructs309119
|
||||
Node: Sample Init File311652
|
||||
Node: Bindable Readline Commands314769
|
||||
Node: Commands For Moving315976
|
||||
Node: Commands For History317120
|
||||
Node: Commands For Text321305
|
||||
Node: Commands For Killing323978
|
||||
Node: Numeric Arguments326435
|
||||
Node: Commands For Completion327574
|
||||
Node: Keyboard Macros331766
|
||||
Node: Miscellaneous Commands332454
|
||||
Node: Readline vi Mode338260
|
||||
Node: Programmable Completion339167
|
||||
Node: Programmable Completion Builtins346417
|
||||
Node: A Programmable Completion Example356163
|
||||
Node: Using History Interactively361413
|
||||
Node: Bash History Facilities362097
|
||||
Node: Bash History Builtins365096
|
||||
Node: History Interaction369024
|
||||
Node: Event Designators371729
|
||||
Node: Word Designators372951
|
||||
Node: Modifiers374590
|
||||
Node: Installing Bash375994
|
||||
Node: Basic Installation377131
|
||||
Node: Compilers and Options379823
|
||||
Node: Compiling For Multiple Architectures380564
|
||||
Node: Installation Names382228
|
||||
Node: Specifying the System Type383046
|
||||
Node: Sharing Defaults383762
|
||||
Node: Operation Controls384435
|
||||
Node: Optional Features385393
|
||||
Node: Reporting Bugs395181
|
||||
Node: Major Differences From The Bourne Shell396379
|
||||
Node: GNU Free Documentation License413238
|
||||
Node: Indexes438434
|
||||
Node: Builtin Index438888
|
||||
Node: Reserved Word Index445715
|
||||
Node: Variable Index448163
|
||||
Node: Function Index461686
|
||||
Node: Concept Index468914
|
||||
Node: Top932
|
||||
Node: Introduction2852
|
||||
Node: What is Bash?3080
|
||||
Node: What is a shell?4193
|
||||
Node: Definitions6732
|
||||
Node: Basic Shell Features9650
|
||||
Node: Shell Syntax10869
|
||||
Node: Shell Operation11899
|
||||
Node: Quoting13193
|
||||
Node: Escape Character14496
|
||||
Node: Single Quotes14981
|
||||
Node: Double Quotes15329
|
||||
Node: ANSI-C Quoting16454
|
||||
Node: Locale Translation17698
|
||||
Node: Comments18594
|
||||
Node: Shell Commands19212
|
||||
Node: Simple Commands20084
|
||||
Node: Pipelines20715
|
||||
Node: Lists23453
|
||||
Node: Compound Commands25182
|
||||
Node: Looping Constructs26188
|
||||
Node: Conditional Constructs28651
|
||||
Node: Command Grouping39581
|
||||
Node: Coprocesses41060
|
||||
Node: GNU Parallel42893
|
||||
Node: Shell Functions46879
|
||||
Node: Shell Parameters51963
|
||||
Node: Positional Parameters56092
|
||||
Node: Special Parameters56992
|
||||
Node: Shell Expansions60051
|
||||
Node: Brace Expansion61977
|
||||
Node: Tilde Expansion64758
|
||||
Node: Shell Parameter Expansion67107
|
||||
Node: Command Substitution79401
|
||||
Node: Arithmetic Expansion80734
|
||||
Node: Process Substitution81666
|
||||
Node: Word Splitting82716
|
||||
Node: Filename Expansion84364
|
||||
Node: Pattern Matching86529
|
||||
Node: Quote Removal90229
|
||||
Node: Redirections90524
|
||||
Node: Executing Commands99688
|
||||
Node: Simple Command Expansion100358
|
||||
Node: Command Search and Execution102288
|
||||
Node: Command Execution Environment104625
|
||||
Node: Environment107611
|
||||
Node: Exit Status109270
|
||||
Node: Signals110892
|
||||
Node: Shell Scripts112860
|
||||
Node: Shell Builtin Commands115378
|
||||
Node: Bourne Shell Builtins117406
|
||||
Node: Bash Builtins137182
|
||||
Node: Modifying Shell Behavior164635
|
||||
Node: The Set Builtin164980
|
||||
Node: The Shopt Builtin175306
|
||||
Node: Special Builtins189727
|
||||
Node: Shell Variables190706
|
||||
Node: Bourne Shell Variables191146
|
||||
Node: Bash Variables193177
|
||||
Node: Bash Features220052
|
||||
Node: Invoking Bash220951
|
||||
Node: Bash Startup Files226729
|
||||
Node: Interactive Shells231758
|
||||
Node: What is an Interactive Shell?232168
|
||||
Node: Is this Shell Interactive?232817
|
||||
Node: Interactive Shell Behavior233632
|
||||
Node: Bash Conditional Expressions236920
|
||||
Node: Shell Arithmetic240922
|
||||
Node: Aliases243698
|
||||
Node: Arrays246254
|
||||
Node: The Directory Stack251235
|
||||
Node: Directory Stack Builtins251954
|
||||
Node: Controlling the Prompt254910
|
||||
Node: The Restricted Shell257682
|
||||
Node: Bash POSIX Mode259519
|
||||
Node: Job Control268906
|
||||
Node: Job Control Basics269366
|
||||
Node: Job Control Builtins274085
|
||||
Node: Job Control Variables278556
|
||||
Node: Command Line Editing279714
|
||||
Node: Introduction and Notation281386
|
||||
Node: Readline Interaction283008
|
||||
Node: Readline Bare Essentials284199
|
||||
Node: Readline Movement Commands285988
|
||||
Node: Readline Killing Commands286953
|
||||
Node: Readline Arguments288873
|
||||
Node: Searching289917
|
||||
Node: Readline Init File292103
|
||||
Node: Readline Init File Syntax293250
|
||||
Node: Conditional Init Constructs310087
|
||||
Node: Sample Init File312620
|
||||
Node: Bindable Readline Commands315737
|
||||
Node: Commands For Moving316944
|
||||
Node: Commands For History318088
|
||||
Node: Commands For Text322273
|
||||
Node: Commands For Killing324946
|
||||
Node: Numeric Arguments327403
|
||||
Node: Commands For Completion328542
|
||||
Node: Keyboard Macros332734
|
||||
Node: Miscellaneous Commands333422
|
||||
Node: Readline vi Mode339228
|
||||
Node: Programmable Completion340135
|
||||
Node: Programmable Completion Builtins347411
|
||||
Node: A Programmable Completion Example357157
|
||||
Node: Using History Interactively362407
|
||||
Node: Bash History Facilities363091
|
||||
Node: Bash History Builtins366090
|
||||
Node: History Interaction370018
|
||||
Node: Event Designators372723
|
||||
Node: Word Designators373945
|
||||
Node: Modifiers375584
|
||||
Node: Installing Bash376988
|
||||
Node: Basic Installation378125
|
||||
Node: Compilers and Options380817
|
||||
Node: Compiling For Multiple Architectures381558
|
||||
Node: Installation Names383222
|
||||
Node: Specifying the System Type384040
|
||||
Node: Sharing Defaults384756
|
||||
Node: Operation Controls385429
|
||||
Node: Optional Features386387
|
||||
Node: Reporting Bugs396451
|
||||
Node: Major Differences From The Bourne Shell397649
|
||||
Node: GNU Free Documentation License414508
|
||||
Node: Indexes439704
|
||||
Node: Builtin Index440158
|
||||
Node: Reserved Word Index446985
|
||||
Node: Variable Index449433
|
||||
Node: Function Index462956
|
||||
Node: Concept Index470184
|
||||
|
||||
End Tag Table
|
||||
|
||||
+10
-7
@@ -996,7 +996,8 @@ lexicographically using the current locale.
|
||||
|
||||
When the @samp{==} and @samp{!=} operators are used, the string to the
|
||||
right of the operator is considered a pattern and matched according
|
||||
to the rules described below in @ref{Pattern Matching}.
|
||||
to the rules described below in @ref{Pattern Matching},
|
||||
as if the @code{extglob} shell option were enabled.
|
||||
The @samp{=} operator is identical to @samp{==}.
|
||||
If the shell option @code{nocasematch}
|
||||
(see the description of @code{shopt} in @ref{The Shopt Builtin})
|
||||
@@ -1608,8 +1609,9 @@ Expands to the process @sc{id} of the shell. In a @code{()} subshell, it
|
||||
expands to the process @sc{id} of the invoking shell, not the subshell.
|
||||
|
||||
@item !
|
||||
Expands to the process @sc{id} of the most recently executed background
|
||||
(asynchronous) command.
|
||||
Expands to the process @sc{id} of the job most recently placed into the
|
||||
background, whether executed as an asynchronous command or using
|
||||
the @code{bg} builtin (@pxref{Job Control Builtins}).
|
||||
|
||||
@item 0
|
||||
Expands to the name of the shell or shell script. This is set at
|
||||
@@ -2266,7 +2268,8 @@ and arithmetic expansion that did not occur within double quotes for
|
||||
word splitting.
|
||||
|
||||
The shell treats each character of @env{$IFS} as a delimiter, and splits
|
||||
the results of the other expansions into words on these characters.
|
||||
the results of the other expansions into words using these characters
|
||||
as field terminators.
|
||||
If @env{IFS} is unset, or its value is exactly @code{<space><tab><newline>},
|
||||
the default, then sequences of
|
||||
@code{ <space>}, @code{<tab>}, and @code{<newline>}
|
||||
@@ -7585,7 +7588,7 @@ or non-zero if an error occurs or an invalid option is encountered.
|
||||
@item wait
|
||||
@btindex wait
|
||||
@example
|
||||
wait [@var{jobspec} or @var{pid} @dots{}]
|
||||
wait [-n] [@var{jobspec} or @var{pid} @dots{}]
|
||||
@end example
|
||||
|
||||
Wait until the child process specified by each process @sc{id} @var{pid}
|
||||
@@ -7610,8 +7613,8 @@ active jobs.
|
||||
If the @option{-h} option is given, the job is not removed from the table,
|
||||
but is marked so that @code{SIGHUP} is not sent to the job if the shell
|
||||
receives a @code{SIGHUP}.
|
||||
If @var{jobspec} is not present, and neither the @option{-a} nor @option{-r}
|
||||
option is supplied, the current job is used.
|
||||
If @var{jobspec} is not present, and neither the @option{-a} nor the
|
||||
@option{-r} option is supplied, the current job is used.
|
||||
If no @var{jobspec} is supplied, the @option{-a} option means to remove or
|
||||
mark all jobs; the @option{-r} option without a @var{jobspec}
|
||||
argument restricts operation to running jobs.
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Sat Jul 13 13:32:05 EDT 2013
|
||||
@set LASTCHANGE Mon Sep 2 12:21:28 EDT 2013
|
||||
|
||||
@set EDITION 4.3
|
||||
@set VERSION 4.3
|
||||
@set UPDATED 13 July 2013
|
||||
@set UPDATED-MONTH July 2013
|
||||
@set UPDATED 2 September 2013
|
||||
@set UPDATED-MONTH September 2013
|
||||
|
||||
+6
-2
@@ -3748,13 +3748,13 @@ fix_assignment_words (words)
|
||||
{
|
||||
WORD_LIST *w, *wcmd;
|
||||
struct builtin *b;
|
||||
int assoc, global, array;
|
||||
int assoc, global, array, integer;
|
||||
|
||||
if (words == 0)
|
||||
return;
|
||||
|
||||
b = 0;
|
||||
assoc = global = array = 0;
|
||||
assoc = global = array = integer = 0;
|
||||
|
||||
/* Skip over assignment statements preceding a command name */
|
||||
wcmd = words;
|
||||
@@ -3789,6 +3789,8 @@ fix_assignment_words (words)
|
||||
#endif
|
||||
if (global)
|
||||
w->word->flags |= W_ASSNGLOBAL;
|
||||
if (integer)
|
||||
w->word->flags |= W_ASSIGNINT;
|
||||
}
|
||||
#if defined (ARRAY_VARS)
|
||||
/* Note that we saw an associative array option to a builtin that takes
|
||||
@@ -3814,6 +3816,8 @@ fix_assignment_words (words)
|
||||
array = 1;
|
||||
if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'g'))
|
||||
global = 1;
|
||||
if ((wcmd->word->flags & W_ASSNBLTIN) && strchr (w->word->word+1, 'i'))
|
||||
integer = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-3
@@ -626,19 +626,32 @@ STRCOMPARE (p, pe, s, se)
|
||||
{
|
||||
int ret;
|
||||
CHAR c1, c2;
|
||||
int l1, l2;
|
||||
|
||||
l1 = pe - p;
|
||||
l2 = se - s;
|
||||
|
||||
if (l1 != l2)
|
||||
return (FNM_NOMATCH); /* unequal lengths, can't be identical */
|
||||
|
||||
c1 = *pe;
|
||||
c2 = *se;
|
||||
|
||||
*pe = *se = '\0';
|
||||
if (c1 != 0)
|
||||
*pe = '\0';
|
||||
if (c2 != 0)
|
||||
*se = '\0';
|
||||
|
||||
#if HAVE_MULTIBYTE || defined (HAVE_STRCOLL)
|
||||
ret = STRCOLL ((XCHAR *)p, (XCHAR *)s);
|
||||
#else
|
||||
ret = STRCMP ((XCHAR *)p, (XCHAR *)s);
|
||||
#endif
|
||||
|
||||
*pe = c1;
|
||||
*se = c2;
|
||||
if (c1 != 0)
|
||||
*pe = c1;
|
||||
if (c2 != 0)
|
||||
*se = c2;
|
||||
|
||||
return (ret == 0 ? ret : FNM_NOMATCH);
|
||||
}
|
||||
|
||||
@@ -1539,12 +1539,21 @@ The default value of @code{rl_catch_signals} is 1.
|
||||
@end deftypevar
|
||||
|
||||
@deftypevar int rl_catch_sigwinch
|
||||
If this variable is non-zero, Readline will install a signal handler for
|
||||
@code{SIGWINCH}.
|
||||
If this variable is set to a non-zero value,
|
||||
Readline will install a signal handler for @code{SIGWINCH}.
|
||||
|
||||
The default value of @code{rl_catch_sigwinch} is 1.
|
||||
@end deftypevar
|
||||
|
||||
@deftypevar int rl_change_environment
|
||||
If this variable is set to a non-zero value,
|
||||
and Readline is handling @code{SIGWINCH}, Readline will modify the
|
||||
@var{LINES} and @var{COLUMNS} environment variables upon receipt of a
|
||||
@code{SIGWINCH}
|
||||
|
||||
The default value of @code{rl_change_environment} is 1.
|
||||
@end deftypevar
|
||||
|
||||
If an application does not wish to have Readline catch any signals, or
|
||||
to handle signals other than those Readline catches (@code{SIGHUP},
|
||||
for example),
|
||||
|
||||
@@ -1833,7 +1833,7 @@ _completion_loader()
|
||||
@{
|
||||
. "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
|
||||
@}
|
||||
complete -D -F _completion_loader
|
||||
complete -D -F _completion_loader -o bashdefault -o default
|
||||
@end example
|
||||
|
||||
@node Programmable Completion Builtins
|
||||
|
||||
@@ -113,6 +113,12 @@ _rl_any_typein ()
|
||||
return any_typein;
|
||||
}
|
||||
|
||||
int
|
||||
_rl_pushed_input_available ()
|
||||
{
|
||||
return (push_index != pop_index);
|
||||
}
|
||||
|
||||
/* Return the amount of space available in the buffer for stuffing
|
||||
characters. */
|
||||
static int
|
||||
@@ -163,12 +169,6 @@ _rl_unget_char (key)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
_rl_pushed_input_available ()
|
||||
{
|
||||
return (push_index != pop_index);
|
||||
}
|
||||
|
||||
/* If a character is available to be read, then read it and stuff it into
|
||||
IBUFFER. Otherwise, just return. Returns number of characters read
|
||||
(0 if none available) and -1 on error (EIO). */
|
||||
|
||||
+16
-9
@@ -156,16 +156,16 @@ rl_forward_search_history (sign, key)
|
||||
WHERE is the history list number of the current line. If it is
|
||||
-1, then this line is the starting one. */
|
||||
static void
|
||||
rl_display_search (search_string, reverse_p, where)
|
||||
rl_display_search (search_string, flags, where)
|
||||
char *search_string;
|
||||
int reverse_p, where;
|
||||
int flags, where;
|
||||
{
|
||||
char *message;
|
||||
int msglen, searchlen;
|
||||
|
||||
searchlen = (search_string && *search_string) ? strlen (search_string) : 0;
|
||||
|
||||
message = (char *)xmalloc (searchlen + 33);
|
||||
message = (char *)xmalloc (searchlen + 64);
|
||||
msglen = 0;
|
||||
|
||||
#if defined (NOTDEF)
|
||||
@@ -178,7 +178,13 @@ rl_display_search (search_string, reverse_p, where)
|
||||
|
||||
message[msglen++] = '(';
|
||||
|
||||
if (reverse_p)
|
||||
if (flags & SF_FAILED)
|
||||
{
|
||||
strcpy (message + msglen, "failed ");
|
||||
msglen += 7;
|
||||
}
|
||||
|
||||
if (flags & SF_REVERSE)
|
||||
{
|
||||
strcpy (message + msglen, "reverse-");
|
||||
msglen += 8;
|
||||
@@ -352,7 +358,7 @@ _rl_isearch_dispatch (cxt, c)
|
||||
{
|
||||
/* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued
|
||||
takes microseconds, so multiply by 1000. If we don't get any
|
||||
additional input and we this keymap shadows another function, process
|
||||
additional input and this keymap shadows another function, process
|
||||
that key as if it was all we read. */
|
||||
if (_rl_keyseq_timeout > 0 &&
|
||||
RL_ISSTATE (RL_STATE_CALLBACK) == 0 &&
|
||||
@@ -477,7 +483,7 @@ add_character:
|
||||
XXX - since _rl_input_available depends on the application-
|
||||
settable keyboard timeout value, this could alternatively
|
||||
use _rl_input_queued(100000) */
|
||||
if (cxt->lastc == ESC && _rl_input_available ())
|
||||
if (cxt->lastc == ESC && (_rl_pushed_input_available () || _rl_input_available ()))
|
||||
rl_execute_next (ESC);
|
||||
return (0);
|
||||
}
|
||||
@@ -517,7 +523,7 @@ add_character:
|
||||
cxt->search_string = (char *)xrealloc (cxt->search_string, cxt->search_string_size);
|
||||
strcpy (cxt->search_string, last_isearch_string);
|
||||
cxt->search_string_index = last_isearch_string_len;
|
||||
rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1);
|
||||
rl_display_search (cxt->search_string, cxt->sflags, -1);
|
||||
break;
|
||||
}
|
||||
return (1);
|
||||
@@ -691,6 +697,7 @@ add_character:
|
||||
/* We cannot find the search string. Ding the bell. */
|
||||
rl_ding ();
|
||||
cxt->history_pos = cxt->last_found_line;
|
||||
rl_display_search (cxt->search_string, cxt->sflags, (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -703,7 +710,7 @@ add_character:
|
||||
rl_replace_line (cxt->lines[cxt->history_pos], 0);
|
||||
rl_point = cxt->sline_index;
|
||||
cxt->last_found_line = cxt->history_pos;
|
||||
rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos);
|
||||
rl_display_search (cxt->search_string, cxt->sflags, (cxt->history_pos == cxt->save_line) ? -1 : cxt->history_pos);
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -738,7 +745,7 @@ rl_search_history (direction, invoking_key)
|
||||
RL_SETSTATE(RL_STATE_ISEARCH);
|
||||
cxt = _rl_isearch_init (direction);
|
||||
|
||||
rl_display_search (cxt->search_string, (cxt->sflags & SF_REVERSE), -1);
|
||||
rl_display_search (cxt->search_string, cxt->sflags, -1);
|
||||
|
||||
/* If we are using the callback interface, all we do is set up here and
|
||||
return. The key is that we leave RL_STATE_ISEARCH set. */
|
||||
|
||||
+12
-2
@@ -1,7 +1,7 @@
|
||||
/* readline.c -- a general facility for reading lines of input
|
||||
with emacs style editing and completion. */
|
||||
|
||||
/* Copyright (C) 1987-2012 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU Readline Library (Readline), a library
|
||||
for reading lines of text with interactive input and history editing.
|
||||
@@ -1249,7 +1249,17 @@ bind_arrow_keys_internal (map)
|
||||
rl_bind_keyseq_if_unbound ("\340G", rl_beg_of_line);
|
||||
rl_bind_keyseq_if_unbound ("\340O", rl_end_of_line);
|
||||
rl_bind_keyseq_if_unbound ("\340S", rl_delete);
|
||||
rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode);
|
||||
rl_bind_keyseq_if_unbound ("\340R", rl_overwrite_mode);
|
||||
|
||||
/* These may or may not work because of the embedded NUL. */
|
||||
rl_bind_keyseq_if_unbound ("\\000H", rl_get_previous_history);
|
||||
rl_bind_keyseq_if_unbound ("\\000P", rl_get_next_history);
|
||||
rl_bind_keyseq_if_unbound ("\\000M", rl_forward_char);
|
||||
rl_bind_keyseq_if_unbound ("\\000K", rl_backward_char);
|
||||
rl_bind_keyseq_if_unbound ("\\000G", rl_beg_of_line);
|
||||
rl_bind_keyseq_if_unbound ("\\000O", rl_end_of_line);
|
||||
rl_bind_keyseq_if_unbound ("\\000S", rl_delete);
|
||||
rl_bind_keyseq_if_unbound ("\\000R", rl_overwrite_mode);
|
||||
#endif
|
||||
|
||||
_rl_keymap = xkeymap;
|
||||
|
||||
@@ -617,6 +617,10 @@ extern int rl_catch_signals;
|
||||
to do that. */
|
||||
extern int rl_catch_sigwinch;
|
||||
|
||||
/* If non-zero, the readline SIGWINCH handler will modify LINES and
|
||||
COLUMNS in the environment. */
|
||||
extern int rl_change_environment;
|
||||
|
||||
/* Completion variables. */
|
||||
/* Pointer to the generator function for completion_matches ().
|
||||
NULL means to use rl_filename_completion_function (), the default
|
||||
|
||||
@@ -79,8 +79,8 @@ extern char *strchr (), *strrchr ();
|
||||
#define _rl_stricmp strcasecmp
|
||||
#define _rl_strnicmp strncasecmp
|
||||
#else
|
||||
extern int _rl_stricmp PARAMS((char *, char *));
|
||||
extern int _rl_strnicmp PARAMS((char *, char *, int));
|
||||
extern int _rl_stricmp PARAMS((const char *, const char *));
|
||||
extern int _rl_strnicmp PARAMS((const char *, const char *, int));
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_STRPBRK) && !defined (HAVE_MULTIBYTE)
|
||||
|
||||
@@ -121,7 +121,7 @@ static int set_tty_settings PARAMS((int, TIOTYPE *));
|
||||
|
||||
static void prepare_terminal_settings PARAMS((int, TIOTYPE, TIOTYPE *));
|
||||
|
||||
static void set_special_char PARAMS((Keymap, TIOTYPE *, int, rl_command_func_t));
|
||||
static void set_special_char PARAMS((Keymap, TIOTYPE *, int, rl_command_func_t *));
|
||||
|
||||
static void
|
||||
save_tty_chars (tiop)
|
||||
@@ -341,7 +341,7 @@ static int set_tty_settings PARAMS((int, TIOTYPE *));
|
||||
|
||||
static void prepare_terminal_settings PARAMS((int, TIOTYPE, TIOTYPE *));
|
||||
|
||||
static void set_special_char PARAMS((Keymap, TIOTYPE *, int, rl_command_func_t));
|
||||
static void set_special_char PARAMS((Keymap, TIOTYPE *, int, rl_command_func_t *));
|
||||
static void _rl_bind_tty_special_chars PARAMS((Keymap, TIOTYPE));
|
||||
|
||||
#if defined (FLUSHO)
|
||||
|
||||
@@ -81,11 +81,15 @@ static void _win_get_screensize PARAMS((int *, int *));
|
||||
static void _emx_get_screensize PARAMS((int *, int *));
|
||||
#endif
|
||||
|
||||
/* If the calling application sets this to a non-zero value, readline will
|
||||
use the $LINES and $COLUMNS environment variables to set its idea of the
|
||||
window size before interrogating the kernel. */
|
||||
/* If the calling application sets this to a non-zero value, readline will
|
||||
use the $LINES and $COLUMNS environment variables to set its idea of the
|
||||
window size before interrogating the kernel. */
|
||||
int rl_prefer_env_winsize = 0;
|
||||
|
||||
/* If this is non-zero, readline will set LINES and COLUMNS in the
|
||||
environment when it handles SIGWINCH. */
|
||||
int rl_change_environment = 1;
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Terminal and Termcap */
|
||||
@@ -305,7 +309,8 @@ _rl_get_screen_size (tty, ignore_env)
|
||||
/* If we're being compiled as part of bash, set the environment
|
||||
variables $LINES and $COLUMNS to new values. Otherwise, just
|
||||
do a pair of putenv () or setenv () calls. */
|
||||
sh_set_lines_and_columns (_rl_screenheight, _rl_screenwidth);
|
||||
if (rl_change_environment)
|
||||
sh_set_lines_and_columns (_rl_screenheight, _rl_screenwidth);
|
||||
|
||||
if (_rl_term_autowrap == 0)
|
||||
_rl_screenwidth--;
|
||||
|
||||
+1
-1
@@ -826,7 +826,7 @@ _rl_insert_char (count, c)
|
||||
pending characters that are bound to rl_insert, and insert
|
||||
them all. Don't do this if we're current reading input from
|
||||
a macro. */
|
||||
if ((RL_ISSTATE (RL_STATE_MACROINPUT) == 0) && _rl_any_typein ())
|
||||
if ((RL_ISSTATE (RL_STATE_MACROINPUT) == 0) && _rl_pushed_input_available ())
|
||||
_rl_insert_typein (c);
|
||||
else
|
||||
{
|
||||
|
||||
+11
-7
@@ -373,11 +373,13 @@ _rl_strpbrk (string1, string2)
|
||||
doesn't matter (strncasecmp). */
|
||||
int
|
||||
_rl_strnicmp (string1, string2, count)
|
||||
char *string1, *string2;
|
||||
const char *string1;
|
||||
const char *string2;
|
||||
int count;
|
||||
{
|
||||
register char *s1, *s2;
|
||||
int d;
|
||||
register const char *s1;
|
||||
register const char *s2;
|
||||
register int d;
|
||||
|
||||
if (count <= 0 || (string1 == string2))
|
||||
return 0;
|
||||
@@ -393,7 +395,7 @@ _rl_strnicmp (string1, string2, count)
|
||||
break;
|
||||
s2++;
|
||||
}
|
||||
while (--count != 0)
|
||||
while (--count != 0);
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -401,10 +403,12 @@ _rl_strnicmp (string1, string2, count)
|
||||
/* strcmp (), but caseless (strcasecmp). */
|
||||
int
|
||||
_rl_stricmp (string1, string2)
|
||||
char *string1, *string2;
|
||||
const char *string1;
|
||||
const char *string2;
|
||||
{
|
||||
register char *s1, *s2;
|
||||
int d;
|
||||
register const char *s1;
|
||||
register const char *s2;
|
||||
register int d;
|
||||
|
||||
s1 = string1;
|
||||
s2 = string2;
|
||||
|
||||
+2
-1
@@ -744,7 +744,8 @@ pcomp_filename_completion_function (text, state)
|
||||
(rl_completion_found_quote == 0). */
|
||||
iscompgen = this_shell_builtin == compgen_builtin;
|
||||
iscompleting = RL_ISSTATE (RL_STATE_COMPLETING);
|
||||
if (iscompgen && iscompleting == 0 && rl_completion_found_quote == 0)
|
||||
if (iscompgen && iscompleting == 0 && rl_completion_found_quote == 0
|
||||
&& rl_filename_dequoting_function)
|
||||
{
|
||||
/* Use rl_completion_quote_character because any single or
|
||||
double quotes have been removed by the time TEXT makes it
|
||||
|
||||
+172
-160
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+195
-181
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+181
-167
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+172
-161
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user