mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-27 23:53:18 +02:00
bash-5.1 beta release
This commit is contained in:
@@ -1,3 +1,94 @@
|
||||
This document details the changes between this version, bash-5.1-beta, and
|
||||
the previous version, bash-5.1-alpha.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed a bug that caused name references to variables to not update the
|
||||
referenced variable's assignment side effects.
|
||||
|
||||
b. Tightened up the parameter transformation error checking for invalid
|
||||
transformation operators.
|
||||
|
||||
c. System-specific changes for: FreeBSD
|
||||
|
||||
d. A few minor changes to move potential uses of stdio functions out of signal
|
||||
handling paths.
|
||||
|
||||
e. Make sure SIGCHLD is blocked in all cases where waitchld() is not called
|
||||
from a signal handler.
|
||||
|
||||
f. Changed `command' builtin processing so it no longer starts an extra process
|
||||
when run asynchronously (command x &).
|
||||
|
||||
g. Avoid performing tilde expansion after `:' in words that look like assignment
|
||||
statements when in posix mode.
|
||||
|
||||
h. Slight changes to how the `complete' builtin prints out options and actions
|
||||
for completion specifications.
|
||||
|
||||
i. Several changes to how `local -' restores the values of options and
|
||||
$SHELLOPTS.
|
||||
|
||||
j. Don't treat a word in a compound assignment as an assignment statement
|
||||
unless it has a valid subscript before the `='.
|
||||
|
||||
k. Fixed a bug with the DEBUG trap and process substitution that caused the
|
||||
terminal's process group to be set incorrectly.
|
||||
|
||||
l. Fixed a bug that left readline's signal handlers installed while running a
|
||||
shell command from a bindable readline command.
|
||||
|
||||
m. Fixed the `fc' builtin to clamp out of range history specifications at the
|
||||
boundaries of the history list for POSIX conformance.
|
||||
|
||||
n. Fixed a bug that caused ${foo@a} to treat foo as an unset variable if it
|
||||
was an array without a value for subscript 0/"0" but had other set
|
||||
elements.
|
||||
|
||||
o. Fixed a bug that caused the history code to attempt to parse command
|
||||
substitutions looking for shell comments before adding them to the history,
|
||||
even while parsing here-documents.
|
||||
|
||||
p. Fixed a bug that could cause a syntax error in a command read by `eval' to
|
||||
exit an interactive shell.
|
||||
|
||||
2. New Features in Bash
|
||||
|
||||
a. If the hash builtin is listing hashed filenames portably, don't print
|
||||
anything if the table is empty.
|
||||
|
||||
b. GLOBIGNORE now ignores `.' and `..' as a terminal pathname component.
|
||||
|
||||
c. Bash attempts to optimize away forks in the last command in a function body
|
||||
under appropriate circumstances.
|
||||
|
||||
d. The globbing code now uses fnmatch(3) to check collation elements (if
|
||||
available) even in cases without multibyte characters.
|
||||
|
||||
e. The `fg' and `bg' builtins now return an error in a command substitution
|
||||
when asked to restart a job inherited from the parent shell.
|
||||
|
||||
f. The shell now attempts to unlink all FIFOs on exit, whether a consuming
|
||||
process has finished with them or not.
|
||||
|
||||
3. Changes to Readline
|
||||
|
||||
a. Make sure that all undo groups are closed when leaving vi insertion mode.
|
||||
|
||||
b. Make sure that the vi-mode `C' and `c' commands enter insert mode even if
|
||||
the motion command doesn't have any effect.
|
||||
|
||||
c. Fixed several potential memory leaks in the callback mode context handling.
|
||||
|
||||
d. If readline is handling a SIGTTOU, make sure SIGTTOU is blocked while
|
||||
executing the terminal cleanup code, since it's no longer run in a signal
|
||||
handling context.
|
||||
|
||||
4. New Features in Readline
|
||||
|
||||
a. The signal cleanup code now blocks SIGINT while processing after a SIGINT.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
This document details the changes between this version, bash-5.1-alpha, and
|
||||
the previous version, bash-5.0-release.
|
||||
|
||||
@@ -304,6 +395,10 @@ q. Readline now behaves better when operate-and-get-next is used when the
|
||||
r. Fixed a bug that could cause vi redo (`.') of a replace command not to work
|
||||
correctly in the C or POSIX locale.
|
||||
|
||||
s. Fixed a bug with vi-mode digit arguments that caused the last command to be
|
||||
set incorrectly. This prevents yank-last-arg from working as intended, for
|
||||
example.
|
||||
|
||||
3. New Features in Bash
|
||||
|
||||
a. `bind -x' now supports different bindings for different editing modes and
|
||||
@@ -396,8 +491,8 @@ dd. New `U', `u', and `L' parameter transformations to convert to uppercase,
|
||||
convert first character to uppercase, and convert to lowercase,
|
||||
respectively.
|
||||
|
||||
ee. PROMPT_COMMANDS: a new array variable, each element of which can contain a
|
||||
command to be executed like PROMPT_COMMAND.
|
||||
ee. PROMPT_COMMAND: can now be an array variable, each element of which can
|
||||
contain a command to be executed like a string PROMPT_COMMAND variable.
|
||||
|
||||
ff. `ulimit' has a -R option to report and set the RLIMIT_RTTIME resource.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ Compatibility with previous versions
|
||||
====================================
|
||||
|
||||
This document details the incompatibilities between this version of bash,
|
||||
bash-5.1, and the previous widely-available versions, bash-3.x (which is
|
||||
bash-5.1, and the previous widely-available versions, bash-3.2 (which is
|
||||
still the `standard' version for Mac OS X), 4.2/4.3 (which are still
|
||||
standard on a few Linux distributions), and bash-4.4/bash-5.0, the current
|
||||
widely-available versions. These were discovered by users of bash-2.x
|
||||
@@ -538,6 +538,11 @@ compat50 (set using BASH_COMPAT)
|
||||
lower, it reverts to the method from bash-5.0 and previous versions,
|
||||
so seeding the random number generator by assigning a value to
|
||||
RANDOM will produce the same sequence as in bash-5.0
|
||||
- If the command hash table is empty, bash versions prior to bash-5.1
|
||||
printed an informational message to that effect even when writing
|
||||
output in a format that can be reused as input (-l). Bash-5.1
|
||||
suppresses that message if -l is supplied
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
+428
-3
@@ -8429,10 +8429,10 @@ lib/readline/kill.c
|
||||
fix for bug reported by Phi Debian <phi.debian@gmail.com>
|
||||
|
||||
lib/readline/vi_mode.c
|
||||
- _rl_vi_change_char: make sure _rl_vi_last_replacement gets filled in
|
||||
- rl_vi_change_char: make sure _rl_vi_last_replacement gets filled in
|
||||
in the case where MB_CUR_MAX == 1. Rest of fix for bug reported by
|
||||
Phi Debian <phi.debian@gmail.com>
|
||||
- rl_vi_change_char: same fix for _rl_vi_last_replacement
|
||||
- _rl_vi_callback_change_char: same fix for _rl_vi_last_replacement
|
||||
|
||||
5/29
|
||||
----
|
||||
@@ -8538,7 +8538,7 @@ doc/{bash.1,bashref.texi}
|
||||
configure.ac
|
||||
- if CFLAGS is not supplied in the environment or on the command line,
|
||||
add the gcc options that suppress warnings about parens and print
|
||||
formats in a slightly different way, that will avoid some collisions
|
||||
formats in a slightly different way that will avoid some collisions
|
||||
|
||||
lib/readline/readline.c
|
||||
- _rl_dispatch_subseq: don't set rl_last_func to rl_vi_arg_digit, just
|
||||
@@ -8552,3 +8552,428 @@ lib/readline/vi_mode.c
|
||||
it needs to use it later
|
||||
- rl_vi_redo: suppress attempts to redo `.' when the current keymap is
|
||||
vi_movement_keymap, since that will recursively call vi_redo
|
||||
|
||||
6/11
|
||||
----
|
||||
redir.c
|
||||
- limit HEREDOC_PIPESIZE to 4096 on FreeBSD; that is where it can
|
||||
handle atomic writes without hanging. Tested on FreeBSD 13
|
||||
|
||||
[bash-5.1-alpha frozen]
|
||||
|
||||
6/15
|
||||
----
|
||||
subst.c
|
||||
- do_assignment_internal: call stupidly_hack_special_variables on the
|
||||
name returned from the variable assignment, in case there was a
|
||||
nameref expansion, and on the original name only if the assignment
|
||||
returned NULL. Fixes bug reported by James D. Lin <jamesdlin@gmail.com>
|
||||
|
||||
6/16
|
||||
----
|
||||
builtins/hash.def
|
||||
- hash_builtin: don't print anything if the hash table is empty when
|
||||
listing portably (-l) unless the shell compatibility level is <= 50
|
||||
Issue originally raised by <beluro@web.de>
|
||||
|
||||
6/17
|
||||
----
|
||||
pathexp.c
|
||||
- glob_name_is_acceptable: extend GLOBIGNORE to ignore `.' and `..'
|
||||
as a terminal pathname component instead of just ignoring filenames
|
||||
that are `.' or `..'. From a suggestion by Ilkka Virta
|
||||
<itvirta@iki.fi>
|
||||
|
||||
6/18
|
||||
----
|
||||
po/Makefile.in.in
|
||||
- MKINSTALLDIRS: deprecated, no longer in AM_INTL_SUBDIR, so we have
|
||||
to create the variable manually
|
||||
|
||||
lib/readline/doc/rltech.texi
|
||||
- add descriptions of the active mark functions that are available to
|
||||
applications. I guess they will remain public
|
||||
|
||||
subst.c
|
||||
- valid_parameter_transform: new function, reject transformations
|
||||
longer than a single character or invalid transformation operators
|
||||
- parameter_brace_transform: call valid_parameter_transform
|
||||
|
||||
6/22
|
||||
----
|
||||
lib/sh/zread.c
|
||||
- lbuf: bump size up to ZBUFSIZ (default 4096). From a report by
|
||||
Jason A. Donenfeld <Jason@zx2c4.com>
|
||||
|
||||
lib/sh/zcatfd.c
|
||||
- zcatfd: lbuf: bump size up to ZBUFSIZ (default 4096)
|
||||
|
||||
lib/sh/zmapfd.c
|
||||
- zmapfd: lbuf: bump size up to ZBUFSIZ (default 4096)
|
||||
|
||||
6/29
|
||||
----
|
||||
aclocal.m4
|
||||
- BASH_FUNC_SBRK: changes for cross-compiling on FreeBSD variants,
|
||||
from Jessica Clarke <jrtc27@jrtc27.com>
|
||||
|
||||
xmalloc.c
|
||||
- HAVE_SBRK: use #if instead of #ifdef so we only use it if we think
|
||||
it works
|
||||
|
||||
examples/loadables/finfo.c
|
||||
- st_dev,st_nlink: cast to unsigned long, report from Jessica Clarke
|
||||
<jrtc27@jrtc27.com>
|
||||
|
||||
unwind_prot.c
|
||||
- unwind_protect_mem_internal: make sure we allocate at least as many
|
||||
bytes for an entire UNWIND_ELT. Fix from Jessica Clarke
|
||||
<jrtc27@jrtc27.com>
|
||||
|
||||
7/1
|
||||
---
|
||||
eval.c
|
||||
- alrm_catcher: use write(2) instead of fprintf to print the
|
||||
auto-logout message to the terminal
|
||||
|
||||
jobs.c
|
||||
- UNQUEUE_SIGCHLD: set queue_sigchld to 1 around call to waitchld(),
|
||||
since it is not being called from a signal handler and so SIGCHLD is
|
||||
not blocked. Fixes report by Godmar Back <godmar@gmail.com>
|
||||
|
||||
7/2
|
||||
---
|
||||
doc/{bash.1,bashref.texi}
|
||||
- read: clarify that without any name arguments, the line assigned to
|
||||
REPLY is not modified. From a question by M. Nejat AYDIN
|
||||
<mnaydin@yahoo.com> with input from Eli Schwartz
|
||||
<eschwartz@archlinux.org>
|
||||
|
||||
7/5
|
||||
---
|
||||
lib/readline/vi_mode.c
|
||||
- _rl_vi_done_inserting: make sure to close out all undo groups when
|
||||
leaving insert mode, so we don't have anything dangling.
|
||||
Report and fix from David Fries <David@Fries.net>
|
||||
|
||||
7/6
|
||||
---
|
||||
lib/readline/vi_mode.c
|
||||
- _rl_vi_domove_motion_cleanup: the `c' and `C' commands should enter
|
||||
insert mode even if the motion command doesn't delete any text.
|
||||
From a report by David Fries <David@Fries.net>
|
||||
- _rl_vi_done_inserting: add a missing rl_end_undo_group when
|
||||
_rl_vi_doing_insert is set: there should be one begun by
|
||||
rl_vi_start_inserting and one begun by the command (change or replace).
|
||||
From a report by David Fries <David@Fries.net>
|
||||
- rl_vi_replace: set _rl_vi_last_key_before_insert to 'R' explicitly,
|
||||
since other code checks that and we want to allow users to rebind
|
||||
this function
|
||||
|
||||
7/7
|
||||
---
|
||||
lib/readline/vi_mode.c
|
||||
- rl_vi_{delete,change,yank}_to: if we have a non-null _rl_vimvcxt,
|
||||
just reinitialize it so we don't have to allocate a new one. This is
|
||||
a change primarily for callback mode, and fixes a memory leak
|
||||
|
||||
builtins/evalstring.c
|
||||
- optimize_shell_function: try to optimize away the fork in the last
|
||||
command in a shell function body, under certain conditions
|
||||
|
||||
execute_cmd.c
|
||||
- execute_function: attempt to optimize away forks in a shell function
|
||||
that is already marked NO_FORK and being executed in a command
|
||||
substitution
|
||||
|
||||
7/8
|
||||
---
|
||||
{jobs,nojobs,trap,unwind_prot}.c,lib/malloc/{malloc,table}.c
|
||||
- interrupt_immediately: remove, no longer used
|
||||
|
||||
jobs.c
|
||||
- waitchld: don't perform asynchronous notification if we are currently
|
||||
executing a builtin (executing_builtin != 0). Inspired by a report
|
||||
from Godmar Back <godmar@gmail.com>
|
||||
|
||||
7/9
|
||||
---
|
||||
lib/readline/signals.c
|
||||
- _rl_handle_signal: block SIGTTOU while handling a SIGTTOU, since we
|
||||
no longer run this in a signal handling context where SIGTTOIU would
|
||||
be blocked
|
||||
|
||||
7/14
|
||||
----
|
||||
execute_cmd.c
|
||||
- execute_simple_command: use new variable `cmdflags' instead of using
|
||||
simple_command->flags directly; initialize from simple_command->flags
|
||||
- check_command_builtin: take a simple command list of words starting
|
||||
with `command' and including a command_word argument, and peel off
|
||||
the `command' and any instances of `-p' and `--' and return the
|
||||
updated list
|
||||
- execute_simple_command: if the first word of the simple command is
|
||||
`command', call check_command_builtin to peel off any `command' and
|
||||
`-p' and `--' and go on to execute the rest of the words as a simple
|
||||
command. If we're in posix mode, we've got the special builtins
|
||||
handled before this runs. Fixes complaint about `command' in the
|
||||
background running an extra bash process from Dmitry Alexandrov
|
||||
<dag@gnui.org>
|
||||
|
||||
7/17
|
||||
----
|
||||
doc/bash.1
|
||||
lib/readline/doc/{rltech,hstech,rluser}.texi
|
||||
lib/readline/doc/{readline,history}.3
|
||||
- a few small tweaks to make the language gender-neutral
|
||||
|
||||
7/18
|
||||
----
|
||||
subst.c
|
||||
- expand_word_internal: case `:' make sure the shell is either not in
|
||||
posix mode or W_TILDEEXP is set before turning on W_ITILDE. The old
|
||||
code would turn it on unconditionally if the W_ASSIGNMENT flag was
|
||||
set. Fixes bug reported by OÄuz <oguzismailuysal@gmail.com>
|
||||
|
||||
7/20
|
||||
----
|
||||
builtins/complete.def
|
||||
- replace macros used to print compspec actions, options, and other
|
||||
info with a small set of functions that traverse the structs used
|
||||
to hold that information and print everything instead of eumerating
|
||||
each option and action separately. From a patch submitted by
|
||||
Martin Kealey <martin@kurahaupo.gen.nz>
|
||||
|
||||
7/27
|
||||
----
|
||||
variables.c
|
||||
- push_posix_tempvar_internal: restore $SHELLOPTS after restoring the
|
||||
values of shell options saved by `local -' by calling set_shellopts().
|
||||
Report from Grisha Levit <grishalevit@gmail.com>
|
||||
|
||||
flags.c
|
||||
- reset_shell_flags: set histexp_flag to 0 and let bash_history_reinit
|
||||
take care of setting history_expansion appropriately. Report and fix
|
||||
from Grisha Levit <grishalevit@gmail.com>
|
||||
|
||||
7/28
|
||||
----
|
||||
general.c
|
||||
- assignment: if (FLAGS & 1), we are parsing the contents of a compound
|
||||
assignment, and a word must begin with a `[' and have a valid
|
||||
subscript terminated by `]' before the `=' to be considered an
|
||||
assignment statemen and subsequently expanded like one. Report from
|
||||
Alexey Izbyshev <izbyshev@ispras.ru>
|
||||
|
||||
7/30
|
||||
----
|
||||
lib/glob/sm_loop.c
|
||||
- BRACKMATCH: if the bracket expression is matching simple characters
|
||||
and not a range, compare the character from the string and the
|
||||
pattern directly, as required by Posix interp 948
|
||||
|
||||
lib/glob/smatch.c
|
||||
- charcmp_wc: split off code that calls wcscoll from rangecmp_wc,
|
||||
just return the results of wcscoll
|
||||
- rangecmp_wc: call charcmp_wc and impose a total ordering
|
||||
by performing a byte comparison (or wint_t comparison) of C1 and C2
|
||||
as required by Posix interp 948 (charcmp_wc takes care of the
|
||||
behavior of FORCECOLL)
|
||||
- collequiv_wc: call charcmp_wc instead of rangecmp_wc
|
||||
- charcmp: character comparison code from rangecmp
|
||||
- rangecmp: call charcmp and impose total ordering as required by
|
||||
Posix interp 948
|
||||
- collequiv: call charcmp instead of rangecmp
|
||||
- _fnmatch_fallback: ASCII version of fallback for equivalence classes
|
||||
when there are no multibyte characters in the pattern; just calls
|
||||
fnmatch with a reconstructed equivalence class pattern
|
||||
- collequiv: call _fnmatch_fallback if charcmp returns non-zero and
|
||||
the configure check indicates fnmatch has character class support.
|
||||
Fixes issue reported by Harald van Dijk <harald@gigawatt.nl>
|
||||
|
||||
8/2
|
||||
---
|
||||
lib/readline/signals.c
|
||||
- _rl_handle_signal: since we're not called in a signal handler context
|
||||
any more, we don't need to explicitly unblock the signal we received
|
||||
so the application's signal handler will get it when we resend the
|
||||
signal to ourselves. It doesn't hurt anything to do it, but we don't
|
||||
have to
|
||||
- _rl_handle_signal: Set up a framework for any signals that need to
|
||||
be blocked during cleanup: add the signal to SET (initialized to the
|
||||
existing set of blocked signals) and set BLOCK_SIG to 1. We block
|
||||
that set around the call to rl_cleanup_after_signal().
|
||||
- _rl_handle_signal: on AIX, if the signal is SIGHUP, make sure we
|
||||
block SIGHUP while running rl_cleanup_after_signal()
|
||||
|
||||
8/3
|
||||
---
|
||||
jobs.c
|
||||
- start_job: don't allow `fg' or `bg' in a command substitution to
|
||||
attempt to start a parent's jobs. Suggested by OÄuz
|
||||
<oguzismailuysal@gmail.com>
|
||||
|
||||
builtins/set.def
|
||||
- set_current_options: only call change_flag or SET_BINARY_O_OPTION_VALUE
|
||||
if the value has changed from what is stored in the bitmap, to avoid
|
||||
any side effects from setting the options and save time on any
|
||||
unnecessary function calls. Inspired by report from Grisha Levit
|
||||
<grishalevit@gmail.com>
|
||||
|
||||
parse.y
|
||||
- xparse_dolparen: before we jump to top level, check whether we are
|
||||
still reading from the string (we might have run all the unwind-
|
||||
protects) and turn off PST_CMDSUBST if we are not. Fixes fuzzing
|
||||
bug reported by Jakub Wilk <jwilk@jwilk.net>
|
||||
|
||||
8/4
|
||||
---
|
||||
subst.c
|
||||
- process_substitute: set subshell_environment to include SUBSHELL_ASYNC
|
||||
in the child process, since we passed FORK_ASYNC to make_child. Fixes
|
||||
DEBUG trap problem reported by Jonathan Rascher <jon@bcat.name>
|
||||
|
||||
subst.c
|
||||
- unlink_all_fifos: new function, just unconditionally closes and
|
||||
unlinks (if using FIFOs) each pipe used for process substitution.
|
||||
There is an open to unblock any child processes sleeping on the
|
||||
FIFO first. Inspired by a suggestion from "CHIGOT, CLEMENT"
|
||||
<clement.chigot@atos.net>
|
||||
|
||||
shell.c
|
||||
- exit_shell: call unlink_all_fifos() instead of unlink_fifo_list()
|
||||
|
||||
sig.c
|
||||
- termsig_handler: call unlink_all_fifos() instead of
|
||||
unlink_fifo_list()
|
||||
|
||||
8/5
|
||||
---
|
||||
arrayfunc.c
|
||||
- quote_compound_array_list: turn empty strings into '' instead of
|
||||
leaving them unmodified. Fixes bug in changes from 4/29 reported
|
||||
by andy_bash <andy_bash@objectmail.com>
|
||||
|
||||
8/10
|
||||
----
|
||||
bashline.c
|
||||
- edit_and_execute_command,bash_execute_unix_command: restore the bash
|
||||
signal handlers before running parse_and_execute() so bash will catch
|
||||
and handle signals, instead of letting readline catch them without
|
||||
any opportunity to run _rl_handle_signal(). Fixes bug reported by
|
||||
Stan Marsh <gazelle@xmission.com>
|
||||
|
||||
8/11
|
||||
----
|
||||
builtins/fc.def
|
||||
- fc_gethnum: return HIST_INVALID for -0 if not in listing mode
|
||||
- fc_builtin: throw an out-of-range error if histbeg or histend gets
|
||||
set to HIST_INVALID
|
||||
- fc_builtin: don't throw errors for other out-of-range history
|
||||
specifications, clamp them at the beginning or end of the history
|
||||
list, as appropriate, per POSIX. Report and fix from Martijn Dekker
|
||||
<martijn@inlv.org>
|
||||
|
||||
8/12
|
||||
----
|
||||
builtins/fc.def
|
||||
- fc_gethnum: return HIST_NOTFOUND (new error) if the string is not a
|
||||
number and doesn't correspond to any command in the history list
|
||||
- fc_builtin: print a "no command found" error message if fc_gethnum
|
||||
returns HIST_NOTFOUND
|
||||
|
||||
8/14
|
||||
----
|
||||
flags.c
|
||||
- no_invisible_vars: removed undocumented `-I' flag
|
||||
|
||||
{flags,variables}.c,flags.h,builtins/{declare,setattr.def}
|
||||
- no_invisible_vars: remove all references
|
||||
|
||||
command.h
|
||||
- PF_ALLINDS: new flag, means to expand an array variable name without
|
||||
a subscript as if it were subscripted by `@' instead of `0'
|
||||
|
||||
subst.c
|
||||
- parameter_brace_expand_word: if PFLAGS contains PF_ALLINDS, expand
|
||||
an array variable name as if it were subscripted by "@" instead of
|
||||
0/"0": a string with the element values separated by " ". Little
|
||||
nuance; we're just interested in whether or not there are any
|
||||
values at all
|
||||
- parameter_brace_expand: if we are expanding something like ${foo@a},
|
||||
pass PF_ALLINDS to parameter_brace_expand_word and
|
||||
parameter_brace_expand_indir so we don't get tripped up on `nounset'
|
||||
if foo has an assigned subscript other than 0/"0". Inspired by a
|
||||
report from Andrew Neff <andrew.neff@visionsystemsinc.com>
|
||||
|
||||
8/17
|
||||
----
|
||||
bashhist.c
|
||||
- bash_add_history,maybe_add_history: don't need to call shell_comment
|
||||
if we are in the middle of adding a here-document, since it may
|
||||
call the parser recursively on data that is not guaranteed to be
|
||||
valid input. From a report by Hyunho Cho <mug896@gmail.com>
|
||||
|
||||
8/24
|
||||
----
|
||||
lib/readline/complete.c
|
||||
- compare_match: compare TEXT from the line buffer and MATCH, a
|
||||
possible completion for TEXT, after dequoting TEXT if necessary
|
||||
- rl_complete_internal,rl_menu_complete : if show-all-if-unmodified is
|
||||
set, use compare_match instead of a straight strcmp to determine if
|
||||
the match has changed the text to complete, so we can use it for
|
||||
filenames that require quoting. Report and pointer to fix from
|
||||
Abon B <gnuabonbon@gmail.com>
|
||||
|
||||
8/25
|
||||
----
|
||||
eval.c
|
||||
- execute_prompt_command: PROMPT_COMMAND can now be an array, subsuming
|
||||
PROMPT_COMMANDS, which bash no longer looks for. Prompted by a
|
||||
suggestion from Martijn Dekker <martijn@inlv.org>
|
||||
|
||||
8/26
|
||||
----
|
||||
builtins/fc.def
|
||||
- fc_gethnum: now takes a flags word as the third argument, with two
|
||||
current flag values: HN_LISTING, which means we are listing history
|
||||
entries, and HN_FIRST, which means we are parsing the first in a
|
||||
first,last range of history entries
|
||||
- fc_gethnum: if we have a number >= 0, and it's out of range, return
|
||||
different values (0 or last history) depending on whether we are
|
||||
parsing the first or last in a range argument. Based on a report from
|
||||
Martijn Dekker <martijn@inlv.org>
|
||||
|
||||
8/31
|
||||
----
|
||||
parse.y
|
||||
- grammar: call handle_eof_input_unit from the eof-after-error
|
||||
production only from interactive top-level shells, so a syntax error
|
||||
in `eval' doesn't exit an interactive shell. Report and fix from
|
||||
Koichi Murase <myoga.murase@gmail.com>
|
||||
|
||||
bashline.c
|
||||
- bash_execute_unix_command: if we call parse_and_execute with allocated
|
||||
memory, make sure not to include SEVAL_NOFREE in the flags so it will
|
||||
free that command string before returning. Report and fix from
|
||||
Koichi Murase <myoga.murase@gmail.com>
|
||||
|
||||
array.[ch]
|
||||
- array_to_argv: now takes a second argument: COUNTP; returns the number
|
||||
of elements stored in the strvec
|
||||
- array_to_argv: don't store array elements with null values; it makes
|
||||
it hard for callers to walk the whole array reliably
|
||||
|
||||
pcomplete.c
|
||||
- gen_shell_function_matches: change call to array_to_argv
|
||||
|
||||
array.h
|
||||
- execute_array_command: now takes the entire ARRAY * as the first
|
||||
parameter
|
||||
|
||||
eval.c
|
||||
- execute_array_command: now takes the entire array, puts the elements
|
||||
into a strvec, and executes each element of the strvevc as a command.
|
||||
This protects against a command from PROMPT_COMMAND[n] unsetting the
|
||||
corresponding element of PROMPT_COMMAND.
|
||||
From a report from Koichi Murase <myoga.murase@gmail.com>
|
||||
|
||||
@@ -916,6 +916,7 @@ tests/array24.sub f
|
||||
tests/array25.sub f
|
||||
tests/array26.sub f
|
||||
tests/array27.sub f
|
||||
tests/array28.sub f
|
||||
tests/array-at-star f
|
||||
tests/array2.right f
|
||||
tests/assoc.tests f
|
||||
@@ -945,6 +946,7 @@ tests/builtins3.sub f
|
||||
tests/builtins4.sub f
|
||||
tests/builtins5.sub f
|
||||
tests/builtins6.sub f
|
||||
tests/builtins7.sub f
|
||||
tests/source1.sub f
|
||||
tests/source2.sub f
|
||||
tests/source3.sub f
|
||||
@@ -960,6 +962,8 @@ tests/case3.sub f
|
||||
tests/case4.sub f
|
||||
tests/casemod.tests f
|
||||
tests/casemod.right f
|
||||
tests/complete.tests f
|
||||
tests/complete.right f
|
||||
tests/comsub.tests f
|
||||
tests/comsub.right f
|
||||
tests/comsub1.sub f
|
||||
@@ -1221,6 +1225,7 @@ tests/new-exp11.sub f
|
||||
tests/new-exp12.sub f
|
||||
tests/new-exp13.sub f
|
||||
tests/new-exp14.sub f
|
||||
tests/new-exp15.sub f
|
||||
tests/new-exp.right f
|
||||
tests/nquote.tests f
|
||||
tests/nquote.right f
|
||||
@@ -1322,6 +1327,7 @@ tests/run-braces f
|
||||
tests/run-builtins f
|
||||
tests/run-case f
|
||||
tests/run-casemod f
|
||||
tests/run-complete f
|
||||
tests/run-comsub f
|
||||
tests/run-comsub-eof f
|
||||
tests/run-comsub-posix f
|
||||
@@ -1453,6 +1459,7 @@ tests/varenv17.sub f
|
||||
tests/varenv18.sub f
|
||||
tests/varenv19.sub f
|
||||
tests/varenv20.sub f
|
||||
tests/varenv21.sub f
|
||||
tests/version f
|
||||
tests/version.mini f
|
||||
tests/vredir.tests f
|
||||
|
||||
+5
-5
@@ -760,7 +760,7 @@ Makefile makefile: config.status $(srcdir)/Makefile.in
|
||||
|
||||
Makefiles makefiles: config.status $(srcdir)/Makefile.in
|
||||
@for mf in $(CREATED_MAKEFILES); do \
|
||||
CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
|
||||
CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status || exit 1; \
|
||||
done
|
||||
|
||||
config.h: stamp-h
|
||||
@@ -846,16 +846,16 @@ install-headers-dirs:
|
||||
|
||||
install-headers: install-headers-dirs
|
||||
@for hf in $(INSTALLED_HEADERS) ; do \
|
||||
${INSTALL_DATA} $(srcdir)/"$$hf" $(DESTDIR)$(headersdir)/$$hf; \
|
||||
${INSTALL_DATA} $(srcdir)/"$$hf" $(DESTDIR)$(headersdir)/$$hf || exit 1; \
|
||||
done
|
||||
@for hf in $(INSTALLED_INCFILES) ; do \
|
||||
${INSTALL_DATA} $(BASHINCDIR)/"$$hf" $(DESTDIR)$(headersdir)/include/$$hf; \
|
||||
${INSTALL_DATA} $(BASHINCDIR)/"$$hf" $(DESTDIR)$(headersdir)/include/$$hf || exit 1; \
|
||||
done
|
||||
@for hf in $(INSTALLED_BUILTINS_HEADERS) ; do \
|
||||
${INSTALL_DATA} $(BUILTIN_SRCDIR)/"$$hf" $(DESTDIR)$(headersdir)/builtins/$$hf; \
|
||||
${INSTALL_DATA} $(BUILTIN_SRCDIR)/"$$hf" $(DESTDIR)$(headersdir)/builtins/$$hf || exit 1; \
|
||||
done
|
||||
@for hf in $(CREATED_HEADERS) ; do \
|
||||
${INSTALL_DATA} $(BUILD_DIR)/"$$hf" $(DESTDIR)$(headersdir)/$$hf; \
|
||||
${INSTALL_DATA} $(BUILD_DIR)/"$$hf" $(DESTDIR)$(headersdir)/$$hf || exit 1; \
|
||||
done
|
||||
-$(INSTALL_DATA) $(SDIR)/bash.pc $(DESTDIR)$(pkgconfigdir)/bash.pc
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ dd. New `U', `u', and `L' parameter transformations to convert to uppercase,
|
||||
convert first character to uppercase, and convert to lowercase,
|
||||
respectively.
|
||||
|
||||
ee. PROMPT_COMMANDS: a new array variable, each element of which can contain a
|
||||
command to be executed like PROMPT_COMMAND.
|
||||
ee. PROMPT_COMMAND: can now be an array variable, each element of which can
|
||||
contain a command to be executed like a string PROMPT_COMMAND variable.
|
||||
|
||||
ff. `ulimit' has a -R option to report and set the RLIMIT_RTTIME resource.
|
||||
|
||||
@@ -128,6 +128,23 @@ nn. HISTFILE is now readonly in a restricted shell.
|
||||
oo. The bash malloc now returns memory that is 16-byte aligned on 64-bit
|
||||
systems.
|
||||
|
||||
pp. If the hash builtin is listing hashed filenames portably, don't print
|
||||
anything if the table is empty.
|
||||
|
||||
qq. GLOBIGNORE now ignores `.' and `..' as a terminal pathname component.
|
||||
|
||||
rr. Bash attempts to optimize away forks in the last command in a function body
|
||||
under appropriate circumstances.
|
||||
|
||||
ss. The globbing code now uses fnmatch(3) to check collation elements (if
|
||||
available) even in cases without multibyte characters.
|
||||
|
||||
tt. The `fg' and `bg' builtins now return an error in a command substitution
|
||||
when asked to restart a job inherited from the parent shell.
|
||||
|
||||
uu. The shell now attempts to unlink all FIFOs on exit, whether a consuming
|
||||
process has finished with them or not.
|
||||
|
||||
2. New Features in Readline
|
||||
|
||||
a. If a second consecutive completion attempt produces matches where the first
|
||||
@@ -161,6 +178,8 @@ i. Readline tries to take advantage of the more regular structure of UTF-8
|
||||
j. The bindable operate-and-get-next command (and its default bindings) are
|
||||
now part of readline instead of a bash-specific addition.
|
||||
|
||||
k. The signal cleanup code now blocks SIGINT while processing after a SIGINT.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
This is a terse description of the new features added to bash-5.0 since
|
||||
the release of bash-4.4. As always, the manual page (doc/bash.1) is
|
||||
|
||||
Vendored
+8
-3
@@ -2230,7 +2230,12 @@ AC_DEFINE_UNQUOTED([WEXITSTATUS_OFFSET], [$bash_cv_wexitstatus_offset], [Offset
|
||||
|
||||
AC_DEFUN([BASH_FUNC_SBRK],
|
||||
[
|
||||
AC_CHECK_FUNCS_ONCE([sbrk])
|
||||
AC_MSG_CHECKING([for sbrk])
|
||||
AC_CACHE_VAL(ac_cv_func_sbrk,
|
||||
[AC_TRY_LINK([#include <unistd.h>],
|
||||
[ void *x = sbrk (4096); ],
|
||||
ac_cv_func_sbrk=yes, ac_cv_func_sbrk=no)])
|
||||
AC_MSG_RESULT($ac_cv_func_sbrk)
|
||||
if test X$ac_cv_func_sbrk = Xyes; then
|
||||
AC_CACHE_CHECK([for working sbrk], [bash_cv_func_sbrk],
|
||||
[AC_TRY_RUN([
|
||||
@@ -2253,8 +2258,8 @@ main(int c, char **v)
|
||||
ac_cv_func_sbrk=no
|
||||
fi
|
||||
fi
|
||||
if test $ac_cv_func_sbrk = no; then
|
||||
AC_DEFINE(HAVE_SBRK, 0,
|
||||
if test $ac_cv_func_sbrk = yes; then
|
||||
AC_DEFINE(HAVE_SBRK, 1,
|
||||
[Define if you have a working sbrk function.])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -810,22 +810,29 @@ WORD_LIST *list;
|
||||
}
|
||||
|
||||
char **
|
||||
array_to_argv (a)
|
||||
array_to_argv (a, countp)
|
||||
ARRAY *a;
|
||||
int *countp;
|
||||
{
|
||||
char **ret, *t;
|
||||
int i;
|
||||
ARRAY_ELEMENT *ae;
|
||||
|
||||
if (a == 0 || array_empty(a))
|
||||
if (a == 0 || array_empty(a)) {
|
||||
if (countp)
|
||||
*countp = 0;
|
||||
return ((char **)NULL);
|
||||
}
|
||||
ret = strvec_create (array_num_elements (a) + 1);
|
||||
i = 0;
|
||||
for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) {
|
||||
t = element_value (ae);
|
||||
ret[i++] = t ? savestring (t) : (char *)NULL;
|
||||
if (t)
|
||||
ret[i++] = savestring (t);
|
||||
}
|
||||
ret[i] = (char *)NULL;
|
||||
if (countp)
|
||||
*countp = i;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ extern WORD_LIST *array_keys_to_word_list PARAMS((ARRAY *));
|
||||
|
||||
extern ARRAY *array_assign_list PARAMS((ARRAY *, WORD_LIST *));
|
||||
|
||||
extern char **array_to_argv PARAMS((ARRAY *));
|
||||
extern char **array_to_argv PARAMS((ARRAY *, int *));
|
||||
|
||||
extern char *array_to_kvpair PARAMS((ARRAY *, int));
|
||||
extern char *array_to_assign PARAMS((ARRAY *, int));
|
||||
@@ -121,7 +121,7 @@ extern ARRAY *array_from_string PARAMS((char *, char *));
|
||||
|
||||
#define ALL_ELEMENT_SUB(c) ((c) == '@' || (c) == '*')
|
||||
|
||||
/* In eval.c, but uses ARRAY_ELEMENT * */
|
||||
extern int execute_array_command PARAMS((ARRAY_ELEMENT *, void *));
|
||||
/* In eval.c, but uses ARRAY * */
|
||||
extern int execute_array_command PARAMS((ARRAY *, void *));
|
||||
|
||||
#endif /* _ARRAY_H_ */
|
||||
|
||||
+3
-2
@@ -949,7 +949,8 @@ expand_and_quote_assoc_word (w, type)
|
||||
|
||||
/* For each word in a compound array assignment, if the word looks like
|
||||
[ind]=value, single-quote ind and value, but leave the brackets and
|
||||
the = sign (and any `+') alone. This is used for indexed arrays. */
|
||||
the = sign (and any `+') alone. If it's not an assignment, just single-
|
||||
quote the word. This is used for indexed arrays. */
|
||||
void
|
||||
quote_compound_array_list (list, type)
|
||||
WORD_LIST *list;
|
||||
@@ -960,7 +961,7 @@ quote_compound_array_list (list, type)
|
||||
|
||||
for (l = list; l; l = l->next)
|
||||
{
|
||||
if (l->word == 0 || l->word->word == 0 || l->word->word[0] == '\0')
|
||||
if (l->word == 0 || l->word->word == 0)
|
||||
continue; /* should not happen, but just in case... */
|
||||
if ((l->word->flags & W_ASSIGNMENT) == 0)
|
||||
t = sh_single_quote (l->word->word);
|
||||
|
||||
+2
-2
@@ -757,7 +757,7 @@ maybe_add_history (line)
|
||||
int is_comment;
|
||||
|
||||
hist_last_line_added = 0;
|
||||
is_comment = shell_comment (line);
|
||||
is_comment = (parser_state & PST_HEREDOC) ? 0 : shell_comment (line);
|
||||
|
||||
/* Don't use the value of history_control to affect the second
|
||||
and subsequent lines of a multi-line command (old code did
|
||||
@@ -874,7 +874,7 @@ bash_add_history (line)
|
||||
add_it = 1;
|
||||
if (command_oriented_history && current_command_line_count > 1)
|
||||
{
|
||||
is_comment = shell_comment (line);
|
||||
is_comment = (parser_state & PST_HEREDOC) ? 0 : shell_comment (line);
|
||||
|
||||
/* The second and subsequent lines of a here document have the trailing
|
||||
newline preserved. We don't want to add extra newlines here, but we
|
||||
|
||||
+5
-1
@@ -968,6 +968,7 @@ edit_and_execute_command (count, c, editing_mode, edit_command)
|
||||
|
||||
if (rl_deprep_term_function)
|
||||
(*rl_deprep_term_function) ();
|
||||
rl_clear_signals ();
|
||||
save_parser_state (&ps);
|
||||
r = parse_and_execute (command, (editing_mode == VI_EDITING_MODE) ? "v" : "C-xC-e", SEVAL_NOHIST);
|
||||
restore_parser_state (&ps);
|
||||
@@ -977,6 +978,7 @@ edit_and_execute_command (count, c, editing_mode, edit_command)
|
||||
|
||||
if (rl_prep_term_function)
|
||||
(*rl_prep_term_function) (metaflag);
|
||||
rl_set_signals ();
|
||||
|
||||
current_command_line_count = saved_command_line_count;
|
||||
|
||||
@@ -4337,7 +4339,9 @@ bash_execute_unix_command (count, key)
|
||||
array_needs_making = 1;
|
||||
|
||||
save_parser_state (&ps);
|
||||
r = parse_and_execute (savestring (cmd), "bash_execute_unix_command", SEVAL_NOHIST|SEVAL_NOFREE);
|
||||
rl_clear_signals ();
|
||||
r = parse_and_execute (savestring (cmd), "bash_execute_unix_command", SEVAL_NOHIST);
|
||||
rl_set_signals ();
|
||||
restore_parser_state (&ps);
|
||||
|
||||
v = find_variable ("READLINE_LINE");
|
||||
|
||||
@@ -124,6 +124,10 @@ command_builtin (list)
|
||||
|
||||
#define COMMAND_BUILTIN_FLAGS (CMD_NO_FUNCTIONS | CMD_INHIBIT_EXPANSION | CMD_COMMAND_BUILTIN | (use_standard_path ? CMD_STDPATH : 0))
|
||||
|
||||
#ifdef DEBUG
|
||||
itrace("command_builtin: running execute_command for `%s'", list->word->word);
|
||||
#endif
|
||||
|
||||
/* We don't want this to be reparsed (consider command echo 'foo &'), so
|
||||
just make a simple_command structure and call execute_command with it. */
|
||||
command = make_bare_simple_command ();
|
||||
|
||||
@@ -210,6 +210,7 @@ extern int should_suppress_fork PARAMS((COMMAND *));
|
||||
extern int can_optimize_connection PARAMS((COMMAND *));
|
||||
extern void optimize_fork PARAMS((COMMAND *));
|
||||
extern void optimize_subshell_command PARAMS((COMMAND *));
|
||||
extern void optimize_shell_function PARAMS((COMMAND *));
|
||||
|
||||
/* Functions from evalfile.c */
|
||||
extern int maybe_execute_file PARAMS((const char *, int));
|
||||
|
||||
+79
-131
@@ -42,7 +42,7 @@ Options:
|
||||
command) word
|
||||
|
||||
When completion is attempted, the actions are applied in the order the
|
||||
uppercase-letter options are listed above. If multiple options are supplied,
|
||||
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:
|
||||
@@ -97,11 +97,16 @@ static void print_compopts PARAMS((const char *, COMPSPEC *, int));
|
||||
static void print_all_completions PARAMS((void));
|
||||
static int print_cmd_completions PARAMS((WORD_LIST *));
|
||||
|
||||
static void print_compoptions PARAMS((unsigned long, int));
|
||||
static void print_compactions PARAMS((unsigned long));
|
||||
static void print_arg PARAMS((const char *, const char *, int));
|
||||
static void print_cmd_name PARAMS((const char *));
|
||||
|
||||
static char *Garg, *Warg, *Parg, *Sarg, *Xarg, *Farg, *Carg;
|
||||
|
||||
static const struct _compacts {
|
||||
const char * const actname;
|
||||
int actflag;
|
||||
unsigned long actflag;
|
||||
int actopt;
|
||||
} compacts[] = {
|
||||
{ "alias", CA_ALIAS, 'a' },
|
||||
@@ -134,7 +139,7 @@ static const struct _compacts {
|
||||
/* This should be a STRING_INT_ALIST */
|
||||
static const struct _compopt {
|
||||
const char * const optname;
|
||||
int optflag;
|
||||
unsigned long optflag;
|
||||
} compopts[] = {
|
||||
{ "bashdefault", COPT_BASHDEFAULT },
|
||||
{ "default", COPT_DEFAULT },
|
||||
@@ -485,122 +490,95 @@ remove_cmd_completions (list)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define SQPRINTARG(a, f) \
|
||||
do { \
|
||||
if (a) \
|
||||
{ \
|
||||
x = sh_single_quote (a); \
|
||||
printf ("%s %s ", f, x); \
|
||||
free (x); \
|
||||
} \
|
||||
} while (0)
|
||||
static void
|
||||
print_compoptions (copts, full)
|
||||
unsigned long copts;
|
||||
int full;
|
||||
{
|
||||
const struct _compopt *co;
|
||||
|
||||
#define PRINTARG(a, f) \
|
||||
do { \
|
||||
if (a) \
|
||||
printf ("%s %s ", f, a); \
|
||||
} while (0)
|
||||
for (co = compopts; co->optname; co++)
|
||||
if (copts & co->optflag)
|
||||
printf ("-o %s ", co->optname);
|
||||
else if (full)
|
||||
printf ("+o %s ", co->optname);
|
||||
}
|
||||
|
||||
#define PRINTOPT(a, f) \
|
||||
do { \
|
||||
if (acts & a) \
|
||||
printf ("%s ", f); \
|
||||
} while (0)
|
||||
static void
|
||||
print_compactions (acts)
|
||||
unsigned long acts;
|
||||
{
|
||||
const struct _compacts *ca;
|
||||
|
||||
#define PRINTACT(a, f) \
|
||||
do { \
|
||||
if (acts & a) \
|
||||
printf ("-A %s ", f); \
|
||||
} while (0)
|
||||
/* simple flags first */
|
||||
for (ca = compacts; ca->actname; ca++)
|
||||
if (ca->actopt && (acts & ca->actflag))
|
||||
printf ("-%c ", ca->actopt);
|
||||
|
||||
#define PRINTCOMPOPT(a, f) \
|
||||
do { \
|
||||
if (copts & a) \
|
||||
printf ("-o %s ", f); \
|
||||
} while (0)
|
||||
/* then the rest of the actions */
|
||||
for (ca = compacts; ca->actname; ca++)
|
||||
if (ca->actopt == 0 && (acts & ca->actflag))
|
||||
printf ("-A %s ", ca->actname);
|
||||
}
|
||||
|
||||
#define XPRINTCOMPOPT(a, f) \
|
||||
do { \
|
||||
if (copts & a) \
|
||||
printf ("-o %s ", f); \
|
||||
else \
|
||||
printf ("+o %s ", f); \
|
||||
} while (0)
|
||||
static void
|
||||
print_arg (arg, flag, quote)
|
||||
const char *arg, *flag;
|
||||
int quote;
|
||||
{
|
||||
char *x;
|
||||
|
||||
if (arg)
|
||||
{
|
||||
x = quote ? sh_single_quote (arg) : (char *)arg;
|
||||
printf ("%s %s ", flag, x);
|
||||
if (x != arg)
|
||||
free (x);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_cmd_name (cmd)
|
||||
const char *cmd;
|
||||
{
|
||||
if (STREQ (cmd, DEFAULTCMD))
|
||||
printf ("-D");
|
||||
else if (STREQ (cmd, EMPTYCMD))
|
||||
printf ("-E");
|
||||
else if (STREQ (cmd, INITIALWORD))
|
||||
printf ("-I");
|
||||
else if (*cmd == 0) /* XXX - can this happen? */
|
||||
printf ("''");
|
||||
else
|
||||
printf ("%s", cmd);
|
||||
}
|
||||
|
||||
static int
|
||||
print_one_completion (cmd, cs)
|
||||
char *cmd;
|
||||
COMPSPEC *cs;
|
||||
{
|
||||
unsigned long acts, copts;
|
||||
char *x;
|
||||
|
||||
printf ("complete ");
|
||||
|
||||
copts = cs->options;
|
||||
|
||||
/* First, print the -o options. */
|
||||
PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
|
||||
PRINTCOMPOPT (COPT_DEFAULT, "default");
|
||||
PRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
|
||||
PRINTCOMPOPT (COPT_FILENAMES, "filenames");
|
||||
PRINTCOMPOPT (COPT_NOQUOTE, "noquote");
|
||||
PRINTCOMPOPT (COPT_NOSORT, "nosort");
|
||||
PRINTCOMPOPT (COPT_NOSPACE, "nospace");
|
||||
PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
|
||||
|
||||
acts = cs->actions;
|
||||
|
||||
/* simple flags next */
|
||||
PRINTOPT (CA_ALIAS, "-a");
|
||||
PRINTOPT (CA_BUILTIN, "-b");
|
||||
PRINTOPT (CA_COMMAND, "-c");
|
||||
PRINTOPT (CA_DIRECTORY, "-d");
|
||||
PRINTOPT (CA_EXPORT, "-e");
|
||||
PRINTOPT (CA_FILE, "-f");
|
||||
PRINTOPT (CA_GROUP, "-g");
|
||||
PRINTOPT (CA_JOB, "-j");
|
||||
PRINTOPT (CA_KEYWORD, "-k");
|
||||
PRINTOPT (CA_SERVICE, "-s");
|
||||
PRINTOPT (CA_USER, "-u");
|
||||
PRINTOPT (CA_VARIABLE, "-v");
|
||||
|
||||
/* now the rest of the actions */
|
||||
PRINTACT (CA_ARRAYVAR, "arrayvar");
|
||||
PRINTACT (CA_BINDING, "binding");
|
||||
PRINTACT (CA_DISABLED, "disabled");
|
||||
PRINTACT (CA_ENABLED, "enabled");
|
||||
PRINTACT (CA_FUNCTION, "function");
|
||||
PRINTACT (CA_HELPTOPIC, "helptopic");
|
||||
PRINTACT (CA_HOSTNAME, "hostname");
|
||||
PRINTACT (CA_RUNNING, "running");
|
||||
PRINTACT (CA_SETOPT, "setopt");
|
||||
PRINTACT (CA_SHOPT, "shopt");
|
||||
PRINTACT (CA_SIGNAL, "signal");
|
||||
PRINTACT (CA_STOPPED, "stopped");
|
||||
print_compoptions (cs->options, 0);
|
||||
print_compactions (cs->actions);
|
||||
|
||||
/* now the rest of the arguments */
|
||||
|
||||
/* arguments that require quoting */
|
||||
SQPRINTARG (cs->globpat, "-G");
|
||||
SQPRINTARG (cs->words, "-W");
|
||||
SQPRINTARG (cs->prefix, "-P");
|
||||
SQPRINTARG (cs->suffix, "-S");
|
||||
SQPRINTARG (cs->filterpat, "-X");
|
||||
print_arg (cs->globpat, "-G", 1);
|
||||
print_arg (cs->words, "-W", 1);
|
||||
print_arg (cs->prefix, "-P", 1);
|
||||
print_arg (cs->suffix, "-S", 1);
|
||||
print_arg (cs->filterpat, "-X", 1);
|
||||
|
||||
SQPRINTARG (cs->command, "-C");
|
||||
print_arg (cs->command, "-C", 1);
|
||||
|
||||
/* simple arguments that don't require quoting */
|
||||
PRINTARG (cs->funcname, "-F");
|
||||
print_arg (cs->funcname, "-F", 0);
|
||||
|
||||
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);
|
||||
print_cmd_name (cmd);
|
||||
printf ("\n");
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -611,42 +589,12 @@ print_compopts (cmd, cs, full)
|
||||
COMPSPEC *cs;
|
||||
int full;
|
||||
{
|
||||
int copts;
|
||||
|
||||
printf ("compopt ");
|
||||
copts = cs->options;
|
||||
|
||||
if (full)
|
||||
{
|
||||
XPRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
|
||||
XPRINTCOMPOPT (COPT_DEFAULT, "default");
|
||||
XPRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
|
||||
XPRINTCOMPOPT (COPT_FILENAMES, "filenames");
|
||||
XPRINTCOMPOPT (COPT_NOQUOTE, "noquote");
|
||||
XPRINTCOMPOPT (COPT_NOSORT, "nosort");
|
||||
XPRINTCOMPOPT (COPT_NOSPACE, "nospace");
|
||||
XPRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
|
||||
}
|
||||
else
|
||||
{
|
||||
PRINTCOMPOPT (COPT_BASHDEFAULT, "bashdefault");
|
||||
PRINTCOMPOPT (COPT_DEFAULT, "default");
|
||||
PRINTCOMPOPT (COPT_DIRNAMES, "dirnames");
|
||||
PRINTCOMPOPT (COPT_FILENAMES, "filenames");
|
||||
PRINTCOMPOPT (COPT_NOQUOTE, "noquote");
|
||||
PRINTCOMPOPT (COPT_NOSORT, "nosort");
|
||||
PRINTCOMPOPT (COPT_NOSPACE, "nospace");
|
||||
PRINTCOMPOPT (COPT_PLUSDIRS, "plusdirs");
|
||||
}
|
||||
print_compoptions (cs->options, full);
|
||||
print_cmd_name (cmd);
|
||||
|
||||
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);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
@@ -727,20 +727,20 @@ restart_new_var_name:
|
||||
if (flags_on & att_assoc)
|
||||
{
|
||||
var = make_new_assoc_variable (name);
|
||||
if (var && offset == 0 && no_invisible_vars == 0)
|
||||
if (var && offset == 0)
|
||||
VSETATTR (var, att_invisible);
|
||||
}
|
||||
else if ((flags_on & att_array) || making_array_special)
|
||||
{
|
||||
var = make_new_array_variable (name);
|
||||
if (var && offset == 0 && no_invisible_vars == 0)
|
||||
if (var && offset == 0)
|
||||
VSETATTR (var, att_invisible);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
var = mkglobal ? bind_global_variable (name, (char *)NULL, ASS_FORCE) : bind_variable (name, (char *)NULL, ASS_FORCE);
|
||||
if (var && offset == 0 && no_invisible_vars == 0)
|
||||
if (var && offset == 0)
|
||||
VSETATTR (var, att_invisible);
|
||||
}
|
||||
if (var == 0)
|
||||
|
||||
+21
-1
@@ -145,7 +145,27 @@ optimize_subshell_command (command)
|
||||
(command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR))
|
||||
optimize_subshell_command (command->value.Connection->second);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
optimize_shell_function (command)
|
||||
COMMAND *command;
|
||||
{
|
||||
COMMAND *fc;
|
||||
|
||||
fc = (command->type == cm_group) ? command->value.Group->command : command;
|
||||
|
||||
if (fc->type == cm_simple && should_suppress_fork (fc))
|
||||
{
|
||||
fc->flags |= CMD_NO_FORK;
|
||||
fc->value.Simple->flags |= CMD_NO_FORK;
|
||||
}
|
||||
else if (fc->type == cm_connection && can_optimize_connection (fc) && should_suppress_fork (fc->value.Connection->second))
|
||||
{
|
||||
fc->value.Connection->second->flags |= CMD_NO_FORK;
|
||||
fc->value.Connection->second->value.Simple->flags |= CMD_NO_FORK;
|
||||
}
|
||||
}
|
||||
|
||||
/* How to force parse_and_execute () to clean up after itself. */
|
||||
void
|
||||
parse_and_execute_cleanup (old_running_trap)
|
||||
|
||||
+67
-15
@@ -86,6 +86,14 @@ $END
|
||||
extern int errno;
|
||||
#endif /* !errno */
|
||||
|
||||
#define HIST_INVALID INT_MIN
|
||||
#define HIST_ERANGE INT_MIN+1
|
||||
#define HIST_NOTFOUND INT_MIN+2
|
||||
|
||||
/* Values for the flags argument to fc_gethnum */
|
||||
#define HN_LISTING 0x01
|
||||
#define HN_FIRST 0x02
|
||||
|
||||
extern int unlink PARAMS((const char *));
|
||||
|
||||
extern FILE *sh_mktmpfp PARAMS((char *, int, char **));
|
||||
@@ -201,7 +209,7 @@ fc_builtin (list)
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
listing = 1;
|
||||
listing = HN_LISTING; /* for fc_gethnum */
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
@@ -321,14 +329,11 @@ fc_builtin (list)
|
||||
while (last_hist >= 0 && hlist[last_hist] == 0)
|
||||
last_hist--;
|
||||
if (last_hist < 0)
|
||||
{
|
||||
sh_erange ((char *)NULL, _("history specification"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
last_hist = 0; /* per POSIX */
|
||||
|
||||
if (list)
|
||||
{
|
||||
histbeg = fc_gethnum (list->word->word, hlist, listing);
|
||||
histbeg = fc_gethnum (list->word->word, hlist, listing|HN_FIRST);
|
||||
list = list->next;
|
||||
|
||||
if (list)
|
||||
@@ -353,12 +358,27 @@ fc_builtin (list)
|
||||
histbeg = histend = last_hist;
|
||||
}
|
||||
|
||||
/* We print error messages for line specifications out of range. */
|
||||
if ((histbeg < 0) || (histend < 0))
|
||||
if (histbeg == HIST_INVALID || histend == HIST_INVALID)
|
||||
{
|
||||
sh_erange ((char *)NULL, _("history specification"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
else if (histbeg == HIST_ERANGE || histend == HIST_ERANGE)
|
||||
{
|
||||
sh_erange ((char *)NULL, _("history specification"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
else if (histbeg == HIST_NOTFOUND || histend == HIST_NOTFOUND)
|
||||
{
|
||||
builtin_error (_("no command found"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
/* We don't throw an error for line specifications out of range, per POSIX */
|
||||
if (histbeg < 0)
|
||||
histbeg = 0;
|
||||
if (histend < 0)
|
||||
histend = 0;
|
||||
|
||||
/* "When not listing, the fc command that caused the editing shall not be
|
||||
entered into the history list." */
|
||||
@@ -382,12 +402,27 @@ fc_builtin (list)
|
||||
histbeg = last_hist;
|
||||
}
|
||||
|
||||
/* We print error messages for line specifications out of range. */
|
||||
if ((histbeg < 0) || (histend < 0))
|
||||
if (histbeg == HIST_INVALID || histend == HIST_INVALID)
|
||||
{
|
||||
sh_erange ((char *)NULL, _("history specification"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
else if (histbeg == HIST_ERANGE || histend == HIST_ERANGE)
|
||||
{
|
||||
sh_erange ((char *)NULL, _("history specification"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
else if (histbeg == HIST_NOTFOUND || histend == HIST_NOTFOUND)
|
||||
{
|
||||
builtin_error (_("no command found"));
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
/* We don't throw an error for line specifications out of range, per POSIX */
|
||||
if (histbeg < 0)
|
||||
histbeg = 0;
|
||||
if (histend < 0)
|
||||
histend = 0;
|
||||
|
||||
if (histend < histbeg)
|
||||
{
|
||||
@@ -507,7 +542,9 @@ fc_number (list)
|
||||
/* Return an absolute index into HLIST which corresponds to COMMAND. If
|
||||
COMMAND is a number, then it was specified in relative terms. If it
|
||||
is a string, then it is the start of a command line present in HLIST.
|
||||
MODE is 1 if we are listing commands, 0 if we are executing them. */
|
||||
MODE includes HN_LISTING if we are listing commands, and does not if we
|
||||
are executing them. If MODE includes HN_FIRST we are looking for the
|
||||
first history number specification. */
|
||||
static int
|
||||
fc_gethnum (command, hlist, mode)
|
||||
char *command;
|
||||
@@ -515,9 +552,10 @@ fc_gethnum (command, hlist, mode)
|
||||
int mode;
|
||||
{
|
||||
int sign, n, clen, rh;
|
||||
register int i, j, last_hist, real_last;
|
||||
register int i, j, last_hist, real_last, listing;
|
||||
register char *s;
|
||||
|
||||
listing = mode & HN_LISTING;
|
||||
sign = 1;
|
||||
/* Count history elements. */
|
||||
for (i = 0; hlist[i]; i++);
|
||||
@@ -570,19 +608,33 @@ fc_gethnum (command, hlist, mode)
|
||||
n = atoi (s);
|
||||
n *= sign;
|
||||
|
||||
/* We want to return something that is an offset to HISTORY_BASE. */
|
||||
|
||||
/* If the value is negative or zero, then it is an offset from
|
||||
the current history item. */
|
||||
/* We don't use HN_FIRST here, so we don't return different values
|
||||
depending on whether we're looking for the first or last in a
|
||||
pair of range arguments, but nobody else does, either. */
|
||||
if (n < 0)
|
||||
{
|
||||
n += i + 1;
|
||||
return (n < 0 ? 0 : n);
|
||||
}
|
||||
else if (n == 0)
|
||||
return ((sign == -1) ? (mode ? real_last : -1) : i);
|
||||
return ((sign == -1) ? (listing ? real_last : HIST_INVALID) : i);
|
||||
else
|
||||
{
|
||||
/* If we're out of range (greater than I (last history entry) or
|
||||
less than HISTORY_BASE, we want to return different values
|
||||
based on whether or not we are looking for the first or last
|
||||
value in a desired range of history entries. */
|
||||
n -= history_base;
|
||||
return (i < n ? i : n);
|
||||
if (n < 0)
|
||||
return (mode & HN_FIRST ? 0 : i);
|
||||
else if (n >= i)
|
||||
return (mode & HN_FIRST ? 0 : i);
|
||||
else
|
||||
return n;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,7 +644,7 @@ fc_gethnum (command, hlist, mode)
|
||||
if (STREQN (command, histline (j), clen))
|
||||
return (j);
|
||||
}
|
||||
return (-1);
|
||||
return (HIST_NOTFOUND);
|
||||
}
|
||||
|
||||
/* Locate the most recent history line which begins with
|
||||
|
||||
+2
-1
@@ -134,7 +134,8 @@ hash_builtin (list)
|
||||
if (list == 0 && expunge_hash_table == 0)
|
||||
{
|
||||
opt = print_hashed_commands (list_portably);
|
||||
if (opt == 0 && posixly_correct == 0)
|
||||
if (opt == 0 && posixly_correct == 0 &&
|
||||
(list_portably == 0 || shell_compatibility_level <= 50))
|
||||
printf (_("%s: hash table empty\n"), this_command_name);
|
||||
|
||||
return (EXECUTION_SUCCESS);
|
||||
|
||||
+15
-3
@@ -358,17 +358,29 @@ void
|
||||
set_current_options (bitmap)
|
||||
const char *bitmap;
|
||||
{
|
||||
int i;
|
||||
int i, v, cv, *on_or_off;
|
||||
|
||||
if (bitmap == 0)
|
||||
return;
|
||||
|
||||
for (i = 0; o_options[i].name; i++)
|
||||
{
|
||||
v = bitmap[i] ? FLAG_ON : FLAG_OFF;
|
||||
if (o_options[i].letter)
|
||||
change_flag (o_options[i].letter, bitmap[i] ? FLAG_ON : FLAG_OFF);
|
||||
{
|
||||
/* We should not get FLAG_UNKNOWN here */
|
||||
on_or_off = find_flag (o_options[i].letter);
|
||||
cv = *on_or_off ? FLAG_ON : FLAG_OFF;
|
||||
if (v != cv)
|
||||
change_flag (o_options[i].letter, v);
|
||||
}
|
||||
else
|
||||
SET_BINARY_O_OPTION_VALUE (i, bitmap[i] ? FLAG_ON : FLAG_OFF, o_options[i].name);
|
||||
{
|
||||
cv = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
|
||||
cv = cv ? FLAG_ON : FLAG_OFF;
|
||||
if (v != cv)
|
||||
SET_BINARY_O_OPTION_VALUE (i, v, o_options[i].name);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now reset the variables changed by posix mode */
|
||||
|
||||
@@ -645,7 +645,7 @@ set_var_attribute (name, attribute, undo)
|
||||
if (var == 0)
|
||||
{
|
||||
var = bind_variable (name, (char *)NULL, 0);
|
||||
if (var && no_invisible_vars == 0)
|
||||
if (var)
|
||||
VSETATTR (var, att_invisible);
|
||||
}
|
||||
else if (var->context != 0)
|
||||
|
||||
@@ -113,6 +113,7 @@ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select,
|
||||
#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */
|
||||
#define PF_COMPLETE 0x10 /* same as W_COMPLETE, sets SX_COMPLETE */
|
||||
#define PF_EXPANDRHS 0x20 /* same as W_EXPANDRHS */
|
||||
#define PF_ALLINDS 0x40 /* array, act as if [@] was supplied */
|
||||
|
||||
/* Possible values for subshell_environment */
|
||||
#define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# From configure.ac for Bash 5.1, version 5.020.
|
||||
# From configure.ac for Bash 5.1, version 5.021.
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for bash 5.1-alpha.
|
||||
# Generated by GNU Autoconf 2.69 for bash 5.1-beta.
|
||||
#
|
||||
# Report bugs to <bug-bash@gnu.org>.
|
||||
#
|
||||
@@ -581,8 +581,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bash'
|
||||
PACKAGE_TARNAME='bash'
|
||||
PACKAGE_VERSION='5.1-alpha'
|
||||
PACKAGE_STRING='bash 5.1-alpha'
|
||||
PACKAGE_VERSION='5.1-beta'
|
||||
PACKAGE_STRING='bash 5.1-beta'
|
||||
PACKAGE_BUGREPORT='bug-bash@gnu.org'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1427,7 +1427,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 5.1-alpha to adapt to many kinds of systems.
|
||||
\`configure' configures bash 5.1-beta to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1492,7 +1492,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bash 5.1-alpha:";;
|
||||
short | recursive ) echo "Configuration of bash 5.1-beta:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1693,7 +1693,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bash configure 5.1-alpha
|
||||
bash configure 5.1-beta
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2402,7 +2402,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 5.1-alpha, which was
|
||||
It was created by bash $as_me 5.1-beta, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2691,7 +2691,6 @@ as_fn_append ac_func_list " uselocale"
|
||||
as_fn_append ac_header_list " xlocale.h"
|
||||
as_fn_append ac_header_list " sys/time.h"
|
||||
as_fn_append ac_func_list " alarm"
|
||||
as_fn_append ac_func_list " sbrk"
|
||||
as_fn_append ac_func_list " fpurge"
|
||||
as_fn_append ac_func_list " __fpurge"
|
||||
as_fn_append ac_func_list " snprintf"
|
||||
@@ -2801,7 +2800,7 @@ ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
BASHVERS=5.1
|
||||
RELSTATUS=alpha
|
||||
RELSTATUS=beta
|
||||
|
||||
case "$RELSTATUS" in
|
||||
alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
|
||||
@@ -2903,6 +2902,9 @@ m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
|
||||
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
|
||||
*-aix*) opt_bash_malloc=no ;; # AIX machines
|
||||
*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
|
||||
# These lack a working sbrk(2)
|
||||
aarch64-freebsd*) opt_bash_malloc=no ;;
|
||||
riscv*-freebsd*) opt_bash_malloc=no ;;
|
||||
# Mach-derived systems have a ton of extra malloc functions and lack sbrk(2)
|
||||
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
|
||||
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
|
||||
@@ -2915,13 +2917,6 @@ sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
|
||||
*-nsk*) opt_bash_malloc=no ;; # HP NonStop
|
||||
*-haiku*) opt_bash_malloc=no ;; # Haiku OS
|
||||
*-genode*) opt_bash_malloc=no ;; # Genode has no sbrk
|
||||
# Deprecated -- bash malloc is suitable
|
||||
#sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment
|
||||
#mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment
|
||||
#*-freebsd*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here
|
||||
#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree
|
||||
#*-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
|
||||
#*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
|
||||
esac
|
||||
|
||||
# memory scrambling on free()
|
||||
@@ -18548,9 +18543,33 @@ fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sbrk" >&5
|
||||
$as_echo_n "checking for sbrk... " >&6; }
|
||||
if ${ac_cv_func_sbrk+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
void *x = sbrk (4096);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_func_sbrk=yes
|
||||
else
|
||||
ac_cv_func_sbrk=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_sbrk" >&5
|
||||
$as_echo "$ac_cv_func_sbrk" >&6; }
|
||||
if test X$ac_cv_func_sbrk = Xyes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working sbrk" >&5
|
||||
$as_echo_n "checking for working sbrk... " >&6; }
|
||||
@@ -18595,9 +18614,9 @@ $as_echo "$bash_cv_func_sbrk" >&6; }
|
||||
ac_cv_func_sbrk=no
|
||||
fi
|
||||
fi
|
||||
if test $ac_cv_func_sbrk = no; then
|
||||
if test $ac_cv_func_sbrk = yes; then
|
||||
|
||||
$as_echo "#define HAVE_SBRK 0" >>confdefs.h
|
||||
$as_echo "#define HAVE_SBRK 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
@@ -20394,6 +20413,7 @@ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
|
||||
;;
|
||||
esac ;;
|
||||
netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
|
||||
freebsd*) LOCAL_CFLAGS='-DHEREDOC_PIPESIZE=4096' ;;
|
||||
*qnx[67]*) LOCAL_LIBS="-lncurses" ;;
|
||||
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
|
||||
powerux*) LOCAL_LIBS="-lgen" ;;
|
||||
@@ -21037,7 +21057,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 5.1-alpha, which was
|
||||
This file was extended by bash $as_me 5.1-beta, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -21103,7 +21123,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 5.1-alpha
|
||||
bash config.status 5.1-beta
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
+7
-10
@@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AC_REVISION([for Bash 5.1, version 5.020])dnl
|
||||
AC_REVISION([for Bash 5.1, version 5.021])dnl
|
||||
|
||||
define(bashvers, 5.1)
|
||||
define(relstatus, alpha)
|
||||
define(relstatus, beta)
|
||||
|
||||
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
|
||||
|
||||
@@ -77,6 +77,9 @@ m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
|
||||
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
|
||||
*-aix*) opt_bash_malloc=no ;; # AIX machines
|
||||
*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
|
||||
# These lack a working sbrk(2)
|
||||
aarch64-freebsd*) opt_bash_malloc=no ;;
|
||||
riscv*-freebsd*) opt_bash_malloc=no ;;
|
||||
# Mach-derived systems have a ton of extra malloc functions and lack sbrk(2)
|
||||
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
|
||||
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
|
||||
@@ -89,13 +92,6 @@ sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
|
||||
*-nsk*) opt_bash_malloc=no ;; # HP NonStop
|
||||
*-haiku*) opt_bash_malloc=no ;; # Haiku OS
|
||||
*-genode*) opt_bash_malloc=no ;; # Genode has no sbrk
|
||||
# Deprecated -- bash malloc is suitable
|
||||
#sparc-netbsd*) opt_bash_malloc=no ;; # needs 8-byte alignment
|
||||
#mips-irix6*) opt_bash_malloc=no ;; # needs 8-byte alignment
|
||||
#*-freebsd*-gnu) opt_bash_malloc=no ;; # there's some undetermined problem here
|
||||
#*-freebsd*) opt_bash_malloc=no ;; # they claim it's better; I disagree
|
||||
#*-openbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
|
||||
#*-mirbsd*) opt_bash_malloc=no ;; # they claim it needs eight-bit alignment
|
||||
esac
|
||||
|
||||
# memory scrambling on free()
|
||||
@@ -1139,7 +1135,7 @@ LOCAL_DEFS=-DSHELL
|
||||
dnl use this section to possibly define more cpp variables, specify local
|
||||
dnl libraries, and specify any additional local cc or ld flags
|
||||
dnl
|
||||
dnl this should really go away someday
|
||||
dnl most of these are really old; this should really go away someday
|
||||
|
||||
case "${host_os}" in
|
||||
sysv4.2*) AC_DEFINE(SVR4_2)
|
||||
@@ -1168,6 +1164,7 @@ linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading
|
||||
*) AC_DEFINE(PGRP_PIPE) ;;
|
||||
esac ;;
|
||||
netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
|
||||
freebsd*) LOCAL_CFLAGS='-DHEREDOC_PIPESIZE=4096' ;;
|
||||
*qnx[[67]]*) LOCAL_LIBS="-lncurses" ;;
|
||||
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
|
||||
powerux*) LOCAL_LIBS="-lgen" ;;
|
||||
|
||||
+479
-471
File diff suppressed because it is too large
Load Diff
+25
-15
@@ -5,12 +5,12 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet.ramey@case.edu
|
||||
.\"
|
||||
.\" Last Change: Fri Jun 5 14:46:57 EDT 2020
|
||||
.\" Last Change: Tue Aug 25 09:58:55 EDT 2020
|
||||
.\"
|
||||
.\" bash_builtins, strip all but Built-Ins section
|
||||
.if \n(zZ=1 .ig zZ
|
||||
.if \n(zY=1 .ig zY
|
||||
.TH BASH 1 "2020 June 5" "GNU Bash 5.1"
|
||||
.TH BASH 1 "2020 August 25" "GNU Bash 5.1"
|
||||
.\"
|
||||
.\" There's some problem with having a `@'
|
||||
.\" in a tagged paragraph with the BSD man macros.
|
||||
@@ -2037,7 +2037,8 @@ below.
|
||||
.B BASH_COMPAT
|
||||
The value is used to set the shell's compatibility level.
|
||||
See
|
||||
\fBSHELL COMPATIBILITY MODE\fP
|
||||
.SM
|
||||
.B SHELL COMPATIBILITY MODE
|
||||
below for a description of the various compatibility
|
||||
levels and their effects.
|
||||
The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42)
|
||||
@@ -2049,7 +2050,8 @@ compatibility levels, the shell prints an error message and sets the
|
||||
compatibility level to the default for the current version.
|
||||
The valid values correspond to the compatibility levels
|
||||
described below under
|
||||
\fBSHELL COMPATIBILITY MODE\fP.
|
||||
.SM
|
||||
.BR BSHELL COMPATIBILITY MODE .
|
||||
For example, 4.2 and 42 are valid values that correspond
|
||||
to the \fBcompat42\fP \fBshopt\fP option
|
||||
and set the compatibility level to 42.
|
||||
@@ -2473,13 +2475,12 @@ had been executed.
|
||||
When the shell enters \fIposix mode\fP, it sets this variable if it was
|
||||
not already set.
|
||||
.TP
|
||||
.B PROMPT_COMMANDS
|
||||
If this array variable is set,
|
||||
.B PROMPT_COMMAND
|
||||
If this variable is set, and is an array,
|
||||
the value of each set element is executed as a command
|
||||
prior to issuing each primary prompt.
|
||||
If this is not set, but
|
||||
.B PROMPT_COMMAND
|
||||
is set to a value, its value is used as a command to execute instead.
|
||||
If this is set but not an array variable,
|
||||
its value is used as a command to execute instead.
|
||||
.TP
|
||||
.B PROMPT_DIRTRIM
|
||||
If set to a number greater than zero, the value is used as the number of
|
||||
@@ -5793,11 +5794,11 @@ replaced with an ellipsis when displaying possible completions.
|
||||
This determines when the user is queried about viewing
|
||||
the number of possible completions
|
||||
generated by the \fBpossible\-completions\fP command.
|
||||
It may be set to any integer value greater than or equal to
|
||||
zero. If the number of possible completions is greater than
|
||||
or equal to the value of this variable, the user is asked whether
|
||||
or not he wishes to view them; otherwise they are simply listed
|
||||
on the terminal.
|
||||
It may be set to any integer value greater than or equal to zero.
|
||||
If the number of possible completions is greater than
|
||||
or equal to the value of this variable,
|
||||
readline will ask whether or not the user wishes to view them;
|
||||
otherwise they are simply listed on the terminal.
|
||||
.TP
|
||||
.B convert\-meta (On)
|
||||
If set to \fBOn\fP, readline will convert characters with the
|
||||
@@ -8960,6 +8961,8 @@ If \fIname\fP is \-, the set of shell options is made local to the function
|
||||
in which \fBlocal\fP is invoked: shell options changed using the
|
||||
\fBset\fP builtin inside the function are restored to their original values
|
||||
when the function returns.
|
||||
The restore is effected as if a series of \fBset\fP commands were executed
|
||||
to restore the values that were in place before the function.
|
||||
With no operands,
|
||||
.B local
|
||||
writes a list of local variables to the standard output. It is
|
||||
@@ -9337,7 +9340,9 @@ Read input from file descriptor \fIfd\fP.
|
||||
.PP
|
||||
If no
|
||||
.I names
|
||||
are supplied, the line read is assigned to the variable
|
||||
are supplied, the line read,
|
||||
without the ending delimiter but otherwise unmodified,
|
||||
is assigned to the variable
|
||||
.SM
|
||||
.BR REPLY .
|
||||
The exit status is zero, unless end-of-file is encountered, \fBread\fP
|
||||
@@ -11058,6 +11063,11 @@ so seeding the random number generator by assigning a value to
|
||||
.SM
|
||||
.B RANDOM
|
||||
will produce the same sequence as in bash-5.0
|
||||
.IP \(bu
|
||||
If the command hash table is empty, bash versions prior to bash-5.1
|
||||
printed an informational message to that effect, even when producing
|
||||
output that can be reused as input. Bash-5.1 suppresses that message
|
||||
when the \fB\-l\fP option is supplied.
|
||||
.RE
|
||||
.PD
|
||||
.\" bash_builtins
|
||||
|
||||
+28
-17
@@ -3,7 +3,7 @@
|
||||
</HEAD>
|
||||
<BODY><TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2020 June 5<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2020 August 25<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<BR><A HREF="#index">Index</A>
|
||||
@@ -2589,7 +2589,9 @@ below.
|
||||
<DD>
|
||||
The value is used to set the shell's compatibility level.
|
||||
See
|
||||
<B>SHELL COMPATIBILITY MODE</B>
|
||||
<FONT SIZE=-1><B>SHELL COMPATIBILITY MODE</B>
|
||||
|
||||
</FONT>
|
||||
below for a description of the various compatibility
|
||||
levels and their effects.
|
||||
The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42)
|
||||
@@ -2601,7 +2603,9 @@ compatibility levels, the shell prints an error message and sets the
|
||||
compatibility level to the default for the current version.
|
||||
The valid values correspond to the compatibility levels
|
||||
described below under
|
||||
<B>SHELL COMPATIBILITY MODE</B>.
|
||||
<FONT SIZE=-1><B>BSHELL</B>COMPATIBILITY<B>MODE</B>.
|
||||
|
||||
</FONT>
|
||||
For example, 4.2 and 42 are valid values that correspond
|
||||
to the <B>compat42</B> <B>shopt</B> option
|
||||
and set the compatibility level to 42.
|
||||
@@ -3125,16 +3129,14 @@ running, <B>bash</B> enables <I>posix mode</I>, as if the command
|
||||
had been executed.
|
||||
When the shell enters <I>posix mode</I>, it sets this variable if it was
|
||||
not already set.
|
||||
<DT><B>PROMPT_COMMANDS</B>
|
||||
<DT><B>PROMPT_COMMAND</B>
|
||||
|
||||
<DD>
|
||||
If this array variable is set,
|
||||
If this variable is set, and is an array,
|
||||
the value of each set element is executed as a command
|
||||
prior to issuing each primary prompt.
|
||||
If this is not set, but
|
||||
<B>PROMPT_COMMAND</B>
|
||||
|
||||
is set to a value, its value is used as a command to execute instead.
|
||||
If this is set but not an array variable,
|
||||
its value is used as a command to execute instead.
|
||||
<DT><B>PROMPT_DIRTRIM</B>
|
||||
|
||||
<DD>
|
||||
@@ -7392,11 +7394,11 @@ replaced with an ellipsis when displaying possible completions.
|
||||
This determines when the user is queried about viewing
|
||||
the number of possible completions
|
||||
generated by the <B>possible-completions</B> command.
|
||||
It may be set to any integer value greater than or equal to
|
||||
zero. If the number of possible completions is greater than
|
||||
or equal to the value of this variable, the user is asked whether
|
||||
or not he wishes to view them; otherwise they are simply listed
|
||||
on the terminal.
|
||||
It may be set to any integer value greater than or equal to zero.
|
||||
If the number of possible completions is greater than
|
||||
or equal to the value of this variable,
|
||||
readline will ask whether or not the user wishes to view them;
|
||||
otherwise they are simply listed on the terminal.
|
||||
<DT><B>convert-meta (On)</B>
|
||||
|
||||
<DD>
|
||||
@@ -11307,6 +11309,8 @@ If <I>name</I> is -, the set of shell options is made local to the function
|
||||
in which <B>local</B> is invoked: shell options changed using the
|
||||
<B>set</B> builtin inside the function are restored to their original values
|
||||
when the function returns.
|
||||
The restore is effected as if a series of <B>set</B> commands were executed
|
||||
to restore the values that were in place before the function.
|
||||
With no operands,
|
||||
<B>local</B>
|
||||
|
||||
@@ -11765,7 +11769,9 @@ Read input from file descriptor <I>fd</I>.
|
||||
If no
|
||||
<I>names</I>
|
||||
|
||||
are supplied, the line read is assigned to the variable
|
||||
are supplied, the line read,
|
||||
without the ending delimiter but otherwise unmodified,
|
||||
is assigned to the variable
|
||||
<FONT SIZE=-1><B>REPLY</B>.
|
||||
|
||||
</FONT>
|
||||
@@ -13944,6 +13950,11 @@ so seeding the random number generator by assigning a value to
|
||||
|
||||
</FONT>
|
||||
will produce the same sequence as in bash-5.0
|
||||
<DT>*<DD>
|
||||
If the command hash table is empty, bash versions prior to bash-5.1
|
||||
printed an informational message to that effect, even when producing
|
||||
output that can be reused as input. Bash-5.1 suppresses that message
|
||||
when the <B>-l</B> option is supplied.
|
||||
</DL></DL>
|
||||
|
||||
|
||||
@@ -14241,7 +14252,7 @@ There may be only one active coprocess at a time.
|
||||
<HR>
|
||||
<TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash 5.1<TH ALIGN=CENTER width=33%>2020 June 5<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
<TH ALIGN=LEFT width=33%>GNU Bash 5.1<TH ALIGN=CENTER width=33%>2020 August 25<TH ALIGN=RIGHT width=33%>BASH(1)
|
||||
</TR>
|
||||
</TABLE>
|
||||
<HR>
|
||||
@@ -14348,6 +14359,6 @@ There may be only one active coprocess at a time.
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by man2html from bash.1.<BR>
|
||||
Time: 10 June 2020 12:00:48 EDT
|
||||
Time: 07 September 2020 09:52:27 EDT
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
+213
-197
@@ -2,9 +2,9 @@ This is bash.info, produced by makeinfo version 6.7 from
|
||||
bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
Bash shell (version 5.1, 5 June 2020).
|
||||
Bash shell (version 5.1, 25 August 2020).
|
||||
|
||||
This is Edition 5.1, last updated 5 June 2020, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 25 August 2020, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
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.1, 5 June 2020). The Bash home page is
|
||||
Bash shell (version 5.1, 25 August 2020). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.1, last updated 5 June 2020, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 25 August 2020, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -2322,7 +2322,7 @@ file descriptor greater than 10 and assign it to {VARNAME}. If >&- or
|
||||
<&- is preceded by {VARNAME}, the value of VARNAME defines the file
|
||||
descriptor to close. If {VARNAME} is supplied, the redirection persists
|
||||
beyond the scope of the command, allowing the shell programmer to manage
|
||||
the file descriptor himself.
|
||||
the file descriptor's lifetime manually.
|
||||
|
||||
In the following descriptions, if the file descriptor number is
|
||||
omitted, and the first character of the redirection operator is '<', the
|
||||
@@ -3202,12 +3202,12 @@ standard.
|
||||
|
||||
Shift the positional parameters to the left by N. The positional
|
||||
parameters from N+1 ... '$#' are renamed to '$1' ... '$#'-N.
|
||||
Parameters represented by the numbers '$#' to '$#'-N+1 are unset.
|
||||
N must be a non-negative number less than or equal to '$#'. If N
|
||||
is zero or greater than '$#', the positional parameters are not
|
||||
changed. If N is not supplied, it is assumed to be 1. The return
|
||||
status is zero unless N is greater than '$#' or less than zero,
|
||||
non-zero otherwise.
|
||||
Parameters represented by the numbers '$#' down to '$#'-N+1 are
|
||||
unset. N must be a non-negative number less than or equal to '$#'.
|
||||
If N is zero or greater than '$#', the positional parameters are
|
||||
not changed. If N is not supplied, it is assumed to be 1. The
|
||||
return status is zero unless N is greater than '$#' or less than
|
||||
zero, non-zero otherwise.
|
||||
|
||||
'test'
|
||||
'['
|
||||
@@ -3746,9 +3746,11 @@ standard.
|
||||
and its children. If NAME is '-', the set of shell options is made
|
||||
local to the function in which 'local' is invoked: shell options
|
||||
changed using the 'set' builtin inside the function are restored to
|
||||
their original values when the function returns. The return status
|
||||
is zero unless 'local' is used outside a function, an invalid NAME
|
||||
is supplied, or NAME is a readonly variable.
|
||||
their original values when the function returns. The restore is
|
||||
effected as if a series of 'set' commands were executed to restore
|
||||
the values that were in place before the function. The return
|
||||
status is zero unless 'local' is used outside a function, an
|
||||
invalid NAME is supplied, or NAME is a readonly variable.
|
||||
|
||||
'logout'
|
||||
logout [N]
|
||||
@@ -3866,13 +3868,7 @@ standard.
|
||||
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
|
||||
exit status is zero, unless end-of-file is encountered, 'read'
|
||||
times out (in which case the status 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'.
|
||||
next character read and for line continuation.
|
||||
|
||||
Options, if supplied, have the following meanings:
|
||||
|
||||
@@ -3944,6 +3940,14 @@ standard.
|
||||
'-u FD'
|
||||
Read input from file descriptor FD.
|
||||
|
||||
If no NAMEs are supplied, the line read, without the ending
|
||||
delimiter but otherwise unmodified, is assigned to the variable
|
||||
'REPLY'. The exit status is zero, unless end-of-file is
|
||||
encountered, 'read' times out (in which case the status 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'.
|
||||
|
||||
'readarray'
|
||||
readarray [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT]
|
||||
[-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY]
|
||||
@@ -4746,11 +4750,6 @@ This builtin allows you to change additional shell optional behavior.
|
||||
If set, the 'echo' builtin expands backslash-escape sequences
|
||||
by default.
|
||||
|
||||
The return status when listing options is zero if all OPTNAMES are
|
||||
enabled, non-zero otherwise. When setting or unsetting options,
|
||||
the return status is zero unless an OPTNAME is not a valid shell
|
||||
option.
|
||||
|
||||
|
||||
File: bash.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands
|
||||
|
||||
@@ -5423,11 +5422,11 @@ Variables::).
|
||||
The process ID of the shell's parent process. This variable is
|
||||
readonly.
|
||||
|
||||
'PROMPT_COMMANDS'
|
||||
If this array variable is set, the value of each set element is
|
||||
interpreted as a command to execute before printing the primary
|
||||
prompt ('$PS1'). If this is not set, but 'PROMPT_COMMAND' is set
|
||||
to a value, its value is used as a command to execute instead.
|
||||
'PROMPT_COMMAND'
|
||||
If this variable is set, and is an array, the value of each set
|
||||
element is interpreted as a command to execute before printing the
|
||||
primary prompt ('$PS1'). If this is set but not an array variable,
|
||||
its value is used as a command to execute instead.
|
||||
|
||||
'PROMPT_DIRTRIM'
|
||||
If set to a number greater than zero, the value is used as the
|
||||
@@ -7032,6 +7031,10 @@ required for bash-5.1 and later versions.
|
||||
previous versions, so seeding the random number generator by
|
||||
assigning a value to 'RANDOM' will produce the same sequence
|
||||
as in bash-5.0
|
||||
* If the command hash table is empty, Bash versions prior to
|
||||
bash-5.1 printed an informational message to that effect, even
|
||||
when producing output that can be reused as input. Bash-5.1
|
||||
suppresses that message when the '-l' option is supplied.
|
||||
|
||||
|
||||
File: bash.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top
|
||||
@@ -7698,11 +7701,11 @@ Variable Settings
|
||||
The number of possible completions that determines when the
|
||||
user is asked whether the list of possibilities should be
|
||||
displayed. If the number of possible completions is greater
|
||||
than this value, Readline will ask the user whether or not he
|
||||
wishes to view them; otherwise, they are simply listed. This
|
||||
variable must be set to an integer value greater than or equal
|
||||
to 0. A negative value means Readline should never ask. The
|
||||
default limit is '100'.
|
||||
than or equal to this value, Readline will ask whether or not
|
||||
the user wishes to view them; otherwise, they are simply
|
||||
listed. This variable must be set to an integer value greater
|
||||
than or equal to 0. A negative value means Readline should
|
||||
never ask. The default limit is '100'.
|
||||
|
||||
'convert-meta'
|
||||
If set to 'on', Readline will convert characters with the
|
||||
@@ -8229,8 +8232,8 @@ variable assignment, and conditional syntax.
|
||||
# rather than as meta-prefixed characters
|
||||
set output-meta on
|
||||
|
||||
# if there are more than 150 possible completions for
|
||||
# a word, ask the user if he wants to see all of them
|
||||
# if there are 150 or more possible completions for a word,
|
||||
# ask whether or not the user wants to see all of them
|
||||
set completion-query-items 150
|
||||
|
||||
# For FTP
|
||||
@@ -8358,10 +8361,14 @@ File: bash.info, Node: Commands For History, Next: Commands For Text, Prev: C
|
||||
'reverse-search-history (C-r)'
|
||||
Search backward starting at the current line and moving 'up'
|
||||
through the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the
|
||||
mark.
|
||||
|
||||
'forward-search-history (C-s)'
|
||||
Search forward starting at the current line and moving 'down'
|
||||
through the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the
|
||||
mark.
|
||||
|
||||
'non-incremental-reverse-search-history (M-p)'
|
||||
Search backward starting at the current line and moving 'up'
|
||||
@@ -8469,6 +8476,11 @@ File: bash.info, Node: Commands For Text, Next: Commands For Killing, Prev: C
|
||||
was bound to 'self-insert' instead of executing any editing
|
||||
commands.
|
||||
|
||||
Bracketed paste sets the region (the characters between point and
|
||||
the mark) to the inserted text. It uses the concept of an _active
|
||||
mark_: when the mark is active, Readline redisplay uses the
|
||||
terminal's standout mode to denote the region.
|
||||
|
||||
'transpose-chars (C-t)'
|
||||
Drag the character before the cursor forward over the character at
|
||||
the cursor, moving the cursor forward as well. If the insertion
|
||||
@@ -8513,10 +8525,14 @@ File: bash.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: C
|
||||
-------------------------
|
||||
|
||||
'kill-line (C-k)'
|
||||
Kill the text from point to the end of the line.
|
||||
Kill the text from point to the end of the line. With a negative
|
||||
numeric argument, kill backward from the cursor to the beginning of
|
||||
the current line.
|
||||
|
||||
'backward-kill-line (C-x Rubout)'
|
||||
Kill backward from the cursor to the beginning of the current line.
|
||||
With a negative numeric argument, kill forward from the cursor to
|
||||
the end of the current line.
|
||||
|
||||
'unix-line-discard (C-u)'
|
||||
Kill backward from the cursor to the beginning of the current line.
|
||||
@@ -11284,17 +11300,17 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 58)
|
||||
* let: Bash Builtins. (line 350)
|
||||
* local: Bash Builtins. (line 358)
|
||||
* logout: Bash Builtins. (line 372)
|
||||
* mapfile: Bash Builtins. (line 377)
|
||||
* logout: Bash Builtins. (line 374)
|
||||
* mapfile: Bash Builtins. (line 379)
|
||||
* popd: Directory Stack Builtins.
|
||||
(line 35)
|
||||
* printf: Bash Builtins. (line 423)
|
||||
* printf: Bash Builtins. (line 425)
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 53)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 207)
|
||||
* read: Bash Builtins. (line 472)
|
||||
* readarray: Bash Builtins. (line 566)
|
||||
* read: Bash Builtins. (line 474)
|
||||
* readarray: Bash Builtins. (line 570)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 217)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -11303,7 +11319,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 257)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 575)
|
||||
* source: Bash Builtins. (line 579)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 113)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -11312,12 +11328,12 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 349)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 355)
|
||||
* type: Bash Builtins. (line 580)
|
||||
* typeset: Bash Builtins. (line 612)
|
||||
* ulimit: Bash Builtins. (line 618)
|
||||
* type: Bash Builtins. (line 584)
|
||||
* typeset: Bash Builtins. (line 616)
|
||||
* ulimit: Bash Builtins. (line 622)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 404)
|
||||
* unalias: Bash Builtins. (line 721)
|
||||
* unalias: Bash Builtins. (line 725)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 422)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -11551,7 +11567,7 @@ D.3 Parameter and Variable Index
|
||||
* PIPESTATUS: Bash Variables. (line 553)
|
||||
* POSIXLY_CORRECT: Bash Variables. (line 558)
|
||||
* PPID: Bash Variables. (line 568)
|
||||
* PROMPT_COMMANDS: Bash Variables. (line 572)
|
||||
* PROMPT_COMMAND: Bash Variables. (line 572)
|
||||
* PROMPT_DIRTRIM: Bash Variables. (line 578)
|
||||
* PS0: Bash Variables. (line 584)
|
||||
* PS1: Bourne Shell Variables.
|
||||
@@ -11612,16 +11628,16 @@ D.4 Function Index
|
||||
* backward-char (C-b): Commands For Moving. (line 15)
|
||||
* backward-delete-char (Rubout): Commands For Text. (line 17)
|
||||
* backward-kill-line (C-x Rubout): Commands For Killing.
|
||||
(line 9)
|
||||
(line 11)
|
||||
* backward-kill-word (M-<DEL>): Commands For Killing.
|
||||
(line 24)
|
||||
(line 28)
|
||||
* backward-word (M-b): Commands For Moving. (line 22)
|
||||
* beginning-of-history (M-<): Commands For History.
|
||||
(line 20)
|
||||
* beginning-of-line (C-a): Commands For Moving. (line 6)
|
||||
* bracketed-paste-begin (): Commands For Text. (line 33)
|
||||
* call-last-kbd-macro (C-x e): Keyboard Macros. (line 13)
|
||||
* capitalize-word (M-c): Commands For Text. (line 61)
|
||||
* capitalize-word (M-c): Commands For Text. (line 66)
|
||||
* character-search (C-]): Miscellaneous Commands.
|
||||
(line 42)
|
||||
* character-search-backward (M-C-]): Miscellaneous Commands.
|
||||
@@ -11643,24 +11659,24 @@ D.4 Function Index
|
||||
* complete-variable (M-$): Commands For Completion.
|
||||
(line 64)
|
||||
* copy-backward-word (): Commands For Killing.
|
||||
(line 65)
|
||||
(line 69)
|
||||
* copy-forward-word (): Commands For Killing.
|
||||
(line 70)
|
||||
(line 74)
|
||||
* copy-region-as-kill (): Commands For Killing.
|
||||
(line 61)
|
||||
(line 65)
|
||||
* dabbrev-expand (): Commands For Completion.
|
||||
(line 95)
|
||||
* delete-char (C-d): Commands For Text. (line 12)
|
||||
* delete-char-or-list (): Commands For Completion.
|
||||
(line 43)
|
||||
* delete-horizontal-space (): Commands For Killing.
|
||||
(line 53)
|
||||
(line 57)
|
||||
* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6)
|
||||
* display-shell-version (C-x C-v): Miscellaneous Commands.
|
||||
(line 110)
|
||||
* do-lowercase-version (M-A, M-B, M-X, ...): Miscellaneous Commands.
|
||||
(line 14)
|
||||
* downcase-word (M-l): Commands For Text. (line 57)
|
||||
* downcase-word (M-l): Commands For Text. (line 62)
|
||||
* dump-functions (): Miscellaneous Commands.
|
||||
(line 74)
|
||||
* dump-macros (): Miscellaneous Commands.
|
||||
@@ -11681,7 +11697,7 @@ D.4 Function Index
|
||||
* forward-backward-delete-char (): Commands For Text. (line 21)
|
||||
* forward-char (C-f): Commands For Moving. (line 12)
|
||||
* forward-search-history (C-s): Commands For History.
|
||||
(line 31)
|
||||
(line 33)
|
||||
* forward-word (M-f): Commands For Moving. (line 18)
|
||||
* glob-complete-word (M-g): Miscellaneous Commands.
|
||||
(line 92)
|
||||
@@ -11694,13 +11710,13 @@ D.4 Function Index
|
||||
* history-expand-line (M-^): Miscellaneous Commands.
|
||||
(line 118)
|
||||
* history-search-backward (): Commands For History.
|
||||
(line 53)
|
||||
(line 57)
|
||||
* history-search-forward (): Commands For History.
|
||||
(line 47)
|
||||
(line 51)
|
||||
* history-substring-search-backward (): Commands For History.
|
||||
(line 65)
|
||||
(line 69)
|
||||
* history-substring-search-forward (): Commands For History.
|
||||
(line 59)
|
||||
(line 63)
|
||||
* insert-comment (M-#): Miscellaneous Commands.
|
||||
(line 61)
|
||||
* insert-completions (M-*): Commands For Completion.
|
||||
@@ -11710,11 +11726,11 @@ D.4 Function Index
|
||||
* kill-line (C-k): Commands For Killing.
|
||||
(line 6)
|
||||
* kill-region (): Commands For Killing.
|
||||
(line 57)
|
||||
(line 61)
|
||||
* kill-whole-line (): Commands For Killing.
|
||||
(line 15)
|
||||
* kill-word (M-d): Commands For Killing.
|
||||
(line 19)
|
||||
* kill-word (M-d): Commands For Killing.
|
||||
(line 23)
|
||||
* magic-space (): Miscellaneous Commands.
|
||||
(line 121)
|
||||
* menu-complete (): Commands For Completion.
|
||||
@@ -11725,12 +11741,12 @@ D.4 Function Index
|
||||
(line 17)
|
||||
* next-screen-line (): Commands For Moving. (line 41)
|
||||
* non-incremental-forward-search-history (M-n): Commands For History.
|
||||
(line 41)
|
||||
(line 45)
|
||||
* non-incremental-reverse-search-history (M-p): Commands For History.
|
||||
(line 35)
|
||||
(line 39)
|
||||
* operate-and-get-next (C-o): Commands For History.
|
||||
(line 92)
|
||||
* overwrite-mode (): Commands For Text. (line 65)
|
||||
(line 96)
|
||||
* overwrite-mode (): Commands For Text. (line 70)
|
||||
* possible-command-completions (C-x !): Commands For Completion.
|
||||
(line 86)
|
||||
* possible-completions (M-?): Commands For Completion.
|
||||
@@ -11761,40 +11777,40 @@ D.4 Function Index
|
||||
* set-mark (C-@): Miscellaneous Commands.
|
||||
(line 33)
|
||||
* shell-backward-kill-word (): Commands For Killing.
|
||||
(line 33)
|
||||
(line 37)
|
||||
* shell-backward-word (M-C-b): Commands For Moving. (line 30)
|
||||
* shell-expand-line (M-C-e): Miscellaneous Commands.
|
||||
(line 113)
|
||||
* shell-forward-word (M-C-f): Commands For Moving. (line 26)
|
||||
* shell-kill-word (M-C-d): Commands For Killing.
|
||||
(line 28)
|
||||
(line 32)
|
||||
* shell-transpose-words (M-C-t): Commands For Killing.
|
||||
(line 37)
|
||||
(line 41)
|
||||
* skip-csi-sequence (): Miscellaneous Commands.
|
||||
(line 52)
|
||||
* start-kbd-macro (C-x (): Keyboard Macros. (line 6)
|
||||
* tilde-expand (M-&): Miscellaneous Commands.
|
||||
(line 30)
|
||||
* transpose-chars (C-t): Commands For Text. (line 42)
|
||||
* transpose-words (M-t): Commands For Text. (line 48)
|
||||
* transpose-chars (C-t): Commands For Text. (line 47)
|
||||
* transpose-words (M-t): Commands For Text. (line 53)
|
||||
* undo (C-_ or C-x C-u): Miscellaneous Commands.
|
||||
(line 23)
|
||||
* universal-argument (): Numeric Arguments. (line 10)
|
||||
* unix-filename-rubout (): Commands For Killing.
|
||||
(line 48)
|
||||
(line 52)
|
||||
* unix-line-discard (C-u): Commands For Killing.
|
||||
(line 12)
|
||||
(line 16)
|
||||
* unix-word-rubout (C-w): Commands For Killing.
|
||||
(line 44)
|
||||
* upcase-word (M-u): Commands For Text. (line 53)
|
||||
(line 48)
|
||||
* upcase-word (M-u): Commands For Text. (line 58)
|
||||
* yank (C-y): Commands For Killing.
|
||||
(line 75)
|
||||
(line 79)
|
||||
* yank-last-arg (M-. or M-_): Commands For History.
|
||||
(line 80)
|
||||
(line 84)
|
||||
* yank-nth-arg (M-C-y): Commands For History.
|
||||
(line 71)
|
||||
(line 75)
|
||||
* yank-pop (M-y): Commands For Killing.
|
||||
(line 78)
|
||||
(line 82)
|
||||
|
||||
|
||||
File: bash.info, Node: Concept Index, Prev: Function Index, Up: Indexes
|
||||
@@ -11963,66 +11979,66 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top887
|
||||
Node: Introduction2797
|
||||
Node: What is Bash?3013
|
||||
Node: What is a shell?4127
|
||||
Node: Definitions6665
|
||||
Node: Basic Shell Features9616
|
||||
Node: Shell Syntax10835
|
||||
Node: Shell Operation11861
|
||||
Node: Quoting13154
|
||||
Node: Escape Character14454
|
||||
Node: Single Quotes14939
|
||||
Node: Double Quotes15287
|
||||
Node: ANSI-C Quoting16565
|
||||
Node: Locale Translation17824
|
||||
Node: Comments18977
|
||||
Node: Shell Commands19595
|
||||
Node: Reserved Words20533
|
||||
Node: Simple Commands21289
|
||||
Node: Pipelines21943
|
||||
Node: Lists24875
|
||||
Node: Compound Commands26666
|
||||
Node: Looping Constructs27678
|
||||
Node: Conditional Constructs30173
|
||||
Node: Command Grouping41744
|
||||
Node: Coprocesses43223
|
||||
Node: GNU Parallel45126
|
||||
Node: Shell Functions49427
|
||||
Node: Shell Parameters56634
|
||||
Node: Positional Parameters61047
|
||||
Node: Special Parameters61947
|
||||
Node: Shell Expansions65171
|
||||
Node: Brace Expansion67294
|
||||
Node: Tilde Expansion70017
|
||||
Node: Shell Parameter Expansion72634
|
||||
Node: Command Substitution87763
|
||||
Node: Arithmetic Expansion89118
|
||||
Node: Process Substitution90050
|
||||
Node: Word Splitting91170
|
||||
Node: Filename Expansion93114
|
||||
Node: Pattern Matching95663
|
||||
Node: Quote Removal99649
|
||||
Node: Redirections99944
|
||||
Node: Executing Commands109502
|
||||
Node: Simple Command Expansion110172
|
||||
Node: Command Search and Execution112126
|
||||
Node: Command Execution Environment114502
|
||||
Node: Environment117486
|
||||
Node: Exit Status119145
|
||||
Node: Signals120815
|
||||
Node: Shell Scripts122782
|
||||
Node: Shell Builtin Commands125794
|
||||
Node: Bourne Shell Builtins127832
|
||||
Node: Bash Builtins148756
|
||||
Node: Modifying Shell Behavior178486
|
||||
Node: The Set Builtin178831
|
||||
Node: The Shopt Builtin189244
|
||||
Node: Special Builtins204380
|
||||
Node: Shell Variables205359
|
||||
Node: Bourne Shell Variables205796
|
||||
Node: Bash Variables207900
|
||||
Node: Top893
|
||||
Node: Introduction2809
|
||||
Node: What is Bash?3025
|
||||
Node: What is a shell?4139
|
||||
Node: Definitions6677
|
||||
Node: Basic Shell Features9628
|
||||
Node: Shell Syntax10847
|
||||
Node: Shell Operation11873
|
||||
Node: Quoting13166
|
||||
Node: Escape Character14466
|
||||
Node: Single Quotes14951
|
||||
Node: Double Quotes15299
|
||||
Node: ANSI-C Quoting16577
|
||||
Node: Locale Translation17836
|
||||
Node: Comments18989
|
||||
Node: Shell Commands19607
|
||||
Node: Reserved Words20545
|
||||
Node: Simple Commands21301
|
||||
Node: Pipelines21955
|
||||
Node: Lists24887
|
||||
Node: Compound Commands26678
|
||||
Node: Looping Constructs27690
|
||||
Node: Conditional Constructs30185
|
||||
Node: Command Grouping41756
|
||||
Node: Coprocesses43235
|
||||
Node: GNU Parallel45138
|
||||
Node: Shell Functions49439
|
||||
Node: Shell Parameters56646
|
||||
Node: Positional Parameters61059
|
||||
Node: Special Parameters61959
|
||||
Node: Shell Expansions65183
|
||||
Node: Brace Expansion67306
|
||||
Node: Tilde Expansion70029
|
||||
Node: Shell Parameter Expansion72646
|
||||
Node: Command Substitution87775
|
||||
Node: Arithmetic Expansion89130
|
||||
Node: Process Substitution90062
|
||||
Node: Word Splitting91182
|
||||
Node: Filename Expansion93126
|
||||
Node: Pattern Matching95675
|
||||
Node: Quote Removal99661
|
||||
Node: Redirections99956
|
||||
Node: Executing Commands109526
|
||||
Node: Simple Command Expansion110196
|
||||
Node: Command Search and Execution112150
|
||||
Node: Command Execution Environment114526
|
||||
Node: Environment117510
|
||||
Node: Exit Status119169
|
||||
Node: Signals120839
|
||||
Node: Shell Scripts122806
|
||||
Node: Shell Builtin Commands125818
|
||||
Node: Bourne Shell Builtins127856
|
||||
Node: Bash Builtins148785
|
||||
Node: Modifying Shell Behavior178720
|
||||
Node: The Set Builtin179065
|
||||
Node: The Shopt Builtin189478
|
||||
Node: Special Builtins204388
|
||||
Node: Shell Variables205367
|
||||
Node: Bourne Shell Variables205804
|
||||
Node: Bash Variables207908
|
||||
Node: Bash Features240478
|
||||
Node: Invoking Bash241491
|
||||
Node: Bash Startup Files247504
|
||||
@@ -12040,60 +12056,60 @@ Node: Controlling the Prompt277893
|
||||
Node: The Restricted Shell280843
|
||||
Node: Bash POSIX Mode283437
|
||||
Node: Shell Compatibility Mode294473
|
||||
Node: Job Control300848
|
||||
Node: Job Control Basics301308
|
||||
Node: Job Control Builtins306304
|
||||
Node: Job Control Variables311704
|
||||
Node: Command Line Editing312860
|
||||
Node: Introduction and Notation314531
|
||||
Node: Readline Interaction316154
|
||||
Node: Readline Bare Essentials317345
|
||||
Node: Readline Movement Commands319128
|
||||
Node: Readline Killing Commands320088
|
||||
Node: Readline Arguments322006
|
||||
Node: Searching323050
|
||||
Node: Readline Init File325236
|
||||
Node: Readline Init File Syntax326495
|
||||
Node: Conditional Init Constructs347025
|
||||
Node: Sample Init File351221
|
||||
Node: Bindable Readline Commands354338
|
||||
Node: Commands For Moving355542
|
||||
Node: Commands For History357593
|
||||
Node: Commands For Text362220
|
||||
Node: Commands For Killing365608
|
||||
Node: Numeric Arguments368423
|
||||
Node: Commands For Completion369562
|
||||
Node: Keyboard Macros373753
|
||||
Node: Miscellaneous Commands374440
|
||||
Node: Readline vi Mode380124
|
||||
Node: Programmable Completion381031
|
||||
Node: Programmable Completion Builtins388811
|
||||
Node: A Programmable Completion Example399506
|
||||
Node: Using History Interactively404753
|
||||
Node: Bash History Facilities405437
|
||||
Node: Bash History Builtins408442
|
||||
Node: History Interaction413171
|
||||
Node: Event Designators416791
|
||||
Node: Word Designators418145
|
||||
Node: Modifiers419905
|
||||
Node: Installing Bash421716
|
||||
Node: Basic Installation422853
|
||||
Node: Compilers and Options426111
|
||||
Node: Compiling For Multiple Architectures426852
|
||||
Node: Installation Names428545
|
||||
Node: Specifying the System Type429363
|
||||
Node: Sharing Defaults430079
|
||||
Node: Operation Controls430752
|
||||
Node: Optional Features431710
|
||||
Node: Reporting Bugs442228
|
||||
Node: Major Differences From The Bourne Shell443422
|
||||
Node: GNU Free Documentation License460274
|
||||
Node: Indexes485451
|
||||
Node: Builtin Index485905
|
||||
Node: Reserved Word Index492732
|
||||
Node: Variable Index495180
|
||||
Node: Function Index511077
|
||||
Node: Concept Index524587
|
||||
Node: Job Control301129
|
||||
Node: Job Control Basics301589
|
||||
Node: Job Control Builtins306585
|
||||
Node: Job Control Variables311985
|
||||
Node: Command Line Editing313141
|
||||
Node: Introduction and Notation314812
|
||||
Node: Readline Interaction316435
|
||||
Node: Readline Bare Essentials317626
|
||||
Node: Readline Movement Commands319409
|
||||
Node: Readline Killing Commands320369
|
||||
Node: Readline Arguments322287
|
||||
Node: Searching323331
|
||||
Node: Readline Init File325517
|
||||
Node: Readline Init File Syntax326776
|
||||
Node: Conditional Init Constructs347315
|
||||
Node: Sample Init File351511
|
||||
Node: Bindable Readline Commands354635
|
||||
Node: Commands For Moving355839
|
||||
Node: Commands For History357890
|
||||
Node: Commands For Text362683
|
||||
Node: Commands For Killing366332
|
||||
Node: Numeric Arguments369365
|
||||
Node: Commands For Completion370504
|
||||
Node: Keyboard Macros374695
|
||||
Node: Miscellaneous Commands375382
|
||||
Node: Readline vi Mode381066
|
||||
Node: Programmable Completion381973
|
||||
Node: Programmable Completion Builtins389753
|
||||
Node: A Programmable Completion Example400448
|
||||
Node: Using History Interactively405695
|
||||
Node: Bash History Facilities406379
|
||||
Node: Bash History Builtins409384
|
||||
Node: History Interaction414113
|
||||
Node: Event Designators417733
|
||||
Node: Word Designators419087
|
||||
Node: Modifiers420847
|
||||
Node: Installing Bash422658
|
||||
Node: Basic Installation423795
|
||||
Node: Compilers and Options427053
|
||||
Node: Compiling For Multiple Architectures427794
|
||||
Node: Installation Names429487
|
||||
Node: Specifying the System Type430305
|
||||
Node: Sharing Defaults431021
|
||||
Node: Operation Controls431694
|
||||
Node: Optional Features432652
|
||||
Node: Reporting Bugs443170
|
||||
Node: Major Differences From The Bourne Shell444364
|
||||
Node: GNU Free Documentation License461216
|
||||
Node: Indexes486393
|
||||
Node: Builtin Index486847
|
||||
Node: Reserved Word Index493674
|
||||
Node: Variable Index496122
|
||||
Node: Function Index512019
|
||||
Node: Concept Index525529
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Binary file not shown.
+1242
-1225
File diff suppressed because it is too large
Load Diff
+4
-3
@@ -29,9 +29,10 @@ EENNVVIIRROONNMMEENNTT
|
||||
|
||||
EEDDIITTOORR Specifies the preferred editor. If EEDDIITTOORR is not set, bbaasshhbbuugg
|
||||
attempts to locate a number of alternative editors, including
|
||||
eemmaaccss, and defaults to vvii.
|
||||
eemmaaccss. If bbaasshhbbuugg cannot locate any of the alternative editors,
|
||||
it attempts to execute vvii.
|
||||
|
||||
HHOOMMEE Directory in which the failed bug report is saved if the mail
|
||||
HHOOMMEE Directory in which the failed bug report is saved if the mail
|
||||
fails.
|
||||
|
||||
TTMMPPDDIIRR Directory in which to create temporary files and directories.
|
||||
@@ -48,4 +49,4 @@ AAUUTTHHOORRSS
|
||||
|
||||
|
||||
|
||||
GNU Bash-4.4 2016 February 15 BASHBUG(1)
|
||||
GNU Bash 5.1 2020 August 1 BASHBUG(1)
|
||||
|
||||
+6
-4
@@ -5,9 +5,9 @@
|
||||
.\" Case Western Reserve University
|
||||
.\" chet@po.cwru.edu
|
||||
.\"
|
||||
.\" Last Change: Mon Feb 15 14:42:40 EST 2016
|
||||
.\" Last Change: Sun Aug 2 15:39:07 EDT 2020
|
||||
.\"
|
||||
.TH BASHBUG 1 "2016 February 15" "GNU Bash-4.4"
|
||||
.TH BASHBUG 1 "2020 August 1" "GNU Bash 5.1"
|
||||
.SH NAME
|
||||
bashbug \- report a bug in bash
|
||||
.SH SYNOPSIS
|
||||
@@ -44,8 +44,10 @@ Specifies the preferred editor. If
|
||||
is not set,
|
||||
.B bashbug
|
||||
attempts to locate a number of alternative editors, including
|
||||
.BR emacs ,
|
||||
and defaults to \fBvi\fP.
|
||||
.BR emacs .
|
||||
If
|
||||
.B bashbug
|
||||
cannot locate any of the alternative editors, it attempts to execute \fBvi\fP.
|
||||
.TP
|
||||
.B HOME
|
||||
Directory in which the failed bug report is saved if the mail fails.
|
||||
|
||||
+19
-16
@@ -1,10 +1,10 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.22.3
|
||||
%%CreationDate: Mon Mar 28 15:34:55 2016
|
||||
%%Creator: groff version 1.22.4
|
||||
%%CreationDate: Fri Aug 7 11:58:10 2020
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%+ font Times-Italic
|
||||
%%DocumentSuppliedResources: procset grops 1.22 3
|
||||
%%DocumentSuppliedResources: procset grops 1.22 4
|
||||
%%Pages: 1
|
||||
%%PageOrder: Ascend
|
||||
%%DocumentMedia: Default 612 792 0 () ()
|
||||
@@ -14,7 +14,7 @@
|
||||
%%PageMedia: Default
|
||||
%%EndDefaults
|
||||
%%BeginProlog
|
||||
%%BeginResource: procset grops 1.22 3
|
||||
%%BeginResource: procset grops 1.22 4
|
||||
%!PS-Adobe-3.0 Resource-ProcSet
|
||||
/setpacking where{
|
||||
pop
|
||||
@@ -275,20 +275,23 @@ E(vironment v)-.4 E(ariables if the)-.25 E 2.5(ye)-.15 G(xist:)-2.65 E
|
||||
F2(EDIT)108 300 Q(OR)-.18 E F0 .327(Speci\214es the preferred editor)144
|
||||
312 R 2.827(.I)-.55 G(f)-2.827 E F4(EDIT)2.827 E(OR)-.162 E F0 .327
|
||||
(is not set,)2.577 F F2(bashb)2.827 E(ug)-.2 E F0 .328
|
||||
(attempts to locate a number of alter)2.827 F(-)-.2 E(nati)144 324 Q .3
|
||||
-.15(ve e)-.25 H(ditors, including).15 E F2(emacs)2.5 E F0 2.5(,a)C
|
||||
(nd def)-2.5 E(aults to)-.1 E F2(vi)2.5 E F0(.)A F2(HOME)108 340.8 Q F0
|
||||
(Directory in which the f)144 352.8 Q(ailed b)-.1 E(ug report is sa)-.2
|
||||
E -.15(ve)-.2 G 2.5(di).15 G 2.5(ft)-2.5 G(he mail f)-2.5 E(ails.)-.1 E
|
||||
F2(TMPDIR)108 369.6 Q F0
|
||||
(attempts to locate a number of alter)2.827 F(-)-.2 E(nati)144 324 Q
|
||||
1.925 -.15(ve e)-.25 H 1.625(ditors, including).15 F F2(emacs)4.125 E F0
|
||||
6.625(.I)C(f)-6.625 E F2(bashb)4.125 E(ug)-.2 E F0 1.625
|
||||
(cannot locate an)4.125 F 4.125(yo)-.15 G 4.125(ft)-4.125 G 1.625
|
||||
(he alternati)-4.125 F 1.925 -.15(ve e)-.25 H 1.625(ditors, it at-).15 F
|
||||
(tempts to e)144 336 Q -.15(xe)-.15 G(cute).15 E F2(vi)2.5 E F0(.)A F2
|
||||
(HOME)108 352.8 Q F0(Directory in which the f)144 364.8 Q(ailed b)-.1 E
|
||||
(ug report is sa)-.2 E -.15(ve)-.2 G 2.5(di).15 G 2.5(ft)-2.5 G
|
||||
(he mail f)-2.5 E(ails.)-.1 E F2(TMPDIR)108 381.6 Q F0
|
||||
(Directory in which to create temporary \214les and directories.)144
|
||||
381.6 Q F1(SEE ALSO)72 398.4 Q F3(bash)108 410.4 Q F0(\(1\))A F1 -.548
|
||||
(AU)72 427.2 S(THORS).548 E F0(Brian F)108 439.2 Q(ox, Free Softw)-.15 E
|
||||
(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 451.2 Q(g)-.18 E
|
||||
(Chet Rame)108 468 Q 1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8
|
||||
393.6 Q F1(SEE ALSO)72 410.4 Q F3(bash)108 422.4 Q F0(\(1\))A F1 -.548
|
||||
(AU)72 439.2 S(THORS).548 E F0(Brian F)108 451.2 Q(ox, Free Softw)-.15 E
|
||||
(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 463.2 Q(g)-.18 E
|
||||
(Chet Rame)108 480 Q 1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8
|
||||
E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(chet@po.cwru.edu)
|
||||
108 480 Q(GNU Bash-4.4)72 768 Q(2016 February 15)138.46 E(1)193.45 E 0
|
||||
Cg EP
|
||||
108 492 Q(GNU Bash 5.1)72 768 Q(2020 August 1)145.395 E(1)199.555 E 0 Cg
|
||||
EP
|
||||
%%Trailer
|
||||
end
|
||||
%%EOF
|
||||
|
||||
Binary file not shown.
+44
-30
@@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- This text is a brief description of the features that are present in
|
||||
the Bash shell (version 5.1, 5 June 2020).
|
||||
the Bash shell (version 5.1, 25 August 2020).
|
||||
|
||||
This is Edition 5.1, last updated 5 June 2020,
|
||||
This is Edition 5.1, last updated 25 August 2020,
|
||||
of The GNU Bash Reference Manual,
|
||||
for Bash, Version 5.1.
|
||||
|
||||
@@ -275,10 +275,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
|
||||
<span id="Bash-Features-1"></span><h1 class="top">Bash Features</h1>
|
||||
|
||||
<p>This text is a brief description of the features that are present in
|
||||
the Bash shell (version 5.1, 5 June 2020).
|
||||
the Bash shell (version 5.1, 25 August 2020).
|
||||
The Bash home page is <a href="http://www.gnu.org/software/bash/">http://www.gnu.org/software/bash/</a>.
|
||||
</p>
|
||||
<p>This is Edition 5.1, last updated 5 June 2020,
|
||||
<p>This is Edition 5.1, last updated 25 August 2020,
|
||||
of <cite>The GNU Bash Reference Manual</cite>,
|
||||
for <code>Bash</code>, Version 5.1.
|
||||
</p>
|
||||
@@ -3229,7 +3229,7 @@ by {<var>varname</var>}, the value of <var>varname</var> defines the file
|
||||
descriptor to close.
|
||||
If {<var>varname</var>} is supplied, the redirection persists beyond
|
||||
the scope of the command, allowing the shell programmer to manage
|
||||
the file descriptor himself.
|
||||
the file descriptor’s lifetime manually.
|
||||
</p>
|
||||
<p>In the following descriptions, if the file descriptor number is
|
||||
omitted, and the first character of the redirection operator is
|
||||
@@ -4322,7 +4322,7 @@ and not during the execution of a script by <code>.</code> or <code>source</code
|
||||
<p>Shift the positional parameters to the left by <var>n</var>.
|
||||
The positional parameters from <var>n</var>+1 … <code>$#</code> are
|
||||
renamed to <code>$1</code> … <code>$#</code>-<var>n</var>.
|
||||
Parameters represented by the numbers <code>$#</code> to <code>$#</code>-<var>n</var>+1
|
||||
Parameters represented by the numbers <code>$#</code> down to <code>$#</code>-<var>n</var>+1
|
||||
are unset.
|
||||
<var>n</var> must be a non-negative number less than or equal to <code>$#</code>.
|
||||
If <var>n</var> is zero or greater than <code>$#</code>, the positional parameters
|
||||
@@ -5040,6 +5040,8 @@ If <var>name</var> is ‘<samp>-</samp>’, the set of shell options is
|
||||
function in which <code>local</code> is invoked: shell options changed using
|
||||
the <code>set</code> builtin inside the function are restored to their original
|
||||
values when the function returns.
|
||||
The restore is effected as if a series of <code>set</code> commands were executed
|
||||
to restore the values that were in place before the function.
|
||||
The return status is zero unless <code>local</code> is used outside
|
||||
a function, an invalid <var>name</var> is supplied, or <var>name</var> is a
|
||||
readonly variable.
|
||||
@@ -5197,12 +5199,6 @@ are used to split the line into words using the same rules the shell
|
||||
uses for expansion (described above in <a href="#Word-Splitting">Word Splitting</a>).
|
||||
The backslash character ‘<samp>\</samp>’ 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 <code>REPLY</code>.
|
||||
The exit status is zero, unless end-of-file is encountered, <code>read</code>
|
||||
times out (in which case the status 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 <samp>-u</samp>.
|
||||
</p>
|
||||
<p>Options, if supplied, have the following meanings:
|
||||
</p>
|
||||
@@ -5290,6 +5286,15 @@ The exit status is greater than 128 if the timeout is exceeded.
|
||||
</p></dd>
|
||||
</dl>
|
||||
|
||||
<p>If no <var>name</var>s are supplied, the line read,
|
||||
without the ending delimiter but otherwise unmodified,
|
||||
is assigned to the
|
||||
variable <code>REPLY</code>.
|
||||
The exit status is zero, unless end-of-file is encountered, <code>read</code>
|
||||
times out (in which case the status 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 <samp>-u</samp>.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>readarray</code></dt>
|
||||
<dd><span id="index-readarray"></span>
|
||||
@@ -6289,12 +6294,7 @@ by default.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p>The return status when listing options is zero if all <var>optnames</var>
|
||||
are enabled, non-zero otherwise.
|
||||
When setting or unsetting options, the return status is zero unless an
|
||||
<var>optname</var> is not a valid shell option.
|
||||
</p></dd>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<hr>
|
||||
@@ -7322,15 +7322,14 @@ not already set.
|
||||
is readonly.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>PROMPT_COMMANDS</code>
|
||||
<span id="index-PROMPT_005fCOMMANDS"></span>
|
||||
<dt><code>PROMPT_COMMAND</code>
|
||||
<span id="index-PROMPT_005fCOMMAND"></span>
|
||||
</dt>
|
||||
<dd><p>If this array variable is set,
|
||||
<dd><p>If this variable is set, and is an array,
|
||||
the value of each set element is interpreted as a command to execute
|
||||
before printing the primary prompt (<code>$PS1</code>).
|
||||
If this is not set, but
|
||||
<code>PROMPT_COMMAND</code>
|
||||
is set to a value, its value is used as a command to execute instead.
|
||||
If this is set but not an array variable,
|
||||
its value is used as a command to execute instead.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>PROMPT_DIRTRIM</code>
|
||||
@@ -9347,6 +9346,10 @@ more randomness. If the shell compatibility level is set to 50 or
|
||||
lower, it reverts to the method from bash-5.0 and previous versions,
|
||||
so seeding the random number generator by assigning a value to
|
||||
<code>RANDOM</code> will produce the same sequence as in bash-5.0
|
||||
</li><li> If the command hash table is empty, Bash versions prior to bash-5.1
|
||||
printed an informational message to that effect, even when producing
|
||||
output that can be reused as input. Bash-5.1 suppresses that message
|
||||
when the <samp>-l</samp> option is supplied.
|
||||
</li></ul>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -10218,9 +10221,9 @@ replaced with an ellipsis when displaying possible completions.
|
||||
<dd><span id="index-completion_002dquery_002ditems"></span>
|
||||
<p>The number of possible completions that determines when the user is
|
||||
asked whether the list of possibilities should be displayed.
|
||||
If the number of possible completions is greater than this value,
|
||||
Readline will ask the user whether or not he wishes to view
|
||||
them; otherwise, they are simply listed.
|
||||
If the number of possible completions is greater than or equal to this value,
|
||||
Readline will ask whether or not the user wishes to view them;
|
||||
otherwise, they are simply listed.
|
||||
This variable must be set to an integer value greater than or equal to 0.
|
||||
A negative value means Readline should never ask.
|
||||
The default limit is <code>100</code>.
|
||||
@@ -10907,8 +10910,8 @@ set convert-meta off
|
||||
# rather than as meta-prefixed characters
|
||||
set output-meta on
|
||||
|
||||
# if there are more than 150 possible completions for
|
||||
# a word, ask the user if he wants to see all of them
|
||||
# if there are 150 or more possible completions for a word,
|
||||
# ask whether or not the user wants to see all of them
|
||||
set completion-query-items 150
|
||||
|
||||
# For FTP
|
||||
@@ -11108,6 +11111,7 @@ being entered.
|
||||
</dt>
|
||||
<dd><p>Search backward starting at the current line and moving ‘up’ through
|
||||
the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the mark.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>forward-search-history (C-s)</code>
|
||||
@@ -11115,6 +11119,7 @@ the history as necessary. This is an incremental search.
|
||||
</dt>
|
||||
<dd><p>Search forward starting at the current line and moving ‘down’ through
|
||||
the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the mark.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>non-incremental-reverse-search-history (M-p)</code>
|
||||
@@ -11281,6 +11286,11 @@ each character as if it had been read from the keyboard. The characters
|
||||
are inserted as if each one was bound to <code>self-insert</code> instead of
|
||||
executing any editing commands.
|
||||
</p>
|
||||
<p>Bracketed paste sets the region (the characters between point and the mark)
|
||||
to the inserted text. It uses the concept of an <em>active mark</em>: when the
|
||||
mark is active, Readline redisplay uses the terminal’s standout mode to
|
||||
denote the region.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>transpose-chars (C-t)</code>
|
||||
<span id="index-transpose_002dchars-_0028C_002dt_0029"></span>
|
||||
@@ -11354,12 +11364,16 @@ Next: <a href="#Numeric-Arguments" accesskey="n" rel="next">Numeric Arguments</a
|
||||
<span id="index-kill_002dline-_0028C_002dk_0029"></span>
|
||||
</dt>
|
||||
<dd><p>Kill the text from point to the end of the line.
|
||||
With a negative numeric argument, kill backward from the cursor to the
|
||||
beginning of the current line.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>backward-kill-line (C-x Rubout)</code>
|
||||
<span id="index-backward_002dkill_002dline-_0028C_002dx-Rubout_0029"></span>
|
||||
</dt>
|
||||
<dd><p>Kill backward from the cursor to the beginning of the current line.
|
||||
With a negative numeric argument, kill forward from the cursor to the
|
||||
end of the current line.
|
||||
</p>
|
||||
</dd>
|
||||
<dt><code>unix-line-discard (C-u)</code>
|
||||
@@ -15230,7 +15244,7 @@ Next: <a href="#Function-Index" accesskey="n" rel="next">Function Index</a>, Pre
|
||||
<tr><td></td><td valign="top"><a href="#index-PIPESTATUS"><code>PIPESTATUS</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-POSIXLY_005fCORRECT"><code>POSIXLY_CORRECT</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-PPID"><code>PPID</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-PROMPT_005fCOMMANDS"><code>PROMPT_COMMANDS</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-PROMPT_005fCOMMAND"><code>PROMPT_COMMAND</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-PROMPT_005fDIRTRIM"><code>PROMPT_DIRTRIM</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-PS0"><code>PS0</code></a>:</td><td> </td><td valign="top"><a href="#Bash-Variables">Bash Variables</a></td></tr>
|
||||
<tr><td></td><td valign="top"><a href="#index-PS1"><code>PS1</code></a>:</td><td> </td><td valign="top"><a href="#Bourne-Shell-Variables">Bourne Shell Variables</a></td></tr>
|
||||
|
||||
+213
-197
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 6.7 from
|
||||
bashref.texi.
|
||||
|
||||
This text is a brief description of the features that are present in the
|
||||
Bash shell (version 5.1, 5 June 2020).
|
||||
Bash shell (version 5.1, 25 August 2020).
|
||||
|
||||
This is Edition 5.1, last updated 5 June 2020, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 25 August 2020, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
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.1, 5 June 2020). The Bash home page is
|
||||
Bash shell (version 5.1, 25 August 2020). The Bash home page is
|
||||
<http://www.gnu.org/software/bash/>.
|
||||
|
||||
This is Edition 5.1, last updated 5 June 2020, of 'The GNU Bash
|
||||
This is Edition 5.1, last updated 25 August 2020, of 'The GNU Bash
|
||||
Reference Manual', for 'Bash', Version 5.1.
|
||||
|
||||
Bash contains features that appear in other popular shells, and some
|
||||
@@ -2322,7 +2322,7 @@ file descriptor greater than 10 and assign it to {VARNAME}. If >&- or
|
||||
<&- is preceded by {VARNAME}, the value of VARNAME defines the file
|
||||
descriptor to close. If {VARNAME} is supplied, the redirection persists
|
||||
beyond the scope of the command, allowing the shell programmer to manage
|
||||
the file descriptor himself.
|
||||
the file descriptor's lifetime manually.
|
||||
|
||||
In the following descriptions, if the file descriptor number is
|
||||
omitted, and the first character of the redirection operator is '<', the
|
||||
@@ -3202,12 +3202,12 @@ standard.
|
||||
|
||||
Shift the positional parameters to the left by N. The positional
|
||||
parameters from N+1 ... '$#' are renamed to '$1' ... '$#'-N.
|
||||
Parameters represented by the numbers '$#' to '$#'-N+1 are unset.
|
||||
N must be a non-negative number less than or equal to '$#'. If N
|
||||
is zero or greater than '$#', the positional parameters are not
|
||||
changed. If N is not supplied, it is assumed to be 1. The return
|
||||
status is zero unless N is greater than '$#' or less than zero,
|
||||
non-zero otherwise.
|
||||
Parameters represented by the numbers '$#' down to '$#'-N+1 are
|
||||
unset. N must be a non-negative number less than or equal to '$#'.
|
||||
If N is zero or greater than '$#', the positional parameters are
|
||||
not changed. If N is not supplied, it is assumed to be 1. The
|
||||
return status is zero unless N is greater than '$#' or less than
|
||||
zero, non-zero otherwise.
|
||||
|
||||
'test'
|
||||
'['
|
||||
@@ -3746,9 +3746,11 @@ standard.
|
||||
and its children. If NAME is '-', the set of shell options is made
|
||||
local to the function in which 'local' is invoked: shell options
|
||||
changed using the 'set' builtin inside the function are restored to
|
||||
their original values when the function returns. The return status
|
||||
is zero unless 'local' is used outside a function, an invalid NAME
|
||||
is supplied, or NAME is a readonly variable.
|
||||
their original values when the function returns. The restore is
|
||||
effected as if a series of 'set' commands were executed to restore
|
||||
the values that were in place before the function. The return
|
||||
status is zero unless 'local' is used outside a function, an
|
||||
invalid NAME is supplied, or NAME is a readonly variable.
|
||||
|
||||
'logout'
|
||||
logout [N]
|
||||
@@ -3866,13 +3868,7 @@ standard.
|
||||
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
|
||||
exit status is zero, unless end-of-file is encountered, 'read'
|
||||
times out (in which case the status 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'.
|
||||
next character read and for line continuation.
|
||||
|
||||
Options, if supplied, have the following meanings:
|
||||
|
||||
@@ -3944,6 +3940,14 @@ standard.
|
||||
'-u FD'
|
||||
Read input from file descriptor FD.
|
||||
|
||||
If no NAMEs are supplied, the line read, without the ending
|
||||
delimiter but otherwise unmodified, is assigned to the variable
|
||||
'REPLY'. The exit status is zero, unless end-of-file is
|
||||
encountered, 'read' times out (in which case the status 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'.
|
||||
|
||||
'readarray'
|
||||
readarray [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT]
|
||||
[-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY]
|
||||
@@ -4746,11 +4750,6 @@ This builtin allows you to change additional shell optional behavior.
|
||||
If set, the 'echo' builtin expands backslash-escape sequences
|
||||
by default.
|
||||
|
||||
The return status when listing options is zero if all OPTNAMES are
|
||||
enabled, non-zero otherwise. When setting or unsetting options,
|
||||
the return status is zero unless an OPTNAME is not a valid shell
|
||||
option.
|
||||
|
||||
|
||||
File: bashref.info, Node: Special Builtins, Prev: Modifying Shell Behavior, Up: Shell Builtin Commands
|
||||
|
||||
@@ -5423,11 +5422,11 @@ Variables::).
|
||||
The process ID of the shell's parent process. This variable is
|
||||
readonly.
|
||||
|
||||
'PROMPT_COMMANDS'
|
||||
If this array variable is set, the value of each set element is
|
||||
interpreted as a command to execute before printing the primary
|
||||
prompt ('$PS1'). If this is not set, but 'PROMPT_COMMAND' is set
|
||||
to a value, its value is used as a command to execute instead.
|
||||
'PROMPT_COMMAND'
|
||||
If this variable is set, and is an array, the value of each set
|
||||
element is interpreted as a command to execute before printing the
|
||||
primary prompt ('$PS1'). If this is set but not an array variable,
|
||||
its value is used as a command to execute instead.
|
||||
|
||||
'PROMPT_DIRTRIM'
|
||||
If set to a number greater than zero, the value is used as the
|
||||
@@ -7032,6 +7031,10 @@ required for bash-5.1 and later versions.
|
||||
previous versions, so seeding the random number generator by
|
||||
assigning a value to 'RANDOM' will produce the same sequence
|
||||
as in bash-5.0
|
||||
* If the command hash table is empty, Bash versions prior to
|
||||
bash-5.1 printed an informational message to that effect, even
|
||||
when producing output that can be reused as input. Bash-5.1
|
||||
suppresses that message when the '-l' option is supplied.
|
||||
|
||||
|
||||
File: bashref.info, Node: Job Control, Next: Command Line Editing, Prev: Bash Features, Up: Top
|
||||
@@ -7698,11 +7701,11 @@ Variable Settings
|
||||
The number of possible completions that determines when the
|
||||
user is asked whether the list of possibilities should be
|
||||
displayed. If the number of possible completions is greater
|
||||
than this value, Readline will ask the user whether or not he
|
||||
wishes to view them; otherwise, they are simply listed. This
|
||||
variable must be set to an integer value greater than or equal
|
||||
to 0. A negative value means Readline should never ask. The
|
||||
default limit is '100'.
|
||||
than or equal to this value, Readline will ask whether or not
|
||||
the user wishes to view them; otherwise, they are simply
|
||||
listed. This variable must be set to an integer value greater
|
||||
than or equal to 0. A negative value means Readline should
|
||||
never ask. The default limit is '100'.
|
||||
|
||||
'convert-meta'
|
||||
If set to 'on', Readline will convert characters with the
|
||||
@@ -8229,8 +8232,8 @@ variable assignment, and conditional syntax.
|
||||
# rather than as meta-prefixed characters
|
||||
set output-meta on
|
||||
|
||||
# if there are more than 150 possible completions for
|
||||
# a word, ask the user if he wants to see all of them
|
||||
# if there are 150 or more possible completions for a word,
|
||||
# ask whether or not the user wants to see all of them
|
||||
set completion-query-items 150
|
||||
|
||||
# For FTP
|
||||
@@ -8358,10 +8361,14 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev
|
||||
'reverse-search-history (C-r)'
|
||||
Search backward starting at the current line and moving 'up'
|
||||
through the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the
|
||||
mark.
|
||||
|
||||
'forward-search-history (C-s)'
|
||||
Search forward starting at the current line and moving 'down'
|
||||
through the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the
|
||||
mark.
|
||||
|
||||
'non-incremental-reverse-search-history (M-p)'
|
||||
Search backward starting at the current line and moving 'up'
|
||||
@@ -8469,6 +8476,11 @@ File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev
|
||||
was bound to 'self-insert' instead of executing any editing
|
||||
commands.
|
||||
|
||||
Bracketed paste sets the region (the characters between point and
|
||||
the mark) to the inserted text. It uses the concept of an _active
|
||||
mark_: when the mark is active, Readline redisplay uses the
|
||||
terminal's standout mode to denote the region.
|
||||
|
||||
'transpose-chars (C-t)'
|
||||
Drag the character before the cursor forward over the character at
|
||||
the cursor, moving the cursor forward as well. If the insertion
|
||||
@@ -8513,10 +8525,14 @@ File: bashref.info, Node: Commands For Killing, Next: Numeric Arguments, Prev
|
||||
-------------------------
|
||||
|
||||
'kill-line (C-k)'
|
||||
Kill the text from point to the end of the line.
|
||||
Kill the text from point to the end of the line. With a negative
|
||||
numeric argument, kill backward from the cursor to the beginning of
|
||||
the current line.
|
||||
|
||||
'backward-kill-line (C-x Rubout)'
|
||||
Kill backward from the cursor to the beginning of the current line.
|
||||
With a negative numeric argument, kill forward from the cursor to
|
||||
the end of the current line.
|
||||
|
||||
'unix-line-discard (C-u)'
|
||||
Kill backward from the cursor to the beginning of the current line.
|
||||
@@ -11284,17 +11300,17 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 58)
|
||||
* let: Bash Builtins. (line 350)
|
||||
* local: Bash Builtins. (line 358)
|
||||
* logout: Bash Builtins. (line 372)
|
||||
* mapfile: Bash Builtins. (line 377)
|
||||
* logout: Bash Builtins. (line 374)
|
||||
* mapfile: Bash Builtins. (line 379)
|
||||
* popd: Directory Stack Builtins.
|
||||
(line 35)
|
||||
* printf: Bash Builtins. (line 423)
|
||||
* printf: Bash Builtins. (line 425)
|
||||
* pushd: Directory Stack Builtins.
|
||||
(line 53)
|
||||
* pwd: Bourne Shell Builtins.
|
||||
(line 207)
|
||||
* read: Bash Builtins. (line 472)
|
||||
* readarray: Bash Builtins. (line 566)
|
||||
* read: Bash Builtins. (line 474)
|
||||
* readarray: Bash Builtins. (line 570)
|
||||
* readonly: Bourne Shell Builtins.
|
||||
(line 217)
|
||||
* return: Bourne Shell Builtins.
|
||||
@@ -11303,7 +11319,7 @@ D.1 Index of Shell Builtin Commands
|
||||
* shift: Bourne Shell Builtins.
|
||||
(line 257)
|
||||
* shopt: The Shopt Builtin. (line 9)
|
||||
* source: Bash Builtins. (line 575)
|
||||
* source: Bash Builtins. (line 579)
|
||||
* suspend: Job Control Builtins.
|
||||
(line 113)
|
||||
* test: Bourne Shell Builtins.
|
||||
@@ -11312,12 +11328,12 @@ D.1 Index of Shell Builtin Commands
|
||||
(line 349)
|
||||
* trap: Bourne Shell Builtins.
|
||||
(line 355)
|
||||
* type: Bash Builtins. (line 580)
|
||||
* typeset: Bash Builtins. (line 612)
|
||||
* ulimit: Bash Builtins. (line 618)
|
||||
* type: Bash Builtins. (line 584)
|
||||
* typeset: Bash Builtins. (line 616)
|
||||
* ulimit: Bash Builtins. (line 622)
|
||||
* umask: Bourne Shell Builtins.
|
||||
(line 404)
|
||||
* unalias: Bash Builtins. (line 721)
|
||||
* unalias: Bash Builtins. (line 725)
|
||||
* unset: Bourne Shell Builtins.
|
||||
(line 422)
|
||||
* wait: Job Control Builtins.
|
||||
@@ -11551,7 +11567,7 @@ D.3 Parameter and Variable Index
|
||||
* PIPESTATUS: Bash Variables. (line 553)
|
||||
* POSIXLY_CORRECT: Bash Variables. (line 558)
|
||||
* PPID: Bash Variables. (line 568)
|
||||
* PROMPT_COMMANDS: Bash Variables. (line 572)
|
||||
* PROMPT_COMMAND: Bash Variables. (line 572)
|
||||
* PROMPT_DIRTRIM: Bash Variables. (line 578)
|
||||
* PS0: Bash Variables. (line 584)
|
||||
* PS1: Bourne Shell Variables.
|
||||
@@ -11612,16 +11628,16 @@ D.4 Function Index
|
||||
* backward-char (C-b): Commands For Moving. (line 15)
|
||||
* backward-delete-char (Rubout): Commands For Text. (line 17)
|
||||
* backward-kill-line (C-x Rubout): Commands For Killing.
|
||||
(line 9)
|
||||
(line 11)
|
||||
* backward-kill-word (M-<DEL>): Commands For Killing.
|
||||
(line 24)
|
||||
(line 28)
|
||||
* backward-word (M-b): Commands For Moving. (line 22)
|
||||
* beginning-of-history (M-<): Commands For History.
|
||||
(line 20)
|
||||
* beginning-of-line (C-a): Commands For Moving. (line 6)
|
||||
* bracketed-paste-begin (): Commands For Text. (line 33)
|
||||
* call-last-kbd-macro (C-x e): Keyboard Macros. (line 13)
|
||||
* capitalize-word (M-c): Commands For Text. (line 61)
|
||||
* capitalize-word (M-c): Commands For Text. (line 66)
|
||||
* character-search (C-]): Miscellaneous Commands.
|
||||
(line 42)
|
||||
* character-search-backward (M-C-]): Miscellaneous Commands.
|
||||
@@ -11643,24 +11659,24 @@ D.4 Function Index
|
||||
* complete-variable (M-$): Commands For Completion.
|
||||
(line 64)
|
||||
* copy-backward-word (): Commands For Killing.
|
||||
(line 65)
|
||||
(line 69)
|
||||
* copy-forward-word (): Commands For Killing.
|
||||
(line 70)
|
||||
(line 74)
|
||||
* copy-region-as-kill (): Commands For Killing.
|
||||
(line 61)
|
||||
(line 65)
|
||||
* dabbrev-expand (): Commands For Completion.
|
||||
(line 95)
|
||||
* delete-char (C-d): Commands For Text. (line 12)
|
||||
* delete-char-or-list (): Commands For Completion.
|
||||
(line 43)
|
||||
* delete-horizontal-space (): Commands For Killing.
|
||||
(line 53)
|
||||
(line 57)
|
||||
* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6)
|
||||
* display-shell-version (C-x C-v): Miscellaneous Commands.
|
||||
(line 110)
|
||||
* do-lowercase-version (M-A, M-B, M-X, ...): Miscellaneous Commands.
|
||||
(line 14)
|
||||
* downcase-word (M-l): Commands For Text. (line 57)
|
||||
* downcase-word (M-l): Commands For Text. (line 62)
|
||||
* dump-functions (): Miscellaneous Commands.
|
||||
(line 74)
|
||||
* dump-macros (): Miscellaneous Commands.
|
||||
@@ -11681,7 +11697,7 @@ D.4 Function Index
|
||||
* forward-backward-delete-char (): Commands For Text. (line 21)
|
||||
* forward-char (C-f): Commands For Moving. (line 12)
|
||||
* forward-search-history (C-s): Commands For History.
|
||||
(line 31)
|
||||
(line 33)
|
||||
* forward-word (M-f): Commands For Moving. (line 18)
|
||||
* glob-complete-word (M-g): Miscellaneous Commands.
|
||||
(line 92)
|
||||
@@ -11694,13 +11710,13 @@ D.4 Function Index
|
||||
* history-expand-line (M-^): Miscellaneous Commands.
|
||||
(line 118)
|
||||
* history-search-backward (): Commands For History.
|
||||
(line 53)
|
||||
(line 57)
|
||||
* history-search-forward (): Commands For History.
|
||||
(line 47)
|
||||
(line 51)
|
||||
* history-substring-search-backward (): Commands For History.
|
||||
(line 65)
|
||||
(line 69)
|
||||
* history-substring-search-forward (): Commands For History.
|
||||
(line 59)
|
||||
(line 63)
|
||||
* insert-comment (M-#): Miscellaneous Commands.
|
||||
(line 61)
|
||||
* insert-completions (M-*): Commands For Completion.
|
||||
@@ -11710,11 +11726,11 @@ D.4 Function Index
|
||||
* kill-line (C-k): Commands For Killing.
|
||||
(line 6)
|
||||
* kill-region (): Commands For Killing.
|
||||
(line 57)
|
||||
(line 61)
|
||||
* kill-whole-line (): Commands For Killing.
|
||||
(line 15)
|
||||
* kill-word (M-d): Commands For Killing.
|
||||
(line 19)
|
||||
* kill-word (M-d): Commands For Killing.
|
||||
(line 23)
|
||||
* magic-space (): Miscellaneous Commands.
|
||||
(line 121)
|
||||
* menu-complete (): Commands For Completion.
|
||||
@@ -11725,12 +11741,12 @@ D.4 Function Index
|
||||
(line 17)
|
||||
* next-screen-line (): Commands For Moving. (line 41)
|
||||
* non-incremental-forward-search-history (M-n): Commands For History.
|
||||
(line 41)
|
||||
(line 45)
|
||||
* non-incremental-reverse-search-history (M-p): Commands For History.
|
||||
(line 35)
|
||||
(line 39)
|
||||
* operate-and-get-next (C-o): Commands For History.
|
||||
(line 92)
|
||||
* overwrite-mode (): Commands For Text. (line 65)
|
||||
(line 96)
|
||||
* overwrite-mode (): Commands For Text. (line 70)
|
||||
* possible-command-completions (C-x !): Commands For Completion.
|
||||
(line 86)
|
||||
* possible-completions (M-?): Commands For Completion.
|
||||
@@ -11761,40 +11777,40 @@ D.4 Function Index
|
||||
* set-mark (C-@): Miscellaneous Commands.
|
||||
(line 33)
|
||||
* shell-backward-kill-word (): Commands For Killing.
|
||||
(line 33)
|
||||
(line 37)
|
||||
* shell-backward-word (M-C-b): Commands For Moving. (line 30)
|
||||
* shell-expand-line (M-C-e): Miscellaneous Commands.
|
||||
(line 113)
|
||||
* shell-forward-word (M-C-f): Commands For Moving. (line 26)
|
||||
* shell-kill-word (M-C-d): Commands For Killing.
|
||||
(line 28)
|
||||
(line 32)
|
||||
* shell-transpose-words (M-C-t): Commands For Killing.
|
||||
(line 37)
|
||||
(line 41)
|
||||
* skip-csi-sequence (): Miscellaneous Commands.
|
||||
(line 52)
|
||||
* start-kbd-macro (C-x (): Keyboard Macros. (line 6)
|
||||
* tilde-expand (M-&): Miscellaneous Commands.
|
||||
(line 30)
|
||||
* transpose-chars (C-t): Commands For Text. (line 42)
|
||||
* transpose-words (M-t): Commands For Text. (line 48)
|
||||
* transpose-chars (C-t): Commands For Text. (line 47)
|
||||
* transpose-words (M-t): Commands For Text. (line 53)
|
||||
* undo (C-_ or C-x C-u): Miscellaneous Commands.
|
||||
(line 23)
|
||||
* universal-argument (): Numeric Arguments. (line 10)
|
||||
* unix-filename-rubout (): Commands For Killing.
|
||||
(line 48)
|
||||
(line 52)
|
||||
* unix-line-discard (C-u): Commands For Killing.
|
||||
(line 12)
|
||||
(line 16)
|
||||
* unix-word-rubout (C-w): Commands For Killing.
|
||||
(line 44)
|
||||
* upcase-word (M-u): Commands For Text. (line 53)
|
||||
(line 48)
|
||||
* upcase-word (M-u): Commands For Text. (line 58)
|
||||
* yank (C-y): Commands For Killing.
|
||||
(line 75)
|
||||
(line 79)
|
||||
* yank-last-arg (M-. or M-_): Commands For History.
|
||||
(line 80)
|
||||
(line 84)
|
||||
* yank-nth-arg (M-C-y): Commands For History.
|
||||
(line 71)
|
||||
(line 75)
|
||||
* yank-pop (M-y): Commands For Killing.
|
||||
(line 78)
|
||||
(line 82)
|
||||
|
||||
|
||||
File: bashref.info, Node: Concept Index, Prev: Function Index, Up: Indexes
|
||||
@@ -11963,66 +11979,66 @@ D.5 Concept Index
|
||||
|
||||
|
||||
Tag Table:
|
||||
Node: Top887
|
||||
Node: Introduction2797
|
||||
Node: What is Bash?3013
|
||||
Node: What is a shell?4127
|
||||
Node: Definitions6665
|
||||
Node: Basic Shell Features9616
|
||||
Node: Shell Syntax10835
|
||||
Node: Shell Operation11861
|
||||
Node: Quoting13154
|
||||
Node: Escape Character14454
|
||||
Node: Single Quotes14939
|
||||
Node: Double Quotes15287
|
||||
Node: ANSI-C Quoting16565
|
||||
Node: Locale Translation17824
|
||||
Node: Comments18977
|
||||
Node: Shell Commands19595
|
||||
Node: Reserved Words20533
|
||||
Node: Simple Commands21289
|
||||
Node: Pipelines21943
|
||||
Node: Lists24875
|
||||
Node: Compound Commands26666
|
||||
Node: Looping Constructs27678
|
||||
Node: Conditional Constructs30173
|
||||
Node: Command Grouping41744
|
||||
Node: Coprocesses43223
|
||||
Node: GNU Parallel45126
|
||||
Node: Shell Functions49427
|
||||
Node: Shell Parameters56634
|
||||
Node: Positional Parameters61047
|
||||
Node: Special Parameters61947
|
||||
Node: Shell Expansions65171
|
||||
Node: Brace Expansion67294
|
||||
Node: Tilde Expansion70017
|
||||
Node: Shell Parameter Expansion72634
|
||||
Node: Command Substitution87763
|
||||
Node: Arithmetic Expansion89118
|
||||
Node: Process Substitution90050
|
||||
Node: Word Splitting91170
|
||||
Node: Filename Expansion93114
|
||||
Node: Pattern Matching95663
|
||||
Node: Quote Removal99649
|
||||
Node: Redirections99944
|
||||
Node: Executing Commands109502
|
||||
Node: Simple Command Expansion110172
|
||||
Node: Command Search and Execution112126
|
||||
Node: Command Execution Environment114502
|
||||
Node: Environment117486
|
||||
Node: Exit Status119145
|
||||
Node: Signals120815
|
||||
Node: Shell Scripts122782
|
||||
Node: Shell Builtin Commands125794
|
||||
Node: Bourne Shell Builtins127832
|
||||
Node: Bash Builtins148756
|
||||
Node: Modifying Shell Behavior178486
|
||||
Node: The Set Builtin178831
|
||||
Node: The Shopt Builtin189244
|
||||
Node: Special Builtins204380
|
||||
Node: Shell Variables205359
|
||||
Node: Bourne Shell Variables205796
|
||||
Node: Bash Variables207900
|
||||
Node: Top893
|
||||
Node: Introduction2809
|
||||
Node: What is Bash?3025
|
||||
Node: What is a shell?4139
|
||||
Node: Definitions6677
|
||||
Node: Basic Shell Features9628
|
||||
Node: Shell Syntax10847
|
||||
Node: Shell Operation11873
|
||||
Node: Quoting13166
|
||||
Node: Escape Character14466
|
||||
Node: Single Quotes14951
|
||||
Node: Double Quotes15299
|
||||
Node: ANSI-C Quoting16577
|
||||
Node: Locale Translation17836
|
||||
Node: Comments18989
|
||||
Node: Shell Commands19607
|
||||
Node: Reserved Words20545
|
||||
Node: Simple Commands21301
|
||||
Node: Pipelines21955
|
||||
Node: Lists24887
|
||||
Node: Compound Commands26678
|
||||
Node: Looping Constructs27690
|
||||
Node: Conditional Constructs30185
|
||||
Node: Command Grouping41756
|
||||
Node: Coprocesses43235
|
||||
Node: GNU Parallel45138
|
||||
Node: Shell Functions49439
|
||||
Node: Shell Parameters56646
|
||||
Node: Positional Parameters61059
|
||||
Node: Special Parameters61959
|
||||
Node: Shell Expansions65183
|
||||
Node: Brace Expansion67306
|
||||
Node: Tilde Expansion70029
|
||||
Node: Shell Parameter Expansion72646
|
||||
Node: Command Substitution87775
|
||||
Node: Arithmetic Expansion89130
|
||||
Node: Process Substitution90062
|
||||
Node: Word Splitting91182
|
||||
Node: Filename Expansion93126
|
||||
Node: Pattern Matching95675
|
||||
Node: Quote Removal99661
|
||||
Node: Redirections99956
|
||||
Node: Executing Commands109526
|
||||
Node: Simple Command Expansion110196
|
||||
Node: Command Search and Execution112150
|
||||
Node: Command Execution Environment114526
|
||||
Node: Environment117510
|
||||
Node: Exit Status119169
|
||||
Node: Signals120839
|
||||
Node: Shell Scripts122806
|
||||
Node: Shell Builtin Commands125818
|
||||
Node: Bourne Shell Builtins127856
|
||||
Node: Bash Builtins148785
|
||||
Node: Modifying Shell Behavior178720
|
||||
Node: The Set Builtin179065
|
||||
Node: The Shopt Builtin189478
|
||||
Node: Special Builtins204388
|
||||
Node: Shell Variables205367
|
||||
Node: Bourne Shell Variables205804
|
||||
Node: Bash Variables207908
|
||||
Node: Bash Features240478
|
||||
Node: Invoking Bash241491
|
||||
Node: Bash Startup Files247504
|
||||
@@ -12040,60 +12056,60 @@ Node: Controlling the Prompt277893
|
||||
Node: The Restricted Shell280843
|
||||
Node: Bash POSIX Mode283437
|
||||
Node: Shell Compatibility Mode294473
|
||||
Node: Job Control300848
|
||||
Node: Job Control Basics301308
|
||||
Node: Job Control Builtins306304
|
||||
Node: Job Control Variables311704
|
||||
Node: Command Line Editing312860
|
||||
Node: Introduction and Notation314531
|
||||
Node: Readline Interaction316154
|
||||
Node: Readline Bare Essentials317345
|
||||
Node: Readline Movement Commands319128
|
||||
Node: Readline Killing Commands320088
|
||||
Node: Readline Arguments322006
|
||||
Node: Searching323050
|
||||
Node: Readline Init File325236
|
||||
Node: Readline Init File Syntax326495
|
||||
Node: Conditional Init Constructs347025
|
||||
Node: Sample Init File351221
|
||||
Node: Bindable Readline Commands354338
|
||||
Node: Commands For Moving355542
|
||||
Node: Commands For History357593
|
||||
Node: Commands For Text362220
|
||||
Node: Commands For Killing365608
|
||||
Node: Numeric Arguments368423
|
||||
Node: Commands For Completion369562
|
||||
Node: Keyboard Macros373753
|
||||
Node: Miscellaneous Commands374440
|
||||
Node: Readline vi Mode380124
|
||||
Node: Programmable Completion381031
|
||||
Node: Programmable Completion Builtins388811
|
||||
Node: A Programmable Completion Example399506
|
||||
Node: Using History Interactively404753
|
||||
Node: Bash History Facilities405437
|
||||
Node: Bash History Builtins408442
|
||||
Node: History Interaction413171
|
||||
Node: Event Designators416791
|
||||
Node: Word Designators418145
|
||||
Node: Modifiers419905
|
||||
Node: Installing Bash421716
|
||||
Node: Basic Installation422853
|
||||
Node: Compilers and Options426111
|
||||
Node: Compiling For Multiple Architectures426852
|
||||
Node: Installation Names428545
|
||||
Node: Specifying the System Type429363
|
||||
Node: Sharing Defaults430079
|
||||
Node: Operation Controls430752
|
||||
Node: Optional Features431710
|
||||
Node: Reporting Bugs442228
|
||||
Node: Major Differences From The Bourne Shell443422
|
||||
Node: GNU Free Documentation License460274
|
||||
Node: Indexes485451
|
||||
Node: Builtin Index485905
|
||||
Node: Reserved Word Index492732
|
||||
Node: Variable Index495180
|
||||
Node: Function Index511077
|
||||
Node: Concept Index524587
|
||||
Node: Job Control301129
|
||||
Node: Job Control Basics301589
|
||||
Node: Job Control Builtins306585
|
||||
Node: Job Control Variables311985
|
||||
Node: Command Line Editing313141
|
||||
Node: Introduction and Notation314812
|
||||
Node: Readline Interaction316435
|
||||
Node: Readline Bare Essentials317626
|
||||
Node: Readline Movement Commands319409
|
||||
Node: Readline Killing Commands320369
|
||||
Node: Readline Arguments322287
|
||||
Node: Searching323331
|
||||
Node: Readline Init File325517
|
||||
Node: Readline Init File Syntax326776
|
||||
Node: Conditional Init Constructs347315
|
||||
Node: Sample Init File351511
|
||||
Node: Bindable Readline Commands354635
|
||||
Node: Commands For Moving355839
|
||||
Node: Commands For History357890
|
||||
Node: Commands For Text362683
|
||||
Node: Commands For Killing366332
|
||||
Node: Numeric Arguments369365
|
||||
Node: Commands For Completion370504
|
||||
Node: Keyboard Macros374695
|
||||
Node: Miscellaneous Commands375382
|
||||
Node: Readline vi Mode381066
|
||||
Node: Programmable Completion381973
|
||||
Node: Programmable Completion Builtins389753
|
||||
Node: A Programmable Completion Example400448
|
||||
Node: Using History Interactively405695
|
||||
Node: Bash History Facilities406379
|
||||
Node: Bash History Builtins409384
|
||||
Node: History Interaction414113
|
||||
Node: Event Designators417733
|
||||
Node: Word Designators419087
|
||||
Node: Modifiers420847
|
||||
Node: Installing Bash422658
|
||||
Node: Basic Installation423795
|
||||
Node: Compilers and Options427053
|
||||
Node: Compiling For Multiple Architectures427794
|
||||
Node: Installation Names429487
|
||||
Node: Specifying the System Type430305
|
||||
Node: Sharing Defaults431021
|
||||
Node: Operation Controls431694
|
||||
Node: Optional Features432652
|
||||
Node: Reporting Bugs443170
|
||||
Node: Major Differences From The Bourne Shell444364
|
||||
Node: GNU Free Documentation License461216
|
||||
Node: Indexes486393
|
||||
Node: Builtin Index486847
|
||||
Node: Reserved Word Index493674
|
||||
Node: Variable Index496122
|
||||
Node: Function Index512019
|
||||
Node: Concept Index525529
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Binary file not shown.
+1988
-1951
File diff suppressed because it is too large
Load Diff
+22
-19
@@ -2727,7 +2727,7 @@ by @{@var{varname}@}, the value of @var{varname} defines the file
|
||||
descriptor to close.
|
||||
If @{@var{varname}@} is supplied, the redirection persists beyond
|
||||
the scope of the command, allowing the shell programmer to manage
|
||||
the file descriptor himself.
|
||||
the file descriptor's lifetime manually.
|
||||
|
||||
In the following descriptions, if the file descriptor number is
|
||||
omitted, and the first character of the redirection operator is
|
||||
@@ -3787,7 +3787,7 @@ shift [@var{n}]
|
||||
Shift the positional parameters to the left by @var{n}.
|
||||
The positional parameters from @var{n}+1 @dots{} @code{$#} are
|
||||
renamed to @code{$1} @dots{} @code{$#}-@var{n}.
|
||||
Parameters represented by the numbers @code{$#} to @code{$#}-@var{n}+1
|
||||
Parameters represented by the numbers @code{$#} down to @code{$#}-@var{n}+1
|
||||
are unset.
|
||||
@var{n} must be a non-negative number less than or equal to @code{$#}.
|
||||
If @var{n} is zero or greater than @code{$#}, the positional parameters
|
||||
@@ -4440,6 +4440,8 @@ If @var{name} is @samp{-}, the set of shell options is made local to the
|
||||
function in which @code{local} is invoked: shell options changed using
|
||||
the @code{set} builtin inside the function are restored to their original
|
||||
values when the function returns.
|
||||
The restore is effected as if a series of @code{set} commands were executed
|
||||
to restore the values that were in place before the function.
|
||||
The return status is zero unless @code{local} is used outside
|
||||
a function, an invalid @var{name} is supplied, or @var{name} is a
|
||||
readonly variable.
|
||||
@@ -4584,12 +4586,6 @@ are used to split the line into words using the same rules the shell
|
||||
uses for expansion (described above in @ref{Word Splitting}).
|
||||
The backslash character @samp{\} 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 @env{REPLY}.
|
||||
The exit status is zero, unless end-of-file is encountered, @code{read}
|
||||
times out (in which case the status 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 @option{-u}.
|
||||
|
||||
Options, if supplied, have the following meanings:
|
||||
|
||||
@@ -4666,6 +4662,15 @@ The exit status is greater than 128 if the timeout is exceeded.
|
||||
Read input from file descriptor @var{fd}.
|
||||
@end table
|
||||
|
||||
If no @var{name}s are supplied, the line read,
|
||||
without the ending delimiter but otherwise unmodified,
|
||||
is assigned to the
|
||||
variable @env{REPLY}.
|
||||
The exit status is zero, unless end-of-file is encountered, @code{read}
|
||||
times out (in which case the status 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 @option{-u}.
|
||||
|
||||
@item readarray
|
||||
@btindex readarray
|
||||
@example
|
||||
@@ -5529,12 +5534,6 @@ If set, the @code{echo} builtin expands backslash-escape sequences
|
||||
by default.
|
||||
|
||||
@end table
|
||||
|
||||
@noindent
|
||||
The return status when listing options is zero if all @var{optnames}
|
||||
are enabled, non-zero otherwise.
|
||||
When setting or unsetting options, the return status is zero unless an
|
||||
@var{optname} is not a valid shell option.
|
||||
@end table
|
||||
|
||||
@node Special Builtins
|
||||
@@ -6284,13 +6283,12 @@ not already set.
|
||||
The process @sc{id} of the shell's parent process. This variable
|
||||
is readonly.
|
||||
|
||||
@item PROMPT_COMMANDS
|
||||
If this array variable is set,
|
||||
@item PROMPT_COMMAND
|
||||
If this variable is set, and is an array,
|
||||
the value of each set element is interpreted as a command to execute
|
||||
before printing the primary prompt (@env{$PS1}).
|
||||
If this is not set, but
|
||||
@env{PROMPT_COMMAND}
|
||||
is set to a value, its value is used as a command to execute instead.
|
||||
If this is set but not an array variable,
|
||||
its value is used as a command to execute instead.
|
||||
|
||||
@item PROMPT_DIRTRIM
|
||||
If set to a number greater than zero, the value is used as the number of
|
||||
@@ -8164,6 +8162,11 @@ more randomness. If the shell compatibility level is set to 50 or
|
||||
lower, it reverts to the method from bash-5.0 and previous versions,
|
||||
so seeding the random number generator by assigning a value to
|
||||
@env{RANDOM} will produce the same sequence as in bash-5.0
|
||||
@item
|
||||
If the command hash table is empty, Bash versions prior to bash-5.1
|
||||
printed an informational message to that effect, even when producing
|
||||
output that can be reused as input. Bash-5.1 suppresses that message
|
||||
when the @option{-l} option is supplied.
|
||||
@end itemize
|
||||
@end table
|
||||
|
||||
|
||||
+444
-436
File diff suppressed because it is too large
Load Diff
+1002
-993
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
%!PS-Adobe-3.0
|
||||
%%Creator: groff version 1.22.4
|
||||
%%CreationDate: Wed Jun 10 12:00:37 2020
|
||||
%%CreationDate: Mon Sep 7 09:52:16 2020
|
||||
%%DocumentNeededResources: font Times-Roman
|
||||
%%+ font Times-Bold
|
||||
%%DocumentSuppliedResources: procset grops 1.22 4
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set LASTCHANGE Fri Jun 5 14:48:45 EDT 2020
|
||||
@set LASTCHANGE Tue Aug 25 09:58:38 EDT 2020
|
||||
|
||||
@set EDITION 5.1
|
||||
@set VERSION 5.1
|
||||
|
||||
@set UPDATED 5 June 2020
|
||||
@set UPDATED-MONTH June 2020
|
||||
@set UPDATED 25 August 2020
|
||||
@set UPDATED-MONTH August 2020
|
||||
|
||||
@@ -237,8 +237,11 @@ static sighandler
|
||||
alrm_catcher(i)
|
||||
int i;
|
||||
{
|
||||
printf (_("\007timed out waiting for input: auto-logout\n"));
|
||||
fflush (stdout);
|
||||
char *msg;
|
||||
|
||||
msg = _("\007timed out waiting for input: auto-logout\n");
|
||||
write (1, msg, strlen (msg));
|
||||
|
||||
bash_logout (); /* run ~/.bash_logout if this is a login shell */
|
||||
jump_to_top_level (EXITPROG);
|
||||
SIGRETURN (0);
|
||||
@@ -260,17 +263,25 @@ send_pwd_to_eterm ()
|
||||
}
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
/* Caller ensures that A has a non-zero number of elements */
|
||||
int
|
||||
execute_array_command (ae, v)
|
||||
ARRAY_ELEMENT *ae;
|
||||
execute_array_command (a, v)
|
||||
ARRAY *a;
|
||||
void *v;
|
||||
{
|
||||
char *tag, *command;
|
||||
char *tag;
|
||||
char **argv;
|
||||
int argc, i;
|
||||
|
||||
tag = (char *)v;
|
||||
command = element_value (ae);
|
||||
if (command && *command)
|
||||
execute_variable_command (command, tag);
|
||||
argc = 0;
|
||||
argv = array_to_argv (a, &argc);
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
if (argv[i] && argv[i][0])
|
||||
execute_variable_command (argv[i], tag);
|
||||
}
|
||||
strvec_dispose (argv);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -279,19 +290,26 @@ static void
|
||||
execute_prompt_command ()
|
||||
{
|
||||
char *command_to_execute;
|
||||
#if defined (ARRAY_VARS)
|
||||
SHELL_VAR *pcv;
|
||||
#if defined (ARRAY_VARS)
|
||||
ARRAY *pcmds;
|
||||
|
||||
GET_ARRAY_FROM_VAR ("PROMPT_COMMANDS", pcv, pcmds);
|
||||
if (pcv && var_isset (pcv) && pcmds && array_num_elements (pcmds) > 0)
|
||||
{
|
||||
array_walk (pcmds, execute_array_command, "PROMPT_COMMANDS");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
command_to_execute = get_string_value ("PROMPT_COMMAND");
|
||||
pcv = find_variable ("PROMPT_COMMAND");
|
||||
if (pcv == 0 || var_isset (pcv) == 0 || invisible_p (pcv))
|
||||
return;
|
||||
#if defined (ARRAY_VARS)
|
||||
if (array_p (pcv))
|
||||
{
|
||||
if ((pcmds = array_cell (pcv)) && array_num_elements (pcmds) > 0)
|
||||
execute_array_command (pcmds, "PROMPT_COMMAND");
|
||||
return;
|
||||
}
|
||||
else if (assoc_p (pcv))
|
||||
return; /* currently don't allow associative arrays here */
|
||||
#endif
|
||||
|
||||
command_to_execute = value_cell (pcv);
|
||||
if (command_to_execute && *command_to_execute)
|
||||
execute_variable_command (command_to_execute, "PROMPT_COMMAND");
|
||||
}
|
||||
@@ -310,7 +328,7 @@ parse_command ()
|
||||
|
||||
/* Allow the execution of a random command just before the printing
|
||||
of each primary prompt. If the shell variable PROMPT_COMMAND
|
||||
is set then the value of it is the command to execute. */
|
||||
is set then its value (array or string) is the command(s) to execute. */
|
||||
/* The tests are a combination of SHOULD_PROMPT() and prompt_again()
|
||||
from parse.y, which are the conditions under which the prompt is
|
||||
actually printed. */
|
||||
|
||||
@@ -340,13 +340,13 @@ int flags;
|
||||
else
|
||||
printf("%ld\n", st->st_ctime);
|
||||
} else if (flags & OPT_DEV)
|
||||
printf("%d\n", st->st_dev);
|
||||
printf("%lu\n", (unsigned long)st->st_dev);
|
||||
else if (flags & OPT_INO)
|
||||
printf("%lu\n", (unsigned long)st->st_ino);
|
||||
else if (flags & OPT_FID)
|
||||
printf("%d:%lu\n", st->st_dev, (unsigned long)st->st_ino);
|
||||
printf("%lu:%lu\n", (unsigned long)st->st_dev, (unsigned long)st->st_ino);
|
||||
else if (flags & OPT_NLINK)
|
||||
printf("%d\n", st->st_nlink);
|
||||
printf("%lu\n", (unsigned long)st->st_nlink);
|
||||
else if (flags & OPT_LNKNAM) {
|
||||
#ifdef S_ISLNK
|
||||
b = xmalloc(4096);
|
||||
|
||||
+114
-16
@@ -896,6 +896,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
|
||||
only the failure of a simple command. We don't want to run the error
|
||||
trap if the command run by the `command' builtin fails; we want to
|
||||
defer that until the command builtin itself returns failure. */
|
||||
/* 2020/07/14 -- this changes with how the command builtin is handled */
|
||||
if (was_error_trap && ignore_return == 0 && invert == 0 &&
|
||||
pipe_in == NO_PIPE && pipe_out == NO_PIPE &&
|
||||
(command->value.Simple->flags & CMD_COMMAND_BUILTIN) == 0 &&
|
||||
@@ -4161,6 +4162,52 @@ fix_assignment_words (words)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef ISOPTION
|
||||
# define ISOPTION(s, c) (s[0] == '-' && s[1] == c && s[2] == 0)
|
||||
#endif
|
||||
|
||||
#define RETURN_NOT_COMMAND() \
|
||||
do { if (typep) *typep = 0; return words; } while (0)
|
||||
|
||||
/* Make sure we have `command [-p] command_name [args]', and handle skipping
|
||||
over the usual `--' that ends the options. Returns the updated WORDS with
|
||||
the command and options stripped and sets *TYPEP to a non-zero value. If
|
||||
any other options are supplied, or there is not a command_name, we punt
|
||||
and return a zero value in *TYPEP without updating WORDS. */
|
||||
static WORD_LIST *
|
||||
check_command_builtin (words, typep)
|
||||
WORD_LIST *words;
|
||||
int *typep;
|
||||
{
|
||||
int type;
|
||||
WORD_LIST *w;
|
||||
|
||||
w = words->next;
|
||||
type = 1;
|
||||
|
||||
if (w && ISOPTION (w->word->word, 'p')) /* command -p */
|
||||
{
|
||||
#if defined (RESTRICTED_SHELL)
|
||||
if (restricted)
|
||||
RETURN_NOT_COMMAND();
|
||||
#endif
|
||||
w = w->next;
|
||||
type = 2;
|
||||
}
|
||||
|
||||
if (w && ISOPTION (w->word->word, '-')) /* command [-p] -- */
|
||||
w = w->next;
|
||||
else if (w && w->word->word[0] == '-') /* any other option */
|
||||
RETURN_NOT_COMMAND();
|
||||
|
||||
if (w == 0 || w->word->word == 0) /* must have a command_name */
|
||||
RETURN_NOT_COMMAND();
|
||||
|
||||
if (typep)
|
||||
*typep = type;
|
||||
return w;
|
||||
}
|
||||
|
||||
/* Return 1 if the file found by searching $PATH for PATHNAME, defaulting
|
||||
to PATHNAME, is a directory. Used by the autocd code below. */
|
||||
static int
|
||||
@@ -4188,7 +4235,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
WORD_LIST *words, *lastword;
|
||||
char *command_line, *lastarg, *temp;
|
||||
int first_word_quoted, result, builtin_is_special, already_forked, dofork;
|
||||
int fork_flags;
|
||||
int fork_flags, cmdflags;
|
||||
pid_t old_last_async_pid;
|
||||
sh_builtin_func_t *builtin;
|
||||
SHELL_VAR *func;
|
||||
@@ -4233,6 +4280,8 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
return (EXECUTION_SUCCESS);
|
||||
#endif
|
||||
|
||||
cmdflags = simple_command->flags;
|
||||
|
||||
first_word_quoted =
|
||||
simple_command->words ? (simple_command->words->word->flags & W_QUOTED) : 0;
|
||||
|
||||
@@ -4269,7 +4318,7 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
if (make_child (p = savestring (the_printed_command_except_trap), fork_flags) == 0)
|
||||
{
|
||||
already_forked = 1;
|
||||
simple_command->flags |= CMD_NO_FORK;
|
||||
cmdflags |= CMD_NO_FORK;
|
||||
|
||||
subshell_environment = SUBSHELL_FORK; /* XXX */
|
||||
if (pipe_in != NO_PIPE || pipe_out != NO_PIPE)
|
||||
@@ -4318,15 +4367,15 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
|
||||
/* If we are re-running this as the result of executing the `command'
|
||||
builtin, do not expand the command words a second time. */
|
||||
if ((simple_command->flags & CMD_INHIBIT_EXPANSION) == 0)
|
||||
if ((cmdflags & CMD_INHIBIT_EXPANSION) == 0)
|
||||
{
|
||||
current_fds_to_close = fds_to_close;
|
||||
fix_assignment_words (simple_command->words);
|
||||
/* Pass the ignore return flag down to command substitutions */
|
||||
if (simple_command->flags & CMD_IGNORE_RETURN) /* XXX */
|
||||
if (cmdflags & CMD_IGNORE_RETURN) /* XXX */
|
||||
comsub_ignore_return++;
|
||||
words = expand_words (simple_command->words);
|
||||
if (simple_command->flags & CMD_IGNORE_RETURN)
|
||||
if (cmdflags & CMD_IGNORE_RETURN)
|
||||
comsub_ignore_return--;
|
||||
current_fds_to_close = (struct fd_bitmap *)NULL;
|
||||
}
|
||||
@@ -4356,12 +4405,16 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
|
||||
begin_unwind_frame ("simple-command");
|
||||
|
||||
if (echo_command_at_execute && (simple_command->flags & CMD_COMMAND_BUILTIN) == 0)
|
||||
if (echo_command_at_execute && (cmdflags & CMD_COMMAND_BUILTIN) == 0)
|
||||
xtrace_print_word_list (words, 1);
|
||||
|
||||
builtin = (sh_builtin_func_t *)NULL;
|
||||
func = (SHELL_VAR *)NULL;
|
||||
if ((simple_command->flags & CMD_NO_FUNCTIONS) == 0)
|
||||
|
||||
/* This test is still here in case we want to change the command builtin
|
||||
handler code below to recursively call execute_simple_command (after
|
||||
modifying the simple_command struct). */
|
||||
if ((cmdflags & CMD_NO_FUNCTIONS) == 0)
|
||||
{
|
||||
/* Posix.2 says special builtins are found before functions. We
|
||||
don't set builtin_is_special anywhere other than here, because
|
||||
@@ -4393,6 +4446,43 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
|
||||
}
|
||||
tempenv_assign_error = 0; /* don't care about this any more */
|
||||
|
||||
/* This is where we handle the command builtin as a pseudo-reserved word
|
||||
prefix. This allows us to optimize away forks if we can. */
|
||||
old_command_builtin = -1;
|
||||
if (builtin == 0 && func == 0)
|
||||
{
|
||||
WORD_LIST *disposer, *l;
|
||||
int cmdtype;
|
||||
|
||||
builtin = find_shell_builtin (words->word->word);
|
||||
while (builtin == command_builtin)
|
||||
{
|
||||
disposer = words;
|
||||
cmdtype = 0;
|
||||
words = check_command_builtin (words, &cmdtype);
|
||||
if (cmdtype > 0) /* command -p [--] words */
|
||||
{
|
||||
for (l = disposer; l->next != words; l = l->next)
|
||||
;
|
||||
l->next = 0;
|
||||
dispose_words (disposer);
|
||||
cmdflags |= CMD_COMMAND_BUILTIN | CMD_NO_FUNCTIONS;
|
||||
if (cmdtype == 2)
|
||||
cmdflags |= CMD_STDPATH;
|
||||
builtin = find_shell_builtin (words->word->word);
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (cmdflags & CMD_COMMAND_BUILTIN)
|
||||
{
|
||||
old_command_builtin = executing_command_builtin;
|
||||
unwind_protect_int (executing_command_builtin);
|
||||
executing_command_builtin |= 1;
|
||||
}
|
||||
builtin = 0;
|
||||
}
|
||||
|
||||
add_unwind_protect (dispose_words, words);
|
||||
QUIT;
|
||||
|
||||
@@ -4469,9 +4559,12 @@ run_builtin:
|
||||
if (builtin)
|
||||
{
|
||||
old_builtin = executing_builtin;
|
||||
old_command_builtin = executing_command_builtin;
|
||||
unwind_protect_int (executing_builtin); /* modified in execute_builtin */
|
||||
unwind_protect_int (executing_command_builtin); /* ditto */
|
||||
if (old_command_builtin == -1) /* sentinel, can be set above */
|
||||
{
|
||||
old_command_builtin = executing_command_builtin;
|
||||
unwind_protect_int (executing_command_builtin); /* ditto and set above */
|
||||
}
|
||||
}
|
||||
if (already_forked)
|
||||
{
|
||||
@@ -4484,7 +4577,7 @@ run_builtin:
|
||||
|
||||
if (async)
|
||||
{
|
||||
if ((simple_command->flags & CMD_STDIN_REDIR) &&
|
||||
if ((cmdflags & CMD_STDIN_REDIR) &&
|
||||
pipe_in == NO_PIPE &&
|
||||
(stdin_redirects (simple_command->redirects) == 0))
|
||||
async_redirect_stdin ();
|
||||
@@ -4496,14 +4589,14 @@ run_builtin:
|
||||
execute_subshell_builtin_or_function
|
||||
(words, simple_command->redirects, builtin, func,
|
||||
pipe_in, pipe_out, async, fds_to_close,
|
||||
simple_command->flags);
|
||||
cmdflags);
|
||||
subshell_level--;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = execute_builtin_or_function
|
||||
(words, builtin, func, simple_command->redirects, fds_to_close,
|
||||
simple_command->flags);
|
||||
cmdflags);
|
||||
if (builtin)
|
||||
{
|
||||
if (result > EX_SHERRBASE)
|
||||
@@ -4569,12 +4662,12 @@ execute_from_filesystem:
|
||||
/* The old code did not test already_forked and only did this if
|
||||
subshell_environment&SUBSHELL_COMSUB != 0 (comsubs and procsubs). Other
|
||||
uses of the no-fork optimization left FIFOs in $TMPDIR */
|
||||
if (already_forked == 0 && (simple_command->flags & CMD_NO_FORK) && fifos_pending() > 0)
|
||||
simple_command->flags &= ~CMD_NO_FORK;
|
||||
if (already_forked == 0 && (cmdflags & CMD_NO_FORK) && fifos_pending() > 0)
|
||||
cmdflags &= ~CMD_NO_FORK;
|
||||
#endif
|
||||
result = execute_disk_command (words, simple_command->redirects, command_line,
|
||||
pipe_in, pipe_out, async, fds_to_close,
|
||||
simple_command->flags);
|
||||
cmdflags);
|
||||
|
||||
return_result:
|
||||
bind_lastarg (lastarg);
|
||||
@@ -4637,7 +4730,7 @@ execute_builtin (builtin, words, flags, subshell)
|
||||
the ERR trap, then restore them when the command completes. This is
|
||||
also a problem (as below) for the command and source/. builtins. */
|
||||
if (subshell == 0 && (flags & CMD_IGNORE_RETURN) &&
|
||||
(builtin == eval_builtin || builtin == command_builtin || builtin == source_builtin))
|
||||
(builtin == eval_builtin || (flags & CMD_COMMAND_BUILTIN) || builtin == source_builtin))
|
||||
{
|
||||
begin_unwind_frame ("eval_builtin");
|
||||
unwind_protect_int (exit_immediately_on_error);
|
||||
@@ -4831,6 +4924,11 @@ execute_function (var, words, flags, fds_to_close, async, subshell)
|
||||
if (tc && (flags & CMD_IGNORE_RETURN))
|
||||
tc->flags |= CMD_IGNORE_RETURN;
|
||||
|
||||
/* A limited attempt at optimization: shell functions at the end of command
|
||||
substitutions that are already marked NO_FORK. */
|
||||
if (tc && (flags & CMD_NO_FORK) && (subshell_environment & SUBSHELL_COMSUB))
|
||||
optimize_shell_function (tc);
|
||||
|
||||
gs = sh_getopt_save_istate ();
|
||||
if (subshell == 0)
|
||||
{
|
||||
|
||||
@@ -112,9 +112,6 @@ int no_symbolic_links = 0;
|
||||
int lexical_scoping = 0;
|
||||
#endif
|
||||
|
||||
/* Non-zero means no such thing as invisible variables. */
|
||||
int no_invisible_vars = 0;
|
||||
|
||||
/* Non-zero means look up and remember command names in a hash table, */
|
||||
int hashing_enabled = 1;
|
||||
|
||||
@@ -201,7 +198,6 @@ const struct flags_alist shell_flags[] = {
|
||||
#if defined (BANG_HISTORY)
|
||||
{ 'H', &histexp_flag },
|
||||
#endif /* BANG_HISTORY */
|
||||
{ 'I', &no_invisible_vars },
|
||||
{ 'P', &no_symbolic_links },
|
||||
{ 'T', &function_trace_mode },
|
||||
{0, (int *)NULL}
|
||||
@@ -349,7 +345,7 @@ reset_shell_flags ()
|
||||
place_keywords_in_env = read_but_dont_execute = just_one_command = 0;
|
||||
noclobber = unbound_vars_is_error = 0;
|
||||
echo_command_at_execute = jobs_m_flag = forced_interactive = 0;
|
||||
no_symbolic_links = no_invisible_vars = 0;
|
||||
no_symbolic_links = 0;
|
||||
privileged_mode = pipefail_opt = 0;
|
||||
|
||||
error_trace_mode = function_trace_mode = 0;
|
||||
@@ -364,11 +360,7 @@ reset_shell_flags ()
|
||||
#endif
|
||||
|
||||
#if defined (BANG_HISTORY)
|
||||
# if defined (STRICT_POSIX)
|
||||
history_expansion = 0;
|
||||
# else
|
||||
history_expansion = 1;
|
||||
# endif /* STRICT_POSIX */
|
||||
histexp_flag = 0;
|
||||
#endif
|
||||
|
||||
#if defined (BRACE_EXPANSION)
|
||||
|
||||
@@ -45,7 +45,7 @@ extern int
|
||||
disallow_filename_globbing,
|
||||
place_keywords_in_env, read_but_dont_execute,
|
||||
just_one_command, unbound_vars_is_error, echo_input_at_read, verbose_flag,
|
||||
echo_command_at_execute, no_invisible_vars, noclobber,
|
||||
echo_command_at_execute, noclobber,
|
||||
hashing_enabled, forced_interactive, privileged_mode, jobs_m_flag,
|
||||
asynchronous_notification, interactive_comments, no_symbolic_links,
|
||||
function_trace_mode, error_trace_mode, pipefail_opt;
|
||||
|
||||
@@ -425,7 +425,8 @@ legal_alias_name (string, flags)
|
||||
|
||||
/* Returns non-zero if STRING is an assignment statement. The returned value
|
||||
is the index of the `=' sign. If FLAGS&1 we are expecting a compound assignment
|
||||
and don't want an array subscript before the `='. */
|
||||
and require an array subscript before the `=' to denote an assignment
|
||||
statement. */
|
||||
int
|
||||
assignment (string, flags)
|
||||
const char *string;
|
||||
@@ -437,7 +438,17 @@ assignment (string, flags)
|
||||
c = string[indx = 0];
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
if ((legal_variable_starter (c) == 0) && ((flags&1) == 0 || c != '[')) /* ] */
|
||||
/* If parser_state includes PST_COMPASSIGN, FLAGS will include 1, so we are
|
||||
parsing the contents of a compound assignment. If parser_state includes
|
||||
PST_REPARSE, we are in the middle of an assignment statement and breaking
|
||||
the words between the parens into words and assignment statements, but
|
||||
we don't need to check for that right now. Within a compound assignment,
|
||||
the subscript is required to make the word an assignment statement. If
|
||||
we don't have a subscript, even if the word is a valid assignment
|
||||
statement otherwise, we don't want to treat it as one. */
|
||||
if ((flags & 1) && c != '[') /* ] */
|
||||
return (0);
|
||||
else if ((flags & 1) == 0 && legal_variable_starter (c) == 0)
|
||||
#else
|
||||
if (legal_variable_starter (c) == 0)
|
||||
#endif
|
||||
|
||||
@@ -132,7 +132,7 @@ ungetc_with_restart (c, stream)
|
||||
/* A facility similar to stdio, but input-only. */
|
||||
|
||||
#if defined (USING_BASH_MALLOC)
|
||||
# define MAX_INPUT_BUFFER_SIZE 8176
|
||||
# define MAX_INPUT_BUFFER_SIZE 8172
|
||||
#else
|
||||
# define MAX_INPUT_BUFFER_SIZE 8192
|
||||
#endif
|
||||
|
||||
@@ -319,11 +319,17 @@ static int queue_sigchld;
|
||||
|
||||
#define QUEUE_SIGCHLD(os) (os) = sigchld, queue_sigchld++
|
||||
|
||||
/* We set queue_sigchld around the call to waitchld to protect data structures
|
||||
from a SIGCHLD arriving while waitchld is executing. */
|
||||
#define UNQUEUE_SIGCHLD(os) \
|
||||
do { \
|
||||
queue_sigchld--; \
|
||||
if (queue_sigchld == 0 && os != sigchld) \
|
||||
waitchld (-1, 0); \
|
||||
{ \
|
||||
queue_sigchld = 1; \
|
||||
waitchld (-1, 0); \
|
||||
queue_sigchld = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static SigHandler *old_tstp, *old_ttou, *old_ttin;
|
||||
@@ -2022,9 +2028,8 @@ print_pipeline (p, job_index, format, stream)
|
||||
reported asynchronously, so just add the CR if the shell is
|
||||
currently interactive and asynchronous notification is enabled. */
|
||||
if (asynchronous_notification && interactive)
|
||||
fprintf (stream, "\r\n");
|
||||
else
|
||||
fprintf (stream, "\n");
|
||||
putc ('\r', stream);
|
||||
fprintf (stream, "\n");
|
||||
}
|
||||
|
||||
if (p == last)
|
||||
@@ -2753,8 +2758,7 @@ wait_sigint_handler (sig)
|
||||
{
|
||||
SigHandler *sigint_handler;
|
||||
|
||||
if (interrupt_immediately ||
|
||||
(this_shell_builtin && this_shell_builtin == wait_builtin))
|
||||
if (this_shell_builtin && this_shell_builtin == wait_builtin)
|
||||
{
|
||||
set_exit_status (128+SIGINT);
|
||||
restore_sigint_handler ();
|
||||
@@ -2766,20 +2770,12 @@ wait_sigint_handler (sig)
|
||||
{
|
||||
trap_handler (SIGINT); /* set pending_traps[SIGINT] */
|
||||
wait_signal_received = SIGINT;
|
||||
if (interrupt_immediately && wait_intr_flag)
|
||||
{
|
||||
interrupt_immediately = 0;
|
||||
sh_longjmp (wait_intr_buf, 1);
|
||||
}
|
||||
if (wait_intr_flag)
|
||||
sh_longjmp (wait_intr_buf, 1);
|
||||
else
|
||||
/* Let CHECK_WAIT_INTR handle it in wait_for/waitchld */
|
||||
SIGRETURN (0);
|
||||
}
|
||||
else if (interrupt_immediately)
|
||||
{
|
||||
ADDINTERRUPT;
|
||||
QUIT;
|
||||
}
|
||||
else /* wait_builtin but signal not trapped, treat as interrupt */
|
||||
kill (getpid (), SIGINT);
|
||||
}
|
||||
@@ -3563,6 +3559,13 @@ start_job (job, foreground)
|
||||
|
||||
BLOCK_CHILD (set, oset);
|
||||
|
||||
if ((subshell_environment & SUBSHELL_COMSUB) && (pipeline_pgrp == shell_pgrp))
|
||||
{
|
||||
internal_error (_("%s: no current jobs"), this_command_name);
|
||||
UNBLOCK_CHILD (oset);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (DEADJOB (job))
|
||||
{
|
||||
internal_error (_("%s: job has terminated"), this_command_name);
|
||||
@@ -3942,7 +3945,6 @@ itrace("waitchld: waitpid returns %d block = %d children_exited = %d", pid, bloc
|
||||
{
|
||||
if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin)
|
||||
{
|
||||
interrupt_immediately = 0;
|
||||
/* This was trap_handler (SIGCHLD) but that can lose traps if
|
||||
children_exited > 1 */
|
||||
queue_sigchld_trap (children_exited);
|
||||
@@ -3973,7 +3975,7 @@ itrace("waitchld: waitpid returns %d block = %d children_exited = %d", pid, bloc
|
||||
that has just changed state. If we notify asynchronously, and the job
|
||||
that this process belongs to is no longer running, then notify the user
|
||||
of that fact now. */
|
||||
if (asynchronous_notification && interactive)
|
||||
if (asynchronous_notification && interactive && executing_builtin == 0)
|
||||
notify_of_job_status ();
|
||||
|
||||
return (children_exited);
|
||||
@@ -4206,7 +4208,6 @@ run_sigchld_trap (nchild)
|
||||
unwind_protect_int (last_command_exit_value);
|
||||
unwind_protect_int (last_command_exit_signal);
|
||||
unwind_protect_var (last_made_pid);
|
||||
unwind_protect_int (interrupt_immediately);
|
||||
unwind_protect_int (jobs_list_frozen);
|
||||
unwind_protect_pointer (the_pipeline);
|
||||
unwind_protect_pointer (subst_assign_varlist);
|
||||
|
||||
@@ -583,15 +583,10 @@ BRACKMATCH (p, test, flags)
|
||||
isrange = 1;
|
||||
}
|
||||
|
||||
#if 0 /* TAG: bash-5.1 */
|
||||
if (isrange == 0 && test == cstart)
|
||||
goto matched;
|
||||
if (isrange && RANGECMP (test, cstart, forcecoll) >= 0 && RANGECMP (test, cend, forcecoll) <= 0)
|
||||
goto matched;
|
||||
#else
|
||||
if (RANGECMP (test, cstart, forcecoll) >= 0 && RANGECMP (test, cend, forcecoll) <= 0)
|
||||
goto matched;
|
||||
#endif
|
||||
|
||||
if (c == L(']'))
|
||||
break;
|
||||
|
||||
+85
-25
@@ -36,6 +36,12 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if FNMATCH_EQUIV_FALLBACK
|
||||
/* We don't include <fnmatch.h> in order to avoid namespace collisions; the
|
||||
internal strmatch still uses the FNM_ constants. */
|
||||
extern int fnmatch (const char *, const char *, int);
|
||||
#endif
|
||||
|
||||
/* First, compile `sm_loop.c' for single-byte characters. */
|
||||
#define CHAR unsigned char
|
||||
#define U_CHAR unsigned char
|
||||
@@ -55,6 +61,32 @@ extern int errno;
|
||||
|
||||
int glob_asciirange = GLOBASCII_DEFAULT;
|
||||
|
||||
#if FNMATCH_EQUIV_FALLBACK
|
||||
/* Construct a string w1 = "c1" and a pattern w2 = "[[=c2=]]" and pass them
|
||||
to fnmatch to see if wide characters c1 and c2 collate as members of the
|
||||
same equivalence class. We can't really do this portably any other way */
|
||||
static int
|
||||
_fnmatch_fallback (s, p)
|
||||
int s, p; /* string char, patchar */
|
||||
{
|
||||
char s1[2]; /* string */
|
||||
char s2[8]; /* constructed pattern */
|
||||
|
||||
s1[0] = (unsigned char)s;
|
||||
s1[1] = '\0';
|
||||
|
||||
/* reconstruct the pattern */
|
||||
s2[0] = s2[1] = '[';
|
||||
s2[2] = '=';
|
||||
s2[3] = (unsigned char)p;
|
||||
s2[4] = '=';
|
||||
s2[5] = s2[6] = ']';
|
||||
s2[7] = '\0';
|
||||
|
||||
return (fnmatch ((const char *)s2, (const char *)s1, 0));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We use strcoll(3) for range comparisons in bracket expressions,
|
||||
even though it can have unwanted side effects in locales
|
||||
other than POSIX or US. For instance, in the de locale, [A-Z] matches
|
||||
@@ -63,9 +95,11 @@ int glob_asciirange = GLOBASCII_DEFAULT;
|
||||
straight ordering as if in the C locale. */
|
||||
|
||||
#if defined (HAVE_STRCOLL)
|
||||
/* Helper function for collating symbol equivalence. */
|
||||
/* Helper functions for collating symbol equivalence. */
|
||||
|
||||
/* Return 0 if C1 == C2 or collates equally if FORCECOLL is non-zero. */
|
||||
static int
|
||||
rangecmp (c1, c2, forcecoll)
|
||||
charcmp (c1, c2, forcecoll)
|
||||
int c1, c2;
|
||||
int forcecoll;
|
||||
{
|
||||
@@ -86,8 +120,21 @@ rangecmp (c1, c2, forcecoll)
|
||||
s1[0] = c1;
|
||||
s2[0] = c2;
|
||||
|
||||
if ((ret = strcoll (s1, s2)) != 0)
|
||||
return ret;
|
||||
return (strcoll (s1, s2));
|
||||
}
|
||||
|
||||
static int
|
||||
rangecmp (c1, c2, forcecoll)
|
||||
int c1, c2;
|
||||
int forcecoll;
|
||||
{
|
||||
int r;
|
||||
|
||||
r = charcmp (c1, c2, forcecoll);
|
||||
|
||||
/* We impose a total ordering here by returning c1-c2 if charcmp returns 0 */
|
||||
if (r != 0)
|
||||
return r;
|
||||
return (c1 - c2); /* impose total ordering */
|
||||
}
|
||||
#else /* !HAVE_STRCOLL */
|
||||
@@ -95,14 +142,23 @@ rangecmp (c1, c2, forcecoll)
|
||||
#endif /* !HAVE_STRCOLL */
|
||||
|
||||
#if defined (HAVE_STRCOLL)
|
||||
/* Returns 1 if chars C and EQUIV collate equally in the current locale. */
|
||||
static int
|
||||
collequiv (c1, c2)
|
||||
int c1, c2;
|
||||
collequiv (c, equiv)
|
||||
int c, equiv;
|
||||
{
|
||||
return (rangecmp (c1, c2, 1) == 0);
|
||||
if (charcmp (c, equiv, 1) == 0)
|
||||
return 1;
|
||||
|
||||
#if FNMATCH_EQUIV_FALLBACK
|
||||
return (_fnmatch_fallback (c, equiv) == 0);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
#else
|
||||
# define collequiv(c1, c2) ((c1) == (c2))
|
||||
# define collequiv(c, equiv) ((c) == (equiv))
|
||||
#endif
|
||||
|
||||
#define _COLLSYM _collsym
|
||||
@@ -290,10 +346,6 @@ is_cclass (c, name)
|
||||
extern char *mbsmbchar PARAMS((const char *));
|
||||
|
||||
#if FNMATCH_EQUIV_FALLBACK
|
||||
/* We don't include <fnmatch.h> in order to avoid namespace collisions; the
|
||||
internal strmatch still uses the FNM_ constants. */
|
||||
extern int fnmatch (const char *, const char *, int);
|
||||
|
||||
/* Construct a string w1 = "c1" and a pattern w2 = "[[=c2=]]" and pass them
|
||||
to fnmatch to see if wide characters c1 and c2 collate as members of the
|
||||
same equivalence class. We can't really do this portably any other way */
|
||||
@@ -325,13 +377,13 @@ _fnmatch_fallback_wc (c1, c2)
|
||||
#endif
|
||||
|
||||
static int
|
||||
rangecmp_wc (c1, c2, forcecoll)
|
||||
charcmp_wc (c1, c2, forcecoll)
|
||||
wint_t c1, c2;
|
||||
int forcecoll;
|
||||
{
|
||||
static wchar_t s1[2] = { L' ', L'\0' };
|
||||
static wchar_t s2[2] = { L' ', L'\0' };
|
||||
int r, oerrno;
|
||||
int r;
|
||||
|
||||
if (c1 == c2)
|
||||
return 0;
|
||||
@@ -342,27 +394,35 @@ rangecmp_wc (c1, c2, forcecoll)
|
||||
s1[0] = c1;
|
||||
s2[0] = c2;
|
||||
|
||||
#if 0 /* TAG:bash-5.1 */
|
||||
/* We impose a total ordering here by returning c1-c2 if wcscoll returns 0,
|
||||
as we do above in the single-byte case. If we do this, we can no longer
|
||||
use this code in collequiv_wc */
|
||||
if ((r = wcscoll (s1, s2)) != 0)
|
||||
return r;
|
||||
return ((int)(c1 - c2)); /* impose total ordering */
|
||||
#else
|
||||
return (wcscoll (s1, s2));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Returns non-zero on success */
|
||||
static int
|
||||
rangecmp_wc (c1, c2, forcecoll)
|
||||
wint_t c1, c2;
|
||||
int forcecoll;
|
||||
{
|
||||
int r;
|
||||
|
||||
r = charcmp_wc (c1, c2, forcecoll);
|
||||
|
||||
/* We impose a total ordering here by returning c1-c2 if charcmp returns 0,
|
||||
as we do above in the single-byte case. */
|
||||
if (r != 0 || forcecoll)
|
||||
return r;
|
||||
return ((int)(c1 - c2)); /* impose total ordering */
|
||||
}
|
||||
|
||||
/* Returns 1 if wide chars C and EQUIV collate equally in the current locale. */
|
||||
static int
|
||||
collequiv_wc (c, equiv)
|
||||
wint_t c, equiv;
|
||||
{
|
||||
wchar_t s, p;
|
||||
|
||||
if (rangecmp_wc (c, equiv, 1) == 0)
|
||||
if (charcmp_wc (c, equiv, 1) == 0)
|
||||
return 1;
|
||||
|
||||
#if FNMATCH_EQUIV_FALLBACK
|
||||
/* We check explicitly for success (fnmatch returns 0) to avoid problems if
|
||||
our local definition of FNM_NOMATCH (strmatch.h) doesn't match the
|
||||
|
||||
+3
-3
@@ -319,7 +319,7 @@ extern char *sbrk ();
|
||||
#endif /* !HAVE_DECL_SBRK */
|
||||
|
||||
#ifdef SHELL
|
||||
extern int interrupt_immediately, running_trap;
|
||||
extern int running_trap;
|
||||
extern int signal_is_trapped PARAMS((int));
|
||||
#endif
|
||||
|
||||
@@ -620,9 +620,9 @@ morecore (nu)
|
||||
blocked_sigs = 0;
|
||||
#ifdef SHELL
|
||||
# if defined (SIGCHLD)
|
||||
if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD))
|
||||
if (running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD))
|
||||
# else
|
||||
if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT))
|
||||
if (running_trap || signal_is_trapped (SIGINT))
|
||||
# endif
|
||||
#endif
|
||||
{
|
||||
|
||||
+3
-3
@@ -29,7 +29,7 @@
|
||||
#include "table.h"
|
||||
|
||||
#ifdef SHELL
|
||||
extern int interrupt_immediately, running_trap;
|
||||
extern int running_trap;
|
||||
extern int signal_is_trapped PARAMS((int));
|
||||
#endif
|
||||
|
||||
@@ -174,7 +174,7 @@ mregister_alloc (tag, mem, size, file, line)
|
||||
/* Block all signals in case we are executed from a signal handler. */
|
||||
blocked_sigs = 0;
|
||||
#ifdef SHELL
|
||||
if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD))
|
||||
if (running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD))
|
||||
#endif
|
||||
{
|
||||
_malloc_block_signals (&set, &oset);
|
||||
@@ -229,7 +229,7 @@ mregister_free (mem, size, file, line)
|
||||
/* Block all signals in case we are executed from a signal handler. */
|
||||
blocked_sigs = 0;
|
||||
#ifdef SHELL
|
||||
if (interrupt_immediately || running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD))
|
||||
if (running_trap || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD))
|
||||
#endif
|
||||
{
|
||||
_malloc_block_signals (&set, &oset);
|
||||
|
||||
+26
-5
@@ -1,6 +1,6 @@
|
||||
/* complete.c -- filename completion for readline. */
|
||||
|
||||
/* Copyright (C) 1987-2019 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2020 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.
|
||||
@@ -148,6 +148,7 @@ static int complete_fncmp PARAMS((const char *, int, const char *, int));
|
||||
static void display_matches PARAMS((char **));
|
||||
static int compute_lcd_of_matches PARAMS((char **, int, const char *));
|
||||
static int postprocess_matches PARAMS((char ***, int));
|
||||
static int compare_match PARAMS((char *, const char *));
|
||||
static int complete_get_screenwidth PARAMS((void));
|
||||
|
||||
static char *make_quoted_replacement PARAMS((char *, int, char *));
|
||||
@@ -1964,6 +1965,26 @@ _rl_free_match_list (char **matches)
|
||||
xfree (matches);
|
||||
}
|
||||
|
||||
/* Compare a possibly-quoted filename TEXT from the line buffer and a possible
|
||||
MATCH that is the product of filename completion, which acts on the dequoted
|
||||
text. */
|
||||
static int
|
||||
compare_match (char *text, const char *match)
|
||||
{
|
||||
char *temp;
|
||||
int r;
|
||||
|
||||
if (rl_filename_completion_desired && rl_filename_quoting_desired &&
|
||||
rl_completion_found_quote && rl_filename_dequoting_function)
|
||||
{
|
||||
temp = (*rl_filename_dequoting_function) (text, rl_completion_quote_character);
|
||||
r = strcmp (temp, match);
|
||||
free (temp);
|
||||
return r;
|
||||
}
|
||||
return (strcmp (text, match));
|
||||
}
|
||||
|
||||
/* Complete the word at or before point.
|
||||
WHAT_TO_DO says what to do with the completion.
|
||||
`?' means list the possible completions.
|
||||
@@ -2010,7 +2031,7 @@ rl_complete_internal (int what_to_do)
|
||||
matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
|
||||
/* nontrivial_lcd is set if the common prefix adds something to the word
|
||||
being completed. */
|
||||
nontrivial_lcd = matches && strcmp (text, matches[0]) != 0;
|
||||
nontrivial_lcd = matches && compare_match (text, matches[0]) != 0;
|
||||
if (what_to_do == '!' || what_to_do == '@')
|
||||
tlen = strlen (text);
|
||||
xfree (text);
|
||||
@@ -2772,7 +2793,7 @@ rl_old_menu_complete (int count, int invoking_key)
|
||||
{
|
||||
insert_match (matches[match_list_index], orig_start, SINGLE_MATCH, "e_char);
|
||||
append_to_match (matches[match_list_index], delimiter, quote_char,
|
||||
strcmp (orig_text, matches[match_list_index]));
|
||||
compare_match (orig_text, matches[match_list_index]));
|
||||
}
|
||||
|
||||
completion_changed_buffer = 1;
|
||||
@@ -2846,7 +2867,7 @@ rl_menu_complete (int count, int ignore)
|
||||
matches = gen_completion_matches (orig_text, orig_start, orig_end,
|
||||
our_func, found_quote, quote_char);
|
||||
|
||||
nontrivial_lcd = matches && strcmp (orig_text, matches[0]) != 0;
|
||||
nontrivial_lcd = matches && compare_match (orig_text, matches[0]) != 0;
|
||||
|
||||
/* If we are matching filenames, the attempted completion function will
|
||||
have set rl_filename_completion_desired to a non-zero value. The basic
|
||||
@@ -2953,7 +2974,7 @@ rl_menu_complete (int count, int ignore)
|
||||
{
|
||||
insert_match (matches[match_list_index], orig_start, SINGLE_MATCH, "e_char);
|
||||
append_to_match (matches[match_list_index], delimiter, quote_char,
|
||||
strcmp (orig_text, matches[match_list_index]));
|
||||
compare_match (orig_text, matches[match_list_index]));
|
||||
}
|
||||
|
||||
completion_changed_buffer = 1;
|
||||
|
||||
@@ -48,7 +48,7 @@ History library is able to keep track of those lines, associate arbitrary
|
||||
data with each line, and utilize information from previous lines in
|
||||
composing new ones.
|
||||
|
||||
The programmer using the History library has available functions
|
||||
A programmer using the History library has available functions
|
||||
for remembering lines on a history list, associating arbitrary data
|
||||
with a line, removing lines from the list, searching through the list
|
||||
for a line containing an arbitrary text string, and referencing any line
|
||||
@@ -62,7 +62,7 @@ commands for manipulating the text of previous lines and using that text
|
||||
in new commands. The basic history manipulation commands are similar to
|
||||
the history substitution provided by @code{csh}.
|
||||
|
||||
If the programmer desires, he can use the Readline library, which
|
||||
The programmer can also use the Readline library, which
|
||||
includes some history manipulation by default, and has the added
|
||||
advantage of command line editing.
|
||||
|
||||
|
||||
@@ -1342,6 +1342,29 @@ This differs from @code{clear_history} because it frees private data
|
||||
Readline saves in the history list.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun {void} rl_activate_mark (void)
|
||||
Enable an @emph{active} mark.
|
||||
When this is enabled, the text between point and mark (the @var{region}) is
|
||||
displayed in the terminal's standout mode (a @var{face}).
|
||||
This is called by various readline functions that set the mark and insert
|
||||
text, and is available for applications to call.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun {void} rl_deactivate_mark (void)
|
||||
Turn off the active mark.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun {void} rl_keep_mark_active (void)
|
||||
Indicate that the mark should remain active when the current readline function
|
||||
completes and after redisplay occurs.
|
||||
In most cases, the mark remains active for only the duration of a single
|
||||
bindable readline function.
|
||||
@end deftypefun
|
||||
|
||||
@deftypefun {int} rl_mark_active_p (void)
|
||||
Return a non-zero value if the mark is currently active; zero otherwise.
|
||||
@end deftypefun
|
||||
|
||||
@node Alternate Interface
|
||||
@subsection Alternate Interface
|
||||
|
||||
|
||||
@@ -493,9 +493,9 @@ replaced with an ellipsis when displaying possible completions.
|
||||
@vindex completion-query-items
|
||||
The number of possible completions that determines when the user is
|
||||
asked whether the list of possibilities should be displayed.
|
||||
If the number of possible completions is greater than this value,
|
||||
Readline will ask the user whether or not he wishes to view
|
||||
them; otherwise, they are simply listed.
|
||||
If the number of possible completions is greater than or equal to this value,
|
||||
Readline will ask whether or not the user wishes to view them;
|
||||
otherwise, they are simply listed.
|
||||
This variable must be set to an integer value greater than or equal to 0.
|
||||
A negative value means Readline should never ask.
|
||||
The default limit is @code{100}.
|
||||
@@ -1115,8 +1115,8 @@ set convert-meta off
|
||||
# rather than as meta-prefixed characters
|
||||
set output-meta on
|
||||
|
||||
# if there are more than 150 possible completions for
|
||||
# a word, ask the user if he wants to see all of them
|
||||
# if there are 150 or more possible completions for a word,
|
||||
# ask whether or not the user wants to see all of them
|
||||
set completion-query-items 150
|
||||
|
||||
# For FTP
|
||||
@@ -1254,10 +1254,12 @@ being entered.
|
||||
@item reverse-search-history (C-r)
|
||||
Search backward starting at the current line and moving `up' through
|
||||
the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the mark.
|
||||
|
||||
@item forward-search-history (C-s)
|
||||
Search forward starting at the current line and moving `down' through
|
||||
the history as necessary. This is an incremental search.
|
||||
This command sets the region to the matched text and activates the mark.
|
||||
|
||||
@item non-incremental-reverse-search-history (M-p)
|
||||
Search backward starting at the current line and moving `up'
|
||||
@@ -1377,6 +1379,11 @@ each character as if it had been read from the keyboard. The characters
|
||||
are inserted as if each one was bound to @code{self-insert} instead of
|
||||
executing any editing commands.
|
||||
|
||||
Bracketed paste sets the region (the characters between point and the mark)
|
||||
to the inserted text. It uses the concept of an @emph{active mark}: when the
|
||||
mark is active, Readline redisplay uses the terminal's standout mode to
|
||||
denote the region.
|
||||
|
||||
@item transpose-chars (C-t)
|
||||
Drag the character before the cursor forward over
|
||||
the character at the cursor, moving the
|
||||
@@ -1426,9 +1433,13 @@ By default, this command is unbound.
|
||||
|
||||
@item kill-line (C-k)
|
||||
Kill the text from point to the end of the line.
|
||||
With a negative numeric argument, kill backward from the cursor to the
|
||||
beginning of the current line.
|
||||
|
||||
@item backward-kill-line (C-x Rubout)
|
||||
Kill backward from the cursor to the beginning of the current line.
|
||||
With a negative numeric argument, kill forward from the cursor to the
|
||||
end of the current line.
|
||||
|
||||
@item unix-line-discard (C-u)
|
||||
Kill backward from the cursor to the beginning of the current line.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
Copyright (C) 1988-2020 Free Software Foundation, Inc.
|
||||
@end ignore
|
||||
|
||||
@set EDITION 8.0
|
||||
@set VERSION 8.0
|
||||
@set UPDATED 4 May 2020
|
||||
@set UPDATED-MONTH May 2020
|
||||
@set EDITION 8.1
|
||||
@set VERSION 8.1
|
||||
@set UPDATED 17 July 2020
|
||||
@set UPDATED-MONTH July 2020
|
||||
|
||||
@set LASTCHANGE Mon May 4 14:55:02 EDT 2020
|
||||
@set LASTCHANGE Fri Jul 17 09:35:36 EDT 2020
|
||||
|
||||
@@ -377,11 +377,11 @@ com_stat (arg)
|
||||
|
||||
printf ("Statistics for `%s':\n", arg);
|
||||
|
||||
printf ("%s has %d link%s, and is %d byte%s in length.\n",
|
||||
printf ("%s has %d link%s, and is %lu byte%s in length.\n",
|
||||
arg,
|
||||
finfo.st_nlink,
|
||||
(finfo.st_nlink == 1) ? "" : "s",
|
||||
finfo.st_size,
|
||||
(unsigned long)finfo.st_size,
|
||||
(finfo.st_size == 1) ? "" : "s");
|
||||
printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime));
|
||||
printf (" Last access at: %s", ctime (&finfo.st_atime));
|
||||
|
||||
@@ -512,7 +512,7 @@ rl_read_key (void)
|
||||
{
|
||||
if (rl_get_char (&c) == 0)
|
||||
c = (*rl_getc_function) (rl_instream);
|
||||
/* fprintf(stderr, "rl_read_key: calling RL_CHECK_SIGNALS: _rl_caught_signal = %d", _rl_caught_signal); */
|
||||
/* fprintf(stderr, "rl_read_key: calling RL_CHECK_SIGNALS: _rl_caught_signal = %d\r\n", _rl_caught_signal); */
|
||||
RL_CHECK_SIGNALS ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
#define SF_FOUND 0x02
|
||||
#define SF_FAILED 0x04
|
||||
#define SF_CHGKMAP 0x08
|
||||
#define SF_PATTERN 0x10 /* unused so far */
|
||||
#define SF_PATTERN 0x10
|
||||
#define SF_NOCASE 0x20 /* unused so far */
|
||||
|
||||
typedef struct __rl_search_context
|
||||
{
|
||||
|
||||
+57
-16
@@ -135,7 +135,7 @@ void *_rl_sigcleanarg;
|
||||
|
||||
/* Readline signal handler functions. */
|
||||
|
||||
/* Called from RL_CHECK_SIGNALS() macro */
|
||||
/* Called from RL_CHECK_SIGNALS() macro to run signal handling code. */
|
||||
RETSIGTYPE
|
||||
_rl_signal_handler (int sig)
|
||||
{
|
||||
@@ -170,11 +170,16 @@ rl_signal_handler (int sig)
|
||||
SIGHANDLER_RETURN;
|
||||
}
|
||||
|
||||
/* This is called to handle a signal when it is safe to do so (out of the
|
||||
signal handler execution path). Called by _rl_signal_handler for all the
|
||||
signals readline catches except SIGWINCH. */
|
||||
static RETSIGTYPE
|
||||
_rl_handle_signal (int sig)
|
||||
{
|
||||
int block_sig;
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
sigset_t set;
|
||||
sigset_t set, oset;
|
||||
#else /* !HAVE_POSIX_SIGNALS */
|
||||
# if defined (HAVE_BSD_SIGNALS)
|
||||
long omask;
|
||||
@@ -204,7 +209,16 @@ _rl_handle_signal (int sig)
|
||||
_rl_sigcleanup = 0;
|
||||
_rl_sigcleanarg = 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
/* Get the current set of blocked signals. If we want to block a signal for
|
||||
the duration of the cleanup functions, make sure to add it to SET and
|
||||
set block_sig = 1 (see the SIGHUP case below). */
|
||||
block_sig = 0; /* sentinel to block signals with sigprocmask */
|
||||
sigemptyset (&set);
|
||||
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
|
||||
#endif
|
||||
|
||||
switch (sig)
|
||||
{
|
||||
case SIGINT:
|
||||
@@ -219,38 +233,60 @@ _rl_handle_signal (int sig)
|
||||
#if defined (SIGTSTP)
|
||||
case SIGTSTP:
|
||||
case SIGTTIN:
|
||||
case SIGTTOU:
|
||||
# if defined (HAVE_POSIX_SIGNALS)
|
||||
/* Block SIGTTOU so we can restore the terminal settings to something
|
||||
sane without stopping on SIGTTOU if we have been placed into the
|
||||
background. Even trying to get the current terminal pgrp with
|
||||
tcgetpgrp() will generate SIGTTOU, so we don't bother. Don't bother
|
||||
doing this if we've been stopped on SIGTTOU; it's already too late. */
|
||||
sigemptyset (&set);
|
||||
tcgetpgrp() will generate SIGTTOU, so we don't bother. We still do
|
||||
this even if we've been stopped on SIGTTOU, since we handle signals
|
||||
when we have returned from the signal handler and the signal is no
|
||||
longer blocked. */
|
||||
sigaddset (&set, SIGTTOU);
|
||||
sigprocmask (SIG_BLOCK, &set, (sigset_t *)NULL);
|
||||
block_sig = 1;
|
||||
# endif
|
||||
case SIGTTOU:
|
||||
#endif /* SIGTSTP */
|
||||
case SIGTERM:
|
||||
/* Any signals that should be blocked during cleanup should go here. */
|
||||
#if defined (SIGHUP)
|
||||
case SIGHUP:
|
||||
# if defined (_AIX)
|
||||
if (block_sig == 0)
|
||||
{
|
||||
sigaddset (&set, sig);
|
||||
block_sig = 1;
|
||||
}
|
||||
# endif // _AIX
|
||||
#endif
|
||||
/* Signals that don't require blocking during cleanup should go here. */
|
||||
case SIGTERM:
|
||||
#if defined (SIGALRM)
|
||||
case SIGALRM:
|
||||
#endif
|
||||
#if defined (SIGQUIT)
|
||||
case SIGQUIT:
|
||||
#endif
|
||||
|
||||
if (block_sig)
|
||||
sigprocmask (SIG_BLOCK, &set, &oset);
|
||||
|
||||
rl_echo_signal_char (sig);
|
||||
rl_cleanup_after_signal ();
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
# if defined (SIGTSTP)
|
||||
/* Unblock SIGTTOU blocked above */
|
||||
if (sig == SIGTTIN || sig == SIGTSTP)
|
||||
sigprocmask (SIG_UNBLOCK, &set, (sigset_t *)NULL);
|
||||
# endif
|
||||
/* At this point, the application's signal handler, if any, is the
|
||||
current handler. */
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
/* Unblock any signal(s) blocked above */
|
||||
if (block_sig)
|
||||
sigprocmask (SIG_UNBLOCK, &oset, (sigset_t *)NULL);
|
||||
#endif
|
||||
|
||||
/* We don't have to bother unblocking the signal because we are not
|
||||
running in a signal handler context. */
|
||||
#if 0
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
/* Make sure this signal is not blocked when we resend it to the
|
||||
calling application. */
|
||||
sigemptyset (&set);
|
||||
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &set);
|
||||
sigdelset (&set, sig);
|
||||
@@ -259,6 +295,7 @@ _rl_handle_signal (int sig)
|
||||
omask = sigblock (0);
|
||||
# endif /* HAVE_BSD_SIGNALS */
|
||||
#endif /* !HAVE_POSIX_SIGNALS */
|
||||
#endif
|
||||
|
||||
#if defined (__EMX__)
|
||||
signal (sig, SIG_ACK);
|
||||
@@ -270,7 +307,10 @@ _rl_handle_signal (int sig)
|
||||
raise (sig); /* assume we have raise */
|
||||
#endif
|
||||
|
||||
/* Let the signal that we just sent through. */
|
||||
/* We don't need to modify the signal mask now that this is not run in
|
||||
a signal handler context. */
|
||||
#if 0
|
||||
/* Let the signal that we just sent through if it is blocked. */
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL);
|
||||
#else /* !HAVE_POSIX_SIGNALS */
|
||||
@@ -278,6 +318,7 @@ _rl_handle_signal (int sig)
|
||||
sigsetmask (omask & ~(sigmask (sig)));
|
||||
# endif /* HAVE_BSD_SIGNALS */
|
||||
#endif /* !HAVE_POSIX_SIGNALS */
|
||||
#endif
|
||||
|
||||
rl_reset_after_signal ();
|
||||
}
|
||||
|
||||
+28
-10
@@ -875,8 +875,8 @@ _rl_vi_done_inserting (void)
|
||||
{
|
||||
if (_rl_vi_doing_insert)
|
||||
{
|
||||
/* The `C', `s', and `S' commands set this. */
|
||||
rl_end_undo_group ();
|
||||
/* The `c', `s', `S', and `R' commands set this. */
|
||||
rl_end_undo_group (); /* for the group in rl_vi_start_inserting */
|
||||
/* Now, the text between rl_undo_list->next->start and
|
||||
rl_undo_list->next->end is what was inserted while in insert
|
||||
mode. It gets copied to VI_INSERT_BUFFER because it depends
|
||||
@@ -887,7 +887,9 @@ _rl_vi_done_inserting (void)
|
||||
_rl_vi_save_replace (); /* Half the battle */
|
||||
else
|
||||
_rl_vi_save_insert (rl_undo_list->next);
|
||||
vi_continued_command = 1;
|
||||
/* sanity check, should always be >= 1 here */
|
||||
if (_rl_undo_group_level > 0)
|
||||
rl_end_undo_group (); /* for the group in the command (change or replace) */
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -899,10 +901,12 @@ _rl_vi_done_inserting (void)
|
||||
/* XXX - Other keys probably need to be checked. */
|
||||
else if (_rl_vi_last_key_before_insert == 'C')
|
||||
rl_end_undo_group ();
|
||||
while (_rl_undo_group_level > 0)
|
||||
rl_end_undo_group ();
|
||||
vi_continued_command = 0;
|
||||
}
|
||||
|
||||
/* Sanity check, make sure all the undo groups are closed before we leave
|
||||
insert mode */
|
||||
while (_rl_undo_group_level > 0)
|
||||
rl_end_undo_group ();
|
||||
}
|
||||
|
||||
int
|
||||
@@ -1210,6 +1214,10 @@ _rl_vi_domove_motion_cleanup (int c, _rl_vimotion_cxt *m)
|
||||
/* No change in position means the command failed. */
|
||||
if (rl_mark == rl_point)
|
||||
{
|
||||
/* 'c' and 'C' enter insert mode after the delete even if the motion
|
||||
didn't delete anything, as long as the motion command is valid. */
|
||||
if (_rl_to_upper (m->key) == 'C' && _rl_vi_motion_command (c))
|
||||
return (vidomove_dispatch (m));
|
||||
RL_UNSETSTATE (RL_STATE_VIMOTION);
|
||||
return (-1);
|
||||
}
|
||||
@@ -1382,7 +1390,11 @@ rl_vi_delete_to (int count, int key)
|
||||
{
|
||||
int c, r;
|
||||
|
||||
_rl_vimvcxt = _rl_mvcxt_alloc (VIM_DELETE, key);
|
||||
if (_rl_vimvcxt)
|
||||
_rl_mvcxt_init (_rl_vimvcxt, VIM_DELETE, key);
|
||||
else
|
||||
_rl_vimvcxt = _rl_mvcxt_alloc (VIM_DELETE, key);
|
||||
|
||||
_rl_vimvcxt->start = rl_point;
|
||||
|
||||
rl_mark = rl_point;
|
||||
@@ -1470,7 +1482,10 @@ rl_vi_change_to (int count, int key)
|
||||
{
|
||||
int c, r;
|
||||
|
||||
_rl_vimvcxt = _rl_mvcxt_alloc (VIM_CHANGE, key);
|
||||
if (_rl_vimvcxt)
|
||||
_rl_mvcxt_init (_rl_vimvcxt, VIM_CHANGE, key);
|
||||
else
|
||||
_rl_vimvcxt = _rl_mvcxt_alloc (VIM_CHANGE, key);
|
||||
_rl_vimvcxt->start = rl_point;
|
||||
|
||||
rl_mark = rl_point;
|
||||
@@ -1539,7 +1554,10 @@ rl_vi_yank_to (int count, int key)
|
||||
{
|
||||
int c, r;
|
||||
|
||||
_rl_vimvcxt = _rl_mvcxt_alloc (VIM_YANK, key);
|
||||
if (_rl_vimvcxt)
|
||||
_rl_mvcxt_init (_rl_vimvcxt, VIM_YANK, key);
|
||||
else
|
||||
_rl_vimvcxt = _rl_mvcxt_alloc (VIM_YANK, key);
|
||||
_rl_vimvcxt->start = rl_point;
|
||||
|
||||
rl_mark = rl_point;
|
||||
@@ -2247,7 +2265,7 @@ rl_vi_replace (int count, int key)
|
||||
|
||||
rl_vi_start_inserting (key, 1, rl_arg_sign);
|
||||
|
||||
_rl_vi_last_key_before_insert = key;
|
||||
_rl_vi_last_key_before_insert = 'R'; /* in case someone rebinds it */
|
||||
_rl_keymap = vi_replace_map;
|
||||
|
||||
if (_rl_enable_bracketed_paste)
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ mailstat(path, st)
|
||||
struct stat st_ret, st_tmp;
|
||||
DIR *dd;
|
||||
struct dirent *fn;
|
||||
char dir[PATH_MAX * 2], file[PATH_MAX * 2];
|
||||
char dir[PATH_MAX * 2], file[PATH_MAX * 2 + 1];
|
||||
int i, l;
|
||||
time_t atime, mtime;
|
||||
|
||||
|
||||
+10
-1
@@ -62,6 +62,7 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(TM_IN_SYS_TIME)
|
||||
#include <sys/types.h>
|
||||
@@ -80,6 +81,10 @@
|
||||
|
||||
#undef strchr /* avoid AIX weirdness */
|
||||
|
||||
#if !defined (errno)
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if defined (SHELL)
|
||||
extern char *get_string_value (const char *);
|
||||
#endif
|
||||
@@ -172,7 +177,7 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
|
||||
char *start = s;
|
||||
auto char tbuf[100];
|
||||
long off;
|
||||
int i, w;
|
||||
int i, w, oerrno;
|
||||
long y;
|
||||
static short first = 1;
|
||||
#ifdef POSIX_SEMANTICS
|
||||
@@ -217,6 +222,8 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
|
||||
};
|
||||
static const char *ampm[] = { "AM", "PM", };
|
||||
|
||||
oerrno = errno;
|
||||
|
||||
if (s == NULL || format == NULL || timeptr == NULL || maxsize == 0)
|
||||
return 0;
|
||||
|
||||
@@ -716,6 +723,8 @@ strftime(char *s, size_t maxsize, const char *format, const struct tm *timeptr)
|
||||
out:
|
||||
if (s < endp && *format == '\0') {
|
||||
*s = '\0';
|
||||
if (s == start)
|
||||
errno = oerrno;
|
||||
return (s - start);
|
||||
} else
|
||||
return 0;
|
||||
|
||||
+5
-1
@@ -34,6 +34,10 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifndef ZBUFSIZ
|
||||
# define ZBUFSIZ 4096
|
||||
#endif
|
||||
|
||||
extern ssize_t zread PARAMS((int, char *, size_t));
|
||||
extern int zwrite PARAMS((int, char *, ssize_t));
|
||||
|
||||
@@ -46,7 +50,7 @@ zcatfd (fd, ofd, fn)
|
||||
{
|
||||
ssize_t nr;
|
||||
int rval;
|
||||
char lbuf[1024];
|
||||
char lbuf[ZBUFSIZ];
|
||||
|
||||
rval = 0;
|
||||
while (1)
|
||||
|
||||
+7
-3
@@ -36,6 +36,10 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifndef ZBUFSIZ
|
||||
# define ZBUFSIZ 4096
|
||||
#endif
|
||||
|
||||
extern ssize_t zread PARAMS((int, char *, size_t));
|
||||
|
||||
/* Dump contents of file descriptor FD to *OSTR. FN is the filename for
|
||||
@@ -48,12 +52,12 @@ zmapfd (fd, ostr, fn)
|
||||
{
|
||||
ssize_t nr;
|
||||
int rval;
|
||||
char lbuf[512];
|
||||
char lbuf[ZBUFSIZ];
|
||||
char *result;
|
||||
int rsize, rind;
|
||||
|
||||
rval = 0;
|
||||
result = (char *)xmalloc (rsize = 512);
|
||||
result = (char *)xmalloc (rsize = ZBUFSIZ);
|
||||
rind = 0;
|
||||
|
||||
while (1)
|
||||
@@ -72,7 +76,7 @@ zmapfd (fd, ostr, fn)
|
||||
return -1;
|
||||
}
|
||||
|
||||
RESIZE_MALLOCED_BUFFER (result, rind, nr, rsize, 512);
|
||||
RESIZE_MALLOCED_BUFFER (result, rind, nr, rsize, ZBUFSIZ);
|
||||
memcpy (result+rind, lbuf, nr);
|
||||
rind += nr;
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,6 +1,6 @@
|
||||
/* zread - read data from file descriptor into buffer with retries */
|
||||
|
||||
/* Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -37,6 +37,10 @@ extern int errno;
|
||||
# define SEEK_CUR 1
|
||||
#endif
|
||||
|
||||
#ifndef ZBUFSIZ
|
||||
# define ZBUFSIZ 4096
|
||||
#endif
|
||||
|
||||
extern int executing_builtin;
|
||||
|
||||
extern void check_signals_and_traps (void);
|
||||
@@ -117,7 +121,7 @@ zreadintr (fd, buf, len)
|
||||
in read(2). This does some local buffering to avoid many one-character
|
||||
calls to read(2), like those the `read' builtin performs. */
|
||||
|
||||
static char lbuf[128];
|
||||
static char lbuf[ZBUFSIZ];
|
||||
static size_t lind, lused;
|
||||
|
||||
ssize_t
|
||||
|
||||
@@ -785,20 +785,11 @@ wait_sigint_handler (sig)
|
||||
{
|
||||
last_command_exit_value = 128+SIGINT;
|
||||
restore_sigint_handler ();
|
||||
interrupt_immediately = 0;
|
||||
trap_handler (SIGINT); /* set pending_traps[SIGINT] */
|
||||
wait_signal_received = SIGINT;
|
||||
SIGRETURN (0);
|
||||
}
|
||||
|
||||
if (interrupt_immediately)
|
||||
{
|
||||
last_command_exit_value = EXECUTION_FAILURE;
|
||||
restore_sigint_handler ();
|
||||
ADDINTERRUPT;
|
||||
QUIT;
|
||||
}
|
||||
|
||||
wait_sigint_received = 1;
|
||||
|
||||
SIGRETURN (0);
|
||||
|
||||
@@ -420,9 +420,9 @@ inputunit: simple_list simple_list_terminator
|
||||
global_command = (COMMAND *)NULL;
|
||||
if (last_command_exit_value == 0)
|
||||
last_command_exit_value = EX_BADUSAGE; /* force error return */
|
||||
handle_eof_input_unit ();
|
||||
if (interactive && parse_and_execute_level == 0)
|
||||
{
|
||||
handle_eof_input_unit ();
|
||||
YYACCEPT;
|
||||
}
|
||||
else
|
||||
@@ -1644,9 +1644,9 @@ rewind_input_string ()
|
||||
|
||||
/* These two functions used to test the value of the HAVE_RESTARTABLE_SYSCALLS
|
||||
define, and just use getc/ungetc if it was defined, but since bash
|
||||
installs its signal handlers without the SA_RESTART flag, some signals
|
||||
(like SIGCHLD, SIGWINCH, etc.) received during a read(2) will not cause
|
||||
the read to be restarted. We need to restart it ourselves. */
|
||||
installs most of its signal handlers without the SA_RESTART flag, some
|
||||
signals received during a read(2) will not cause the read to be restarted.
|
||||
We will need to restart it ourselves. */
|
||||
|
||||
static int
|
||||
yy_stream_get ()
|
||||
@@ -4518,6 +4518,8 @@ xparse_dolparen (base, string, indp, flags)
|
||||
if (nc < 0)
|
||||
{
|
||||
clear_shell_input_line (); /* XXX */
|
||||
if (bash_input.type != st_string) /* paranoia */
|
||||
parser_state &= ~(PST_CMDSUBST|PST_EOFTOKEN);
|
||||
jump_to_top_level (-nc); /* XXX */
|
||||
}
|
||||
|
||||
|
||||
+63
-54
@@ -1,4 +1,4 @@
|
||||
/* A Bison parser, made by GNU Bison 3.5.2. */
|
||||
/* A Bison parser, made by GNU Bison 3.6.4. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Undocumented macros, especially those whose name start with YY_,
|
||||
are private implementation details. Do not rely on them. */
|
||||
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
|
||||
especially those whose name start with YY_ or yy_. They are
|
||||
private implementation details that can be changed or removed. */
|
||||
|
||||
#ifndef YY_YY_Y_TAB_H_INCLUDED
|
||||
# define YY_YY_Y_TAB_H_INCLUDED
|
||||
@@ -44,61 +45,69 @@
|
||||
extern int yydebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
/* Token kinds. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
{
|
||||
IF = 258,
|
||||
THEN = 259,
|
||||
ELSE = 260,
|
||||
ELIF = 261,
|
||||
FI = 262,
|
||||
CASE = 263,
|
||||
ESAC = 264,
|
||||
FOR = 265,
|
||||
SELECT = 266,
|
||||
WHILE = 267,
|
||||
UNTIL = 268,
|
||||
DO = 269,
|
||||
DONE = 270,
|
||||
FUNCTION = 271,
|
||||
COPROC = 272,
|
||||
COND_START = 273,
|
||||
COND_END = 274,
|
||||
COND_ERROR = 275,
|
||||
IN = 276,
|
||||
BANG = 277,
|
||||
TIME = 278,
|
||||
TIMEOPT = 279,
|
||||
TIMEIGN = 280,
|
||||
WORD = 281,
|
||||
ASSIGNMENT_WORD = 282,
|
||||
REDIR_WORD = 283,
|
||||
NUMBER = 284,
|
||||
ARITH_CMD = 285,
|
||||
ARITH_FOR_EXPRS = 286,
|
||||
COND_CMD = 287,
|
||||
AND_AND = 288,
|
||||
OR_OR = 289,
|
||||
GREATER_GREATER = 290,
|
||||
LESS_LESS = 291,
|
||||
LESS_AND = 292,
|
||||
LESS_LESS_LESS = 293,
|
||||
GREATER_AND = 294,
|
||||
SEMI_SEMI = 295,
|
||||
SEMI_AND = 296,
|
||||
SEMI_SEMI_AND = 297,
|
||||
LESS_LESS_MINUS = 298,
|
||||
AND_GREATER = 299,
|
||||
AND_GREATER_GREATER = 300,
|
||||
LESS_GREATER = 301,
|
||||
GREATER_BAR = 302,
|
||||
BAR_AND = 303,
|
||||
yacc_EOF = 304
|
||||
YYEMPTY = -2,
|
||||
YYEOF = 0, /* "end of file" */
|
||||
YYerror = 256, /* error */
|
||||
YYUNDEF = 257, /* "invalid token" */
|
||||
IF = 258, /* IF */
|
||||
THEN = 259, /* THEN */
|
||||
ELSE = 260, /* ELSE */
|
||||
ELIF = 261, /* ELIF */
|
||||
FI = 262, /* FI */
|
||||
CASE = 263, /* CASE */
|
||||
ESAC = 264, /* ESAC */
|
||||
FOR = 265, /* FOR */
|
||||
SELECT = 266, /* SELECT */
|
||||
WHILE = 267, /* WHILE */
|
||||
UNTIL = 268, /* UNTIL */
|
||||
DO = 269, /* DO */
|
||||
DONE = 270, /* DONE */
|
||||
FUNCTION = 271, /* FUNCTION */
|
||||
COPROC = 272, /* COPROC */
|
||||
COND_START = 273, /* COND_START */
|
||||
COND_END = 274, /* COND_END */
|
||||
COND_ERROR = 275, /* COND_ERROR */
|
||||
IN = 276, /* IN */
|
||||
BANG = 277, /* BANG */
|
||||
TIME = 278, /* TIME */
|
||||
TIMEOPT = 279, /* TIMEOPT */
|
||||
TIMEIGN = 280, /* TIMEIGN */
|
||||
WORD = 281, /* WORD */
|
||||
ASSIGNMENT_WORD = 282, /* ASSIGNMENT_WORD */
|
||||
REDIR_WORD = 283, /* REDIR_WORD */
|
||||
NUMBER = 284, /* NUMBER */
|
||||
ARITH_CMD = 285, /* ARITH_CMD */
|
||||
ARITH_FOR_EXPRS = 286, /* ARITH_FOR_EXPRS */
|
||||
COND_CMD = 287, /* COND_CMD */
|
||||
AND_AND = 288, /* AND_AND */
|
||||
OR_OR = 289, /* OR_OR */
|
||||
GREATER_GREATER = 290, /* GREATER_GREATER */
|
||||
LESS_LESS = 291, /* LESS_LESS */
|
||||
LESS_AND = 292, /* LESS_AND */
|
||||
LESS_LESS_LESS = 293, /* LESS_LESS_LESS */
|
||||
GREATER_AND = 294, /* GREATER_AND */
|
||||
SEMI_SEMI = 295, /* SEMI_SEMI */
|
||||
SEMI_AND = 296, /* SEMI_AND */
|
||||
SEMI_SEMI_AND = 297, /* SEMI_SEMI_AND */
|
||||
LESS_LESS_MINUS = 298, /* LESS_LESS_MINUS */
|
||||
AND_GREATER = 299, /* AND_GREATER */
|
||||
AND_GREATER_GREATER = 300, /* AND_GREATER_GREATER */
|
||||
LESS_GREATER = 301, /* LESS_GREATER */
|
||||
GREATER_BAR = 302, /* GREATER_BAR */
|
||||
BAR_AND = 303, /* BAR_AND */
|
||||
yacc_EOF = 304 /* yacc_EOF */
|
||||
};
|
||||
typedef enum yytokentype yytoken_kind_t;
|
||||
#endif
|
||||
/* Tokens. */
|
||||
/* Token kinds. */
|
||||
#define YYEOF 0
|
||||
#define YYerror 256
|
||||
#define YYUNDEF 257
|
||||
#define IF 258
|
||||
#define THEN 259
|
||||
#define ELSE 260
|
||||
@@ -151,7 +160,7 @@ extern int yydebug;
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
union YYSTYPE
|
||||
{
|
||||
#line 328 "/Users/chet/src/bash/src/parse.y"
|
||||
#line 328 "/usr/src/local/chet/src/bash/src/parse.y"
|
||||
|
||||
WORD_DESC *word; /* the word that we read. */
|
||||
int number; /* the number that we read. */
|
||||
@@ -161,7 +170,7 @@ union YYSTYPE
|
||||
ELEMENT element;
|
||||
PATTERN_LIST *pattern;
|
||||
|
||||
#line 165 "y.tab.h"
|
||||
#line 174 "y.tab.h"
|
||||
|
||||
};
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
||||
@@ -528,10 +528,18 @@ glob_name_is_acceptable (name)
|
||||
const char *name;
|
||||
{
|
||||
struct ign *p;
|
||||
char *n;
|
||||
int flags;
|
||||
|
||||
/* . and .. are never matched */
|
||||
if (name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')))
|
||||
/* . and .. are never matched. We extend this to the terminal component of a
|
||||
pathname. */
|
||||
n = strrchr (name, '/');
|
||||
if (n == 0 || n[1] == 0)
|
||||
n = (char *)name;
|
||||
else
|
||||
n++;
|
||||
|
||||
if (n[0] == '.' && (n[1] == '\0' || (n[1] == '.' && n[2] == '\0')))
|
||||
return (0);
|
||||
|
||||
flags = FNM_PATHNAME | FNMATCH_EXTFLAG | FNMATCH_NOCASEGLOB;
|
||||
|
||||
+1
-1
@@ -1184,7 +1184,7 @@ gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp)
|
||||
/* XXX - should we filter the list of completions so only those matching
|
||||
TEXT are returned? Right now, we do not. */
|
||||
sl = strlist_create (0);
|
||||
sl->list = array_to_argv (a);
|
||||
sl->list = array_to_argv (a, 0);
|
||||
sl->list_len = sl->list_size = array_num_elements (a);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ gettextsrcdir = $(datadir)/gettext/po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MKINSTALLDIRS = $(top_srcdir)/support/mkinstalldirs
|
||||
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
|
||||
|
||||
GMSGFMT = @GMSGFMT@
|
||||
|
||||
+217
-205
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+206
-194
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+206
-194
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