bash-4.4 beta2 release

This commit is contained in:
Chet Ramey
2016-07-11 16:52:30 -04:00
parent 690150f9e5
commit a4eef1991c
205 changed files with 21194 additions and 15639 deletions
+126
View File
@@ -1,3 +1,129 @@
This document details the changes between this version, bash-4.4-beta2, and
the previous version, bash-4.4-rc1.
1. Changes to Bash
a. Fixed a memory leak when processing ${!var[@]}.
b. Fixed a bug that caused subshells to free trap strings associated with
inherited signals.
c. Inheriting BASHOPTS from the environment now works to force actions
associated with enabling an option, instead of just marking the option
as enabled.
d. Fixed a bug that allowed assignments to BASH_CMDS when the shell was in
restricted mode.
e. Fixed a bug caused by an accidental omission of part of the original patch
for EXECIGNORE.
e. Prompt expansion now quotes the results of the \s, \h, and \H expansions.
f. Fixed a bug that caused parsing errors in command substitutions with
consecutive case statements separated by newlines.
g. Updated logic used to decide whether bash is running inside an emacs
terminal emulator to work with future emacs versions.
h. Fixed two extended pattern matching bugs caused by premature short-
circuiting.
i. Fixed a memory leak in the code that removes duplicate history entries.
j. There are a number of bug fixes to coproc, mapfile, declare, unset,
and assignment statements that prevent nameref variables from creating
and unsetting variables with invalid names.
k. Fixed a bug that caused variables to be inadvertently marked as both an
associative and an indexed array.
l. Fixed a bug that caused `bash -c' to not run a trap specified in the
command string.
j. There are a number of bug fixes to coproc, mapfile, declare, and assignment
statements that prevent nameref variables from overwriting or modifying
attributes of readonly variables.
k. Fixed a bug that caused command substitution to attempt to set the
terminal's process group incorrectly.
l. Fixed a bug that could cause prompt string expansion to display error
messages when the `nounset' shell option is set.
m. Fixed a bug that caused "$@" to not expand to an empty string under the
circumstances when Posix says it should ("${@-${@-$@}}").
n. Fixed several bugs caused by referencing nameref variables whose values
are names of unset variables (or names that are valid for referencing
but not assignment), including creating variables in the temporary
environment.
o. Function tracing and error tracing are disabled if --debugger is supplied
at startup but the shell can't find the debugger start file.
p. Fixed a bug when IFS is used as the control variable in a for statement.
q. Fixed a bug with SIGINT received by a command substitution in an interactive
shell.
r. The checks for nameref variable self-references are more thorough.
s. Fixed several bugs with multi-line aliases.
t. Fixed `test' to handle the four-argument case where $1 == '(' and
$4 == ')'.
u. Fixed a bug in the expansion of $* in the cases where word splitting is
not performed.
v. Fixed a bug in execution of case statements where IFS includes the
pattern matching characters.
2. Changes to Readline
a. When refreshing the line as the result of a key sequence, Readline attempts
to redraw only the last line of a multiline prompt.
b. Fixed an issue that caused completion of git commands to display
incorrectly when using colored-completion-prefix.
c. Fixed several redisplay bugs having to do with multibyte characters and
invisible characters in prompt strings.
3. New Features in Bash
a. Value conversions (arithmetic expansions, case modification, etc.) now
happen when assigning elements of an array using compound assignment.
b. There is a new option settable in config-top.h that makes multiple
directory arguments to `cd' a fatal error.
c. Bash now uses mktemp() when creating internal temporary files; it produces
a warning at build time on many Linux systems.
4. New Features in Readline
a. The default binding for ^W in vi mode now uses word boundaries specified
by Posix (vi-unix-word-rubout is bindable command name).
b. rl_clear_visible_line: new application-callable function; clears all
screen lines occupied by the current visible readline line.
c. rl_tty_set_echoing: application-callable function that controls whether
or not readline thinks it is echoing terminal output.
d. Handle >| and strings of digits preceding and following redirection
specifications as single tokens when tokenizing the line for history
expansion.
e. Fixed a bug with displaying completions when the prefix display length
is greater than the length of the completions to be displayed.
f. The :p history modifier now applies to the entire line, so any expansion
specifying :p causes the line to be printed instead of expanded.
------------------------------------------------------------------------------
This document details the changes between this version, bash-4.4-rc1, and
the previous version, bash-4.4-beta.
+919 -1
View File
@@ -10190,7 +10190,7 @@ shell.c
-----
variables.c
- initialize_shell_variables: don't inherit PS4 from the environment
if the shell is running with euid == 0; just reset it to `+'. This
if the shell is running with euid == 0; just reset it to `+ '. This
is a known potential vulnerability, since PS4 expansion performs
command substitution in the root shell's context before displaying
it. Discussion started by up201407890@alunos.dcc.fc.up.pt
@@ -10413,3 +10413,921 @@ variables.c
- initialize_shell_variables: allow FUNCNEST to set funcnest_max when
imported from the environment. Inspired by
https://bugzilla.redhat.com/show_bug.cgi?id=1274553
2/11
----
bashhist.c
- bash_history_inhibit_expansion: function should be compiled in only if
BANG_HISTORY is defined. Report from isabella parakiss
<izaberina@gmail.com>
[bash-4.4-rc1 frozen]
2/15
----
lib/readline/text.c
- rl_refresh_line: call rl_redraw_prompt_last_line instead of
rl_forced_update_display to avoid redrawing all lines of a multiline
prompt (overwriting the last line of the multiline prompt in the
process). Report from Hugh Davenport <hugh@davenport.net.nz>
2/18
----
subst.c
- parameter_brace_expand: when processing ${!name[@]}, make sure to
free `name' before returning the list of keys to avoid a memory leak.
Fixes bug reported by Emilio PastorMira <Emilio.PastorMira@utimaco.com>
2/19
----
trap.c
- free_trap_strings: when freeing the `special' traps (NSIG to BASH_NSIG),
check whether or not the `signal' is trapped, as it would be if the
subshell inherited it (errtrace) and don't free the trap string in that
case. Fixes bug reported by Jan Klötzke <jan@kloetzke.net>
2/21
----
lib/sh/netconn.c
- isnetconn: return false if getpeername fails with errno == EBADF.
Bug and fix from Andrew Gregory <andrew.gregory.8@gmail.com>
builtins/shopt.def
- parse_bashopts: when reading BASHOPTS from the environment, make
sure to call any set functions associated with a variable, instead
of just setting the value to 1. Report and fix from
Vehlow, Jörg <Joerg.Vehlow@kratzer-automation.com>
2/22
----
lib/readline/complete.c
- rl_display_match_list: don't bother calling strrchr to check the
return value from printable_part() if rl_filename_completion_desired
is non-zero, since in that case printable_part just returns its
argument. Fixes git completion issue reported by
Dilyan Palauzov <dilyan.palauzov@aegee.org>
- _rl_colored_completion_prefix: default is now 0, testing is complete
2/23
----
variables.c
- assign_hashcmd: if the shell is restricted, reject attempts to add
pathnames containing slashes to the hash table, as the hash builtin
does. Fixes bug reported to savannah by Sylvain Beucler as
https://savannah.gnu.org/support/?108969
2/24
----
subst.c
- NEED_FPURGE_DECL: need it before externs.h included, since fpurge
is now used in this file. Fixes warning reported by Mike
Frysinger <vapier@gentoo.org>
- skip_double_quoted: add missing argument to declaration
parse.y
- shell_getc: in call to internal_warning, use %lu to print an argument
cast explicitly to unsigned long. Fixes warning reported by Mike
Frysinger <vapier@gentoo.org>
2/27
----
parse.y
- decode_prompt_string: quote result of \s expansion in case shell has
been invoked with a pathname like '$(id)'. Inspired by report from
Travis Garrell <travis.garrell@oracle.com>
- decode_prompt_string: quote result of \h and \H expansions in the
(unlikely) case that the hostname has been changed to something
malicious including a command substitution. From report from
Travis Garrell <travis.garrell@oracle.com>
builtins/getopts.def
- getopts_unbind_variable: new static function, just calls unbind_variable
for now. Placeholder for any future work to do something special if
OPTARG is readonly. Based on discussion started by Robert Elz
<kre@munnari.oz.au>
lib/readline/vi_mode.c
- rl_vi_unix_word_rubout: new function, implements ^W as Posix specifies
it for vi mode, using whitespace and punctuation characters as word
boundaries. Prompted by question from Carlos Pita
<carolosjosepita@gmail.com>
lib/readline/vi_keymap.c
- bind rl_vi_unix_word_rubout to ^W by default in both insert and
command mode
lib/readline/rltty.c
- _rl_bind_tty_special_chars: if in vi mode, bind the WERASE character
to rl_vi_unix_word_rubout
lib/readline/funmap.c
- vi-unix-word-rubout is new bindable name for rl_vi_unix_word_rubout
lib/readline/readline.h
- rl_vi_unix_word_rubout: new extern declaration
2/28
----
doc/bash.1
- document readline blink-matching-paren variable
- document readline completion-display-width variable
- document readline completion-map-case variable
- note that the default value of history-size depends on the value of
the HISTSIZE variable. All from a message from Branden Robinson
<g.branden.robinson@gmail.com>
doc/bash.1,lib/readline/doc/{readline.3,rluser.texi}
- convert-meta: modify the description to note that readline will turn
the default to off if the locale contains eight-bit characters
- input-meta: modify the description to note that readline will turn
the default to on if the locale contains eight-bit characters
- output-meta: modify the description to note that readline will turn
the default to on if the locale contains eight-bit characters. From
a message from Branden Robinson <g.branden.robinson@gmail.com>
3/6
---
examples/loadables/Makefile.in
- install-dev: make installdirs a prerequisite; don't rely on the
install-supported target to create it first. Bug with parallel
install (`make -j 4 install') reported by Chris Staub
<cstaub67@gmail.com>
3/12
----
lib/readline/display.c:
- rl_clear_visible_line: clear all screen lines occupied by the current
visible readline line. Inspired by report from Lauri Ranta
<lauri.ranta@gmail.com>
lib/readline/readline.h
- rl_clear_visible_line: extern declaration
lib/readline/doc/rltech.texi
- rl_clear_visible_line: add documentation
3/19
----
findcmd.c
- file_status: add inadvertently-dropped test for EXECIGNORE to the
`other' bits check. The check was in the original patch
- search_for_command: if the file should not be considered executable
because it's in the EXECIGNORE blacklist, don't set file_to_lose_on,
since the attempt to execute the last-ditch path will circumvent the
EXECIGNORE setting. Fixes bug reported by Dennis Williamson
<dennistwilliamson@gmail.com>
3/28
----
lib/readline/display.c
- rl_redisplay: when computing where the cursor should go (and the
physical cursor position) after displaying the prompt, don't adjust
the cursor position by wadjust if there are no multibyte chars in
the prompt. lpos is already a physical cursor position; _rl_screenwidth
is the physical screen width, and we're not calling _rl_col_width and
don't need to take invisible characters into account again. Fixes
bug reported by Andreas Schwab <schwab@linux-m68k.org>
4/1
---
parse.y
- parse_comsub: when we read `esac' followed by a break character,
turn on the LEX_RESWDOK flag because we can now read another case
statement or other compound command. Fixes bug reported by
Christian Franke <Christian.Franke@t-online.de>, original version
of patch from Piotr Grzybowski <narsil.pl@gmail.com>
- parse_comsub: leave the reserved-word-ok flag set for four-char
reserved words (then/else/elif/done/time) that can be followed by
reserved words; set lex_rwlen to 0 so we know to start reading a
new one
4/7
---
builtins/{alias,complete,jobs}.def
- {alias,compopt,disown}: add missing `CASE_HELPOPT;' so --help option
prints help longdoc instead of builtin_usage()
4/8
---
arrayfunc.c
- assign_array_var_from_word_list: use bind_array_var_internal instead
of inline code, so value conversions happen on assignment (case
modification, arithmetic evaluation, etc). Fixes bug reported by
Geir Hauge <geir.hauge@gmail.com>
4/9
---
shell.c
- main: change the logic that determines whether or not bash is running
under an emacs terminal emulator so it works with future versions of
emacs, which will change to use only $INSIDE_EMACS. Report and fix
from Paul Eggert <eggert@cs.ucla.edu>
lib/glob/sm_loop.c
- EXT: if we see ?(pat), we can match 0 or 1 times, so if we don't
match, we should consume the extglob pattern and go on to attempt
to match the rest of the pattern against the string. Fixes bug
reported by Isabella Parakiss <izaberina@gmail.com>
- GMATCH: in case `*', don't short-circuit and match anything if the
* is the last character in the pattern until after we check the
special cases for matching a `.'. Fixes bugs reported back on 3/23
by Isabella Parakiss <izaberina@gmail.com>
4/13
----
bashhist.c
- hc_erasedups: fix memory leak by freeing history entry returned by
remove_history. Bug and fix from Seiichi Ishitsuka
<ishitsuka.sc@ncos.nec.co.jp>
4/19
----
config-top.h
- CD_COMPLAINS: now settable in config-top.h; enables (fatal) error
messages if cd is given multiple directory arguments
4/20
----
execute_cmd.c
- coproc_setvars: refuse to create variables with names that are not
valid identifiers. Suggestion from Piotr Grzybowski
<narsil.pl@gmail.com>
rltty.c
- rl_tty_set_echoing: interface to set _rl_echoing_p, returning old
value. Inspired by gdb use of _rl_echoing_p when switching
between terminal and curses modes described by Doug Evans
<dje@google.com>
bashline.c
- bash_execute_unix_command: use rl_clear_visible_line instead of
erasing current line on the screen, inspired by same report from
3/12. Still tentative change
configure.ac
- update release status to rc2, may skip this and go directly to
release
4/21
----
arrayfunc.c
- convert_var_to_array: make sure that the newly-converted array
variable is not marked as being an associative array. Fixes bug
reported by Grisha Levit <grishalevit@gmail.com>
- convert_var_to_assoc: make sure that the newly-converted associative
array variable is not marked as being an indexed array
4/22
----
builtins/evalstring.c
- should_suppress_fork: don't suppress the fork if there are any traps
set, since that requires that we hang around to react to a signal or
collect the command's exit status and run something. Fixes bug
reported by Brian Vandenberg <phantall@gmail.com>
histexpand.c
- history_tokenize_word: handle >| as a single token. Fix from
Piotr Grzybowski <narsil.pl@gmail.com> from a report from
idallen@idallen-fibe.dyndns.org
4/24
----
execute_cmd.
- coproc_setvars: don't overwrite readonly variables used as coproc
names. From a report from Grisha Levit <grishalevit@gmail.com>
histexpand.c
- history_tokenize_word: handle strings of digits before redirections
beginning with `<' or `>' as part of the redirection word; handle
strings of digits following `<&' or `>&' as part of the redirection
word. Inspired by patch from Piotr Grzybowski <narsil.pl@gmail.com>
from a report from idallen@idallen-fibe.dyndns.org
lib/readline/complete.c
- rl_display_match_list: if the common prefix is longer than any of
the possible matches, set the length of the common prefix to 0 so
the entire match gets printed for each match
- rl_display_match_list: make sure to output at least one space
between each displayed match, even if the displayed length is
longer than our computed max
- fnprint: if the length of the prefix (prefix_bytes) is greater than
or equal to the length of the string to be printed (print_len), make
sure to set the prefix length to 0 so the entire string is printed.
From a report from Grisha Levit <grishalevit@gmail.com>
4/25
----
subst.c
- command_substitute: update the conditions under which we give the
terminal to pipeline_pgrp with give_terminal_to to the same ones
where wait_for uses to decide whether to give the terminal back to
shell_pgrp. This code exists to undo the work wait_for does; it
has to give the terminal back to pipeline_pgrp only under those
conditions when wait_for gives it back to the shell pgrp. Fix for
bug reported by Paulo Bardes <bardes0022@gmail.com>
4/26
----
bashline.c
- bash_filename_stat_hook: temporarily disable the `nounset' shell
option around calls to expand_prompt_string so we don't get error
messages during completion. Fixes issue reported by Eric Pruitt
<eric.pruitt@gmail.com>
4/27
----
doc/{bash.1,bashref.texi}
- extdebug: clarify that having this option enabled at shell startup
acts identically to --debugger. From a report from Grisha Levit
<grishalevit@gmail.com>
jobs.[ch]
- wait_for_single_pid: now takes additional `int flags' argument
{jobs,execute_cmd}.c,builtins/wait.def
- wait_for_single_pid: changed callers to add extra argument
jobs.c
- wait_for_single_pid: if (flags & 1) == 0, don't print the error message
if PID isn't found; changed execute_pipeline call when lastpipe is
set
4/28
----
general.c
- bash_tilde_expand: try not setting interrupt_immediately or
terminate_immediately; see what happens with networked password
databases
4/29
----
subst.c
- parameter_brace_expand, parameter_brace_expand_rhs: now take an
additional `pflags' argument from its caller so we can pass
state
- parameter_brace_expand_rhs: if expand_string_for_rhs returns a
quoted null, but l_hasdollat is set to 1, meaning we saw a quoted
"$@" of some form, we need to turn off special handling of "$@"
so something like "${@-${@-$@}}" expands to an empty string like
Posix says it should. Fixes bug reported by Grisha Levit
<grishalevit@gmail.com>
5/1
---
variables.c
- bind_variable_internal: if we have a nameref variable with a valid
array reference that is invalid for assignment (e.g., a[*]), and
assign_array_element returns NULL, short-circuit and return NULL.
Fixes bug reported by Grisha Levit <grishalevit@gmail.com>
general.[ch]
- valid_nameref_value: new function, return 1 if passed argument is
a valid variable name argument for a nameref variable: a valid
identifier, a valid array reference, or a valid positional
parameter. Second argument indicates whether the value is to be
used for an assignment; in this case, return an error if the name
consists of all digits
builtins/declare.def
- declare_internal: disallow values for nameref variables that don't
pass the tests in valid_nameref_value. Part of fix for bug
reported by Grisha Levit <grishalevit@gmail.com>
variables.c
- bind_variable_internal: if trying to assign a value to a nameref
variable, throw an error if valid_nameref_value fails (with a second
argument of 1). More fixes for bug reported by Grisha Levit
<grishalevit@gmail.com>
5/2
---
builtins/declare.def
- declare_internal: don't allow nameref attribute to be applied to an
existing readonly variable; it can be used to circumvent readonly
value. Fix for bug reported by Grisha Levit <grishalevit@gmail.com>
variables.[ch]
- find_variable_last_nameref, find_global_variable_last_nameref: takes a
new flags argument. If flags is non-zero, and we find a nameref
variable that is unset (has no value), return that variable instead
of NULL.
{variables,execute_cmd,arrayfunc,subst}.c,builtins/{declare,set}.def
- find_variable_last_nameref, find_global_variable_last_nameref: change
callers to add flags argument (initially 0)
5/3
---
variables.c
- bind_variable_internal: make sure we run the value of a namref variable
through valid_nameref_value before doing the assignment. This can go
away if we stop allowing namerefs to refer to positional parameters
execute_cmd.c
- execute_select_command: if bind_variable returns NULL, handle it as an
error, as if attempting assignment to a readonly variable
- execute_for_command: use 1 as second argument to
find_variable_last_nameref, so it will return an invisible nameref
to assign for each variable in the list
- execute_for_command: if the current word in the list is an invalid
identifier and the loop variable is a nameref, handle it as an error,
as if attempting assignment to a readonly variable
5/4
---
variables.c
- bind_int_variable: add warning if assigning an int to a nameref
variable
- assign_in_env: if assigning a variable in the temporary environment
that is a namref, throw an error if trying to assign an invalid
value
- bind_variable_value: use valid_nameref_value instead of calls to
legal_identifier and valid_array_reference
execute_cmd.c
- coproc_setvars: if we have a nameref variable as the coproc name, but
it can't be assigned to for some reason, remove the nameref attribute
and issue a warning that we are doing so
- coproc_setvars: don't allow assignment to a nameref variable with an
invalid variable name, using same code as find_or_make_array_variable
general.c
- valid_nameref_value: disallow values consisting solely of digits,
like the positional parameters
builtins/declare.def
- declare_internal: don't call valid_nameref_value on the existing value
of a variable that's being converted to a nameref -- that value is
going to be thrown away and we've already checked the new value
- declare_internal: call bind_variable_value with the ASS_NAMEREF flag
if we're assigning to an existing nameref variable (for instance,
`declare -n x ; declare x=42')
5/5
---
variables.c
- make_local_variable: if we are being asked to create a local copy of
a nameref variable from a prior scope (checked by looking up
using find_variable_noref), use the nameref variable, not the variable
it references (which we find using find_variable). Bug report from
Grisha Levit <grishalevit@gmail.com> ; fix by Piotr Grzybowski
<narsil.pl@gmail.com>
builtins/declare.def
- declare_internal: if asked to do the same thing as above (difference
is declare -n r=foo in previous case; declare -n r in this one),
don't follow reference var from a previous context. Create a new
local variable (using make_local_variable) and inherit attributes
from previous scope's nameref as above
5/6
---
builtins/declare.def
- declare_internal: if we are assigning a value to an existing
invisible nameref variable, validate value early so we don't end up
removing the variable after the assignment fails
builtins/shopt.def
- toggle_shopts: don't call set_bashopts here unless $BASHOPTS exists,
since we don't want to set it up before it gets read from the
environment. Keeping BASHOPTS read-only should keep users from
unsetting it. Fix from Grisha Levit <grishalevit@gmail.com>
- shopt_set_debug_mode: make sure error_trace_mode reflects the setting
of extdebug. This one is tentative. Fix from Grisha Levit
<grishalevit@gmail.com>
- shopt_set_debug_mode: call set_shellopts after setting error_trace_mode
or function_trace_mode. Fix from Grisha Levit <grishalevit@gmail.com>
shell.c
- start_debugger: make sure that function_trace_mode and error_trace_mode
reflect the value of debugging_mode, so they are both disabled if we
disable debugging mode because we can't find the debugger start file.
Fix from Grisha Levit <grishalevit@gmail.com>
- start_debugger: set $SHELLOPTS and $BASHOPTS to the option values are
reflected if we change or set them here. Fix from Grisha Levit
<grishalevit@gmail.com>
builtins/set.def
- reset_shell_options: add reset values for: posix, nolog, pipefail.
Fix from Grisha Levit <grishalevit@gmail.com>
builtins/shopt.def
- reset_shopt_options: add reset values for: autocd, checkjobs,
complete_fullquote, dirspell, failglob, globstar, gnu_errfmt,
huponexit, inherit_errexit, interactive_comments, lastpipe,
no_empty_cmd_completion, progcomp. Fix from Grisha Levit
<grishalevit@gmail.com>
- reset_shopt_options: make sure the following options have the right
defaults based on #defines: checkjobs, checkwinsize, direxpand,
extglob, globasciiranges. Fix from Grisha Levit
<grishalevit@gmail.com>
flags.c
- reset_shell_flags: add missing flags, re-initialize history_expansion
based on STRICT_POSIX
5/8
---
lib/readline/histexpand.c
- history_expand: if any expansion returns 1 from history_expand_internal,
indicating that :p was supplied, make it apply to the entire line
like tcsh and csh. Fixes bug reported by Dean Stanton
<dstanton@tintri.com>
variables.[ch]
- ifsname: move define to variables.h
execute_cmd.c
- execute_for_command: check whether or not the word in the for command
is IFS; call setifs every time the variable is assigned a value.
Fixes bug report from Grisha Levit <grishalevit@gmail.com>
5/16
----
general.c
- valid_nameref_value: explicitly handle name == 0 and *name == 0 right
away to save calls to legal_identifier
builtins/declare.def
- declare_internal: if trying to set nameref attribute on a variable with
a null value, flag as invalid assignment, just as if running
`declare -n r=""'. Fixes bug report from Grisha Levit
<grishalevit@gmail.com>
- declare_internal: when creating a variable with a temporary value (""),
use ASS_FORCE in the assignment flags to bypass name validity checks on
nameref variable names
variables.c
- bind_variable_internal: don't call valid_nameref_value if we're forcing
assignment with (flags & ASS_FORCE)
builtins/read.def
- read_builtin: handle bind_variable returning NULL when setting REPLY.
Report and fix from Grisha Levit <grishalevit@gmail.com>
builtins/setattr.def
- set_var_attribute: handle bind_variable returning NULL
lib/sh/tmpfile.c
- sh_seedrand(): call srandom() to seed the random number generator
- sh_mktmpname, sh_mktmpfd: if we have random(), assume we have srandom()
and seed the random number generator. Still looking for better value to
see random number generator with
variables.c
- check_unbind_variable: use internal_error instead of builtin_error
{execute_cmd,variables}.c
- fix some places where bind_variable could return NULL and it was not
checked. Fix from Piotr Grzybowski <narsil.pl@gmail.com>
5/17
----
arrayfunc.c
- convert_var_to_{array,assoc}: make sure to turn off nameref attribute,
since namerefs can't be arrays
execute_cmd.c
- coproc_setvars: if the coproc name names a nameref, resolve the nameref
and use it as the name of the coproc. Suggested by Grisha Levit
<grishalevit@gmail.com>
subst.c
- command_substitute: don't bother calling QUIT after calling
reset_signal_handlers in the child, kill the child with SIGINT in
case we just reset the signal handler to SIG_DFL and we should just
exit instead of throwing to top level. Fixes bug reported by
Grisha Levit <grishalevit@gmail.com>
5/18
----
variables.c
- find_variable_nameref_for_create: find a nameref variable whose value
doesn't resolve to an existing variable and see whether or not that
value is appropriate for a new variable to be created
- find_variable_nameref_for_assignment: find a nameref variable whose value
doesn't resolve to an existing variable and see whether or not that
value is appropriate for a new variable to be created. Difference
between _assignment and _create is that _assignment allows the nameref
value to be a subscripted array reference
builtins/setattr.def
- set_var_attribute: if variable lookup doesn't return anything, check
for a nameref and make sure that any reference value is something we
should be working on here, using find_variable_nameref_for_create().
If it fails, error out and return, otherwise it's probably a reference
to a variable that hasn't been set yet, so let bind_variable take care
of that. Report from Grisha Levit <grishalevit@gmail.com>
arrayfunc.c
- bind_array_variable: if find_shell_variable returns NULL, check for a
nameref using find_variable_nameref_for_create and create a new array
variable with the value if it returns a valid nameref variable.
Makes `unset var; declare -n ref=var ; ref[0]=foo' work right.
Report from Grisha Levit <grishalevit@gmail.com>
5/19
----
variables.[ch]
- unbind_variable_noref: unset a variable NAME without following any
nameref chain. If the first instance of the variable with that name
is a nameref, just unset that nameref variable.
builtins/getopts.def
- getopts_unbind_variable: if OPTARG is going to be unbound, use
unbind_variable_noref to unbind that name even if it is a nameref
variable. Issue raised by Grisha Levit <grishalevit@gmail.com>
execute_cmd.c
- coproc_unsetvars: use unbind_variable_noref in case someone sets the
coproc _PID variable as a nameref pointing to something read-only or
strange. Issue raised by Grisha Levit <grishalevit@gmail.com>
builtins/set.def
- set_ignoreeof: use unbind_variable_noref to unset "IGNOREEOF" and
"ignoreeof"
- set_posix_mode: use unbind_variable_noref to unset "POSIXLY_CORRECT"
variables.c
- make_vers_array: use unbind_variable_noref to unset "BASH_VERSINFO"
lib/sh/shmatch.c
- sh_regmatch: use unbind_variable_noref to unset "BASH_REMATCH"
bashline.c
- bash_execute_unix_command: use check_unbind_variable to unset
READLINE_LINE and READLINE_POINT
pcomplete.c
- unbind_compfunc_variables: use unbind_variable_noref to unset COMP_LINE,
COMP_POINT, COMP_WORDS, COMP_CWORD, COMP_TYPE, COMP_KEY
- gen_shell_function_matches: use unbind_variable_noref to unset COMPREPLY
config-top.h
- USE_MKTEMP/USE_MKSTEMP: define by default to use libc version of mktemp
and mkstemp in lib/sh/tmpfile.c. Recommended by by Mike Frysinger
<vapier@gentoo.org> to fix a FreeBSD problem
configure.ac,config.h.in
- mkstemp: check for mkstemp, define HAVE_MKSTEMP if available
config-bot.h
- USE_MKSTEMP: #undef if HAVE_MKSTEMP not defined
5/22
----
variables.c
- assign_in_env: if appending to a variable's value, make sure we call
make_variable_value with the empty string if expand_assignment_string_to_string
returns NULL, as do_assignment_internal does. Fixes bug with
`str=''; val=foo ; val+=str printenv val' reported by Grisha Levit
<grishalevit@gmail.com>
- assign_in_env: if assigning to a nameref variable in the temporary
environment, and the nameref has a valid value for assignment (even
if the target variable is not set), resolve the nameref and create
a variable in the temporary environment named by the nameref's value.
If the nameref variable is invisible or isn't set to a valid value
for assignment, just create a regular temporary variable with the
nameref's name. This provides a degree of ksh93 compatibility.
Suggested by Grisha Levit <grishalevit@gmail.com>
- find_variable_nameref_context,find_variable_last_nameref_context:
instead of returning NULL when detecting a loop, return a distinguished
value: &nameref_maxloop_value
- bind_variable: catch nameref_maxloop_value so we can do different
things based on whether or not we get it. Right now we don't do
anything different, but we could
5/24
----
lib/readline/display.c
- update_line,_rl_move_cursor_relative: save value of MB_CUR_MAX in a
variable and use it throughout the functions instead of recomputing it
every time (which possibly costs a function call)
5/25
----
builtins/declare.def
- declare_internal: only check whether the value being assigned to a
nameref variable is a valid identifier if we're not appending to an
existing value. Suggested by Grisha Levit <grishalevit@gmail.com>
- declare_internal: add a couple of more checks on nameref names:
o make sure `declare -n x[3]=y' is an error
o nameref variable self-references now produce a warning when in
function scope
o nameref variable self-references using subscripted arrays
(a=a[0]) now produce warnings at function scope and errors at
global scope
5/29
----
builtins/declare.def
- declare_internal: use name of readonly variable when calling sh_readonly
instead of name passed as argument to declare in case we've followed
a nameref chain
- declare_internal: when turning off attributes on a nameref variable
after following the nameref chain and turning them off on the target
variable, don't allow the readonly attribute to be removed. This is
primarily intended to turn off the nameref attribute. Issue pointed
out by Grisha Levit <grishalevit@gmail.com>
- declare_internal: if we are attempting to modify an existing global
nameref variable, and the -n option is supplied, operate on the
nameref variable itself, not the variable it references
doc/{bash.1,bashref.texi}
- change the descriptions of namerefs and declare -n slightly to note
that using the -n option to declare will operate on the nameref
variable itself rather than the variable it references
variables.c
- bind_variable_internal: if trying to assign to a read-only variable,
print the error message using the variable's name instead of the
name passed to bind_variable in case we followed a nameref
builtins/declare.def
- declare_internal: when we're creating a (possibly invisible) variable
as part of another operation, assigning NULL, make sure to use
ASS_FORCE to avoid warning messages from any existing nameref
variables we follow
- declare_internal: allow the nameref attribute to be removed from a
readonly nameref variable without a value but do not allow it to be
removed from a readonly nameref variable that has a value, even if it
doesn't reference an existing variable. This distinction is for ksh93
compatibility. Pointed out by Grisha Levit <grishalevit@gmail.com>
5/31
----
builtins/declare.def
- declare_internal: if the call to bind_variable_value fails for some
reason, make sure to restore the nameref attribute to flags_on and
flags_off before calling NEXT_VARIABLE
subst.c
- make_internal_declare: handle += append op
- shell_expand_word_list: when transforming assignment statement
arguments to `declare', make sure to handle += append op to avoid
passing invalid identifiers to declare. Report by Grisha Levit
<grishalevit@gmail.com>
6/1
---
builtins/declare.def
- declare_internal: if a nameref assignment fails, only call delete_var to
delete the variable if we created it in declare_internal in the first
place
general.c
- check_selfref: new function, checks a NAME against a VALUE for nameref
self-reference
general.h
- check_selfref: extern declaration
builtins/declare.def
- declare_internal: call check_selfref to determine whether a given NAME
and VALUE constitute an invalid nameref variable self-reference
variables.c
- bind_variable_internal: call check_selfref to determine whether a given
NAME and VALUE constitute an invalid nameref variable self-reference
6/2
---
parse.y
- clear_shell_input_line: new function, clears contents of shell_input_line
and sets index to 0, but doesn't free it
externs.h
- clear_shell_input_line: extern declaration
builtins/evalstring.c
- parse_and_execute: call clear_shell_input_line after setting input to
string to be executed. Fixes problem with command substitution and
multi-line aliases reported by Grisha Levit <grishalevit@gmail.com>
eval.c
- parse_command: only execute PROMPT_COMMAND if the shell is not
currently expanding an alias; use the same tests as parse.y:SHOULD_PROMPT
and parse.y:prompt_again() use to decide whether or not to print a
prompt. Fixes problems with PROMPT_COMMAND and multi-line aliases
reported by Grisha Levit <grishalevit@gmail.com>
builtins/set.def
- unset_builtin: changes to fix three problems reported by Grisha
Levit <grishalevit@gmail.com>:
o if -n is supplied, we should not try to unset a function if
a variable isn't found
o unsetting namerefs whose values are array references does
not work
o unset -n n[0], where n is a nameref, would unset the referenced
variable instead of `n'
redir.c
- redir_varvalue: handle case where nameref var points to subscripted
array reference. Reported by Grisha Levit <grishalevit@gmail.com>
variables.c
- bind_variable_value: make sure to call check_selfref only if aflags
includes ASS_NAMEREF and not ASS_FORCE. Reported by Grisha Levit
<grishalevit@gmail.com>
general.c
- valid_nameref_value: now understands a FLAGS value of 2 to mean that
the name will be used to create a variable, so only legal_identifier
matters
arrayfunc.c
- find_or_make_array_variable: call valid_nameref_value with FLAGS value
of 2 to indicate we will be creating a variable. Fixes mapfile issue
reported by Grisha Levit <grishalevit@gmail.com>
6/5
---
builtins/declare.def
- declare_internal: only pass ASS_FORCE as part of assignment flags to
assignments concerning arrays
- declare_internal: when at the global scope, if we resolve a nameref
and commit to using the new name, go back to to the beginning of the
loop and use the new name in the checks and variable references.
Make sure we construct the new name as a straight substitution of
the nameref value into the old name, including array subscripts and
rebuilding the correct values for `offset' and `value', since they
are relative to the original value of name.
Fixes several issues with checking use of subscripted array variables
as nameref values
- declare_internal: when calling assign_array_element, make sure to pass
ASS_APPEND if aflags includes it, so things like
declare -a var; var[1]=1; declare var[1]+=4
append to the value appropriately and var[1] ends up being `14'
arrayfunc.c
- valid_array_reference: make sure the array reference is properly
terminated after the first subscript; return invalid if there is
anything following the closing `]'
6/12
----
variables.c
- bind_variable_internal: if asked to perform an array subscript
assignment on a nameref variable, display a warning and remove the
nameref attribute (as bash-4.3 did). Reported by Dan Douglas
<ormaaj@gmail.com>
6/14
----
test.c
- posixtest: handle four-argument case where argv[1] == '(' and
argv[4] == ')' by performing two-argument test on $2 and $3. Reported
by Joerg Schilling <Joerg.Schilling@fokus.fraunhofer.de>
6/15
----
variables.c
- sv_ignoreeof: make sure ignoreeof is set only if IGNOREEOF is set and
has a value (no `local IGNOREEOF'). Reported by Grisha Levit
<grishalevit@gmail.com>
- sv_strict_posix: make sure posixly_correct is set only if POSIXLY_CORRECT
is set and has a value. Reported by Grisha Levit <grishalevit@gmail.com>
6/16
----
builtins/declare.def
- declare_internal: analogous to 6/12 change; when performing an array
subscript assignment on a nameref, display a warning, remove the
nameref attribute, and go on
6/21
----
execute_cmd.c
- shell_execve: make sure errno is (re)set appropriately before returning
error value on exec format error
6/23
----
execute_cmd.c
- param_expand: when expanding $* in a context where splitting is not
desired (pflags & PF_ASSIGNRHS), make sure to quote the word and the
included separators. Reported by Dan Douglas <ormaaj@gmail.com>
6/30
----
configure.ac
- release version is now `beta2'
execute_cmd.c
- execute_simple_command: even if already_making_children is non-zero,
don't call wait_for if last_made_pid == NO_PID. Indirectly inspired
by report from Nicolas Vivet <nicolas@nzx.io>
7/2
---
subst.c
- expand_word_internal: when adding an IFS character to the accumulated
string, don't quote it if word expansion is not going to be
performed ((word->flags & (W_NOSPLIT|W_NOSPLIT2)) == 0) in the
default case. This was already the case everwhere else, when we did
`goto add_ifs_character;'. Fixes bug reported by Ibrahim M. Ghazal
<imgx64@gmail.com>
subst.[ch],arrayfunc.c
- string_list_dollar_at: now takes a new third argument, currently
reserved for future use; changed callers and declaration
+14
View File
@@ -57,6 +57,8 @@ code directory by typing 'make clean'. To also remove the files that
'configure' created (so you can compile Bash for a different kind of
computer), type 'make distclean'.
Next: Compiling For Multiple Architectures, Prev: Basic Installation, Up: Installing Bash
Compilers and Options
=====================
@@ -74,6 +76,8 @@ On systems that have the 'env' program, you can do it like this:
The configuration process uses GCC to build Bash if it is available.
Next: Installation Names, Prev: Compilers and Options, Up: Installing Bash
Compiling For Multiple Architectures
====================================
@@ -104,6 +108,8 @@ The 'mkclone' script requires Bash, so you must have already built Bash
for at least one architecture before you can create build directories
for other architectures.
Next: Specifying the System Type, Prev: Compiling For Multiple Architectures, Up: Installing Bash
Installation Names
==================
@@ -119,6 +125,8 @@ option '--exec-prefix=PATH', 'make install' will use PATH as the prefix
for installing programs and libraries. Documentation and other data
files will still use the regular prefix.
Next: Sharing Defaults, Prev: Installation Names, Up: Installing Bash
Specifying the System Type
==========================
@@ -132,6 +140,8 @@ canonical name with three fields: 'CPU-COMPANY-SYSTEM' (e.g.,
See the file 'support/config.sub' for the possible values of each field.
Next: Operation Controls, Prev: Specifying the System Type, Up: Installing Bash
Sharing Defaults
================
@@ -144,6 +154,8 @@ looks for 'PREFIX/share/config.site' if it exists, then
A warning: the Bash 'configure' looks for a site script, but not all
'configure' scripts do.
Next: Optional Features, Prev: Sharing Defaults, Up: Installing Bash
Operation Controls
==================
@@ -173,6 +185,8 @@ Operation Controls
'configure' also accepts some other, not widely used, boilerplate
options. 'configure --help' prints the complete list.
Prev: Operation Controls, Up: Installing Bash
Optional Features
=================
+14 -1
View File
@@ -887,6 +887,7 @@ tests/comsub.tests f
tests/comsub.right f
tests/comsub1.sub f
tests/comsub2.sub f
tests/comsub3.sub f
tests/comsub-eof.tests f
tests/comsub-eof0.sub f
tests/comsub-eof1.sub f
@@ -983,11 +984,13 @@ tests/extglob.tests f
tests/extglob.right f
tests/extglob1.sub f
tests/extglob1a.sub f
tests/extglob3.sub f
tests/extglob2.sub f
tests/extglob2.tests f
tests/extglob2.right f
tests/extglob3.sub f
tests/extglob3.tests f
tests/extglob3.right f
tests/extglob4.sub f
tests/func.tests f
tests/func.right f
tests/func1.sub f
@@ -1005,6 +1008,7 @@ tests/getopts6.sub f
tests/getopts7.sub f
tests/getopts8.sub f
tests/getopts9.sub f
tests/getopts10.sub f
tests/glob.tests f
tests/glob1.sub f
tests/glob.right f
@@ -1058,6 +1062,7 @@ tests/jobs.right f
tests/lastpipe.right f
tests/lastpipe.tests f
tests/lastpipe1.sub f
tests/lastpipe2.sub f
tests/mapfile.data f
tests/mapfile.right f
tests/mapfile.tests f
@@ -1076,6 +1081,14 @@ tests/nameref7.sub f
tests/nameref8.sub f
tests/nameref9.sub f
tests/nameref10.sub f
tests/nameref11.sub f
tests/nameref12.sub f
tests/nameref13.sub f
tests/nameref14.sub f
tests/nameref15.sub f
tests/nameref16.sub f
tests/nameref17.sub f
tests/nameref18.sub f
tests/nameref.right f
tests/new-exp.tests f
tests/new-exp1.sub f
+37 -7
View File
@@ -120,22 +120,33 @@ ii. inherit_errexit: a new `shopt' option that, when set, causes command
substitutions to inherit the -e option. By default, those subshells disable
-e. It's enabled as part of turning on posix mode.
jj. New prompt string: PS0. Expanded and displayed by interactive shells after
jj. New prompt string: PS0. Expanded and displayed by interactive shells after
reading a complete command but before executing it.
kk. Interactive shells now behave as if SIGTSTP/SIGTTIN/SIGTTOU are set to SIG_DFL
when the shell is started, so they are set to SIG_DFL in child processes.
kk. Interactive shells now behave as if SIGTSTP/SIGTTIN/SIGTTOU are set to
SIG_DFL when the shell is started, so they are set to SIG_DFL in child
processes.
ll. Posix-mode shells now allow double quotes to quote the history expansion
character.
mm. OLDPWD can be inherited from the environment if it names a directory.
nn. Shells running as root no longer inherit PS4 from the environment, closing a
security hole involving PS4 expansion performing command substitution.
nn. Shells running as root no longer inherit PS4 from the environment, closing
a security hole involving PS4 expansion performing command substitution.
oo. If executing an implicit `cd' when the `autocd' option is set, bash will now
invoke a function named `cd' if one exists before executing the `cd' builtin.
oo. If executing an implicit `cd' when the `autocd' option is set, bash will
now invoke a function named `cd' if one exists before executing the `cd'
builtin.
pp. Value conversions (arithmetic expansions, case modification, etc.) now
happen when assigning elements of an array using compound assignment.
qq. There is a new option settable in config-top.h that makes multiple
directory arguments to `cd' a fatal error.
rr. Bash now uses mktemp() when creating internal temporary files; it produces
a warning at build time on many Linux systems.
2. New Features in Readline
@@ -182,6 +193,25 @@ k. If readline reads a history file that begins with `#' (or the value of
l. Readline now throws an error if it parses a key binding without a terminating
`:' or whitespace.
m. The default binding for ^W in vi mode now uses word boundaries specified
by Posix (vi-unix-word-rubout is bindable command name).
n. rl_clear_visible_line: new application-callable function; clears all
screen lines occupied by the current visible readline line.
o. rl_tty_set_echoing: application-callable function that controls whether
or not readline thinks it is echoing terminal output.
p. Handle >| and strings of digits preceding and following redirection
specifications as single tokens when tokenizing the line for history
expansion.
q. Fixed a bug with displaying completions when the prefix display length
is greater than the length of the completions to be displayed.
r. The :p history modifier now applies to the entire line, so any expansion
specifying :p causes the line to be printed instead of expanded.
-------------------------------------------------------------------------------
This is a terse description of the new features added to bash-4.3 since
the release of bash-4.2. As always, the manual page (doc/bash.1) is
+3
View File
@@ -209,6 +209,9 @@ The following list is what's changed when 'POSIX mode' is in effect:
'read', the trap handler executes and 'read' returns an exit status
greater than 128.
54. Bash removes an exited background process's status from the list
of such statuses after the 'wait' builtin is used to obtain it.
There is other POSIX behavior that Bash does not implement by default
even when in POSIX mode. Specifically:
+42 -10
View File
@@ -87,6 +87,12 @@ convert_var_to_array (var)
VSETATTR (var, att_array);
VUNSETATTR (var, att_invisible);
/* Make sure it's not marked as an associative array any more */
VUNSETATTR (var, att_assoc);
/* Since namerefs can't be array variables, turn off nameref attribute */
VUNSETATTR (var, att_nameref);
return var;
}
@@ -118,6 +124,12 @@ convert_var_to_assoc (var)
VSETATTR (var, att_assoc);
VUNSETATTR (var, att_invisible);
/* Make sure it's not marked as an indexed array any more */
VUNSETATTR (var, att_array);
/* Since namerefs can't be array variables, turn off nameref attribute */
VUNSETATTR (var, att_nameref);
return var;
}
@@ -204,6 +216,15 @@ bind_array_variable (name, ind, value, flags)
entry = find_shell_variable (name);
if (entry == (SHELL_VAR *) 0)
{
/* Is NAME a nameref variable that points to an unset variable? */
entry = find_variable_nameref_for_create (name, 0);
if (entry == INVALID_NAMEREF_VALUE)
return ((SHELL_VAR *)0);
if (entry && nameref_p (entry))
entry = make_new_array_variable (nameref_cell (entry));
}
if (entry == (SHELL_VAR *) 0)
entry = make_new_array_variable (name);
else if ((readonly_p (entry) && (flags&ASS_FORCE) == 0) || noassign_p (entry))
@@ -259,7 +280,7 @@ assign_array_element (name, value, flags)
{
char *sub, *vname;
int sublen;
SHELL_VAR *entry;
SHELL_VAR *entry, *nv;
vname = array_variable_name (name, &sub, &sublen);
@@ -341,9 +362,21 @@ find_or_make_array_variable (name, flags)
{
/* See if we have a nameref pointing to a variable that hasn't been
created yet. */
var = find_variable_last_nameref (name);
var = find_variable_last_nameref (name, 1);
if (var && nameref_p (var) && invisible_p (var))
{
internal_warning (_("%s: removing nameref attribute"), name);
VUNSETATTR (var, att_nameref);
}
if (var && nameref_p (var))
var = (flags & 2) ? make_new_assoc_variable (nameref_cell (var)) : make_new_array_variable (nameref_cell (var));
{
if (valid_nameref_value (nameref_cell (var), 2) == 0)
{
sh_invalidid (nameref_cell (var));
return ((SHELL_VAR *)NULL);
}
var = (flags & 2) ? make_new_assoc_variable (nameref_cell (var)) : make_new_array_variable (nameref_cell (var));
}
}
if (var == 0)
@@ -403,10 +436,7 @@ assign_array_var_from_word_list (var, list, flags)
i = (flags & ASS_APPEND) ? array_max_index (a) + 1 : 0;
for (l = list; l; l = l->next, i++)
if (var->assign_func)
(*var->assign_func) (var, l->word->word, i, 0);
else
array_insert (a, i, l->word->word);
bind_array_var_internal (var, i, 0, l->word->word, flags & ~ASS_APPEND);
VUNSETATTR (var, att_invisible); /* no longer invisible */
@@ -869,6 +899,8 @@ valid_array_reference (name, flags)
len = skipsubscript (t, 0, 0);
if (t[len] != ']' || len == 1)
return 0;
if (t[len+1] != '\0')
return 0;
for (r = 1; r < len; r++)
if (whitespace (t[r]) == 0)
return 1;
@@ -969,7 +1001,7 @@ array_variable_part (s, subp, lenp)
t = array_variable_name (s, subp, lenp);
if (t == 0)
return ((SHELL_VAR *)NULL);
var = find_variable (t);
var = find_variable (t); /* XXX - handle namerefs here? */
free (t);
return var; /* now return invisible variables; caller must handle */
@@ -1055,7 +1087,7 @@ array_value_internal (s, quoted, flags, rtype, indp)
free (temp);
}
else /* ${name[@]} or unquoted ${name[*]} */
retval = string_list_dollar_at (l, quoted); /* XXX - leak here */
retval = string_list_dollar_at (l, quoted, 0); /* XXX - leak here */
dispose_words (l);
}
@@ -1172,7 +1204,7 @@ array_keys (s, quoted)
free (temp);
}
else /* ${!name[@]} or unquoted ${!name[*]} */
retval = string_list_dollar_at (l, quoted);
retval = string_list_dollar_at (l, quoted, 0);
dispose_words (l);
return retval;
+10 -4
View File
@@ -188,7 +188,9 @@ extern int current_command_line_count;
extern struct dstack dstack;
extern int parser_state;
#if defined (BANG_HISTORY)
static int bash_history_inhibit_expansion __P((char *, int));
#endif
#if defined (READLINE)
static void re_edit __P((char *));
#endif
@@ -199,6 +201,7 @@ static HIST_ENTRY *last_history_entry __P((void));
static char *expand_histignore_pattern __P((char *));
static int history_should_ignore __P((char *));
#if defined (BANG_HISTORY)
/* Is the history expansion starting at string[i] one that should not
be expanded? */
static int
@@ -246,14 +249,15 @@ bash_history_inhibit_expansion (string, i)
else
return (0);
}
#endif
void
bash_initialize_history ()
{
history_quotes_inhibit_expansion = 1;
history_search_delimiter_chars = ";&()|<>";
history_inhibit_expansion_function = bash_history_inhibit_expansion;
#if defined (BANG_HISTORY)
history_inhibit_expansion_function = bash_history_inhibit_expansion;
sv_histchars ("histchars");
#endif
}
@@ -265,9 +269,9 @@ bash_history_reinit (interact)
#if defined (BANG_HISTORY)
history_expansion = interact != 0;
history_expansion_inhibited = 1; /* XXX */
history_inhibit_expansion_function = bash_history_inhibit_expansion;
#endif
remember_on_history = enable_history_list;
history_inhibit_expansion_function = bash_history_inhibit_expansion;
}
void
@@ -285,8 +289,8 @@ bash_history_enable ()
remember_on_history = enable_history_list = 1;
#if defined (BANG_HISTORY)
history_expansion_inhibited = 0;
#endif
history_inhibit_expansion_function = bash_history_inhibit_expansion;
#endif
sv_history_control ("HISTCONTROL");
sv_histignore ("HISTIGNORE");
}
@@ -670,7 +674,9 @@ hc_erasedups (line)
if (STREQ (temp->line, line))
{
r = where_history ();
remove_history (r);
temp = remove_history (r);
if (temp)
free_history_entry (temp);
}
}
using_history ();
+19 -6
View File
@@ -1,6 +1,6 @@
/* bashline.c -- Bash's interface to the readline library. */
/* Copyright (C) 1987-2013 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -54,6 +54,7 @@
#include "pathexp.h"
#include "shmbutil.h"
#include "trap.h"
#include "flags.h"
#if defined (HAVE_MBSTR_H) && defined (HAVE_MBSCHR)
# include <mbstr.h> /* mbschr */
@@ -980,9 +981,6 @@ edit_and_execute_command (count, c, editing_mode, edit_command)
metaval = rl_variable_value ("input-meta");
metaflag = RL_BOOLEAN_VARIABLE_VALUE (metaval);
/* Now, POSIX.1-2001 and SUSv3 say that the commands executed from the
temporary file should be placed into the history. We don't do that
yet. */
if (rl_deprep_term_function)
(*rl_deprep_term_function) ();
save_parser_state (&ps);
@@ -1648,6 +1646,11 @@ bash_default_completion (text, start, end, qc, compflags)
else
{
matches = rl_completion_matches (text, variable_completion_function);
/* If a single match, see if it expands to a directory name and append
a slash if it does. This requires us to expand the variable name,
so we don't want to display errors if the variable is unset. This
can happen with dynamic variables whose value has never been
requested. */
if (matches && matches[0] && matches[1] == 0)
{
t = savestring (matches[0]);
@@ -3124,6 +3127,7 @@ bash_filename_stat_hook (dirname)
{
char *local_dirname, *new_dirname, *t;
int should_expand_dirname, return_value;
int global_nounset;
WORD_LIST *wl;
struct stat sb;
@@ -3140,7 +3144,12 @@ bash_filename_stat_hook (dirname)
if (should_expand_dirname)
{
new_dirname = savestring (local_dirname);
/* no error messages, and expand_prompt_string doesn't longjmp so we don't
have to worry about restoring this setting. */
global_nounset = unbound_vars_is_error;
unbound_vars_is_error = 0;
wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB); /* does the right thing */
unbound_vars_is_error = global_nounset;
if (wl)
{
free (new_dirname);
@@ -4080,8 +4089,12 @@ bash_execute_unix_command (count, key)
ce = rl_get_termcap ("ce");
if (ce) /* clear current line */
{
#if 0
fprintf (rl_outstream, "\r");
tputs (ce, 1, putx);
#else
rl_clear_visible_line ();
#endif
fflush (rl_outstream);
}
else
@@ -4119,8 +4132,8 @@ bash_execute_unix_command (count, key)
}
}
unbind_variable ("READLINE_LINE");
unbind_variable ("READLINE_POINT");
check_unbind_variable ("READLINE_LINE");
check_unbind_variable ("READLINE_POINT");
array_needs_making = 1;
/* and restore the readline buffer and display after command execution. */
+1
View File
@@ -87,6 +87,7 @@ alias_builtin (list)
pflag = 1;
dflags |= AL_REUSABLE;
break;
CASE_HELPOPT;
default:
builtin_usage ();
return (EX_USAGE);
+8 -1
View File
@@ -1,7 +1,7 @@
This file is cd.def, from which is created cd.c. It implements the
builtins "cd" and "pwd" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -329,6 +329,13 @@ cd_builtin (list)
builtin_error (_("too many arguments"));
return (EXECUTION_FAILURE);
}
#endif
#if 0
else if (list->word->word[0] == '\0')
{
builtin_error (_("null directory"));
return (EXECUTION_FAILURE);
}
#endif
else if (list->word->word[0] == '-' && list->word->word[1] == '\0')
{
+1
View File
@@ -813,6 +813,7 @@ compopt_builtin (list)
case 'E':
Eflag = 1;
break;
CASE_HELPOPT;
default:
builtin_usage ();
return (EX_USAGE);
+183 -39
View File
@@ -1,7 +1,7 @@
This file is declare.def, from which is created declare.c.
It implements the builtins "declare" and "local" in Bash.
Copyright (C) 1987-2015 Free Software Foundation, Inc.
Copyright (C) 1987-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -286,8 +286,8 @@ declare_internal (list, local_var)
/* There are arguments left, so we are making variables. */
while (list) /* declare [-aAfFirx] name [name ...] */
{
char *value, *name;
int offset, aflags, wflags;
char *value, *name, *oldname;
int offset, aflags, wflags, created_var, namelen;
#if defined (ARRAY_VARS)
int making_array_special, compound_array_assign, simple_array_assign;
int var_exists, array_exists, creating_array, array_subscript_assignment;
@@ -297,6 +297,7 @@ declare_internal (list, local_var)
wflags = list->word->flags;
offset = assignment (name, 0);
aflags = 0;
created_var = 0;
if (local_var && variable_context && STREQ (name, "-"))
{
@@ -325,7 +326,7 @@ declare_internal (list, local_var)
that is specific to nameref variables. */
if (flags_on & att_nameref)
{
#if defined (ARRAY_VARIABLES)
#if defined (ARRAY_VARS)
if (valid_array_reference (name, 0))
{
builtin_error (_("%s: reference variable cannot be an array"), name);
@@ -334,17 +335,22 @@ declare_internal (list, local_var)
}
else
#endif
/* disallow self references at global scope */
if (STREQ (name, value) && variable_context == 0)
/* disallow self references at global scope, warn at function scope */
if (check_selfref (name, value, 0))
{
builtin_error (_("%s: nameref variable self references not allowed"), name);
assign_error++;
NEXT_VARIABLE ();
if (variable_context == 0)
{
builtin_error (_("%s: nameref variable self references not allowed"), name);
assign_error++;
NEXT_VARIABLE ();
}
else
builtin_warning (_("%s: circular name reference"), name);
}
#if 0
if (value && *value && legal_identifier (value) == 0)
#if 1
if (value && *value && (aflags & ASS_APPEND) == 0 && valid_nameref_value (value, 1) == 0)
{
builtin_error (_("%s: invalid variable name for name reference"), value);
builtin_error (_("`%s': invalid variable name for name reference"), value);
assign_error++;
NEXT_VARIABLE ();
}
@@ -352,13 +358,15 @@ declare_internal (list, local_var)
}
#if defined (ARRAY_VARS)
restart_new_var_name:
var_exists = array_exists = creating_array = 0;
compound_array_assign = simple_array_assign = 0;
array_subscript_assignment = 0;
subscript_start = (char *)NULL;
if (t = strchr (name, '[')) /* ] */
{
/* If offset != 0 we have already validated any array reference */
/* If offset != 0 we have already validated any array reference
because assignment() calls skipsubscript() */
if (offset == 0 && valid_array_reference (name, 0) == 0)
{
sh_invalidid (name);
@@ -395,6 +403,7 @@ declare_internal (list, local_var)
refvar = (SHELL_VAR *)NULL;
if (variable_context && mkglobal == 0 && ((flags_on & att_function) == 0))
{
/* check name for validity here? */
#if defined (ARRAY_VARS)
if (flags_on & att_assoc)
var = make_local_assoc_variable (name);
@@ -402,12 +411,41 @@ declare_internal (list, local_var)
var = make_local_array_variable (name, making_array_special);
else
#endif
if (offset == 0 && (flags_on & att_nameref))
{
/* First look for refvar at current scope */
refvar = find_variable_last_nameref (name, 1);
var = find_variable (name);
/* VARIABLE_CONTEXT != 0, so we are attempting to create or modify
the attributes for a local variable at the same scope. If we've
used a reference from a previous context to resolve VAR, we
want to throw REFVAR and VAR away and create a new local var. */
if (refvar && refvar->context != variable_context)
{
refvar = 0;
var = make_local_variable (name);
}
else if (refvar && refvar->context == variable_context)
var = refvar;
/* Maybe we just want to create a new local variable */
else if (var == 0 || var->context != variable_context)
var = make_local_variable (name);
/* otherwise we have a var at the right context */
}
else
/* XXX - check name for validity here with valid_nameref_value */
var = make_local_variable (name); /* sets att_invisible for new vars */
if (var == 0)
{
any_failed++;
NEXT_VARIABLE ();
}
if (var && nameref_p (var) && readonly_p (var) && nameref_cell (var) && (flags_off & att_nameref))
{
sh_readonly (name);
any_failed++;
NEXT_VARIABLE ();
}
}
else
var = (SHELL_VAR *)NULL;
@@ -471,18 +509,33 @@ declare_internal (list, local_var)
NEXT_VARIABLE ();
}
}
else /* declare -[aAirx] name [name...] */
else /* declare -[aAinrx] name [name...] */
{
/* Non-null if we just created or fetched a local variable. */
#if 0
/* This is bash-4.3 code. */
/* Here's what ksh93 seems to do. If we are modifying an existing
nameref variable, we don't follow the nameref chain past the last
nameref, and we set the nameref variable's value so future
references to that variable will return the value of the variable
we're assigning right now. */
#else
/* Here's what ksh93 seems to do as of the 2012 version: if we are
using declare -n to modify the value of an existing nameref
variable, don't follow the nameref chain at all and just search
for a nameref at the current context. If we have a nameref,
modify its value (changing which variable it references). */
#endif
if (var == 0 && (flags_on & att_nameref))
{
#if 0
/* See if we are trying to modify an existing nameref variable */
var = mkglobal ? find_global_variable_last_nameref (name) : find_variable_last_nameref (name);
var = mkglobal ? find_global_variable_last_nameref (name, 1) : find_variable_last_nameref (name, 1);
#else
/* See if we are trying to modify an existing nameref variable,
but don't follow the nameref chain. */
var = mkglobal ? find_global_variable_noref (name) : find_variable_noref (name);
#endif
if (var && nameref_p (var) == 0)
var = 0;
}
@@ -494,12 +547,37 @@ declare_internal (list, local_var)
else if (var == 0 && (flags_off & att_nameref))
{
/* See if we are trying to modify an existing nameref variable */
refvar = mkglobal ? find_global_variable_last_nameref (name) : find_variable_last_nameref (name);
refvar = mkglobal ? find_global_variable_last_nameref (name, 0) : find_variable_last_nameref (name, 0);
if (refvar && nameref_p (refvar) == 0)
refvar = 0;
/* If the nameref is readonly but doesn't have a value, ksh93
allows the nameref attribute to be removed. If it's readonly
and has a value, even if the value doesn't reference an
existing variable, we disallow the modification */
if (refvar && nameref_cell (refvar) && readonly_p (refvar))
{
sh_readonly (name);
any_failed++;
NEXT_VARIABLE ();
}
if (refvar)
var = mkglobal ? find_global_variable (nameref_cell (refvar)) : find_variable (nameref_cell (refvar));
}
#if defined (ARRAY_VARS)
/* If we have an array assignment to a nameref, remove the nameref
attribute and go on. */
else if (var == 0 && offset && array_subscript_assignment)
{
var = mkglobal ? find_global_variable_noref (name) : find_variable_noref (name);
if (var && nameref_p (var))
{
internal_warning (_("%s: removing nameref attribute"), name);
FREE (value_cell (var)); /* XXX - bash-4.3 compat */
var_setvalue (var, (char *)NULL);
VUNSETATTR (var, att_nameref);
}
}
#endif
/* See if we are trying to set flags or value for an existing nameref
that points to a non-existent variable: e.g.,
@@ -510,15 +588,57 @@ declare_internal (list, local_var)
declare -p foo */
if (var == 0 && (flags_on || flags_off || offset))
{
refvar = mkglobal ? find_global_variable_last_nameref (name) : find_variable_last_nameref (name);
refvar = mkglobal ? find_global_variable_last_nameref (name, 0) : find_variable_last_nameref (name, 0);
if (refvar && nameref_p (refvar) == 0)
refvar = 0;
if (refvar)
var = mkglobal ? find_global_variable (nameref_cell (refvar)) : find_variable (nameref_cell (refvar));
if (refvar && var == 0)
{
free (name);
name = savestring (nameref_cell (refvar));
oldname = name; /* need to free this */
namelen = strlen (nameref_cell (refvar));
#if defined (ARRAY_VARS)
if (subscript_start)
{
*subscript_start = '['; /*]*/
namelen += strlen (subscript_start);
}
#endif
name = xmalloc (namelen + 2 + strlen (value) + 1);
strcpy (name, nameref_cell (refvar));
#if defined (ARRAY_VARS)
if (subscript_start)
strcpy (name + strlen (nameref_cell (refvar)), subscript_start);
#endif
/* We are committed to using the new name, so reset */
if (offset)
{
/* Rebuild assignment and restore offset and value */
if (aflags & ASS_APPEND)
name[namelen++] = '+';
name[namelen++] = '=';
if (value && *value)
strcpy (name + namelen, value);
else
name[namelen] = '\0';
offset = assignment (name, 0);
/* if offset was valid previously, but the substituting
of the nameref value results in an invalid assignment,
throw an invalid identifier error */
if (offset == 0)
{
free (oldname);
sh_invalidid (name);
assign_error++;
NEXT_VARIABLE ();
}
name[offset] = '\0';
value = name + namelen;
}
free (oldname);
goto restart_new_var_name;
/* NOTREACHED */
}
}
if (var == 0)
@@ -547,12 +667,9 @@ declare_internal (list, local_var)
}
else
#endif
if (offset)
var = mkglobal ? bind_global_variable (name, "", 0) : bind_variable (name, "", 0);
else
{
var = mkglobal ? bind_global_variable (name, (char *)NULL, 0) : bind_variable (name, (char *)NULL, 0);
if (var && no_invisible_vars == 0)
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)
VSETATTR (var, att_invisible);
}
if (var == 0)
@@ -560,6 +677,7 @@ declare_internal (list, local_var)
/* Has to appear in brackets */
NEXT_VARIABLE ();
}
created_var = 1;
}
/* Can't take an existing array variable and make it a nameref */
else if ((array_p (var) || assoc_p (var)) && (flags_on & att_nameref))
@@ -568,16 +686,30 @@ declare_internal (list, local_var)
assign_error++;
NEXT_VARIABLE ();
}
else if (nameref_p (var) && (flags_on & att_nameref) == 0 && (flags_off & att_nameref) == 0 && offset && valid_nameref_value (value, 1) == 0)
{
builtin_error (_("`%s': invalid variable name for name reference"), value);
any_failed++;
NEXT_VARIABLE ();
}
else if (flags_on & att_nameref)
{
#if 0
if (nameref_p (var) == 0 && var_isset (var) && var_isnull (var) == 0 && legal_identifier (value_cell (var)) == 0)
#if 1
/* Check of offset is to allow an assignment to a nameref var as
part of the declare word to override existing value */
if (nameref_p (var) == 0 && var_isset (var) && offset == 0 && valid_nameref_value (value_cell (var), 0) == 0)
{
builtin_error (_("%s: invalid variable name for name reference"), value_cell (var));
builtin_error (_("`%s': invalid variable name for name reference"), value_cell (var));
any_failed++;
NEXT_VARIABLE ();
}
#endif
if (readonly_p (var))
{
sh_readonly (name);
any_failed++;
NEXT_VARIABLE ();
}
/* ksh93 compat: turning on nameref attribute turns off -ilu */
VUNSETATTR (var, att_integer|att_uppercase|att_lowercase|att_capcase);
}
@@ -585,7 +717,7 @@ declare_internal (list, local_var)
/* Cannot use declare +r to turn off readonly attribute. */
if (readonly_p (var) && (flags_off & att_readonly))
{
sh_readonly (name);
sh_readonly (name_cell (var));
any_failed++;
NEXT_VARIABLE ();
}
@@ -685,14 +817,14 @@ declare_internal (list, local_var)
VUNSETATTR (var, flags_off);
#if defined (ARRAY_VARS)
aflags |= ASS_FORCE;
if (offset && compound_array_assign)
assign_array_var_from_string (var, value, aflags);
assign_array_var_from_string (var, value, aflags|ASS_FORCE);
else if (simple_array_assign && subscript_start)
{
/* declare [-aA] name[N]=value */
*subscript_start = '['; /* ] */
var = assign_array_element (name, value, 0); /* XXX - not aflags */
/* XXX - problem here with appending */
var = assign_array_element (name, value, aflags&ASS_APPEND); /* XXX - not aflags */
*subscript_start = '\0';
if (var == 0) /* some kind of assignment error */
{
@@ -706,25 +838,30 @@ declare_internal (list, local_var)
{
/* let bind_{array,assoc}_variable take care of this. */
if (assoc_p (var))
bind_assoc_variable (var, name, savestring ("0"), value, aflags);
bind_assoc_variable (var, name, savestring ("0"), value, aflags|ASS_FORCE);
else
bind_array_variable (name, 0, value, aflags);
bind_array_variable (name, 0, value, aflags|ASS_FORCE);
}
else
#endif
/* XXX - no ASS_FORCE here */
/* bind_variable_value duplicates the essential internals of
bind_variable() */
if (offset)
{
if (onref)
if (onref || nameref_p (var))
aflags |= ASS_NAMEREF;
v = bind_variable_value (var, value, aflags);
if (v == 0 && onref)
if (v == 0 && (onref || nameref_p (var)))
{
sh_invalidid (value);
if (valid_nameref_value (value, 1) == 0)
sh_invalidid (value);
assign_error++;
/* XXX - unset this variable? or leave it as normal var? */
delete_var (var->name, mkglobal ? global_variables : shell_variables);
if (created_var)
delete_var (var->name, mkglobal ? global_variables : shell_variables);
flags_on |= onref; /* undo change from above */
flags_off |= offref;
NEXT_VARIABLE ();
}
}
@@ -764,9 +901,16 @@ declare_internal (list, local_var)
flags_on |= onref;
VUNSETATTR (var, offref);
flags_off |= offref;
/* Yuck. ksh93 compatibility */
/* Yuck. ksh93 compatibility. XXX - need to investigate more but
definitely happens when turning off nameref attribute on nameref
(see comments above). Under no circumstances allow this to turn
off readonly attribute on readonly nameref variable. */
if (refvar)
VUNSETATTR (refvar, flags_off);
{
if (flags_off & att_readonly)
flags_off &= ~att_readonly;
VUNSETATTR (refvar, flags_off);
}
stupidly_hack_special_variables (name);
+9 -2
View File
@@ -104,7 +104,12 @@ should_suppress_fork (command)
running_trap == 0 &&
*bash_input.location.string == '\0' &&
command->type == cm_simple &&
#if 0
signal_is_trapped (EXIT_TRAP) == 0 &&
signal_is_trapped (ERROR_TRAP) == 0 &&
#else
any_signals_trapped () < 0 &&
#endif
command->redirects == 0 && command->value.Simple->redirects == 0 &&
((command->flags & CMD_TIME_PIPELINE) == 0) &&
((command->flags & CMD_INVERT_RETURN) == 0));
@@ -262,6 +267,7 @@ parse_and_execute (string, from_file, flags)
current_token = '\n'; /* reset_parser() ? */
with_input_from_string (string, from_file);
clear_shell_input_line ();
while (*(bash_input.location.string))
{
command = (COMMAND *)NULL;
@@ -384,7 +390,8 @@ parse_and_execute (string, from_file, flags)
* we're not going to run the exit trap AND
* we have a simple command without redirections AND
* the command is not being timed AND
* the command's return status is not being inverted
* the command's return status is not being inverted AND
* there aren't any traps in effect
* THEN
* tell the execution code that we don't need to fork
*/
@@ -491,7 +498,7 @@ parse_string (string, from_file, flags, endp)
sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &ps_sigmask);
#endif
/* itrace("parse_string: `%s'", string); */
/*itrace("parse_string: `%s'", string);*/
/* Reset the line number if the caller wants us to. If we don't reset the
line number, we have to subtract one, because we will add one just
before executing the next command (resetting the line number sets it to
+7
View File
@@ -447,6 +447,13 @@ fc_builtin (list)
return (EXECUTION_FAILURE);
}
#if defined (READLINE)
/* If we're executing as part of a dispatched readline commnand like
{emacs,vi}_edit_and_execute_command, the readline state will indicate it.
We could remove the partial command from the history, but ksh93 doesn't
so we stay compatible. */
#endif
/* Make sure parse_and_execute doesn't turn this off, even though a
call to parse_and_execute farther up the function call stack (e.g.,
if this is called by vi_edit_and_execute_command) may have already
+16 -3
View File
@@ -74,6 +74,7 @@ $END
#endif
#include "../bashansi.h"
#include "../bashintl.h"
#include "../shell.h"
#include "common.h"
@@ -86,6 +87,7 @@ $END
extern char *this_command_name;
static int getopts_unbind_variable __P((char *));
static int getopts_bind_variable __P((char *, char *));
static int dogetopts __P((int, char **));
@@ -99,6 +101,17 @@ getopts_reset (newind)
sh_badopt = 0;
}
static int
getopts_unbind_variable (name)
char *name;
{
#if 0
return (unbind_variable (name));
#else
return (unbind_variable_noref (name));
#endif
}
static int
getopts_bind_variable (name, value)
char *name, *value;
@@ -253,7 +266,7 @@ dogetopts (argc, argv)
if (ret == G_EOF)
{
unbind_variable ("OPTARG");
getopts_unbind_variable ("OPTARG");
getopts_bind_variable (name, "?");
return (EXECUTION_FAILURE);
}
@@ -270,7 +283,7 @@ dogetopts (argc, argv)
bind_variable ("OPTARG", strval, 0);
}
else
unbind_variable ("OPTARG");
getopts_unbind_variable ("OPTARG");
return (ret);
}
@@ -289,7 +302,7 @@ dogetopts (argc, argv)
else
{
ret = getopts_bind_variable (name, "?");
unbind_variable ("OPTARG");
getopts_unbind_variable ("OPTARG");
}
return (ret);
}
+1
View File
@@ -253,6 +253,7 @@ disown_builtin (list)
case 'r':
running_jobs = 1;
break;
CASE_HELPOPT;
default:
builtin_usage ();
return (EX_USAGE);
+1 -1
View File
@@ -2,7 +2,7 @@ This file is mapfile.def, from which is created mapfile.c.
It implements the builtin "mapfile" in Bash.
Copyright (C) 2005-2006 Rocky Bernstein for Free Software Foundation, Inc.
Copyright (C) 2008-2015 Free Software Foundation, Inc.
Copyright (C) 2008-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+3 -2
View File
@@ -797,9 +797,10 @@ assign_vars:
}
else
var = bind_variable ("REPLY", input_string, 0);
VUNSETATTR (var, att_invisible);
if (readonly_p (var) || noassign_p (var))
if (var == 0 || readonly_p (var) || noassign_p (var))
retval = EXECUTION_FAILURE;
else
VUNSETATTR (var, att_invisible);
xfree (input_string);
return (retval);
+1 -1
View File
@@ -145,7 +145,7 @@ to indices 0 and 1 of an array variable NAME in the executing shell.
The default NAME is "COPROC".
Exit Status:
Returns the exit status of COMMAND.
The coproc command returns an exit status of 0.
$END
$BUILTIN function
+37 -12
View File
@@ -183,7 +183,9 @@ static int previous_option_value;
/* A struct used to match long options for set -o to the corresponding
option letter or internal variable. The functions can be called to
dynamically generate values. */
dynamically generate values. If you add a new variable name here
that doesn't have a corresponding single-character option letter, make
sure to set the value appropriately in reset_shell_options. */
const struct {
char *name;
int letter;
@@ -365,11 +367,11 @@ set_ignoreeof (on_or_off, option_name)
char *option_name;
{
ignoreeof = on_or_off == FLAG_ON;
unbind_variable ("ignoreeof");
unbind_variable_noref ("ignoreeof");
if (ignoreeof)
bind_variable ("IGNOREEOF", "10", 0);
else
unbind_variable ("IGNOREEOF");
unbind_variable_noref ("IGNOREEOF");
sv_ignoreeof ("IGNOREEOF");
return 0;
}
@@ -381,7 +383,7 @@ set_posix_mode (on_or_off, option_name)
{
posixly_correct = on_or_off == FLAG_ON;
if (posixly_correct == 0)
unbind_variable ("POSIXLY_CORRECT");
unbind_variable_noref ("POSIXLY_CORRECT");
else
bind_variable ("POSIXLY_CORRECT", "y", 0);
sv_strict_posix ("POSIXLY_CORRECT");
@@ -623,10 +625,18 @@ initialize_shell_options (no_shellopts)
void
reset_shell_options ()
{
pipefail_opt = 0;
ignoreeof = 0;
#if defined (STRICT_POSIX)
posixly_correct = 1;
#else
posixly_correct = 0;
#endif
#if defined (HISTORY)
dont_save_function_defs = 0;
remember_on_history = enable_history_list = 1;
#endif
ignoreeof = 0;
}
/* Set some flags from the word values in the input list. If LIST is empty,
@@ -798,7 +808,7 @@ unset_builtin (list)
{
int unset_function, unset_variable, unset_array, opt, nameref, any_failed;
int global_unset_func, global_unset_var;
char *name;
char *name, *tname;
unset_function = unset_variable = unset_array = nameref = any_failed = 0;
global_unset_func = global_unset_var = 0;
@@ -849,7 +859,7 @@ unset_builtin (list)
#if defined (ARRAY_VARS)
unset_array = 0;
if (!unset_function && valid_array_reference (name, 0))
if (!unset_function && nameref == 0 && valid_array_reference (name, 0))
{
t = strchr (name, '[');
*t++ = '\0';
@@ -870,7 +880,7 @@ unset_builtin (list)
/* Only search for functions here if -f supplied. */
var = unset_function ? find_function (name)
: (nameref ? find_variable_last_nameref (name) : find_variable (name));
: (nameref ? find_variable_last_nameref (name, 0) : find_variable (name));
/* Some variables (but not functions yet) cannot be unset, period. */
if (var && unset_function == 0 && non_unsettable_p (var))
@@ -887,7 +897,7 @@ unset_builtin (list)
find a function after unsuccessfully searching for a variable,
note that we're acting on a function now as if -f were
supplied. The readonly check below takes care of it. */
if (var == 0 && unset_variable == 0 && unset_function == 0)
if (var == 0 && nameref == 0 && unset_variable == 0 && unset_function == 0)
{
if (var = find_function (name))
unset_function = 1;
@@ -921,8 +931,23 @@ unset_builtin (list)
variable, make sure we still try to unset the nameref's value */
if (var == 0 && nameref == 0 && unset_function == 0)
{
var = find_variable_last_nameref (name);
tem = (var && nameref_p (var)) ? unbind_variable (nameref_cell (var)) : unbind_variable (name);
var = find_variable_last_nameref (name, 0);
if (var && nameref_p (var))
{
#if defined (ARRAY_VARS)
if (valid_array_reference (nameref_cell (var), 0))
{
tname = savestring (nameref_cell (var));
if (var = array_variable_part (tname, &t, 0))
tem = unbind_array_element (var, t);
free (tname);
}
else
#endif
tem = unbind_variable (nameref_cell (var));
}
else
tem = unbind_variable (name);
}
else
tem = unset_function ? unbind_func (name) : (nameref ? unbind_nameref (name) : unbind_variable (name));
@@ -931,7 +956,7 @@ unset_builtin (list)
is specified, the name refers to a variable; if a variable by
that name does not exist, a function by that name, if any,
shall be unset.'' */
if (tem == -1 && unset_function == 0 && unset_variable == 0)
if (tem == -1 && nameref == 0 && unset_function == 0 && unset_variable == 0)
tem = unbind_func (name);
name = list->word->word; /* reset above for namerefs */
+20 -3
View File
@@ -538,8 +538,8 @@ set_var_attribute (name, attribute, undo)
char *name;
int attribute, undo;
{
SHELL_VAR *var, *tv, *v;
char *tvalue;
SHELL_VAR *var, *tv, *v, *refvar;
char *tvalue, *refname;
if (undo)
var = find_variable (name);
@@ -554,6 +554,11 @@ set_var_attribute (name, attribute, undo)
tvalue = var_isset (tv) ? savestring (value_cell (tv)) : savestring ("");
var = bind_variable (tv->name, tvalue, 0);
if (var == 0)
{
free (tvalue);
return; /* XXX - no error message here */
}
var->attributes |= tv->attributes & ~att_tempvar;
/* This avoids an error message when propagating a read-only var
later on. */
@@ -578,10 +583,22 @@ set_var_attribute (name, attribute, undo)
else
{
var = find_variable_notempenv (name);
if (var == 0)
{
/* We might have a nameref pointing to something that we can't
resolve to a shell variable. If we do, skip it. We do a little
checking just so we can print an error message. */
refvar = find_variable_nameref_for_create (name, 0);
if (refvar == INVALID_NAMEREF_VALUE)
return;
/* Otherwise we probably have a nameref pointing to a variable
that hasn't been created yet. bind_variable will take care
of that. */
}
if (var == 0)
{
var = bind_variable (name, (char *)NULL, 0);
if (no_invisible_vars == 0)
if (var && no_invisible_vars == 0)
VSETATTR (var, att_invisible);
}
else if (var->context != 0)
+58 -12
View File
@@ -1,7 +1,7 @@
This file is shopt.def, from which is created shopt.c.
It implements the Bash `shopt' builtin.
Copyright (C) 1994-2015 Free Software Foundation, Inc.
Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -144,6 +144,9 @@ static int shopt_compat43;
typedef int shopt_set_func_t __P((char *, int));
/* If you add a new variable name here, make sure to set the default value
appropriately in reset_shopt_options. */
static struct {
char *name;
int *value;
@@ -304,32 +307,67 @@ shopt_builtin (list)
}
/* Reset the options managed by `shopt' to the values they would have at
shell startup. */
shell startup. Variables from shopt_vars. */
void
reset_shopt_options ()
{
autocd = cdable_vars = cdspelling = 0;
check_hashed_filenames = CHECKHASH_DEFAULT;
check_window_size = CHECKWINSIZE_DEFAULT;
allow_null_glob_expansion = glob_dot_filenames = 0;
cdable_vars = mail_warning = 0;
no_exit_on_failed_exec = print_shift_error = 0;
check_hashed_filenames = cdspelling = expand_aliases = 0;
no_exit_on_failed_exec = 0;
expand_aliases = 0;
extended_quote = 1;
fail_glob_expansion = 0;
glob_asciirange = GLOBASCII_DEFAULT;
glob_star = 0;
gnu_error_format = 0;
hup_on_exit = 0;
inherit_errexit = 0;
interactive_comments = 1;
lastpipe_opt = 0;
mail_warning = 0;
glob_ignore_case = match_ignore_case = 0;
print_shift_error = 0;
source_uses_path = promptvars = 1;
check_window_size = CHECKWINSIZE_DEFAULT;
#if defined (JOB_CONTROL)
check_jobs_at_exit = 0;
#endif
#if defined (EXTENDED_GLOB)
extended_glob = 0;
extended_glob = EXTGLOB_DEFAULT;
#endif
#if defined (HISTORY)
literal_history = force_append_history = 0;
literal_history = 0;
force_append_history = 0;
command_oriented_history = 1;
#endif
#if defined (READLINE)
complete_fullquote = 1;
force_fignore = 1;
hist_verify = history_reediting = 0;
perform_hostname_completion = 1;
# if DIRCOMPLETE_EXPAND_DEFAULT
dircomplete_expand = 1;
# else
dircomplete_expand = 0;
#endif
dircomplete_spelling = 0;
no_empty_command_completion = 0;
#endif
#if defined (PROGRAMMABLE_COMPLETION)
prog_completion_enabled = 1;
#endif
#if defined (DEFAULT_ECHO_TO_XPG) || defined (STRICT_POSIX)
xpg_echo = 1;
#else
xpg_echo = 0;
#endif /* DEFAULT_ECHO_TO_XPG */
shopt_login_shell = login_shell;
}
@@ -361,6 +399,7 @@ toggle_shopts (mode, list, quiet)
{
WORD_LIST *l;
int ind, rval;
SHELL_VAR *v;
for (l = list, rval = EXECUTION_SUCCESS; l; l = l->next)
{
@@ -378,7 +417,9 @@ toggle_shopts (mode, list, quiet)
}
}
set_bashopts ();
/* Don't set $BASHOPTS here if it hasn't already been initialized */
if (v = find_variable ("BASHOPTS"))
set_bashopts ();
return (rval);
}
@@ -529,7 +570,8 @@ shopt_set_debug_mode (option_name, mode)
int mode;
{
#if defined (DEBUGGER)
function_trace_mode = debugging_mode;
error_trace_mode = function_trace_mode = debugging_mode;
set_shellopts ();
#endif
return (0);
}
@@ -768,7 +810,11 @@ parse_bashopts (value)
{
ind = find_shopt (vname);
if (ind >= 0)
*shopt_vars[ind].value = 1;
{
*shopt_vars[ind].value = 1;
if (shopt_vars[ind].set_func)
(*shopt_vars[ind].set_func) (shopt_vars[ind].name, 1);
}
free (vname);
}
}
+1 -1
View File
@@ -179,7 +179,7 @@ wait_builtin (list)
if (legal_number (w, &pid_value) && pid_value == (pid_t)pid_value)
{
pid = (pid_t)pid_value;
status = wait_for_single_pid (pid);
status = wait_for_single_pid (pid, 1);
}
else
{
+4
View File
@@ -94,6 +94,10 @@
# undef COND_REGEXP
#endif
#if !HAVE_MKSTEMP
# undef USE_MKSTEMP
#endif
/* If the shell is called by this name, it will become restricted. */
#if defined (RESTRICTED_SHELL)
# define RESTRICTED_SHELL_NAME "rbash"
+8
View File
@@ -27,6 +27,10 @@
error messages about `break' and `continue' out of context. */
#define BREAK_COMPLAINS
/* Define CD_COMPLAINS if you want the non-standard, but sometimes-desired
error messages about multiple directory arguments to `cd'. */
#define CD_COMPLAINS
/* Define BUFFERED_INPUT if you want the shell to do its own input
buffering, rather than using stdio. Do not undefine this; it's
required to preserve semantics required by POSIX. */
@@ -152,3 +156,7 @@
/* Define to the maximum level of recursion you want for the source/. builtin.
0 means the limit is not active. */
#define SOURCENEST_MAX 0
/* Define to use libc mktemp/mkstemp instead of replacements in lib/sh/tmpfile.c */
#define USE_MKTEMP
#define USE_MKSTEMP
+3
View File
@@ -736,6 +736,9 @@
/* Define if you have the mkfifo function. */
#undef HAVE_MKFIFO
/* Define if you have the mkstemp function. */
#undef HAVE_MKSTEMP
/* Define if you have the pathconf function. */
#undef HAVE_PATHCONF
Vendored
+22 -11
View File
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac for Bash 4.4, version 4.078.
# From configure.ac for Bash 4.4, version 4.080.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bash 4.4-rc1.
# Generated by GNU Autoconf 2.69 for bash 4.4-beta2.
#
# Report bugs to <bug-bash@gnu.org>.
#
@@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bash'
PACKAGE_TARNAME='bash'
PACKAGE_VERSION='4.4-rc1'
PACKAGE_STRING='bash 4.4-rc1'
PACKAGE_VERSION='4.4-beta2'
PACKAGE_STRING='bash 4.4-beta2'
PACKAGE_BUGREPORT='bug-bash@gnu.org'
PACKAGE_URL=''
@@ -1393,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bash 4.4-rc1 to adapt to many kinds of systems.
\`configure' configures bash 4.4-beta2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1458,7 +1458,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bash 4.4-rc1:";;
short | recursive ) echo "Configuration of bash 4.4-beta2:";;
esac
cat <<\_ACEOF
@@ -1651,7 +1651,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bash configure 4.4-rc1
bash configure 4.4-beta2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2360,7 +2360,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bash $as_me 4.4-rc1, which was
It was created by bash $as_me 4.4-beta2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2754,7 +2754,7 @@ ac_config_headers="$ac_config_headers config.h"
BASHVERS=4.4
RELSTATUS=rc1
RELSTATUS=beta2
case "$RELSTATUS" in
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
@@ -9884,6 +9884,17 @@ _ACEOF
fi
done
for ac_func in mkstemp
do :
ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp"
if test "x$ac_cv_func_mkstemp" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MKSTEMP 1
_ACEOF
fi
done
ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
if test "x$ac_cv_func_getcwd" = xyes; then :
$as_echo "#define HAVE_GETCWD 1" >>confdefs.h
@@ -16655,7 +16666,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bash $as_me 4.4-rc1, which was
This file was extended by bash $as_me 4.4-beta2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16721,7 +16732,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bash config.status 4.4-rc1
bash config.status 4.4-beta2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
+4 -3
View File
@@ -5,7 +5,7 @@ dnl report bugs to chet@po.cwru.edu
dnl
dnl Process this file with autoconf to produce a configure script.
# Copyright (C) 1987-2015 Free Software Foundation, Inc.
# Copyright (C) 1987-2016 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
@@ -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 4.4, version 4.078])dnl
AC_REVISION([for Bash 4.4, version 4.080])dnl
define(bashvers, 4.4)
define(relstatus, rc1)
define(relstatus, beta2)
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
@@ -783,6 +783,7 @@ AC_CHECK_FUNCS(bcopy bzero confstr faccessat fnmatch \
AC_CHECK_FUNCS(vasprintf asprintf)
AC_CHECK_FUNCS(isascii isblank isgraph isprint isspace isxdigit)
AC_CHECK_FUNCS(getpwent getpwnam getpwuid)
AC_CHECK_FUNCS(mkstemp)
AC_REPLACE_FUNCS(getcwd memset)
AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr)
AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoimax strtoumax)
+9 -3
View File
@@ -1,4 +1,4 @@
This is the Bash FAQ, version 4.13, for Bash version 4.3.
This is the Bash FAQ, version 4.14, for Bash version 4.4.
This document contains a set of frequently-asked questions concerning
Bash, the GNU Bourne-Again Shell. Bash is a freely-available command
@@ -2169,11 +2169,17 @@ You may also need
Finally, you need to tell readline that you will be inputting and
displaying eight-bit characters. You use readline variables to do
this. These variables can be set in your .inputrc or using the bash
this. convert-meta says what to do if you read a character with its
eighth bit set. input-meta says whether to permit characters with the
eighth bit at all. output-meta determines how to display characters
with the eighth bit set: if on, they are output directly; if it is off,
such characters are displayed as a meta-prefixed escape sequence.
These variables can be set in your .inputrc or using the bash
`bind' builtin. Here's an example using `bind':
bash$ bind 'set convert-meta off'
bash$ bind 'set meta-flag on'
bash$ bind 'set input-meta on'
bash$ bind 'set output-meta on'
The `set' commands between the single quotes may also be placed
+894 -870
View File
File diff suppressed because it is too large Load Diff
+52 -18
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Mon Feb 8 10:15:48 EST 2016
.\" Last Change: Sun May 29 13:48:21 EDT 2016
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2016 February 8" "GNU Bash 4.4"
.TH BASH 1 "2016 May 29" "GNU Bash 4.4"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -628,7 +628,7 @@ are executed sequentially; the shell waits for each
command to terminate in turn. The return status is the
exit status of the last command executed.
.PP
AND and OR lists are sequences of one of more pipelines separated by the
AND and OR lists are sequences of one or more pipelines separated by the
\fB&&\fP and \fB||\fP control operators, respectively.
AND and OR lists are executed with left associativity.
An AND list has the form
@@ -1266,7 +1266,8 @@ A variable can be assigned the \fInameref\fP attribute using the
to create a \fInameref\fP, or a reference to another variable.
This allows variables to be manipulated indirectly.
Whenever the nameref variable is referenced, assigned to, unset, or has
its attributes modified (other than the \fInameref\fP attribute itself), the
its attributes modified (other than using or changing the \fInameref\fP
attribute itself), the
operation is actually performed on the variable specified by the nameref
variable's value.
A nameref is commonly used within shell functions to refer to a variable
@@ -2014,11 +2015,14 @@ used when the shell is invoked in POSIX mode.
.TP
.B EXECIGNORE
A colon-separated list of shell patterns (see \fBPattern Matching\fP)
defining the list of filenames to be ignored by command search.
defining the list of filenames to be ignored by command search using
\fBPATH\fP.
Files whose full pathnames match one of these patterns are not considered
executable files for the purposes of completion and command execution.
executable files for the purposes of completion and command execution
via \fBPATH\fP lookup.
This does not affect the behavior of the \fB[\fP, \fBtest\fP, and \fB[[\fP
commands.
Full pathnames in the command hash table are not subject to \fBEXECIGNORE\fP.
Use this variable to ignore shared library files that have the executable
bit set, but are not executable files.
The pattern matching honors the setting of the \fBextglob\fP shell
@@ -2319,8 +2323,10 @@ The default path is system-dependent,
and is set by the administrator who installs
.BR bash .
A common value is
.na
.if t \f(CW/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\fP.
.if n ``/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin''.
.ad
.TP
.B POSIXLY_CORRECT
If this variable is in the environment when \fBbash\fP starts, the shell
@@ -3899,9 +3905,9 @@ The format of here-documents is:
No parameter and variable expansion, command substitution,
arithmetic expansion, or pathname expansion is performed on
.IR word .
If any characters in
If any part of
.I word
are quoted, the
is quoted, the
.I delimiter
is the result of quote removal on
.IR word ,
@@ -4219,7 +4225,7 @@ By default, no limit is imposed on the number of recursive calls.
.SH "ARITHMETIC EVALUATION"
The shell allows arithmetic expressions to be evaluated, under
certain circumstances (see the \fBlet\fP and \fBdeclare\fP builtin
commands and \fBArithmetic Expansion\fP).
commands, the \fB((\fP compound command, and \fBArithmetic Expansion\fP).
Evaluation is done in fixed-width integers with no check for overflow,
though division by 0 is trapped and flagged as an error.
The operators and their precedence, associativity, and values
@@ -5451,6 +5457,10 @@ If set to \fBOn\fP, readline attempts to bind the control characters
treated specially by the kernel's terminal driver to their readline
equivalents.
.TP
.B blink\-matching\-paren (Off)
If set to \fBOn\fP, readline attempts to briefly move the cursor to an
opening parenthesis when a closing parenthesis is inserted.
.TP
.B colored\-completion\-prefix (Off)
If set to \fBOn\fP, when listing completions, readline displays the
common prefix of the set of possible completions using a different color.
@@ -5473,10 +5483,23 @@ in emacs mode and to
.B #
in vi command mode.
.TP
.B completion\-display\-width (-1)
The number of screen columns used to display possible matches
when performing completion.
The value is ignored if it is less than 0 or greater than the terminal
screen width.
A value of 0 will cause matches to be displayed one per line.
The default value is -1.
.TP
.B completion\-ignore\-case (Off)
If set to \fBOn\fP, readline performs filename matching and completion
in a case\-insensitive fashion.
.TP
.B completion\-map\-case (Off)
If set to \fBOn\fP, and \fBcompletion\-ignore\-case\fP is enabled, readline
treats hyphens (\fI\-\fP) and underscores (\fI_\fP) as equivalent when
performing case\-insensitive filename matching and completion.
.TP
.B completion\-prefix\-display\-length (0)
The length in characters of the common prefix of a list of possible
completions that is displayed without modification. When set to a
@@ -5498,12 +5521,19 @@ If set to \fBOn\fP, readline will convert characters with the
eighth bit set to an ASCII key sequence
by stripping the eighth bit and prefixing an
escape character (in effect, using escape as the \fImeta prefix\fP).
The default is \fIOn\fP, but readline will set it to \fIOff\fP if the
locale contains eight-bit characters.
.TP
.B disable\-completion (Off)
If set to \fBOn\fP, readline will inhibit word completion. Completion
characters will be inserted into the line as if they had been
mapped to \fBself-insert\fP.
.TP
.B echo\-control\-characters (On)
When set to \fBOn\fP, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard.
.TP
.B editing\-mode (emacs)
Controls whether readline begins with a set of key bindings similar
to \fIEmacs\fP or \fIvi\fP.
@@ -5513,11 +5543,6 @@ can be set to either
or
.BR vi .
.TP
.B echo\-control\-characters (On)
When set to \fBOn\fP, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard.
.TP
.B enable\-bracketed\-paste (Off)
When set to \fBOn\fP, readline will configure the terminal in a way
that will enable it to insert each paste into the editing buffer as a
@@ -5550,7 +5575,10 @@ If set to zero, any existing history entries are deleted and no new entries
are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, the number of history entries is not limited.
By default, the number of history entries is set to the value of the
\fBHISTSIZE\fP shell variable.
If an attempt is made to set \fIhistory\-size\fP to a non-numeric value,
the maximum number of history entries will be set to 500.
.TP
.B horizontal\-scroll\-mode (Off)
When set to \fBOn\fP, makes readline use a single line for display,
@@ -5559,10 +5587,12 @@ becomes longer than the screen width rather than wrapping to a new line.
.TP
.B input\-meta (Off)
If set to \fBOn\fP, readline will enable eight-bit input (that is,
it will not strip the high bit from the characters it reads),
it will not strip the eighth bit from the characters it reads),
regardless of what the terminal claims it can support. The name
.B meta\-flag
is a synonym for this variable.
The default is \fIOff\fP, but readline will set it to \fIOn\fP if the
locale contains eight-bit characters.
.TP
.B isearch\-terminators (``C\-[C\-J'')
The string of characters that should terminate an incremental
@@ -5633,6 +5663,8 @@ the list.
If set to \fBOn\fP, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence.
The default is \fIOff\fP, but readline will set it to \fIOn\fP if the
locale contains eight-bit characters.
.TP
.B page\-completions (On)
If set to \fBOn\fP, readline uses an internal \fImore\fP-like pager
@@ -7692,7 +7724,7 @@ Give each \fIname\fP the \fInameref\fP attribute, making
it a name reference to another variable.
That other variable is defined by the value of \fIname\fP.
All references, assignments, and attribute modifications
to \fIname\fP, except for changing the
to \fIname\fP, except those using or changing the
\fB\-n\fP attribute itself, are performed on the variable referenced by
\fIname\fP's value.
The nameref attribute cannot be applied to array variables.
@@ -9598,7 +9630,9 @@ If set, aliases are expanded as described above under
This option is enabled by default for interactive shells.
.TP 8
.B extdebug
If set, behavior intended for use by debuggers is enabled:
If set at shell invocation, arrange to execute the debugger profile
before the shell starts, identical to the \fB\-\-debugger\fP option.
If set after invocation, behavior intended for use by debuggers is enabled:
.RS
.TP
.B 1.
+57 -20
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2016 February 8<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2016 May 29<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -838,7 +838,7 @@ command to terminate in turn. The return status is the
exit status of the last command executed.
<P>
AND and OR lists are sequences of one of more pipelines separated by the
AND and OR lists are sequences of one or more pipelines separated by the
<B>&amp;&amp;</B> and <B>||</B> control operators, respectively.
AND and OR lists are executed with left associativity.
An AND list has the form
@@ -1628,7 +1628,8 @@ A variable can be assigned the <I>nameref</I> attribute using the
to create a <I>nameref</I>, or a reference to another variable.
This allows variables to be manipulated indirectly.
Whenever the nameref variable is referenced, assigned to, unset, or has
its attributes modified (other than the <I>nameref</I> attribute itself), the
its attributes modified (other than using or changing the <I>nameref</I>
attribute itself), the
operation is actually performed on the variable specified by the nameref
variable's value.
A nameref is commonly used within shell functions to refer to a variable
@@ -2566,11 +2567,14 @@ used when the shell is invoked in POSIX mode.
<DD>
A colon-separated list of shell patterns (see <B>Pattern Matching</B>)
defining the list of filenames to be ignored by command search.
defining the list of filenames to be ignored by command search using
<B>PATH</B>.
Files whose full pathnames match one of these patterns are not considered
executable files for the purposes of completion and command execution.
executable files for the purposes of completion and command execution
via <B>PATH</B> lookup.
This does not affect the behavior of the <B>[</B>, <B>test</B>, and <B>[[</B>
commands.
Full pathnames in the command hash table are not subject to <B>EXECIGNORE</B>.
Use this variable to ignore shared library files that have the executable
bit set, but are not executable files.
The pattern matching honors the setting of the <B>extglob</B> shell
@@ -2949,8 +2953,10 @@ and is set by the administrator who installs
<B>bash</B>.
A common value is
<TT>/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin</TT>.
<DT><B>POSIXLY_CORRECT</B>
<DD>
@@ -4964,10 +4970,10 @@ No parameter and variable expansion, command substitution,
arithmetic expansion, or pathname expansion is performed on
<I>word</I>.
If any characters in
If any part of
<I>word</I>
are quoted, the
is quoted, the
<I>delimiter</I>
is the result of quote removal on
@@ -5396,7 +5402,7 @@ By default, no limit is imposed on the number of recursive calls.
The shell allows arithmetic expressions to be evaluated, under
certain circumstances (see the <B>let</B> and <B>declare</B> builtin
commands and <B>Arithmetic Expansion</B>).
commands, the <B>((</B> compound command, and <B>Arithmetic Expansion</B>).
Evaluation is done in fixed-width integers with no check for overflow,
though division by 0 is trapped and flagged as an error.
The operators and their precedence, associativity, and values
@@ -7008,6 +7014,11 @@ If set to <B>audible</B>, readline attempts to ring the terminal's bell.
If set to <B>On</B>, readline attempts to bind the control characters
treated specially by the kernel's terminal driver to their readline
equivalents.
<DT><B>blink-matching-paren (Off)</B>
<DD>
If set to <B>On</B>, readline attempts to briefly move the cursor to an
opening parenthesis when a closing parenthesis is inserted.
<DT><B>colored-completion-prefix (Off)</B>
<DD>
@@ -7036,11 +7047,26 @@ in emacs mode and to
<B>#</B>
in vi command mode.
<DT><B>completion-display-width (-1)</B>
<DD>
The number of screen columns used to display possible matches
when performing completion.
The value is ignored if it is less than 0 or greater than the terminal
screen width.
A value of 0 will cause matches to be displayed one per line.
The default value is -1.
<DT><B>completion-ignore-case (Off)</B>
<DD>
If set to <B>On</B>, readline performs filename matching and completion
in a case-insensitive fashion.
<DT><B>completion-map-case (Off)</B>
<DD>
If set to <B>On</B>, and <B>completion-ignore-case</B> is enabled, readline
treats hyphens (<I>-</I>) and underscores (<I>_</I>) as equivalent when
performing case-insensitive filename matching and completion.
<DT><B>completion-prefix-display-length (0)</B>
<DD>
@@ -7066,12 +7092,20 @@ If set to <B>On</B>, readline will convert characters with the
eighth bit set to an ASCII key sequence
by stripping the eighth bit and prefixing an
escape character (in effect, using escape as the <I>meta prefix</I>).
The default is <I>On</I>, but readline will set it to <I>Off</I> if the
locale contains eight-bit characters.
<DT><B>disable-completion (Off)</B>
<DD>
If set to <B>On</B>, readline will inhibit word completion. Completion
characters will be inserted into the line as if they had been
mapped to <B>self-insert</B>.
<DT><B>echo-control-characters (On)</B>
<DD>
When set to <B>On</B>, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard.
<DT><B>editing-mode (emacs)</B>
<DD>
@@ -7085,12 +7119,6 @@ can be set to either
or
<B>vi</B>.
<DT><B>echo-control-characters (On)</B>
<DD>
When set to <B>On</B>, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard.
<DT><B>enable-bracketed-paste (Off)</B>
<DD>
@@ -7130,7 +7158,10 @@ If set to zero, any existing history entries are deleted and no new entries
are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, the number of history entries is not limited.
By default, the number of history entries is set to the value of the
<B>HISTSIZE</B> shell variable.
If an attempt is made to set <I>history-size</I> to a non-numeric value,
the maximum number of history entries will be set to 500.
<DT><B>horizontal-scroll-mode (Off)</B>
<DD>
@@ -7141,11 +7172,13 @@ becomes longer than the screen width rather than wrapping to a new line.
<DD>
If set to <B>On</B>, readline will enable eight-bit input (that is,
it will not strip the high bit from the characters it reads),
it will not strip the eighth bit from the characters it reads),
regardless of what the terminal claims it can support. The name
<B>meta-flag</B>
is a synonym for this variable.
The default is <I>Off</I>, but readline will set it to <I>On</I> if the
locale contains eight-bit characters.
<DT><B>isearch-terminators (``C-[C-J'')</B>
<DD>
@@ -7229,6 +7262,8 @@ the list.
If set to <B>On</B>, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence.
The default is <I>Off</I>, but readline will set it to <I>On</I> if the
locale contains eight-bit characters.
<DT><B>page-completions (On)</B>
<DD>
@@ -9807,7 +9842,7 @@ Give each <I>name</I> the <I>nameref</I> attribute, making
it a name reference to another variable.
That other variable is defined by the value of <I>name</I>.
All references, assignments, and attribute modifications
to <I>name</I>, except for changing the
to <I>name</I>, except those using or changing the
<B>-n</B> attribute itself, are performed on the variable referenced by
<I>name</I>'s value.
The nameref attribute cannot be applied to array variables.
@@ -12198,7 +12233,9 @@ This option is enabled by default for interactive shells.
<DT><B>extdebug</B>
<DD>
If set, behavior intended for use by debuggers is enabled:
If set at shell invocation, arrange to execute the debugger profile
before the shell starts, identical to the <B>--debugger</B> option.
If set after invocation, behavior intended for use by debuggers is enabled:
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT><B>1.</B>
@@ -13477,7 +13514,7 @@ There may be only one active coprocess at a time.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash 4.4<TH ALIGN=CENTER width=33%>2016 February 8<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash 4.4<TH ALIGN=CENTER width=33%>2016 May 29<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -13583,6 +13620,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 08 February 2016 10:17:49 EST
Time: 20 June 2016 15:38:21 EDT
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+4392 -4364
View File
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -1,4 +1,4 @@
BASHBUG(1) BASHBUG(1)
BASHBUG(1) General Commands Manual BASHBUG(1)
@@ -27,8 +27,9 @@ DDEESSCCRRIIPPTTIIOONN
EENNVVIIRROONNMMEENNTT
bbaasshhbbuugg will utilize the following environment variables if they exist:
EEDDIITTOORR Specifies the preferred editor. If EEDDIITTOORR is not set, bbaasshhbbuugg
defaults to eemmaaccss.
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.
HHOOMMEE Directory in which the failed bug report is saved if the mail
fails.
@@ -47,4 +48,4 @@ AAUUTTHHOORRSS
GNU Bash-4.0 1998 July 30 BASHBUG(1)
GNU Bash-4.4 2016 February 15 BASHBUG(1)
+5 -4
View File
@@ -5,9 +5,9 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Tue Apr 3 15:46:30 EDT 2007
.\" Last Change: Mon Feb 15 14:42:40 EST 2016
.\"
.TH BASHBUG 1 "1998 July 30" "GNU Bash-4.0"
.TH BASHBUG 1 "2016 February 15" "GNU Bash-4.4"
.SH NAME
bashbug \- report a bug in bash
.SH SYNOPSIS
@@ -43,8 +43,9 @@ Specifies the preferred editor. If
.B EDITOR
is not set,
.B bashbug
defaults to
.BR emacs .
attempts to locate a number of alternative editors, including
.BR emacs ,
and defaults to \fBvi\fP.
.TP
.B HOME
Directory in which the failed bug report is saved if the mail fails.
+39 -29
View File
@@ -1,20 +1,20 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Mon Nov 17 17:38:06 2008
%%Creator: groff version 1.22.3
%%CreationDate: Mon Mar 28 15:34:55 2016
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
%%DocumentSuppliedResources: procset grops 1.19 2
%%DocumentSuppliedResources: procset grops 1.22 3
%%Pages: 1
%%PageOrder: Ascend
%%DocumentMedia: Default 595 842 0 () ()
%%DocumentMedia: Default 612 792 0 () ()
%%Orientation: Portrait
%%EndComments
%%BeginDefaults
%%PageMedia: Default
%%EndDefaults
%%BeginProlog
%%BeginResource: procset grops 1.19 2
%%BeginResource: procset grops 1.22 3
%!PS-Adobe-3.0 Resource-ProcSet
/setpacking where{
pop
@@ -72,6 +72,7 @@ exch pop add exch pop
/level0 save def
1 setlinecap
1 setlinejoin
DEFS/BPhook known{DEFS begin BPhook end}if
72 RES div dup scale
LS{
90 rotate
@@ -137,7 +138,10 @@ pop
findfont
dup maxlength 1 index/FontName known not{1 add}if dict begin
{
1 index/FID ne{def}{pop pop}ifelse
1 index/FID ne
2 index/UniqueID ne
and
{def}{pop pop}ifelse
}forall
/Encoding exch def
dup/FontName exch def
@@ -175,8 +179,10 @@ newpath
userdict begin
/showpage{}def
/setpagedevice{}def
mark
}bind def
/PEND{
cleartomark
countdictstack CNT sub{end}repeat
level1 restore
}bind def
@@ -189,17 +195,17 @@ setpacking
%%EndProlog
%%BeginSetup
%%BeginFeature: *PageSize Default
<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice
<< /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice
%%EndFeature
%%IncludeResource: font Times-Roman
%%IncludeResource: font Times-Bold
%%IncludeResource: font Times-Italic
grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72
def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron
/Zcaron/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef
def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron
/scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef
/.notdef/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent
/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen
/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon
/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O
@@ -229,13 +235,14 @@ def/PL 841.89 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SHB).35 E 347.52(UG\(1\) B)-.1 F
(ASHB)-.35 E(UG\(1\))-.1 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME)
.219 E F0(bashb)108 96 Q(ug \255 report a b)-.2 E(ug in bash)-.2 E F1
(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(bashb)108 124.8 Q(ug)-.2 E F0
([)2.5 E/F3 10/Times-Italic@0 SF(--ver)A(sion)-.1 E F0 2.5(][)C F3
(--help)-2.5 E F0 2.5(][)C F3(email-addr)-2.5 E(ess)-.37 E F0(])A F1
(DESCRIPTION)72 141.6 Q F2(bashb)108 153.6 Q(ug)-.2 E F0 .446
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SHB).35 E 116.13
(UG\(1\) General)-.1 F(Commands Manual)2.5 E -.35(BA)118.63 G(SHB).35 E
(UG\(1\))-.1 E/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME).219 E F0
(bashb)108 96 Q(ug \255 report a b)-.2 E(ug in bash)-.2 E F1(SYNOPSIS)72
112.8 Q/F2 10/Times-Bold@0 SF(bashb)108 124.8 Q(ug)-.2 E F0([)2.5 E/F3
10/Times-Italic@0 SF(--ver)A(sion)-.1 E F0 2.5(][)C F3(--help)-2.5 E F0
2.5(][)C F3(email-addr)-2.5 E(ess)-.37 E F0(])A F1(DESCRIPTION)72 141.6
Q F2(bashb)108 153.6 Q(ug)-.2 E F0 .446
(is a shell script to help the user compose and mail b)2.947 F .446
(ug reports concerning bash in a standard for)-.2 F(-)-.2 E(mat.)108
165.6 Q F2(bashb)5.961 E(ug)-.2 E F0(in)3.461 E -.2(vo)-.4 G -.1(ke).2 G
@@ -265,20 +272,23 @@ F0(in the in)2.5 E -.2(vo)-.4 G(king user').2 E 2.5(sh)-.55 G
(Fix)5 E(es are encouraged.)-.15 E F1(ENVIR)72 271.2 Q(ONMENT)-.329 E F2
(bashb)108 283.2 Q(ug)-.2 E F0(will utilize the follo)2.5 E(wing en)-.25
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(Speci\214es the preferred editor)144 312
Q 2.5(.I)-.55 G(f)-2.5 E F4(EDIT)2.5 E(OR)-.162 E F0(is not set,)2.25 E
F2(bashb)2.5 E(ug)-.2 E F0(def)2.5 E(aults to)-.1 E F2(emacs)2.5 E F0(.)
A F2(HOME)108 328.8 Q F0(Directory in which the f)144 340.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 357.6 Q F0
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
(Directory in which to create temporary \214les and directories.)144
369.6 Q F1(SEE ALSO)72 386.4 Q F3(bash)108 398.4 Q F0(\(1\))A F1 -.548
(AU)72 415.2 S(THORS).548 E F0(Brian F)108 427.2 Q(ox, Free Softw)-.15 E
(are F)-.1 E(oundation)-.15 E(bfox@gnu.or)108 439.2 Q(g)-.18 E
(Chet Rame)108 456 Q 1.3 -.65(y, C)-.15 H(ase W).65 E(estern Reserv)-.8
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
E 2.5(eU)-.15 G(ni)-2.5 E -.15(ve)-.25 G(rsity).15 E(chet@po.cwru.edu)
108 468 Q(GNU Bash-4.0)72 768 Q(1998 July 30)148.175 E(1)203.165 E 0 Cg
EP
108 480 Q(GNU Bash-4.4)72 768 Q(2016 February 15)138.46 E(1)193.45 E 0
Cg EP
%%Trailer
end
%%EOF
BIN
View File
Binary file not shown.
+46 -30
View File
@@ -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 4.4, 8 February 2016).
the Bash shell (version 4.4, 29 May 2016).
This is Edition 4.4, last updated 8 February 2016,
This is Edition 4.4, last updated 29 May 2016,
of The GNU Bash Reference Manual,
for Bash, Version 4.4.
@@ -15,7 +15,7 @@ any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ -->
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Bash Reference Manual</title>
@@ -50,9 +50,8 @@ pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space: nowrap}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: serif; font-weight: normal}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
@@ -285,10 +284,10 @@ Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Previou
<h1 class="top">Bash Features</h1>
<p>This text is a brief description of the features that are present in
the Bash shell (version 4.4, 8 February 2016).
the Bash shell (version 4.4, 29 May 2016).
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 4.4, last updated 8 February 2016,
<p>This is Edition 4.4, last updated 29 May 2016,
of <cite>The GNU Bash Reference Manual</cite>,
for <code>Bash</code>, Version 4.4.
</p>
@@ -1962,12 +1961,13 @@ When applied to a string-valued variable, <var>value</var> is expanded and
appended to the variable&rsquo;s value.
</p>
<p>A variable can be assigned the <var>nameref</var> attribute using the
<samp>-n</samp> option to the \fBdeclare\fP or \fBlocal\fP builtin commands
<samp>-n</samp> option to the <code>declare</code> or <code>local</code> builtin commands
(see <a href="#Bash-Builtins">Bash Builtins</a>)
to create a <var>nameref</var>, or a reference to another variable.
This allows variables to be manipulated indirectly.
Whenever the nameref variable is referenced, assigned to, unset, or has
its attributes modified (other than the nameref attribute itself), the
its attributes modified (other than using or changing the nameref
attribute itself), the
operation is actually performed on the variable specified by the nameref
variable&rsquo;s value.
A nameref is commonly used within shell functions to refer to a variable
@@ -3327,7 +3327,7 @@ input (or file descriptor <var>n</var> if <var>n</var> is specified) for a comma
<p>No parameter and variable expansion, command substitution,
arithmetic expansion, or filename expansion is performed on
<var>word</var>. If any characters in <var>word</var> are quoted, the
<var>word</var>. If any part of <var>word</var> is quoted, the
<var>delimiter</var> is the result of quote removal on <var>word</var>,
and the lines in the here-document are not expanded.
If <var>word</var> is unquoted,
@@ -4275,8 +4275,7 @@ less than zero, non-zero otherwise.
<pre class="example">test <var>expr</var>
</pre></div>
<p>Evaluate a conditional express
ion <var>expr</var> and return a status of 0
<p>Evaluate a conditional expression <var>expr</var> and return a status of 0
(true) or 1 (false).
Each operator and operand must be a separate argument.
Expressions are composed of the primaries described below in
@@ -4469,7 +4468,7 @@ results in permissions of <code>755</code>.
<p>Remove each variable or function <var>name</var>.
If the <samp>-v</samp> option is given, each
<var>name</var> refers to a shell variable and that variable is remvoved.
<var>name</var> refers to a shell variable and that variable is removed.
If the <samp>-f</samp> option is given, the <var>name</var>s refer to shell
functions, and the function definition is removed.
If the <samp>-n</samp> option is supplied, and <var>name</var> is a variable with
@@ -4750,7 +4749,7 @@ The upper-case attribute is disabled.
it a name reference to another variable.
That other variable is defined by the value of <var>name</var>.
All references, assignments, and attribute modifications
to <var>name</var>, except for changing the
to <var>name</var>, except for those using or changing the
<samp>-n</samp> attribute itself, are performed on the variable referenced by
<var>name</var>&rsquo;s value.
The nameref attribute cannot be applied to array variables.
@@ -6011,7 +6010,9 @@ This option is enabled by default for interactive shells.
</p>
</dd>
<dt><code>extdebug</code></dt>
<dd><p>If set, behavior intended for use by debuggers is enabled:
<dd><p>If set at shell invocation, arrange to execute the debugger profile
before the shell starts, identical to the <samp>--debugger</samp> option.
If set after invocation, behavior intended for use by debuggers is enabled:
</p>
<ol>
<li> The <samp>-F</samp> option to the <code>declare</code> builtin (see <a href="#Bash-Builtins">Bash Builtins</a>)
@@ -6773,11 +6774,14 @@ is readonly.
<a name="index-EXECIGNORE"></a>
</dt>
<dd><p>A colon-separated list of shell patterns (see <a href="#Pattern-Matching">Pattern Matching</a>)
defining the list of filenames to be ignored by command search.
defining the list of filenames to be ignored by command search using
<code>PATH</code>.
Files whose full pathnames match one of these patterns are not considered
executable files for the purposes of completion and command execution.
executable files for the purposes of completion and command execution
via <code>PATH</code> lookup.
This does not affect the behavior of the <code>[</code>, <code>test</code>, and <code>[[</code>
commands.
Full pathnames in the command hash table are not subject to <code>EXECIGNORE</code>.
Use this variable to ignore shared library files that have the executable
bit set, but are not executable files.
The pattern matching honors the setting of the <code>extglob</code> shell
@@ -8078,8 +8082,8 @@ Next: <a href="#Aliases" accesskey="n" rel="next">Aliases</a>, Previous: <a href
<a name="index-arithmetic-evaluation"></a>
<p>The shell allows arithmetic expressions to be evaluated, as one of
the shell expansions or by the <code>let</code> and the <samp>-i</samp> option
to the <code>declare</code> builtins.
the shell expansions or by using the <code>((</code> compound command, the
<code>let</code> builtin, or the <samp>-i</samp> option to the <code>declare</code> builtin.
</p>
<p>Evaluation is done in fixed-width integers with no check for overflow,
though division by 0 is trapped and flagged as an error.
@@ -8923,6 +8927,9 @@ has been set.
If Bash receives a trapped signal while executing <code>read</code>, the trap
handler executes and <code>read</code> returns an exit status greater than 128.
</li><li> Bash removes an exited background process&rsquo;s status from the list of such
statuses after the <code>wait</code> builtin is used to obtain it.
</li></ol>
<p>There is other <small>POSIX</small> behavior that Bash does not implement by
@@ -9668,9 +9675,11 @@ incorporating any changes that you might have made to it.
<tr><td align="left" valign="top">&bull; <a href="#Readline-Init-File-Syntax" accesskey="1">Readline Init File Syntax</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Syntax for the commands in the inputrc file.
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Conditional-Init-Constructs" accesskey="2">Conditional Init Constructs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Conditional key bindings in the inputrc file.
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">
</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Sample-Init-File" accesskey="3">Sample Init File</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">An example inputrc file.
</td></tr>
</table>
@@ -9822,7 +9831,9 @@ The default limit is <code>100</code>.
<p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will convert characters with the
eighth bit set to an <small>ASCII</small> key sequence by stripping the eighth
bit and prefixing an <tt class="key">ESC</tt> character, converting them to a
meta-prefixed key sequence. The default value is &lsquo;<samp>on</samp>&rsquo;.
meta-prefixed key sequence. The default value is &lsquo;<samp>on</samp>&rsquo;, but
will be set to &lsquo;<samp>off</samp>&rsquo; if the locale is one that contains
eight-bit characters.
</p>
</dd>
<dt><code>disable-completion</code></dt>
@@ -9832,6 +9843,13 @@ Completion characters will be inserted into the line as if they had
been mapped to <code>self-insert</code>. The default is &lsquo;<samp>off</samp>&rsquo;.
</p>
</dd>
<dt><code>echo-control-characters</code></dt>
<dd><a name="index-echo_002dcontrol_002dcharacters"></a>
<p>When set to &lsquo;<samp>on</samp>&rsquo;, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard. The default is &lsquo;<samp>on</samp>&rsquo;.
</p>
</dd>
<dt><code>editing-mode</code></dt>
<dd><a name="index-editing_002dmode"></a>
<p>The <code>editing-mode</code> variable controls which default set of
@@ -9852,13 +9870,6 @@ sequence into the mode string.
The default is &lsquo;<samp>@</samp>&rsquo;.
</p>
</dd>
<dt><code>echo-control-characters</code></dt>
<dd><a name="index-echo_002dcontrol_002dcharacters"></a>
<p>When set to &lsquo;<samp>on</samp>&rsquo;, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard. The default is &lsquo;<samp>on</samp>&rsquo;.
</p>
</dd>
<dt><code>enable-bracketed-paste</code></dt>
<dd><a name="index-enable_002dbracketed_002dpaste"></a>
<p>When set to &lsquo;<samp>On</samp>&rsquo;, Readline will configure the terminal in a way
@@ -9904,6 +9915,8 @@ are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, the number of history entries is not limited.
If an attempt is made to set <var>history-size</var> to a non-numeric value,
the maximum number of history entries will be set to 500.
</p>
</dd>
<dt><code>horizontal-scroll-mode</code></dt>
@@ -9921,8 +9934,9 @@ this variable is set to &lsquo;<samp>off</samp>&rsquo;.
<p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will enable eight-bit input (it
will not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is &lsquo;<samp>off</samp>&rsquo;. The name <code>meta-flag</code> is a
synonym for this variable.
default value is &lsquo;<samp>off</samp>&rsquo;, but Readline will set it to &lsquo;<samp>on</samp>&rsquo; if the
locale contains eight-bit characters.
The name <code>meta-flag</code> is a synonym for this variable.
</p>
</dd>
<dt><code>isearch-terminators</code></dt>
@@ -10010,7 +10024,9 @@ the list. The default is &lsquo;<samp>off</samp>&rsquo;.
<dd><a name="index-output_002dmeta"></a>
<p>If set to &lsquo;<samp>on</samp>&rsquo;, Readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence. The default is &lsquo;<samp>off</samp>&rsquo;.
sequence.
The default is &lsquo;<samp>off</samp>&rsquo;, but Readline will set it to &lsquo;<samp>on</samp>&rsquo; if the
locale contains eight-bit characters.
</p>
</dd>
<dt><code>page-completions</code></dt>
+277 -263
View File
@@ -1,10 +1,10 @@
This is bashref.info, produced by makeinfo version 6.0 from
This is bashref.info, produced by makeinfo version 6.1 from
bashref.texi.
This text is a brief description of the features that are present in the
Bash shell (version 4.4, 8 February 2016).
Bash shell (version 4.4, 29 May 2016).
This is Edition 4.4, last updated 8 February 2016, of 'The GNU Bash
This is Edition 4.4, last updated 29 May 2016, of 'The GNU Bash
Reference Manual', for 'Bash', Version 4.4.
Copyright (C) 1988-2016 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 4.4, 8 February 2016). The Bash home page is
Bash shell (version 4.4, 29 May 2016). The Bash home page is
<http://www.gnu.org/software/bash/>.
This is Edition 4.4, last updated 8 February 2016, of 'The GNU Bash
This is Edition 4.4, last updated 29 May 2016, of 'The GNU Bash
Reference Manual', for 'Bash', Version 4.4.
Bash contains features that appear in other popular shells, and some
@@ -798,6 +798,7 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
esac
echo " legs."
If the ';;' operator is used, no subsequent matches are attempted
after the first pattern match. Using ';&' in place of ';;' causes
execution to continue with the COMMAND-LIST associated with the
@@ -1280,16 +1281,16 @@ pairs in an associative array. When applied to a string-valued
variable, VALUE is expanded and appended to the variable's value.
A variable can be assigned the NAMEREF attribute using the '-n'
option to the \fBdeclare\fP or \fBlocal\fP builtin commands (*note Bash
option to the 'declare' or 'local' builtin commands (*note Bash
Builtins::) to create a NAMEREF, or a reference to another variable.
This allows variables to be manipulated indirectly. Whenever the
nameref variable is referenced, assigned to, unset, or has its
attributes modified (other than the nameref attribute itself), the
operation is actually performed on the variable specified by the nameref
variable's value. A nameref is commonly used within shell functions to
refer to a variable whose name is passed as an argument to the function.
For instance, if a variable name is passed to a shell function as its
first argument, running
attributes modified (other than using or changing the nameref attribute
itself), the operation is actually performed on the variable specified
by the nameref variable's value. A nameref is commonly used within
shell functions to refer to a variable whose name is passed as an
argument to the function. For instance, if a variable name is passed to
a shell function as its first argument, running
declare -n ref=$1
inside the function creates a nameref variable REF whose value is the
variable name passed as the first argument. References and assignments
@@ -2317,13 +2318,13 @@ command.
DELIMITER
No parameter and variable expansion, command substitution, arithmetic
expansion, or filename expansion is performed on WORD. If any
characters in WORD are quoted, the DELIMITER is the result of quote
removal on WORD, and the lines in the here-document are not expanded.
If WORD is unquoted, all lines of the here-document are subjected to
parameter expansion, command substitution, and arithmetic expansion, the
character sequence '\newline' is ignored, and '\' must be used to quote
the characters '\', '$', and '`'.
expansion, or filename expansion is performed on WORD. If any part of
WORD is quoted, the DELIMITER is the result of quote removal on WORD,
and the lines in the here-document are not expanded. If WORD is
unquoted, all lines of the here-document are subjected to parameter
expansion, command substitution, and arithmetic expansion, the character
sequence '\newline' is ignored, and '\' must be used to quote the
characters '\', '$', and '`'.
If the redirection operator is '<<-', then all leading tab characters
are stripped from input lines and the line containing DELIMITER. This
@@ -3053,7 +3054,7 @@ standard.
'['
test EXPR
Evaluate a conditional express ion EXPR and return a status of 0
Evaluate a conditional expression EXPR and return a status of 0
(true) or 1 (false). Each operator and operand must be a separate
argument. Expressions are composed of the primaries described
below in *note Bash Conditional Expressions::. 'test' does not
@@ -3203,7 +3204,7 @@ standard.
Remove each variable or function NAME. If the '-v' option is
given, each NAME refers to a shell variable and that variable is
remvoved. If the '-f' option is given, the NAMEs refer to shell
removed. If the '-f' option is given, the NAMEs refer to shell
functions, and the function definition is removed. If the '-n'
option is supplied, and NAME is a variable with the NAMEREF
attribute, NAME will be unset rather than the variable it
@@ -3413,10 +3414,10 @@ standard.
Give each NAME the NAMEREF attribute, making it a name
reference to another variable. That other variable is defined
by the value of NAME. All references, assignments, and
attribute modifications to NAME, except for changing the '-n'
attribute itself, are performed on the variable referenced by
NAME's value. The nameref attribute cannot be applied to
array variables.
attribute modifications to NAME, except for those using or
changing the '-n' attribute itself, are performed on the
variable referenced by NAME's value. The nameref attribute
cannot be applied to array variables.
'-r'
Make NAMEs readonly. These names cannot then be assigned
@@ -4390,7 +4391,10 @@ This builtin allows you to change additional shell optional behavior.
interactive shells.
'extdebug'
If set, behavior intended for use by debuggers is enabled:
If set at shell invocation, arrange to execute the debugger
profile before the shell starts, identical to the '--debugger'
option. If set after invocation, behavior intended for use by
debuggers is enabled:
1. The '-F' option to the 'declare' builtin (*note Bash
Builtins::) displays the source file name and line number
@@ -4927,14 +4931,16 @@ Variables::).
'EXECIGNORE'
A colon-separated list of shell patterns (*note Pattern Matching::)
defining the list of filenames to be ignored by command search.
Files whose full pathnames match one of these patterns are not
considered executable files for the purposes of completion and
command execution. This does not affect the behavior of the '[',
'test', and '[[' commands. Use this variable to ignore shared
library files that have the executable bit set, but are not
executable files. The pattern matching honors the setting of the
'extglob' shell option.
defining the list of filenames to be ignored by command search
using 'PATH'. Files whose full pathnames match one of these
patterns are not considered executable files for the purposes of
completion and command execution via 'PATH' lookup. This does not
affect the behavior of the '[', 'test', and '[[' commands. Full
pathnames in the command hash table are not subject to
'EXECIGNORE'. Use this variable to ignore shared library files
that have the executable bit set, but are not executable files.
The pattern matching honors the setting of the 'extglob' shell
option.
'FCEDIT'
The editor used as a default by the '-e' option to the 'fc' builtin
@@ -5877,8 +5883,8 @@ File: bashref.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Conditi
====================
The shell allows arithmetic expressions to be evaluated, as one of the
shell expansions or by the 'let' and the '-i' option to the 'declare'
builtins.
shell expansions or by using the '((' compound command, the 'let'
builtin, or the '-i' option to the 'declare' builtin.
Evaluation is done in fixed-width integers with no check for
overflow, though division by 0 is trapped and flagged as an error. The
@@ -6555,6 +6561,9 @@ startup files.
'read', the trap handler executes and 'read' returns an exit status
greater than 128.
54. Bash removes an exited background process's status from the list
of such statuses after the 'wait' builtin is used to obtain it.
There is other POSIX behavior that Bash does not implement by default
even when in POSIX mode. Specifically:
@@ -7225,13 +7234,20 @@ Variable Settings
If set to 'on', Readline will convert characters with the
eighth bit set to an ASCII key sequence by stripping the
eighth bit and prefixing an <ESC> character, converting them
to a meta-prefixed key sequence. The default value is 'on'.
to a meta-prefixed key sequence. The default value is 'on',
but will be set to 'off' if the locale is one that contains
eight-bit characters.
'disable-completion'
If set to 'On', Readline will inhibit word completion.
Completion characters will be inserted into the line as if
they had been mapped to 'self-insert'. The default is 'off'.
'echo-control-characters'
When set to 'on', on operating systems that indicate they
support it, readline echoes a character corresponding to a
signal generated from the keyboard. The default is 'on'.
'editing-mode'
The 'editing-mode' variable controls which default set of key
bindings is used. By default, Readline starts up in Emacs
@@ -7248,11 +7264,6 @@ Variable Settings
embed a terminal control sequence into the mode string. The
default is '@'.
'echo-control-characters'
When set to 'on', on operating systems that indicate they
support it, readline echoes a character corresponding to a
signal generated from the keyboard. The default is 'on'.
'enable-bracketed-paste'
When set to 'On', Readline will configure the terminal in a
way that will enable it to insert each paste into the editing
@@ -7287,7 +7298,9 @@ Variable Settings
list. If set to zero, any existing history entries are
deleted and no new entries are saved. If set to a value less
than zero, the number of history entries is not limited. By
default, the number of history entries is not limited.
default, the number of history entries is not limited. If an
attempt is made to set HISTORY-SIZE to a non-numeric value,
the maximum number of history entries will be set to 500.
'horizontal-scroll-mode'
This variable can be set to either 'on' or 'off'. Setting it
@@ -7300,8 +7313,9 @@ Variable Settings
If set to 'on', Readline will enable eight-bit input (it will
not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is 'off'. The name 'meta-flag' is a synonym for
this variable.
default value is 'off', but Readline will set it to 'on' if
the locale contains eight-bit characters. The name
'meta-flag' is a synonym for this variable.
'isearch-terminators'
The string of characters that should terminate an incremental
@@ -7365,7 +7379,8 @@ Variable Settings
'output-meta'
If set to 'on', Readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence. The default is 'off'.
sequence. The default is 'off', but Readline will set it to
'on' if the locale contains eight-bit characters.
'page-completions'
If set to 'on', Readline uses an internal 'more'-like pager to
@@ -10706,9 +10721,9 @@ D.2 Index of Shell Reserved Words
* !: Pipelines. (line 9)
* [[: Conditional Constructs.
(line 120)
(line 121)
* ]]: Conditional Constructs.
(line 120)
(line 121)
* {: Command Grouping. (line 21)
* }: Command Grouping. (line 21)
* case: Conditional Constructs.
@@ -10730,7 +10745,7 @@ D.2 Index of Shell Reserved Words
* in: Conditional Constructs.
(line 28)
* select: Conditional Constructs.
(line 78)
(line 79)
* then: Conditional Constructs.
(line 7)
* time: Pipelines. (line 9)
@@ -10824,141 +10839,141 @@ D.3 Parameter and Variable Index
* COPROC: Bash Variables. (line 231)
* DIRSTACK: Bash Variables. (line 235)
* disable-completion: Readline Init File Syntax.
(line 114)
(line 116)
* echo-control-characters: Readline Init File Syntax.
(line 135)
(line 121)
* editing-mode: Readline Init File Syntax.
(line 119)
(line 126)
* EMACS: Bash Variables. (line 245)
* emacs-mode-string: Readline Init File Syntax.
(line 125)
(line 132)
* enable-bracketed-paste: Readline Init File Syntax.
(line 140)
(line 142)
* enable-keypad: Readline Init File Syntax.
(line 148)
(line 150)
* ENV: Bash Variables. (line 250)
* EUID: Bash Variables. (line 254)
* EXECIGNORE: Bash Variables. (line 258)
* expand-tilde: Readline Init File Syntax.
(line 159)
* FCEDIT: Bash Variables. (line 269)
* FIGNORE: Bash Variables. (line 273)
* FUNCNAME: Bash Variables. (line 279)
* FUNCNEST: Bash Variables. (line 296)
* GLOBIGNORE: Bash Variables. (line 301)
* GROUPS: Bash Variables. (line 308)
* histchars: Bash Variables. (line 314)
* HISTCMD: Bash Variables. (line 329)
* HISTCONTROL: Bash Variables. (line 334)
* HISTFILE: Bash Variables. (line 350)
* HISTFILESIZE: Bash Variables. (line 354)
* HISTIGNORE: Bash Variables. (line 365)
(line 161)
* FCEDIT: Bash Variables. (line 271)
* FIGNORE: Bash Variables. (line 275)
* FUNCNAME: Bash Variables. (line 281)
* FUNCNEST: Bash Variables. (line 298)
* GLOBIGNORE: Bash Variables. (line 303)
* GROUPS: Bash Variables. (line 310)
* histchars: Bash Variables. (line 316)
* HISTCMD: Bash Variables. (line 331)
* HISTCONTROL: Bash Variables. (line 336)
* HISTFILE: Bash Variables. (line 352)
* HISTFILESIZE: Bash Variables. (line 356)
* HISTIGNORE: Bash Variables. (line 367)
* history-preserve-point: Readline Init File Syntax.
(line 163)
(line 165)
* history-size: Readline Init File Syntax.
(line 169)
* HISTSIZE: Bash Variables. (line 385)
* HISTTIMEFORMAT: Bash Variables. (line 392)
(line 171)
* HISTSIZE: Bash Variables. (line 387)
* HISTTIMEFORMAT: Bash Variables. (line 394)
* HOME: Bourne Shell Variables.
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 176)
* HOSTFILE: Bash Variables. (line 400)
* HOSTNAME: Bash Variables. (line 411)
* HOSTTYPE: Bash Variables. (line 414)
(line 180)
* HOSTFILE: Bash Variables. (line 402)
* HOSTNAME: Bash Variables. (line 413)
* HOSTTYPE: Bash Variables. (line 416)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 417)
* IGNOREEOF: Bash Variables. (line 419)
* input-meta: Readline Init File Syntax.
(line 183)
* INPUTRC: Bash Variables. (line 427)
(line 187)
* INPUTRC: Bash Variables. (line 429)
* isearch-terminators: Readline Init File Syntax.
(line 190)
(line 195)
* keymap: Readline Init File Syntax.
(line 197)
* LANG: Bash Variables. (line 431)
* LC_ALL: Bash Variables. (line 435)
* LC_COLLATE: Bash Variables. (line 439)
* LC_CTYPE: Bash Variables. (line 446)
(line 202)
* LANG: Bash Variables. (line 433)
* LC_ALL: Bash Variables. (line 437)
* LC_COLLATE: Bash Variables. (line 441)
* LC_CTYPE: Bash Variables. (line 448)
* LC_MESSAGES: Locale Translation. (line 11)
* LC_MESSAGES <1>: Bash Variables. (line 451)
* LC_NUMERIC: Bash Variables. (line 455)
* LC_TIME: Bash Variables. (line 459)
* LINENO: Bash Variables. (line 463)
* LINES: Bash Variables. (line 467)
* MACHTYPE: Bash Variables. (line 473)
* LC_MESSAGES <1>: Bash Variables. (line 453)
* LC_NUMERIC: Bash Variables. (line 457)
* LC_TIME: Bash Variables. (line 461)
* LINENO: Bash Variables. (line 465)
* LINES: Bash Variables. (line 469)
* MACHTYPE: Bash Variables. (line 475)
* MAIL: Bourne Shell Variables.
(line 22)
* MAILCHECK: Bash Variables. (line 477)
* MAILCHECK: Bash Variables. (line 479)
* MAILPATH: Bourne Shell Variables.
(line 27)
* MAPFILE: Bash Variables. (line 485)
* MAPFILE: Bash Variables. (line 487)
* mark-modified-lines: Readline Init File Syntax.
(line 227)
* mark-symlinked-directories: Readline Init File Syntax.
(line 232)
* match-hidden-files: Readline Init File Syntax.
* mark-symlinked-directories: Readline Init File Syntax.
(line 237)
* match-hidden-files: Readline Init File Syntax.
(line 242)
* menu-complete-display-prefix: Readline Init File Syntax.
(line 244)
(line 249)
* meta-flag: Readline Init File Syntax.
(line 183)
* OLDPWD: Bash Variables. (line 489)
(line 187)
* OLDPWD: Bash Variables. (line 491)
* OPTARG: Bourne Shell Variables.
(line 34)
* OPTERR: Bash Variables. (line 492)
* OPTERR: Bash Variables. (line 494)
* OPTIND: Bourne Shell Variables.
(line 38)
* OSTYPE: Bash Variables. (line 496)
* OSTYPE: Bash Variables. (line 498)
* output-meta: Readline Init File Syntax.
(line 249)
* page-completions: Readline Init File Syntax.
(line 254)
* page-completions: Readline Init File Syntax.
(line 260)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 499)
* POSIXLY_CORRECT: Bash Variables. (line 504)
* PPID: Bash Variables. (line 513)
* PROMPT_COMMAND: Bash Variables. (line 517)
* PROMPT_DIRTRIM: Bash Variables. (line 521)
* PS0: Bash Variables. (line 527)
* PIPESTATUS: Bash Variables. (line 501)
* POSIXLY_CORRECT: Bash Variables. (line 506)
* PPID: Bash Variables. (line 515)
* PROMPT_COMMAND: Bash Variables. (line 519)
* PROMPT_DIRTRIM: Bash Variables. (line 523)
* PS0: Bash Variables. (line 529)
* PS1: Bourne Shell Variables.
(line 48)
* PS2: Bourne Shell Variables.
(line 53)
* PS3: Bash Variables. (line 532)
* PS4: Bash Variables. (line 537)
* PWD: Bash Variables. (line 543)
* RANDOM: Bash Variables. (line 546)
* READLINE_LINE: Bash Variables. (line 551)
* READLINE_POINT: Bash Variables. (line 555)
* REPLY: Bash Variables. (line 559)
* PS3: Bash Variables. (line 534)
* PS4: Bash Variables. (line 539)
* PWD: Bash Variables. (line 545)
* RANDOM: Bash Variables. (line 548)
* READLINE_LINE: Bash Variables. (line 553)
* READLINE_POINT: Bash Variables. (line 557)
* REPLY: Bash Variables. (line 561)
* revert-all-at-newline: Readline Init File Syntax.
(line 264)
* SECONDS: Bash Variables. (line 562)
* SHELL: Bash Variables. (line 568)
* SHELLOPTS: Bash Variables. (line 573)
* SHLVL: Bash Variables. (line 582)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 270)
* show-all-if-unmodified: Readline Init File Syntax.
* SECONDS: Bash Variables. (line 564)
* SHELL: Bash Variables. (line 570)
* SHELLOPTS: Bash Variables. (line 575)
* SHLVL: Bash Variables. (line 584)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 276)
* show-all-if-unmodified: Readline Init File Syntax.
(line 282)
* show-mode-in-prompt: Readline Init File Syntax.
(line 285)
* skip-completed-text: Readline Init File Syntax.
(line 291)
* skip-completed-text: Readline Init File Syntax.
(line 297)
* TEXTDOMAIN: Locale Translation. (line 11)
* TEXTDOMAINDIR: Locale Translation. (line 11)
* TIMEFORMAT: Bash Variables. (line 587)
* TMOUT: Bash Variables. (line 625)
* TMPDIR: Bash Variables. (line 637)
* UID: Bash Variables. (line 641)
* TIMEFORMAT: Bash Variables. (line 589)
* TMOUT: Bash Variables. (line 627)
* TMPDIR: Bash Variables. (line 639)
* UID: Bash Variables. (line 643)
* vi-cmd-mode-string: Readline Init File Syntax.
(line 304)
(line 310)
* vi-ins-mode-string: Readline Init File Syntax.
(line 314)
(line 320)
* visible-stats: Readline Init File Syntax.
(line 324)
(line 330)

File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
@@ -11020,8 +11035,7 @@ D.4 Function Index
(line 43)
* delete-horizontal-space (): Commands For Killing.
(line 46)
* digit-argument ('M-0', 'M-1', ... 'M--'): Numeric Arguments.
(line 6)
* digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6)
* display-shell-version (C-x C-v): Miscellaneous Commands.
(line 109)
* do-uppercase-version (M-a, M-b, M-X, ...): Miscellaneous Commands.
@@ -11320,134 +11334,134 @@ D.5 Concept Index

Tag Table:
Node: Top895
Node: Introduction2813
Node: What is Bash?3029
Node: What is a shell?4143
Node: Definitions6681
Node: Basic Shell Features9632
Node: Shell Syntax10851
Node: Shell Operation11877
Node: Quoting13170
Node: Escape Character14470
Node: Single Quotes14955
Node: Double Quotes15303
Node: ANSI-C Quoting16581
Node: Locale Translation17834
Node: Comments18730
Node: Shell Commands19348
Node: Simple Commands20220
Node: Pipelines20851
Node: Lists23594
Node: Compound Commands25323
Node: Looping Constructs26326
Node: Conditional Constructs28789
Node: Command Grouping39710
Node: Coprocesses41189
Node: GNU Parallel43021
Node: Shell Functions46994
Node: Shell Parameters52200
Node: Positional Parameters56602
Node: Special Parameters57502
Node: Shell Expansions60839
Node: Brace Expansion62776
Node: Tilde Expansion65557
Node: Shell Parameter Expansion67905
Node: Command Substitution82037
Node: Arithmetic Expansion83392
Node: Process Substitution84324
Node: Word Splitting85444
Node: Filename Expansion87388
Node: Pattern Matching89672
Node: Quote Removal93370
Node: Redirections93665
Node: Executing Commands102914
Node: Simple Command Expansion103584
Node: Command Search and Execution105514
Node: Command Execution Environment107850
Node: Environment110834
Node: Exit Status112493
Node: Signals114163
Node: Shell Scripts116130
Node: Shell Builtin Commands118645
Node: Bourne Shell Builtins120679
Node: Bash Builtins141281
Node: Modifying Shell Behavior169911
Node: The Set Builtin170256
Node: The Shopt Builtin180669
Node: Special Builtins196289
Node: Shell Variables197268
Node: Bourne Shell Variables197705
Node: Bash Variables199736
Node: Bash Features228000
Node: Invoking Bash228899
Node: Bash Startup Files234848
Node: Interactive Shells239951
Node: What is an Interactive Shell?240361
Node: Is this Shell Interactive?241010
Node: Interactive Shell Behavior241825
Node: Bash Conditional Expressions245200
Node: Shell Arithmetic249201
Node: Aliases251978
Node: Arrays254526
Node: The Directory Stack259610
Node: Directory Stack Builtins260394
Node: Controlling the Prompt263362
Node: The Restricted Shell266108
Node: Bash POSIX Mode267933
Node: Job Control277845
Node: Job Control Basics278305
Node: Job Control Builtins283024
Node: Job Control Variables287554
Node: Command Line Editing288710
Node: Introduction and Notation290381
Node: Readline Interaction292004
Node: Readline Bare Essentials293195
Node: Readline Movement Commands294978
Node: Readline Killing Commands295938
Node: Readline Arguments297856
Node: Searching298900
Node: Readline Init File301086
Node: Readline Init File Syntax302233
Node: Conditional Init Constructs321997
Node: Sample Init File324522
Node: Bindable Readline Commands327639
Node: Commands For Moving328843
Node: Commands For History329986
Node: Commands For Text334275
Node: Commands For Killing337664
Node: Numeric Arguments340145
Node: Commands For Completion341284
Node: Keyboard Macros345475
Node: Miscellaneous Commands346162
Node: Readline vi Mode351966
Node: Programmable Completion352873
Node: Programmable Completion Builtins360334
Node: A Programmable Completion Example370220
Node: Using History Interactively375472
Node: Bash History Facilities376156
Node: Bash History Builtins379157
Node: History Interaction383154
Node: Event Designators386118
Node: Word Designators387337
Node: Modifiers388974
Node: Installing Bash390376
Node: Basic Installation391513
Node: Compilers and Options394204
Node: Compiling For Multiple Architectures394945
Node: Installation Names396608
Node: Specifying the System Type397426
Node: Sharing Defaults398142
Node: Operation Controls398815
Node: Optional Features399773
Node: Reporting Bugs410030
Node: Major Differences From The Bourne Shell411224
Node: GNU Free Documentation License428076
Node: Indexes453253
Node: Builtin Index453707
Node: Reserved Word Index460534
Node: Variable Index462982
Node: Function Index478441
Node: Concept Index491661
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 Translation17818
Node: Comments18714
Node: Shell Commands19332
Node: Simple Commands20204
Node: Pipelines20835
Node: Lists23578
Node: Compound Commands25307
Node: Looping Constructs26310
Node: Conditional Constructs28773
Node: Command Grouping39695
Node: Coprocesses41174
Node: GNU Parallel43006
Node: Shell Functions46979
Node: Shell Parameters52185
Node: Positional Parameters56598
Node: Special Parameters57498
Node: Shell Expansions60835
Node: Brace Expansion62772
Node: Tilde Expansion65553
Node: Shell Parameter Expansion67901
Node: Command Substitution82033
Node: Arithmetic Expansion83388
Node: Process Substitution84320
Node: Word Splitting85440
Node: Filename Expansion87384
Node: Pattern Matching89668
Node: Quote Removal93366
Node: Redirections93661
Node: Executing Commands102904
Node: Simple Command Expansion103574
Node: Command Search and Execution105504
Node: Command Execution Environment107840
Node: Environment110824
Node: Exit Status112483
Node: Signals114153
Node: Shell Scripts116120
Node: Shell Builtin Commands118635
Node: Bourne Shell Builtins120669
Node: Bash Builtins141269
Node: Modifying Shell Behavior169914
Node: The Set Builtin170259
Node: The Shopt Builtin180672
Node: Special Builtins196471
Node: Shell Variables197450
Node: Bourne Shell Variables197887
Node: Bash Variables199918
Node: Bash Features228298
Node: Invoking Bash229197
Node: Bash Startup Files235146
Node: Interactive Shells240249
Node: What is an Interactive Shell?240659
Node: Is this Shell Interactive?241308
Node: Interactive Shell Behavior242123
Node: Bash Conditional Expressions245498
Node: Shell Arithmetic249499
Node: Aliases252316
Node: Arrays254864
Node: The Directory Stack259948
Node: Directory Stack Builtins260732
Node: Controlling the Prompt263700
Node: The Restricted Shell266446
Node: Bash POSIX Mode268271
Node: Job Control278324
Node: Job Control Basics278784
Node: Job Control Builtins283503
Node: Job Control Variables288033
Node: Command Line Editing289189
Node: Introduction and Notation290860
Node: Readline Interaction292483
Node: Readline Bare Essentials293674
Node: Readline Movement Commands295457
Node: Readline Killing Commands296417
Node: Readline Arguments298335
Node: Searching299379
Node: Readline Init File301565
Node: Readline Init File Syntax302712
Node: Conditional Init Constructs322899
Node: Sample Init File325424
Node: Bindable Readline Commands328541
Node: Commands For Moving329745
Node: Commands For History330888
Node: Commands For Text335177
Node: Commands For Killing338566
Node: Numeric Arguments341047
Node: Commands For Completion342186
Node: Keyboard Macros346377
Node: Miscellaneous Commands347064
Node: Readline vi Mode352868
Node: Programmable Completion353775
Node: Programmable Completion Builtins361236
Node: A Programmable Completion Example371122
Node: Using History Interactively376374
Node: Bash History Facilities377058
Node: Bash History Builtins380059
Node: History Interaction384056
Node: Event Designators387020
Node: Word Designators388239
Node: Modifiers389876
Node: Installing Bash391278
Node: Basic Installation392415
Node: Compilers and Options395106
Node: Compiling For Multiple Architectures395847
Node: Installation Names397510
Node: Specifying the System Type398328
Node: Sharing Defaults399044
Node: Operation Controls399717
Node: Optional Features400675
Node: Reporting Bugs410932
Node: Major Differences From The Bourne Shell412126
Node: GNU Free Documentation License428978
Node: Indexes454155
Node: Builtin Index454609
Node: Reserved Word Index461436
Node: Variable Index463884
Node: Function Index479343
Node: Concept Index492500

End Tag Table
BIN
View File
Binary file not shown.
+2561 -2460
View File
File diff suppressed because it is too large Load Diff
+21 -12
View File
@@ -1513,12 +1513,13 @@ When applied to a string-valued variable, @var{value} is expanded and
appended to the variable's value.
A variable can be assigned the @var{nameref} attribute using the
@option{-n} option to the \fBdeclare\fP or \fBlocal\fP builtin commands
@option{-n} option to the @code{declare} or @code{local} builtin commands
(@pxref{Bash Builtins})
to create a @var{nameref}, or a reference to another variable.
This allows variables to be manipulated indirectly.
Whenever the nameref variable is referenced, assigned to, unset, or has
its attributes modified (other than the nameref attribute itself), the
its attributes modified (other than using or changing the nameref
attribute itself), the
operation is actually performed on the variable specified by the nameref
variable's value.
A nameref is commonly used within shell functions to refer to a variable
@@ -2730,7 +2731,7 @@ The format of here-documents is:
No parameter and variable expansion, command substitution,
arithmetic expansion, or filename expansion is performed on
@var{word}. If any characters in @var{word} are quoted, the
@var{word}. If any part of @var{word} is quoted, the
@var{delimiter} is the result of quote removal on @var{word},
and the lines in the here-document are not expanded.
If @var{word} is unquoted,
@@ -3621,8 +3622,7 @@ less than zero, non-zero otherwise.
test @var{expr}
@end example
Evaluate a conditional express
ion @var{expr} and return a status of 0
Evaluate a conditional expression @var{expr} and return a status of 0
(true) or 1 (false).
Each operator and operand must be a separate argument.
Expressions are composed of the primaries described below in
@@ -3801,7 +3801,7 @@ unset [-fnv] [@var{name}]
Remove each variable or function @var{name}.
If the @option{-v} option is given, each
@var{name} refers to a shell variable and that variable is remvoved.
@var{name} refers to a shell variable and that variable is removed.
If the @option{-f} option is given, the @var{name}s refer to shell
functions, and the function definition is removed.
If the @option{-n} option is supplied, and @var{name} is a variable with
@@ -4053,7 +4053,7 @@ Give each @var{name} the @var{nameref} attribute, making
it a name reference to another variable.
That other variable is defined by the value of @var{name}.
All references, assignments, and attribute modifications
to @var{name}, except for changing the
to @var{name}, except for those using or changing the
@option{-n} attribute itself, are performed on the variable referenced by
@var{name}'s value.
The nameref attribute cannot be applied to array variables.
@@ -5144,7 +5144,9 @@ If set, aliases are expanded as described below under Aliases,
This option is enabled by default for interactive shells.
@item extdebug
If set, behavior intended for use by debuggers is enabled:
If set at shell invocation, arrange to execute the debugger profile
before the shell starts, identical to the @option{--debugger} option.
If set after invocation, behavior intended for use by debuggers is enabled:
@enumerate
@item
@@ -5723,11 +5725,14 @@ is readonly.
@item EXECIGNORE
A colon-separated list of shell patterns (@pxref{Pattern Matching})
defining the list of filenames to be ignored by command search.
defining the list of filenames to be ignored by command search using
@code{PATH}.
Files whose full pathnames match one of these patterns are not considered
executable files for the purposes of completion and command execution.
executable files for the purposes of completion and command execution
via @code{PATH} lookup.
This does not affect the behavior of the @code{[}, @code{test}, and @code{[[}
commands.
Full pathnames in the command hash table are not subject to @code{EXECIGNORE}.
Use this variable to ignore shared library files that have the executable
bit set, but are not executable files.
The pattern matching honors the setting of the @code{extglob} shell
@@ -6752,8 +6757,8 @@ may be positive or negative integers.
@cindex arithmetic evaluation
The shell allows arithmetic expressions to be evaluated, as one of
the shell expansions or by the @code{let} and the @option{-i} option
to the @code{declare} builtins.
the shell expansions or by using the @code{((} compound command, the
@code{let} builtin, or the @option{-i} option to the @code{declare} builtin.
Evaluation is done in fixed-width integers with no check for overflow,
though division by 0 is trapped and flagged as an error.
@@ -7566,6 +7571,10 @@ has been set.
If Bash receives a trapped signal while executing @code{read}, the trap
handler executes and @code{read} returns an exit status greater than 128.
@item
Bash removes an exited background process's status from the list of such
statuses after the @code{wait} builtin is used to obtain it.
@end enumerate
There is other @sc{posix} behavior that Bash does not implement by
+7 -5
View File
@@ -411,9 +411,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name
reference to another variable. That other variable is
defined by the value of _n_a_m_e. All references, assign-
ments, and attribute modifications to _n_a_m_e, except for
changing the --nn attribute itself, are performed on the
variable referenced by _n_a_m_e's value. The nameref
ments, and attribute modifications to _n_a_m_e, except those
using or changing the --nn attribute itself, are performed
on the variable referenced by _n_a_m_e's value. The nameref
attribute cannot be applied to array variables.
--rr Make _n_a_m_es readonly. These names cannot then be assigned
values by subsequent assignment statements or unset.
@@ -1393,8 +1393,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
AALLIIAASSEESS. This option is enabled by default for interac-
tive shells.
eexxttddeebbuugg
If set, behavior intended for use by debuggers is
enabled:
If set at shell invocation, arrange to execute the
debugger profile before the shell starts, identical to
the ----ddeebbuuggggeerr option. If set after invocation, behav-
ior intended for use by debuggers is enabled:
11.. The --FF option to the ddeeccllaarree builtin displays the
source file name and line number corresponding to
each function name supplied as an argument.
+347 -342
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.3
%%CreationDate: Mon Feb 8 10:16:53 2016
%%CreationDate: Mon Jun 20 15:38:03 2016
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%+ font Times-Italic
@@ -889,32 +889,32 @@ F0(Gi)180 300 Q 1.619 -.15(ve e)-.25 H(ach).15 E F1(name)3.819 E F0(the)
(ute, making it a name reference to another v)-.2 F(ariable.)-.25 E
1.519(That other v)180 312 R 1.519(ariable is de\214ned by the v)-.25 F
1.518(alue of)-.25 F F1(name)4.018 E F0 6.518(.A)C 1.518
(ll references, assignments, and)-6.518 F(attrib)180 324 Q .27
(ute modi\214cations to)-.2 F F1(name)2.77 E F0 2.77(,e)C .27
(xcept for changing the)-2.92 F F2<ad6e>2.77 E F0(attrib)2.77 E .27
(ute itself, are performed)-.2 F .895(on the v)180 336 R .895
(ariable referenced by)-.25 F F1(name)3.395 E F0 1.995 -.55('s v)D 3.395
(alue. The).3 F .894(nameref attrib)3.395 F .894
(ute cannot be applied to)-.2 F(array v)180 348 Q(ariables.)-.25 E F2
<ad72>144 360 Q F0(Mak)180 360 Q(e)-.1 E F1(name)5.046 E F0 5.046(sr)C
(eadonly)-5.046 E 7.546(.T)-.65 G 2.546
(hese names cannot then be assigned v)-7.546 F 2.547
(alues by subsequent)-.25 F(assignment statements or unset.)180 372 Q F2
<ad74>144 384 Q F0(Gi)180 384 Q .73 -.15(ve e)-.25 H(ach).15 E F1(name)
2.93 E F0(the)2.929 E F1(tr)2.929 E(ace)-.15 E F0(attrib)2.929 E 2.929
(ute. T)-.2 F .429(raced functions inherit the)-.35 F F2(DEB)2.929 E(UG)
-.1 E F0(and)2.929 E F2(RETURN)2.929 E F0(traps from the calling shell.)
180 396 Q(The trace attrib)5 E(ute has no special meaning for v)-.2 E
(ariables.)-.25 E F2<ad75>144 408 Q F0 .909(When the v)180 408 R .909
(ariable is assigned a v)-.25 F .909(alue, all lo)-.25 F(wer)-.25 E .909
(-case characters are con)-.2 F -.15(ve)-.4 G .91(rted to upper).15 F(-)
-.2 E 2.5(case. The)180 420 R(lo)2.5 E(wer)-.25 E(-case attrib)-.2 E
(ute is disabled.)-.2 E F2<ad78>144 432 Q F0(Mark)180 432 Q F1(name)2.5
E F0 2.5(sf)C(or e)-2.5 E(xport to subsequent commands via the en)-.15 E
(vironment.)-.4 E .121(Using `+' instead of `\255' turns of)144 448.8 R
2.621(ft)-.25 G .121(he attrib)-2.621 F .121(ute instead, with the e)-.2
F .12(xceptions that)-.15 F F2(+a)2.62 E F0 .12(may not be used)2.62 F
.644(to destro)144 460.8 R 3.144(ya)-.1 G 3.144(na)-3.144 G .644(rray v)
(ll references, assignments, and)-6.518 F(attrib)180 324 Q .226
(ute modi\214cations to)-.2 F F1(name)2.726 E F0 2.726(,e)C .226
(xcept those using or changing the)-2.876 F F2<ad6e>2.726 E F0(attrib)
2.726 E .227(ute itself, are)-.2 F .809(performed on the v)180 336 R
.809(ariable referenced by)-.25 F F1(name)3.308 E F0 1.908 -.55('s v)D
3.308(alue. The).3 F .808(nameref attrib)3.308 F .808(ute cannot be)-.2
F(applied to array v)180 348 Q(ariables.)-.25 E F2<ad72>144 360 Q F0
(Mak)180 360 Q(e)-.1 E F1(name)5.046 E F0 5.046(sr)C(eadonly)-5.046 E
7.546(.T)-.65 G 2.546(hese names cannot then be assigned v)-7.546 F
2.547(alues by subsequent)-.25 F(assignment statements or unset.)180 372
Q F2<ad74>144 384 Q F0(Gi)180 384 Q .73 -.15(ve e)-.25 H(ach).15 E F1
(name)2.93 E F0(the)2.929 E F1(tr)2.929 E(ace)-.15 E F0(attrib)2.929 E
2.929(ute. T)-.2 F .429(raced functions inherit the)-.35 F F2(DEB)2.929
E(UG)-.1 E F0(and)2.929 E F2(RETURN)2.929 E F0
(traps from the calling shell.)180 396 Q(The trace attrib)5 E
(ute has no special meaning for v)-.2 E(ariables.)-.25 E F2<ad75>144 408
Q F0 .909(When the v)180 408 R .909(ariable is assigned a v)-.25 F .909
(alue, all lo)-.25 F(wer)-.25 E .909(-case characters are con)-.2 F -.15
(ve)-.4 G .91(rted to upper).15 F(-)-.2 E 2.5(case. The)180 420 R(lo)2.5
E(wer)-.25 E(-case attrib)-.2 E(ute is disabled.)-.2 E F2<ad78>144 432 Q
F0(Mark)180 432 Q F1(name)2.5 E F0 2.5(sf)C(or e)-2.5 E
(xport to subsequent commands via the en)-.15 E(vironment.)-.4 E .121
(Using `+' instead of `\255' turns of)144 448.8 R 2.621(ft)-.25 G .121
(he attrib)-2.621 F .121(ute instead, with the e)-.2 F .12
(xceptions that)-.15 F F2(+a)2.62 E F0 .12(may not be used)2.62 F .644
(to destro)144 460.8 R 3.144(ya)-.1 G 3.144(na)-3.144 G .644(rray v)
-3.144 F .644(ariable and)-.25 F F2(+r)3.145 E F0 .645(will not remo)
3.145 F .945 -.15(ve t)-.15 H .645(he readonly attrib).15 F 3.145
(ute. When)-.2 F .645(used in a func-)3.145 F(tion,)144 472.8 Q F2
@@ -2422,592 +2422,597 @@ E F2(exec)2.5 E F0 -.1(fa)2.5 G(ils.).1 E F2(expand_aliases)144 636 Q F0
F 1.017 -.15(ve u)-.15 H(nder).15 E/F3 9/Times-Bold@0 SF(ALIASES)3.217 E
/F4 9/Times-Roman@0 SF(.)A F0 .716(This option is enabled)5.217 F
(by def)184 660 Q(ault for interacti)-.1 E .3 -.15(ve s)-.25 H(hells.)
.15 E F2(extdeb)144 672 Q(ug)-.2 E F0(If set, beha)184 684 Q
(vior intended for use by deb)-.2 E(uggers is enabled:)-.2 E F2(1.)184
696 Q F0(The)220 696 Q F2<ad46>4.25 E F0 1.75(option to the)4.25 F F2
(declar)4.251 E(e)-.18 E F0 -.2(bu)4.251 G 1.751
(iltin displays the source \214le name and line).2 F
(number corresponding to each function name supplied as an ar)220 708 Q
(gument.)-.18 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(18)198.725 E
0 Cg EP
.15 E F2(extdeb)144 672 Q(ug)-.2 E F0 .671(If set at shell in)184 684 R
-.2(vo)-.4 G .671(cation, arrange to e).2 F -.15(xe)-.15 G .671
(cute the deb).15 F .672(ugger pro\214le before the shell starts,)-.2 F
.221(identical to the)184 696 R F2<adad646562>2.721 E(ugger)-.2 E F0
2.721(option. If)2.721 F .221(set after in)2.721 F -.2(vo)-.4 G .221
(cation, beha).2 F .22(vior intended for use by)-.2 F(deb)184 708 Q
(uggers is enabled:)-.2 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E
(18)198.725 E 0 Cg EP
%%Page: 19 19
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF(2.)184 84 Q F0 1.667
(If the command run by the)220 84 R F1(DEB)4.167 E(UG)-.1 E F0 1.667
(trap returns a non-zero v)4.167 F 1.667(alue, the ne)-.25 F(xt)-.15 E
(command is skipped and not e)220 96 Q -.15(xe)-.15 G(cuted.).15 E F1
(3.)184 108 Q F0 .84(If the command run by the)220 108 R F1(DEB)3.34 E
(UG)-.1 E F0 .841(trap returns a v)3.341 F .841
(alue of 2, and the shell is)-.25 F -.15(exe)220 120 S .488
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF(1.)184 84 Q F0(The)
220 84 Q F1<ad46>4.25 E F0 1.75(option to the)4.25 F F1(declar)4.251 E
(e)-.18 E F0 -.2(bu)4.251 G 1.751
(iltin displays the source \214le name and line).2 F
(number corresponding to each function name supplied as an ar)220 96 Q
(gument.)-.18 E F1(2.)184 108 Q F0 1.667(If the command run by the)220
108 R F1(DEB)4.167 E(UG)-.1 E F0 1.667(trap returns a non-zero v)4.167 F
1.667(alue, the ne)-.25 F(xt)-.15 E(command is skipped and not e)220 120
Q -.15(xe)-.15 G(cuted.).15 E F1(3.)184 132 Q F0 .84
(If the command run by the)220 132 R F1(DEB)3.34 E(UG)-.1 E F0 .841
(trap returns a v)3.341 F .841(alue of 2, and the shell is)-.25 F -.15
(exe)220 144 S .488
(cuting in a subroutine \(a shell function or a shell script e).15 F
-.15(xe)-.15 G .488(cuted by the).15 F F1(.)2.988 E F0(or)2.988 E F1
(sour)220 132 Q(ce)-.18 E F0 -.2(bu)2.5 G
(sour)220 156 Q(ce)-.18 E F0 -.2(bu)2.5 G
(iltins\), the shell simulates a call to).2 E F1 -.18(re)2.5 G(tur).18 E
(n)-.15 E F0(.)A F1(4.)184 144 Q/F2 9/Times-Bold@0 SF -.27(BA)220 144 S
(n)-.15 E F0(.)A F1(4.)184 168 Q/F2 9/Times-Bold@0 SF -.27(BA)220 168 S
(SH_ARGC).27 E F0(and)3.153 E F2 -.27(BA)3.403 G(SH_ARGV).27 E F0 .904
(are updated as described in their descriptions)3.154 F(abo)220 156 Q
-.15(ve)-.15 G(.).15 E F1(5.)184 168 Q F0 1.637(Function tracing is ena\
bled: command substitution, shell functions, and sub-)220 168 R
(shells in)220 180 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1
(are updated as described in their descriptions)3.154 F(abo)220 180 Q
-.15(ve)-.15 G(.).15 E F1(5.)184 192 Q F0 1.637(Function tracing is ena\
bled: command substitution, shell functions, and sub-)220 192 R
(shells in)220 204 Q -.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1
(\()2.5 E/F3 10/Times-Italic@0 SF(command)2.5 E F1(\))2.5 E F0
(inherit the)2.5 E F1(DEB)2.5 E(UG)-.1 E F0(and)2.5 E F1(RETURN)2.5 E F0
(traps.)2.5 E F1(6.)184 192 Q F0 1.082(Error tracing is enabled: comman\
d substitution, shell functions, and subshells)220 192 R(in)220 204 Q
(traps.)2.5 E F1(6.)184 216 Q F0 1.082(Error tracing is enabled: comman\
d substitution, shell functions, and subshells)220 216 R(in)220 228 Q
-.2(vo)-.4 G -.1(ke).2 G 2.5(dw).1 G(ith)-2.5 E F1(\()2.5 E F3(command)
2.5 E F1(\))2.5 E F0(inherit the)2.5 E F1(ERR)2.5 E F0(trap.)2.5 E F1
(extglob)144 216 Q F0 .4(If set, the e)184 216 R .4
(extglob)144 240 Q F0 .4(If set, the e)184 240 R .4
(xtended pattern matching features described abo)-.15 F .7 -.15(ve u)
-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 228 Q
F0(are enabled.)2.5 E F1(extquote)144 240 Q F0 2.473(If set,)184 252 R
-.15 H(nder).15 E F1 -.1(Pa)2.9 G .4(thname Expan-).1 F(sion)184 252 Q
F0(are enabled.)2.5 E F1(extquote)144 264 Q F0 2.473(If set,)184 276 R
F1($)4.973 E F0<08>A F3(string)A F0 4.973<0861>C(nd)-4.973 E F1($)4.973
E F0(")A F3(string)A F0 4.973("q)C 2.473(uoting is performed within)
-4.973 F F1(${)4.973 E F3(par)A(ameter)-.15 E F1(})A F0 -.15(ex)4.973 G
(pansions).15 E(enclosed in double quotes.)184 264 Q
(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 276 Q F0
1.425(If set, patterns which f)184 276 R 1.425
(pansions).15 E(enclosed in double quotes.)184 288 Q
(This option is enabled by def)5 E(ault.)-.1 E F1(failglob)144 300 Q F0
1.425(If set, patterns which f)184 300 R 1.425
(ail to match \214lenames during pathname e)-.1 F 1.424
(xpansion result in an)-.15 F -.15(ex)184 288 S(pansion error).15 E(.)
-.55 E F1 -.25(fo)144 300 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0
.936(If set, the suf)184 312 R<8c78>-.25 E .936(es speci\214ed by the)
(xpansion result in an)-.15 F -.15(ex)184 312 S(pansion error).15 E(.)
-.55 E F1 -.25(fo)144 324 S -.18(rc).25 G(e_\214gnor).18 E(e)-.18 E F0
.936(If set, the suf)184 336 R<8c78>-.25 E .936(es speci\214ed by the)
-.15 F F2(FIGNORE)3.436 E F0 .936(shell v)3.186 F .936(ariable cause w)
-.25 F .937(ords to be ignored)-.1 F .32(when performing w)184 324 R .32
-.25 F .937(ords to be ignored)-.1 F .32(when performing w)184 348 R .32
(ord completion e)-.1 F -.15(ve)-.25 G 2.82(ni).15 G 2.82(ft)-2.82 G .32
(he ignored w)-2.82 F .32(ords are the only possible com-)-.1 F 2.947
(pletions. See)184 336 R F2 .447(SHELL V)2.947 F(ARIABLES)-1.215 E F0
(pletions. See)184 360 R F2 .447(SHELL V)2.947 F(ARIABLES)-1.215 E F0
(abo)2.697 E .747 -.15(ve f)-.15 H .448(or a description of).15 F F2
(FIGNORE)2.948 E/F4 9/Times-Roman@0 SF(.)A F0 .448(This option is)4.948
F(enabled by def)184 348 Q(ault.)-.1 E F1(globasciiranges)144 360 Q F0
2.519(If set, range e)184 372 R 2.519
F(enabled by def)184 372 Q(ault.)-.1 E F1(globasciiranges)144 384 Q F0
2.519(If set, range e)184 396 R 2.519
(xpressions used in pattern matching brack)-.15 F 2.518(et e)-.1 F 2.518
(xpressions \(see)-.15 F F2 -.09(Pa)5.018 G(tter).09 E(n)-.135 E
(Matching)184 384 Q F0(abo)2.964 E -.15(ve)-.15 G 3.214(\)b).15 G(eha)
(Matching)184 408 Q F0(abo)2.964 E -.15(ve)-.15 G 3.214(\)b).15 G(eha)
-3.214 E 1.014 -.15(ve a)-.2 H 3.214(si).15 G 3.214(fi)-3.214 G 3.214
(nt)-3.214 G .714(he traditional C locale when performing comparisons.)
-3.214 F 1.02(That is, the current locale')184 396 R 3.52(sc)-.55 G 1.02
-3.214 F 1.02(That is, the current locale')184 420 R 3.52(sc)-.55 G 1.02
(ollating sequence is not tak)-3.52 F 1.02(en into account, so)-.1 F F1
(b)3.52 E F0 1.02(will not)3.52 F .956(collate between)184 408 R F1(A)
(b)3.52 E F0 1.02(will not)3.52 F .956(collate between)184 432 R F1(A)
3.456 E F0(and)3.456 E F1(B)3.456 E F0 3.457(,a)C .957(nd upper)-3.457 F
.957(-case and lo)-.2 F(wer)-.25 E .957
(-case ASCII characters will collate)-.2 F(together)184 420 Q(.)-.55 E
F1(globstar)144 432 Q F0 .519(If set, the pattern)184 432 R F1(**)3.019
(-case ASCII characters will collate)-.2 F(together)184 444 Q(.)-.55 E
F1(globstar)144 456 Q F0 .519(If set, the pattern)184 456 R F1(**)3.019
E F0 .519(used in a pathname e)3.019 F .519(xpansion conte)-.15 F .518
(xt will match all \214les and zero)-.15 F .431
(or more directories and subdirectories.)184 444 R .431
(or more directories and subdirectories.)184 468 R .431
(If the pattern is follo)5.431 F .432(wed by a)-.25 F F1(/)2.932 E F0
2.932(,o)C .432(nly directories)-2.932 F(and subdirectories match.)184
456 Q F1(gnu_errfmt)144 468 Q F0(If set, shell error messages are writt\
en in the standard GNU error message format.)184 480 Q F1(histappend)144
492 Q F0 .676
480 Q F1(gnu_errfmt)144 492 Q F0(If set, shell error messages are writt\
en in the standard GNU error message format.)184 504 Q F1(histappend)144
516 Q F0 .676
(If set, the history list is appended to the \214le named by the v)184
504 R .676(alue of the)-.25 F F2(HISTFILE)3.176 E F0 -.25(va)2.926 G
(ri-).25 E(able when the shell e)184 516 Q(xits, rather than o)-.15 E
-.15(ve)-.15 G(rwriting the \214le.).15 E F1(histr)144 528 Q(eedit)-.18
E F0 .575(If set, and)184 540 R F1 -.18(re)3.075 G(adline).18 E F0 .575
528 R .676(alue of the)-.25 F F2(HISTFILE)3.176 E F0 -.25(va)2.926 G
(ri-).25 E(able when the shell e)184 540 Q(xits, rather than o)-.15 E
-.15(ve)-.15 G(rwriting the \214le.).15 E F1(histr)144 552 Q(eedit)-.18
E F0 .575(If set, and)184 564 R F1 -.18(re)3.075 G(adline).18 E F0 .575
(is being used, a user is gi)3.075 F -.15(ve)-.25 G 3.075(nt).15 G .576
(he opportunity to re-edit a f)-3.075 F .576(ailed his-)-.1 F
(tory substitution.)184 552 Q F1(histv)144 564 Q(erify)-.1 E F0 .403
(If set, and)184 576 R F1 -.18(re)2.903 G(adline).18 E F0 .403
(tory substitution.)184 576 Q F1(histv)144 588 Q(erify)-.1 E F0 .403
(If set, and)184 600 R F1 -.18(re)2.903 G(adline).18 E F0 .403
(is being used, the results of history substitution are not immediately)
2.903 F .661(passed to the shell parser)184 588 R 5.661(.I)-.55 G .662
2.903 F .661(passed to the shell parser)184 612 R 5.661(.I)-.55 G .662
(nstead, the resulting line is loaded into the)-5.661 F F1 -.18(re)3.162
G(adline).18 E F0(editing)3.162 E -.2(bu)184 600 S -.25(ff).2 G(er).25 E
G(adline).18 E F0(editing)3.162 E -.2(bu)184 624 S -.25(ff).2 G(er).25 E
2.5(,a)-.4 G(llo)-2.5 E(wing further modi\214cation.)-.25 E F1
(hostcomplete)144 612 Q F0 1.182(If set, and)184 624 R F1 -.18(re)3.682
(hostcomplete)144 636 Q F0 1.182(If set, and)184 648 R F1 -.18(re)3.682
G(adline).18 E F0 1.182(is being used,)3.682 F F1(bash)3.682 E F0 1.181
(will attempt to perform hostname completion)3.681 F 1.38(when a w)184
636 R 1.38(ord containing a)-.1 F F1(@)3.881 E F0 1.381
660 R 1.38(ord containing a)-.1 F F1(@)3.881 E F0 1.381
(is being completed \(see)3.881 F F1(Completing)3.881 E F0(under)3.881 E
F2(READLINE)3.881 E F0(abo)184 648 Q -.15(ve)-.15 G 2.5(\). This).15 F
(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 660 Q F0(If set,)
184 672 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0
F2(READLINE)3.881 E F0(abo)184 672 Q -.15(ve)-.15 G 2.5(\). This).15 F
(is enabled by def)2.5 E(ault.)-.1 E F1(huponexit)144 684 Q F0(If set,)
184 696 Q F1(bash)2.5 E F0(will send)2.5 E F2(SIGHUP)2.5 E F0
(to all jobs when an interacti)2.25 E .3 -.15(ve l)-.25 H(ogin shell e)
.15 E(xits.)-.15 E F1(inherit_err)144 684 Q(exit)-.18 E F0 .22
(If set, command substitution inherits the v)184 696 R .219(alue of the)
-.25 F F1(err)2.719 E(exit)-.18 E F0 .219(option, instead of unsetting)
2.719 F(it in the subshell en)184 708 Q 2.5(vironment. This)-.4 F
(option is enabled when)2.5 E F3(posix mode)2.5 E F0(is enabled.)2.5 E
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(19)198.725 E 0 Cg EP
.15 E(xits.)-.15 E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(19)
198.725 E 0 Cg EP
%%Page: 20 20
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF(interacti)144 84 Q
-.1(ve)-.1 G(_comments).1 E F0 .33(If set, allo)184 96 R 2.83(waw)-.25 G
.33(ord be)-2.93 F .33(ginning with)-.15 F F1(#)2.83 E F0 .33
(to cause that w)2.83 F .33(ord and all remaining characters on)-.1 F
.967(that line to be ignored in an interacti)184 108 R 1.267 -.15(ve s)
-.25 H .967(hell \(see).15 F/F2 9/Times-Bold@0 SF(COMMENTS)3.467 E F0
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF(inherit_err)144 84 Q
(exit)-.18 E F0 .22(If set, command substitution inherits the v)184 96 R
.219(alue of the)-.25 F F1(err)2.719 E(exit)-.18 E F0 .219
(option, instead of unsetting)2.719 F(it in the subshell en)184 108 Q
2.5(vironment. This)-.4 F(option is enabled when)2.5 E/F2 10
/Times-Italic@0 SF(posix mode)2.5 E F0(is enabled.)2.5 E F1(interacti)
144 120 Q -.1(ve)-.1 G(_comments).1 E F0 .33(If set, allo)184 132 R 2.83
(waw)-.25 G .33(ord be)-2.93 F .33(ginning with)-.15 F F1(#)2.83 E F0
.33(to cause that w)2.83 F .33(ord and all remaining characters on)-.1 F
.967(that line to be ignored in an interacti)184 144 R 1.267 -.15(ve s)
-.25 H .967(hell \(see).15 F/F3 9/Times-Bold@0 SF(COMMENTS)3.467 E F0
(abo)3.217 E -.15(ve)-.15 G 3.467(\). This).15 F .967(option is)3.467 F
(enabled by def)184 120 Q(ault.)-.1 E F1(lastpipe)144 132 Q F0 .066
(If set, and job control is not acti)184 132 R -.15(ve)-.25 G 2.566(,t)
(enabled by def)184 156 Q(ault.)-.1 E F1(lastpipe)144 168 Q F0 .066
(If set, and job control is not acti)184 168 R -.15(ve)-.25 G 2.566(,t)
.15 G .066(he shell runs the last command of a pipeline not e)-2.566 F
-.15(xe)-.15 G(-).15 E(cuted in the background in the current shell en)
184 144 Q(vironment.)-.4 E F1(lithist)144 156 Q F0 .655(If set, and the)
184 156 R F1(cmdhist)3.155 E F0 .654
184 180 Q(vironment.)-.4 E F1(lithist)144 192 Q F0 .655(If set, and the)
184 192 R F1(cmdhist)3.155 E F0 .654
(option is enabled, multi-line commands are sa)3.154 F -.15(ve)-.2 G
3.154(dt).15 G 3.154(ot)-3.154 G .654(he history)-3.154 F
(with embedded ne)184 168 Q
(with embedded ne)184 204 Q
(wlines rather than using semicolon separators where possible.)-.25 E F1
(login_shell)144 180 Q F0 .486
(login_shell)144 216 Q F0 .486
(The shell sets this option if it is started as a login shell \(see)184
192 R F2(INV)2.987 E(OCA)-.405 E(TION)-.855 E F0(abo)2.737 E -.15(ve)
-.15 G 2.987(\). The).15 F -.25(va)184 204 S(lue may not be changed.).25
E F1(mailwar)144 216 Q(n)-.15 E F0 .815(If set, and a \214le that)184
228 R F1(bash)3.315 E F0 .814
228 R F3(INV)2.987 E(OCA)-.405 E(TION)-.855 E F0(abo)2.737 E -.15(ve)
-.15 G 2.987(\). The).15 F -.25(va)184 240 S(lue may not be changed.).25
E F1(mailwar)144 252 Q(n)-.15 E F0 .815(If set, and a \214le that)184
264 R F1(bash)3.315 E F0 .814
(is checking for mail has been accessed since the last time it)3.315 F
-.1(wa)184 240 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E
(`The mail in)-.74 E/F3 10/Times-Italic@0 SF(mail\214le)2.5 E F0
(has been read')2.5 E 2.5('i)-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1
(no_empty_cmd_completion)144 252 Q F0 .324(If set, and)184 264 R F1 -.18
(re)2.824 G(adline).18 E F0 .324(is being used,)2.824 F F1(bash)2.824 E
F0 .324(will not attempt to search the)2.824 F F2 -.666(PA)2.825 G(TH)
-.189 E F0 .325(for possible)2.575 F
(completions when completion is attempted on an empty line.)184 276 Q F1
(nocaseglob)144 288 Q F0 .437(If set,)184 300 R F1(bash)2.937 E F0 .436
-.1(wa)184 276 S 2.5(sc).1 G(heck)-2.5 E(ed, the message `)-.1 E
(`The mail in)-.74 E F2(mail\214le)2.5 E F0(has been read')2.5 E 2.5('i)
-.74 G 2.5(sd)-2.5 G(isplayed.)-2.5 E F1(no_empty_cmd_completion)144 288
Q F0 .324(If set, and)184 300 R F1 -.18(re)2.824 G(adline).18 E F0 .324
(is being used,)2.824 F F1(bash)2.824 E F0 .324
(will not attempt to search the)2.824 F F3 -.666(PA)2.825 G(TH)-.189 E
F0 .325(for possible)2.575 F
(completions when completion is attempted on an empty line.)184 312 Q F1
(nocaseglob)144 324 Q F0 .437(If set,)184 336 R F1(bash)2.937 E F0 .436
(matches \214lenames in a case\255insensiti)2.937 F .736 -.15(ve f)-.25
H .436(ashion when performing pathname).05 F -.15(ex)184 312 S
H .436(ashion when performing pathname).05 F -.15(ex)184 348 S
(pansion \(see).15 E F1 -.1(Pa)2.5 G(thname Expansion).1 E F0(abo)2.5 E
-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 324 Q F0 1.193(If set,)184
336 R F1(bash)3.693 E F0 1.194(matches patterns in a case\255insensiti)
-.15(ve)-.15 G(\).).15 E F1(nocasematch)144 360 Q F0 1.193(If set,)184
372 R F1(bash)3.693 E F0 1.194(matches patterns in a case\255insensiti)
3.693 F 1.494 -.15(ve f)-.25 H 1.194(ashion when performing matching).05
F .551(while e)184 348 R -.15(xe)-.15 G(cuting).15 E F1(case)3.051 E F0
F .551(while e)184 384 R -.15(xe)-.15 G(cuting).15 E F1(case)3.051 E F0
(or)3.051 E F1([[)3.051 E F0 .551
(conditional commands, when performing pattern substitution)3.051 F -.1
(wo)184 360 S .622(rd e).1 F .623(xpansions, or when \214ltering possib\
le completions as part of programmable com-)-.15 F(pletion.)184 372 Q F1
(nullglob)144 384 Q F0 .855(If set,)184 396 R F1(bash)3.355 E F0(allo)
(wo)184 396 S .622(rd e).1 F .623(xpansions, or when \214ltering possib\
le completions as part of programmable com-)-.15 F(pletion.)184 408 Q F1
(nullglob)144 420 Q F0 .855(If set,)184 432 R F1(bash)3.355 E F0(allo)
3.355 E .855(ws patterns which match no \214les \(see)-.25 F F1 -.1(Pa)
3.354 G .854(thname Expansion).1 F F0(abo)3.354 E -.15(ve)-.15 G 3.354
(\)t).15 G(o)-3.354 E -.15(ex)184 408 S
(\)t).15 G(o)-3.354 E -.15(ex)184 444 S
(pand to a null string, rather than themselv).15 E(es.)-.15 E F1(pr)144
420 Q(ogcomp)-.18 E F0 .676(If set, the programmable completion f)184
432 R .677(acilities \(see)-.1 F F1(Pr)3.177 E .677
456 Q(ogcomp)-.18 E F0 .676(If set, the programmable completion f)184
468 R .677(acilities \(see)-.1 F F1(Pr)3.177 E .677
(ogrammable Completion)-.18 F F0(abo)3.177 E -.15(ve)-.15 G(\)).15 E
(are enabled.)184 444 Q(This option is enabled by def)5 E(ault.)-.1 E F1
(pr)144 456 Q(omptv)-.18 E(ars)-.1 E F0 1.448
(If set, prompt strings under)184 468 R 1.448(go parameter e)-.18 F
1.447(xpansion, command substitution, arithmetic)-.15 F -.15(ex)184 480
(are enabled.)184 480 Q(This option is enabled by def)5 E(ault.)-.1 E F1
(pr)144 492 Q(omptv)-.18 E(ars)-.1 E F0 1.448
(If set, prompt strings under)184 504 R 1.448(go parameter e)-.18 F
1.447(xpansion, command substitution, arithmetic)-.15 F -.15(ex)184 516
S .17(pansion, and quote remo).15 F -.25(va)-.15 G 2.67(la).25 G .17
(fter being e)-2.67 F .17(xpanded as described in)-.15 F F2(PR)2.671 E
(fter being e)-2.67 F .17(xpanded as described in)-.15 F F3(PR)2.671 E
(OMPTING)-.27 E F0(abo)2.421 E -.15(ve)-.15 G(.).15 E
(This option is enabled by def)184 492 Q(ault.)-.1 E F1 -.18(re)144 504
(This option is enabled by def)184 528 Q(ault.)-.1 E F1 -.18(re)144 540
S(stricted_shell).18 E F0 1.069
(The shell sets this option if it is started in restricted mode \(see)
184 516 R F2 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 528 Q 2.86
184 552 R F3 1.069(RESTRICTED SHELL)3.569 F F0(belo)184 564 Q 2.86
(w\). The)-.25 F -.25(va)2.86 G .36(lue may not be changed.).25 F .36
(This is not reset when the startup \214les are e)5.36 F -.15(xe)-.15 G
(-).15 E(cuted, allo)184 540 Q(wing the startup \214les to disco)-.25 E
(-).15 E(cuted, allo)184 576 Q(wing the startup \214les to disco)-.25 E
-.15(ve)-.15 G 2.5(rw).15 G(hether or not a shell is restricted.)-2.5 E
F1(shift_v)144 552 Q(erbose)-.1 E F0 .502(If set, the)184 564 R F1
F1(shift_v)144 588 Q(erbose)-.1 E F0 .502(If set, the)184 600 R F1
(shift)3.002 E F0 -.2(bu)3.002 G .501
(iltin prints an error message when the shift count e).2 F .501
(xceeds the number)-.15 F(of positional parameters.)184 576 Q F1(sour)
144 588 Q(cepath)-.18 E F0 .77(If set, the)184 600 R F1(sour)3.27 E(ce)
(xceeds the number)-.15 F(of positional parameters.)184 612 Q F1(sour)
144 624 Q(cepath)-.18 E F0 .77(If set, the)184 636 R F1(sour)3.27 E(ce)
-.18 E F0(\()3.27 E F1(.)A F0 3.27(\)b)C .77(uiltin uses the v)-3.47 F
.771(alue of)-.25 F F2 -.666(PA)3.271 G(TH)-.189 E F0 .771
.771(alue of)-.25 F F3 -.666(PA)3.271 G(TH)-.189 E F0 .771
(to \214nd the directory containing the)3.021 F
(\214le supplied as an ar)184 612 Q 2.5(gument. This)-.18 F
(option is enabled by def)2.5 E(ault.)-.1 E F1(xpg_echo)144 624 Q F0
(If set, the)184 636 Q F1(echo)2.5 E F0 -.2(bu)2.5 G(iltin e).2 E
(\214le supplied as an ar)184 648 Q 2.5(gument. This)-.18 F
(option is enabled by def)2.5 E(ault.)-.1 E F1(xpg_echo)144 660 Q F0
(If set, the)184 672 Q F1(echo)2.5 E F0 -.2(bu)2.5 G(iltin e).2 E
(xpands backslash-escape sequences by def)-.15 E(ault.)-.1 E F1(suspend)
108 652.8 Q F0([)2.5 E F1<ad66>A F0(])A 1.002(Suspend the e)144 664.8 R
108 688.8 Q F0([)2.5 E F1<ad66>A F0(])A 1.002(Suspend the e)144 700.8 R
-.15(xe)-.15 G 1.002(cution of this shell until it recei).15 F -.15(ve)
-.25 G 3.501(sa).15 G F2(SIGCONT)A F0 3.501(signal. A)3.251 F 1.001
(login shell cannot be)3.501 F .022(suspended; the)144 676.8 R F1<ad66>
-.25 G 3.501(sa).15 G F3(SIGCONT)A F0 3.501(signal. A)3.251 F 1.001
(login shell cannot be)3.501 F .022(suspended; the)144 712.8 R F1<ad66>
2.522 E F0 .022(option can be used to o)2.522 F -.15(ve)-.15 G .022
(rride this and force the suspension.).15 F .023(The return status is)
5.023 F 2.5(0u)144 688.8 S(nless the shell is a login shell and)-2.5 E
5.023 F 2.5(0u)144 724.8 S(nless the shell is a login shell and)-2.5 E
F1<ad66>2.5 E F0(is not supplied, or if job control is not enabled.)2.5
E F1(test)108 705.6 Q F3 -.2(ex)2.5 G(pr).2 E F1([)108 717.6 Q F3 -.2
(ex)2.5 G(pr).2 E F1(])2.5 E F0 .878
(Return a status of 0 \(true\) or 1 \(f)144 717.6 R .877
(alse\) depending on the e)-.1 F -.25(va)-.25 G .877
(luation of the conditional e).25 F(xpression)-.15 E F3 -.2(ex)144 729.6
S(pr).2 E F0 5.53(.E).73 G .53
(ach operator and operand must be a separate ar)-5.53 F 3.03
(gument. Expressions)-.18 F .53(are composed of the)3.03 F(GNU Bash-4.2)
72 768 Q(2004 Apr 20)148.735 E(20)198.725 E 0 Cg EP
E(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(20)198.725 E 0 Cg EP
%%Page: 21 21
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E 3.08(primaries described abo)144 84 R 3.38
-.15(ve u)-.15 H(nder).15 E/F1 9/Times-Bold@0 SF(CONDITION)5.58 E 3.079
(AL EXPRESSIONS)-.18 F/F2 9/Times-Roman@0 SF(.)A/F3 10/Times-Bold@0 SF
(test)7.579 E F0 3.079(does not accept an)5.579 F(y)-.15 E
(options, nor does it accept and ignore an ar)144 96 Q(gument of)-.18 E
F3<adad>2.5 E F0(as signifying the end of options.)2.5 E .785
(Expressions may be combined using the follo)144 114 R .786
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF(test)108 84 Q/F2 10
/Times-Italic@0 SF -.2(ex)2.5 G(pr).2 E F1([)108 96 Q F2 -.2(ex)2.5 G
(pr).2 E F1(])2.5 E F0 .878(Return a status of 0 \(true\) or 1 \(f)144
96 R .877(alse\) depending on the e)-.1 F -.25(va)-.25 G .877
(luation of the conditional e).25 F(xpression)-.15 E F2 -.2(ex)144 108 S
(pr).2 E F0 5.53(.E).73 G .53
(ach operator and operand must be a separate ar)-5.53 F 3.03
(gument. Expressions)-.18 F .53(are composed of the)3.03 F 3.08
(primaries described abo)144 120 R 3.38 -.15(ve u)-.15 H(nder).15 E/F3 9
/Times-Bold@0 SF(CONDITION)5.58 E 3.079(AL EXPRESSIONS)-.18 F/F4 9
/Times-Roman@0 SF(.)A F1(test)7.579 E F0 3.079(does not accept an)5.579
F(y)-.15 E(options, nor does it accept and ignore an ar)144 132 Q
(gument of)-.18 E F1<adad>2.5 E F0(as signifying the end of options.)2.5
E .785(Expressions may be combined using the follo)144 150 R .786
(wing operators, listed in decreasing order of prece-)-.25 F 3.412
(dence. The)144 126 R -.25(eva)3.412 G .912
(dence. The)144 162 R -.25(eva)3.412 G .912
(luation depends on the number of ar).25 F .911(guments; see belo)-.18 F
4.711 -.65(w. O)-.25 H .911(perator precedence is).65 F
(used when there are \214v)144 138 Q 2.5(eo)-.15 G 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments.)-.18 E F3(!)144 150 Q/F4 10/Times-Italic@0 SF -.2(ex)2.5
G(pr).2 E F0 -.35(Tr)180 150 S(ue if).35 E F4 -.2(ex)2.5 G(pr).2 E F0
(is f)3.23 E(alse.)-.1 E F3(\()144 162 Q F4 -.2(ex)2.5 G(pr).2 E F3(\))
2.5 E F0 .26(Returns the v)180 162 R .26(alue of)-.25 F F4 -.2(ex)2.76 G
(pr).2 E F0 5.26(.T)C .26(his may be used to o)-5.26 F -.15(ve)-.15 G
.26(rride the normal precedence of opera-).15 F(tors.)180 174 Q F4 -.2
(ex)144 186 S(pr1).2 E F0<ad>2.5 E F3(a)A F4 -.2(ex)2.5 G(pr2).2 E F0
-.35(Tr)180 198 S(ue if both).35 E F4 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E
F4 -.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F4 -.2(ex)144 210 S(pr1).2
E F0<ad>2.5 E F3(o)A F4 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 222 S
(ue if either).35 E F4 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F4 -.2(ex)2.5 G
(pr2).2 E F0(is true.)2.52 E F3(test)144 238.8 Q F0(and)2.5 E F3([)2.5 E
(used when there are \214v)144 174 Q 2.5(eo)-.15 G 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments.)-.18 E F1(!)144 186 Q F2 -.2(ex)2.5 G(pr).2 E F0 -.35
(Tr)180 186 S(ue if).35 E F2 -.2(ex)2.5 G(pr).2 E F0(is f)3.23 E(alse.)
-.1 E F1(\()144 198 Q F2 -.2(ex)2.5 G(pr).2 E F1(\))2.5 E F0 .26
(Returns the v)180 198 R .26(alue of)-.25 F F2 -.2(ex)2.76 G(pr).2 E F0
5.26(.T)C .26(his may be used to o)-5.26 F -.15(ve)-.15 G .26
(rride the normal precedence of opera-).15 F(tors.)180 210 Q F2 -.2(ex)
144 222 S(pr1).2 E F0<ad>2.5 E F1(a)A F2 -.2(ex)2.5 G(pr2).2 E F0 -.35
(Tr)180 234 S(ue if both).35 E F2 -.2(ex)2.5 G(pr1).2 E F0(and)2.5 E F2
-.2(ex)2.5 G(pr2).2 E F0(are true.)2.52 E F2 -.2(ex)144 246 S(pr1).2 E
F0<ad>2.5 E F1(o)A F2 -.2(ex)2.5 G(pr2).2 E F0 -.35(Tr)180 258 S
(ue if either).35 E F2 -.2(ex)2.5 G(pr1).2 E F0(or)2.5 E F2 -.2(ex)2.5 G
(pr2).2 E F0(is true.)2.52 E F1(test)144 274.8 Q F0(and)2.5 E F1([)2.5 E
F0 -.25(eva)2.5 G(luate conditional e).25 E
(xpressions using a set of rules based on the number of ar)-.15 E
(guments.)-.18 E 2.5(0a)144 256.8 S -.18(rg)-2.5 G(uments).18 E(The e)
180 268.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 280.8 S -.18
(rg)-2.5 G(ument).18 E(The e)180 292.8 Q
(guments.)-.18 E 2.5(0a)144 292.8 S -.18(rg)-2.5 G(uments).18 E(The e)
180 304.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(1a)144 316.8 S -.18
(rg)-2.5 G(ument).18 E(The e)180 328.8 Q
(xpression is true if and only if the ar)-.15 E(gument is not null.)-.18
E 2.5(2a)144 304.8 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar)
180 316.8 R .37(gument is)-.18 F F3(!)2.87 E F0 2.87(,t)C .37(he e)-2.87
E 2.5(2a)144 340.8 S -.18(rg)-2.5 G(uments).18 E .37(If the \214rst ar)
180 352.8 R .37(gument is)-.18 F F1(!)2.87 E F0 2.87(,t)C .37(he e)-2.87
F .37(xpression is true if and only if the second ar)-.15 F .37
(gument is null.)-.18 F .379(If the \214rst ar)180 328.8 R .38
(gument is null.)-.18 F .379(If the \214rst ar)180 364.8 R .38
(gument is one of the unary conditional operators listed abo)-.18 F .68
-.15(ve u)-.15 H(nder).15 E F1(CONDI-)2.88 E(TION)180 340.8 Q .553
(AL EXPRESSIONS)-.18 F F2(,)A F0 .552(the e)2.802 F .552
-.15(ve u)-.15 H(nder).15 E F3(CONDI-)2.88 E(TION)180 376.8 Q .553
(AL EXPRESSIONS)-.18 F F4(,)A F0 .552(the e)2.802 F .552
(xpression is true if the unary test is true.)-.15 F .552
(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 352.8 Q
(If the \214rst ar)5.552 F(gu-)-.18 E(ment is not a v)180 388.8 Q
(alid unary conditional operator)-.25 E 2.5(,t)-.4 G(he e)-2.5 E
(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 364.8 S -.18(rg)-2.5 G
(uments).18 E .236(The follo)180 376.8 R .236
(xpression is f)-.15 E(alse.)-.1 E 2.5(3a)144 400.8 S -.18(rg)-2.5 G
(uments).18 E .236(The follo)180 412.8 R .236
(wing conditions are applied in the order listed.)-.25 F .236
(If the second ar)5.236 F .236(gument is one of)-.18 F .855
(the binary conditional operators listed abo)180 388.8 R 1.155 -.15
(ve u)-.15 H(nder).15 E F1(CONDITION)3.355 E .855(AL EXPRESSIONS)-.18 F
F2(,)A F0(the)3.104 E .578(result of the e)180 400.8 R .578(xpression i\
(the binary conditional operators listed abo)180 424.8 R 1.155 -.15
(ve u)-.15 H(nder).15 E F3(CONDITION)3.355 E .855(AL EXPRESSIONS)-.18 F
F4(,)A F0(the)3.104 E .578(result of the e)180 436.8 R .578(xpression i\
s the result of the binary test using the \214rst and third ar)-.15 F
(guments)-.18 E 1.333(as operands.)180 412.8 R(The)6.333 E F3<ad61>3.833
E F0(and)3.833 E F3<ad6f>3.832 E F0 1.332
(guments)-.18 E 1.333(as operands.)180 448.8 R(The)6.333 E F1<ad61>3.833
E F0(and)3.833 E F1<ad6f>3.832 E F0 1.332
(operators are considered binary operators when there are)3.832 F .558
(three ar)180 424.8 R 3.058(guments. If)-.18 F .558(the \214rst ar)3.058
F .558(gument is)-.18 F F3(!)3.058 E F0 3.058(,t)C .558(he v)-3.058 F
(three ar)180 460.8 R 3.058(guments. If)-.18 F .558(the \214rst ar)3.058
F .558(gument is)-.18 F F1(!)3.058 E F0 3.058(,t)C .558(he v)-3.058 F
.558(alue is the ne)-.25 F -.05(ga)-.15 G .558(tion of the tw).05 F
(o-ar)-.1 E(gument)-.18 E .521(test using the second and third ar)180
436.8 R 3.021(guments. If)-.18 F .521(the \214rst ar)3.021 F .52
(gument is e)-.18 F(xactly)-.15 E F3(\()3.02 E F0 .52(and the third)3.02
F(ar)180 448.8 Q .485(gument is e)-.18 F(xactly)-.15 E F3(\))2.985 E F0
472.8 R 3.021(guments. If)-.18 F .521(the \214rst ar)3.021 F .52
(gument is e)-.18 F(xactly)-.15 E F1(\()3.02 E F0 .52(and the third)3.02
F(ar)180 484.8 Q .485(gument is e)-.18 F(xactly)-.15 E F1(\))2.985 E F0
2.985(,t)C .485(he result is the one-ar)-2.985 F .485
(gument test of the second ar)-.18 F 2.985(gument. Other)-.18 F(-)-.2 E
(wise, the e)180 460.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(4a)144
472.8 S -.18(rg)-2.5 G(uments).18 E .385(If the \214rst ar)180 484.8 R
.385(gument is)-.18 F F3(!)2.885 E F0 2.885(,t)C .385
(wise, the e)180 496.8 Q(xpression is f)-.15 E(alse.)-.1 E 2.5(4a)144
508.8 S -.18(rg)-2.5 G(uments).18 E .385(If the \214rst ar)180 520.8 R
.385(gument is)-.18 F F1(!)2.885 E F0 2.885(,t)C .385
(he result is the ne)-2.885 F -.05(ga)-.15 G .384(tion of the three-ar)
.05 F .384(gument e)-.18 F .384(xpression com-)-.15 F 1.647
(posed of the remaining ar)180 496.8 R 4.147(guments. Otherwise,)-.18 F
(posed of the remaining ar)180 532.8 R 4.147(guments. Otherwise,)-.18 F
1.647(the e)4.147 F 1.648(xpression is parsed and e)-.15 F -.25(va)-.25
G(luated).25 E(according to precedence using the rules listed abo)180
508.8 Q -.15(ve)-.15 G(.).15 E 2.5(5o)144 520.8 S 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments)-.18 E 1.635(The e)180 532.8 R 1.635
544.8 Q -.15(ve)-.15 G(.).15 E 2.5(5o)144 556.8 S 2.5(rm)-2.5 G(ore ar)
-2.5 E(guments)-.18 E 1.635(The e)180 568.8 R 1.635
(xpression is parsed and e)-.15 F -.25(va)-.25 G 1.635
(luated according to precedence using the rules listed).25 F(abo)180
544.8 Q -.15(ve)-.15 G(.).15 E(When used with)144 562.8 Q F3(test)2.5 E
F0(or)2.5 E F3([)2.5 E F0 2.5(,t)C(he)-2.5 E F3(<)2.5 E F0(and)2.5 E F3
580.8 Q -.15(ve)-.15 G(.).15 E(When used with)144 598.8 Q F1(test)2.5 E
F0(or)2.5 E F1([)2.5 E F0 2.5(,t)C(he)-2.5 E F1(<)2.5 E F0(and)2.5 E F1
(>)2.5 E F0(operators sort le)2.5 E
(xicographically using ASCII ordering.)-.15 E F3(times)108 579.6 Q F0
(xicographically using ASCII ordering.)-.15 E F1(times)108 615.6 Q F0
1.229(Print the accumulated user and system times for the shell and for\
processes run from the shell.)144 579.6 R(The return status is 0.)144
591.6 Q F3(trap)108 608.4 Q F0([)2.5 E F3(\255lp)A F0 2.5(][)C([)-2.5 E
F4(ar)A(g)-.37 E F0(])A F4(sigspec)2.5 E F0(...])2.5 E .703(The command)
144 620.4 R F4(ar)3.533 E(g)-.37 E F0 .703(is to be read and e)3.423 F
processes run from the shell.)144 615.6 R(The return status is 0.)144
627.6 Q F1(trap)108 644.4 Q F0([)2.5 E F1(\255lp)A F0 2.5(][)C([)-2.5 E
F2(ar)A(g)-.37 E F0(])A F2(sigspec)2.5 E F0(...])2.5 E .703(The command)
144 656.4 R F2(ar)3.533 E(g)-.37 E F0 .703(is to be read and e)3.423 F
-.15(xe)-.15 G .702(cuted when the shell recei).15 F -.15(ve)-.25 G
3.202(ss).15 G(ignal\(s\))-3.202 E F4(sigspec)3.202 E F0 5.702(.I).31 G
(f)-5.702 E F4(ar)3.532 E(g)-.37 E F0(is)3.422 E .608
(absent \(and there is a single)144 632.4 R F4(sigspec)3.108 E F0 3.108
(\)o)C(r)-3.108 E F3<ad>3.108 E F0 3.108(,e)C .608
3.202(ss).15 G(ignal\(s\))-3.202 E F2(sigspec)3.202 E F0 5.702(.I).31 G
(f)-5.702 E F2(ar)3.532 E(g)-.37 E F0(is)3.422 E .608
(absent \(and there is a single)144 668.4 R F2(sigspec)3.108 E F0 3.108
(\)o)C(r)-3.108 E F1<ad>3.108 E F0 3.108(,e)C .608
(ach speci\214ed signal is reset to its original disposition)-3.108 F
.659(\(the v)144 644.4 R .659(alue it had upon entrance to the shell\).)
-.25 F(If)5.658 E F4(ar)3.488 E(g)-.37 E F0 .658
(is the null string the signal speci\214ed by each)3.378 F F4(sigspec)
144.34 656.4 Q F0 .58(is ignored by the shell and by the commands it in)
3.39 F -.2(vo)-.4 G -.1(ke).2 G 3.081(s. If).1 F F4(ar)3.411 E(g)-.37 E
F0 .581(is not present and)3.301 F F3<ad70>3.081 E F0(has)3.081 E 1.215
(been supplied, then the trap commands associated with each)144 668.4 R
F4(sigspec)4.054 E F0 1.214(are displayed.)4.024 F 1.214(If no ar)6.214
F(gu-)-.18 E .86(ments are supplied or if only)144 680.4 R F3<ad70>3.36
E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F3(trap)3.36 E F0 .86
(prints the list of commands associated with each)3.36 F 2.83
(signal. The)144 692.4 R F3<ad6c>2.83 E F0 .33(option causes the shell \
to print a list of signal names and their corresponding num-)2.83 F 4.31
(bers. Each)144 704.4 R F4(sigspec)4.65 E F0 1.811
(is either a signal name de\214ned in <)4.62 F F4(signal.h)A F0 1.811
(>, or a signal number)B 6.811(.S)-.55 G(ignal)-6.811 E
(names are case insensiti)144 716.4 Q .3 -.15(ve a)-.25 H(nd the).15 E
F1(SIG)2.5 E F0(pre\214x is optional.)2.25 E(GNU Bash-4.2)72 768 Q
(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP
.659(\(the v)144 680.4 R .659(alue it had upon entrance to the shell\).)
-.25 F(If)5.658 E F2(ar)3.488 E(g)-.37 E F0 .658
(is the null string the signal speci\214ed by each)3.378 F F2(sigspec)
144.34 692.4 Q F0 .58(is ignored by the shell and by the commands it in)
3.39 F -.2(vo)-.4 G -.1(ke).2 G 3.081(s. If).1 F F2(ar)3.411 E(g)-.37 E
F0 .581(is not present and)3.301 F F1<ad70>3.081 E F0(has)3.081 E 1.215
(been supplied, then the trap commands associated with each)144 704.4 R
F2(sigspec)4.054 E F0 1.214(are displayed.)4.024 F 1.214(If no ar)6.214
F(gu-)-.18 E .86(ments are supplied or if only)144 716.4 R F1<ad70>3.36
E F0 .86(is gi)3.36 F -.15(ve)-.25 G(n,).15 E F1(trap)3.36 E F0 .86
(prints the list of commands associated with each)3.36 F 4.327
(signal. The)144 728.4 R F1<ad6c>4.327 E F0 1.826(option causes the she\
ll to print a list of signal names and their corresponding)4.327 F
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(21)198.725 E 0 Cg EP
%%Page: 22 22
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E 1.649(If a)144 84 R/F1 10/Times-Italic@0 SF
(sigspec)4.489 E F0(is)4.459 E/F2 9/Times-Bold@0 SF(EXIT)4.149 E F0
1.649(\(0\) the command)3.899 F F1(ar)4.479 E(g)-.37 E F0 1.649(is e)
4.369 F -.15(xe)-.15 G 1.649(cuted on e).15 F 1.648(xit from the shell.)
-.15 F 1.648(If a)6.648 F F1(sigspec)4.488 E F0(is)4.458 E F2(DEB)144 96
Q(UG)-.09 E/F3 9/Times-Roman@0 SF(,)A F0 1.167(the command)3.417 F F1
(ar)3.997 E(g)-.37 E F0 1.167(is e)3.887 F -.15(xe)-.15 G 1.167
E(UIL)-.1 E(TINS\(1\))-.92 E 3.125(numbers. Each)144 84 R/F1 10
/Times-Italic@0 SF(sigspec)3.465 E F0 .625
(is either a signal name de\214ned in <)3.435 F F1(signal.h)A F0 .626
(>, or a signal number)B 5.626(.S)-.55 G(ignal)-5.626 E
(names are case insensiti)144 96 Q .3 -.15(ve a)-.25 H(nd the).15 E/F2 9
/Times-Bold@0 SF(SIG)2.5 E F0(pre\214x is optional.)2.25 E 1.649(If a)
144 114 R F1(sigspec)4.489 E F0(is)4.459 E F2(EXIT)4.149 E F0 1.649
(\(0\) the command)3.899 F F1(ar)4.479 E(g)-.37 E F0 1.649(is e)4.369 F
-.15(xe)-.15 G 1.649(cuted on e).15 F 1.648(xit from the shell.)-.15 F
1.648(If a)6.648 F F1(sigspec)4.488 E F0(is)4.458 E F2(DEB)144 126 Q(UG)
-.09 E/F3 9/Times-Roman@0 SF(,)A F0 1.167(the command)3.417 F F1(ar)
3.997 E(g)-.37 E F0 1.167(is e)3.887 F -.15(xe)-.15 G 1.167
(cuted before e).15 F -.15(ve)-.25 G(ry).15 E F1 1.168(simple command)
3.667 F F0(,)A F1(for)3.668 E F0(command,)3.668 E F1(case)3.668 E F0
(com-)3.668 E(mand,)144 108 Q F1(select)2.647 E F0 .147(command, e)2.647
(com-)3.668 E(mand,)144 138 Q F1(select)2.647 E F0 .147(command, e)2.647
F -.15(ve)-.25 G .147(ry arithmetic).15 F F1(for)2.647 E F0 .146
(command, and before the \214rst command e)2.647 F -.15(xe)-.15 G .146
(cutes in a).15 F .145(shell function \(see)144 120 R F2 .145
(cutes in a).15 F .145(shell function \(see)144 150 R F2 .145
(SHELL GRAMMAR)2.645 F F0(abo)2.395 E -.15(ve)-.15 G 2.646(\). Refer).15
F .146(to the description of the)2.646 F/F4 10/Times-Bold@0 SF(extdeb)
2.646 E(ug)-.2 E F0 .146(option to)2.646 F(the)144 132 Q F4(shopt)3.201
2.646 E(ug)-.2 E F0 .146(option to)2.646 F(the)144 162 Q F4(shopt)3.201
E F0 -.2(bu)3.201 G .7(iltin for details of its ef).2 F .7(fect on the)
-.25 F F4(DEB)3.2 E(UG)-.1 E F0 3.2(trap. If)3.2 F(a)3.2 E F1(sigspec)
3.54 E F0(is)3.51 E F2(RETURN)3.2 E F3(,)A F0 .7(the com-)2.95 F(mand)
144 144 Q F1(ar)3.473 E(g)-.37 E F0 .643(is e)3.363 F -.15(xe)-.15 G
144 174 Q F1(ar)3.473 E(g)-.37 E F0 .643(is e)3.363 F -.15(xe)-.15 G
.643(cuted each time a shell function or a script e).15 F -.15(xe)-.15 G
.644(cuted with the).15 F F4(.)3.144 E F0(or)3.144 E F4(sour)3.144 E(ce)
-.18 E F0 -.2(bu)3.144 G(iltins).2 E(\214nishes e)144 156 Q -.15(xe)-.15
G(cuting.).15 E .961(If a)144 174 R F1(sigspec)3.801 E F0(is)3.771 E F2
-.18 E F0 -.2(bu)3.144 G(iltins).2 E(\214nishes e)144 186 Q -.15(xe)-.15
G(cuting.).15 E .961(If a)144 204 R F1(sigspec)3.801 E F0(is)3.771 E F2
(ERR)3.461 E F3(,)A F0 .961(the command)3.211 F F1(ar)3.791 E(g)-.37 E
F0 .961(is e)3.681 F -.15(xe)-.15 G .961(cuted whene).15 F -.15(ve)-.25
G 3.461(ra).15 G .96(pipeline \(which may consist of a)-.001 F .185(sin\
gle simple command\), a list, or a compound command returns a non\255ze\
ro e)144 186 R .185(xit status, subject to)-.15 F .452(the follo)144 198
ro e)144 216 R .185(xit status, subject to)-.15 F .452(the follo)144 228
R .452(wing conditions.)-.25 F(The)5.452 E F2(ERR)2.952 E F0 .451
(trap is not e)2.701 F -.15(xe)-.15 G .451(cuted if the f).15 F .451
(ailed command is part of the com-)-.1 F .387
(mand list immediately follo)144 210 R .387(wing a)-.25 F F4(while)2.887
(mand list immediately follo)144 240 R .387(wing a)-.25 F F4(while)2.887
E F0(or)2.887 E F4(until)2.888 E F0 -.1(ke)2.888 G(yw)-.05 E .388
(ord, part of the test in an)-.1 F F1(if)2.898 E F0 .388
(statement, part)4.848 F .778(of a command e)144 222 R -.15(xe)-.15 G
(statement, part)4.848 F .778(of a command e)144 252 R -.15(xe)-.15 G
.778(cuted in a).15 F F4(&&)3.278 E F0(or)3.278 E F4(||)3.278 E F0 .778
(list e)3.278 F .778(xcept the command follo)-.15 F .778
(wing the \214nal)-.25 F F4(&&)3.278 E F0(or)3.278 E F4(||)3.277 E F0
3.277(,a)C -.15(ny)-3.277 G 1.28(command in a pipeline b)144 234 R 1.28
3.277(,a)C -.15(ny)-3.277 G 1.28(command in a pipeline b)144 264 R 1.28
(ut the last, or if the command')-.2 F 3.78(sr)-.55 G 1.28(eturn v)-3.78
F 1.28(alue is being in)-.25 F -.15(ve)-.4 G 1.28(rted using).15 F F4(!)
3.78 E F0(.)A(These are the same conditions obe)144 246 Q(yed by the)
3.78 E F0(.)A(These are the same conditions obe)144 276 Q(yed by the)
-.15 E F4(err)2.5 E(exit)-.18 E F0(\()2.5 E F4<ad65>A F0 2.5(\)o)C
(ption.)-2.5 E 1.095
(Signals ignored upon entry to the shell cannot be trapped or reset.)144
264 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662
(being ignored are reset to their original v)144 276 R .662
294 R -.35(Tr)6.095 G 1.095(apped signals that are not).35 F .662
(being ignored are reset to their original v)144 306 R .662
(alues in a subshell or subshell en)-.25 F .662(vironment when one is)
-.4 F 2.5(created. The)144 288 R(return status is f)2.5 E(alse if an)-.1
-.4 F 2.5(created. The)144 318 R(return status is f)2.5 E(alse if an)-.1
E(y)-.15 E F1(sigspec)2.84 E F0(is in)2.81 E -.25(va)-.4 G
(lid; otherwise).25 E F4(trap)2.5 E F0(returns true.)2.5 E F4(type)108
304.8 Q F0([)2.5 E F4(\255aftpP)A F0(])A F1(name)2.5 E F0([)2.5 E F1
(name)A F0(...])2.5 E -.4(Wi)144 316.8 S .174
334.8 Q F0([)2.5 E F4(\255aftpP)A F0(])A F1(name)2.5 E F0([)2.5 E F1
(name)A F0(...])2.5 E -.4(Wi)144 346.8 S .174
(th no options, indicate ho).4 F 2.674(we)-.25 G(ach)-2.674 E F1(name)
3.034 E F0 -.1(wo)2.854 G .173
(uld be interpreted if used as a command name.).1 F .173(If the)5.173 F
F4<ad74>144 328.8 Q F0 .842(option is used,)3.342 F F4(type)3.342 E F0
F4<ad74>144 358.8 Q F0 .842(option is used,)3.342 F F4(type)3.342 E F0
.843(prints a string which is one of)3.343 F F1(alias)3.343 E F0(,).27 E
F1 -.1(ke)3.343 G(ywor)-.2 E(d)-.37 E F0(,).77 E F1(function)3.343 E F0
(,).24 E F1 -.2(bu)3.343 G(iltin).2 E F0 3.343(,o).24 G(r)-3.343 E F1
(\214le)5.253 E F0(if)3.523 E F1(name)144.36 340.8 Q F0 .087
(\214le)5.253 E F0(if)3.523 E F1(name)144.36 370.8 Q F0 .087
(is an alias, shell reserv)2.767 F .087(ed w)-.15 F .087
(ord, function, b)-.1 F .086(uiltin, or disk \214le, respecti)-.2 F -.15
(ve)-.25 G(ly).15 E 5.086(.I)-.65 G 2.586(ft)-5.086 G(he)-2.586 E F1
(name)2.946 E F0 .086(is not)2.766 F .118
(found, then nothing is printed, and an e)144 352.8 R .118
(found, then nothing is printed, and an e)144 382.8 R .118
(xit status of f)-.15 F .118(alse is returned.)-.1 F .119(If the)5.119 F
F4<ad70>2.619 E F0 .119(option is used,)2.619 F F4(type)2.619 E F0 .855
(either returns the name of the disk \214le that w)144 364.8 R .855
(either returns the name of the disk \214le that w)144 394.8 R .855
(ould be e)-.1 F -.15(xe)-.15 G .855(cuted if).15 F F1(name)3.715 E F0
.855(were speci\214ed as a com-)3.535 F .64(mand name, or nothing if)144
376.8 R/F5 10/Courier@0 SF .64(type -t name)3.14 F F0 -.1(wo)3.14 G .641
406.8 R/F5 10/Courier@0 SF .64(type -t name)3.14 F F0 -.1(wo)3.14 G .641
(uld not return).1 F F1(\214le)3.141 E F0 5.641(.T).18 G(he)-5.641 E F4
<ad50>3.141 E F0 .641(option forces a)3.141 F F2 -.666(PA)3.141 G(TH)
-.189 E F0 .113(search for each)144 388.8 R F1(name)2.613 E F0 2.613(,e)
-.189 E F0 .113(search for each)144 418.8 R F1(name)2.613 E F0 2.613(,e)
C -.15(ve)-2.863 G 2.613(ni).15 G(f)-2.613 E F5 .113(type -t name)2.613
F F0 -.1(wo)2.613 G .113(uld not return).1 F F1(\214le)2.613 E F0 5.113
(.I).18 G 2.613(fa)-5.113 G .112(command is hashed,)-.001 F F4<ad70>
2.612 E F0(and)144 400.8 Q F4<ad50>3.23 E F0 .73(print the hashed v)3.23
2.612 E F0(and)144 430.8 Q F4<ad50>3.23 E F0 .73(print the hashed v)3.23
F .731
(alue, which is not necessarily the \214le that appears \214rst in)-.25
F F2 -.666(PA)3.231 G(TH)-.189 E F3(.)A F0 .731(If the)5.231 F F4<ad61>
144 412.8 Q F0 1.749(option is used,)4.249 F F4(type)4.248 E F0 1.748
144 442.8 Q F0 1.749(option is used,)4.249 F F4(type)4.248 E F0 1.748
(prints all of the places that contain an e)4.248 F -.15(xe)-.15 G 1.748
(cutable named).15 F F1(name)4.248 E F0 6.748(.T).18 G(his)-6.748 E .744
(includes aliases and functions, if and only if the)144 424.8 R F4<ad70>
(includes aliases and functions, if and only if the)144 454.8 R F4<ad70>
3.244 E F0 .744(option is not also used.)3.244 F .744
(The table of hashed)5.744 F 1.223(commands is not consulted when using)
144 436.8 R F4<ad61>3.723 E F0 6.223(.T)C(he)-6.223 E F4<ad66>3.723 E F0
144 466.8 R F4<ad61>3.723 E F0 6.223(.T)C(he)-6.223 E F4<ad66>3.723 E F0
1.223(option suppresses shell function lookup, as)3.723 F .325(with the)
144 448.8 R F4(command)2.825 E F0 -.2(bu)2.825 G(iltin.).2 E F4(type)
144 478.8 R F4(command)2.825 E F0 -.2(bu)2.825 G(iltin.).2 E F4(type)
5.325 E F0 .325(returns true if all of the ar)2.825 F .326
(guments are found, f)-.18 F .326(alse if an)-.1 F 2.826(ya)-.15 G .326
(re not)-2.826 F(found.)144 460.8 Q F4(ulimit)108 477.6 Q F0([)2.5 E F4
(re not)-2.826 F(found.)144 490.8 Q F4(ulimit)108 507.6 Q F0([)2.5 E F4
(\255HSabcde\214klmnpqrstuvxPT)A F0([)2.5 E F1(limit)A F0(]])A(Pro)144
489.6 Q .244(vides control o)-.15 F -.15(ve)-.15 G 2.744(rt).15 G .244
519.6 Q .244(vides control o)-.15 F -.15(ve)-.15 G 2.744(rt).15 G .244
(he resources a)-2.744 F -.25(va)-.2 G .244
(ilable to the shell and to processes started by it, on systems).25 F
.943(that allo)144 501.6 R 3.443(ws)-.25 G .943(uch control.)-3.443 F
.943(that allo)144 531.6 R 3.443(ws)-.25 G .943(uch control.)-3.443 F
(The)5.943 E F4<ad48>3.443 E F0(and)3.443 E F4<ad53>3.444 E F0 .944
(options specify that the hard or soft limit is set for the)3.444 F(gi)
144 513.6 Q -.15(ve)-.25 G 2.709(nr).15 G 2.709(esource. A)-2.709 F .208
144 543.6 Q -.15(ve)-.25 G 2.709(nr).15 G 2.709(esource. A)-2.709 F .208
(hard limit cannot be increased by a non-root user once it is set; a so\
ft limit may)2.709 F .425(be increased up to the v)144 525.6 R .425
ft limit may)2.709 F .425(be increased up to the v)144 555.6 R .425
(alue of the hard limit.)-.25 F .426(If neither)5.425 F F4<ad48>2.926 E
F0(nor)2.926 E F4<ad53>2.926 E F0 .426
(is speci\214ed, both the soft and)2.926 F .139(hard limits are set.)144
537.6 R .139(The v)5.139 F .139(alue of)-.25 F F1(limit)2.729 E F0 .139
567.6 R .139(The v)5.139 F .139(alue of)-.25 F F1(limit)2.729 E F0 .139
(can be a number in the unit speci\214ed for the resource or one)3.319 F
.741(of the special v)144 549.6 R(alues)-.25 E F4(hard)3.241 E F0(,)A F4
.741(of the special v)144 579.6 R(alues)-.25 E F4(hard)3.241 E F0(,)A F4
(soft)3.241 E F0 3.241(,o)C(r)-3.241 E F4(unlimited)3.241 E F0 3.241(,w)
C .741(hich stand for the current hard limit, the current)-3.241 F .78
(soft limit, and no limit, respecti)144 561.6 R -.15(ve)-.25 G(ly).15 E
(soft limit, and no limit, respecti)144 591.6 R -.15(ve)-.25 G(ly).15 E
5.78(.I)-.65 G(f)-5.78 E F1(limit)3.37 E F0 .78
(is omitted, the current v)3.96 F .78(alue of the soft limit of the)-.25
F .498(resource is printed, unless the)144 573.6 R F4<ad48>2.999 E F0
F .498(resource is printed, unless the)144 603.6 R F4<ad48>2.999 E F0
.499(option is gi)2.999 F -.15(ve)-.25 G 2.999(n. When).15 F .499
(more than one resource is speci\214ed, the)2.999 F
(limit name and unit are printed before the v)144 585.6 Q 2.5
(limit name and unit are printed before the v)144 615.6 Q 2.5
(alue. Other)-.25 F(options are interpreted as follo)2.5 E(ws:)-.25 E F4
<ad61>144 597.6 Q F0(All current limits are reported)180 597.6 Q F4
<ad62>144 609.6 Q F0(The maximum sock)180 609.6 Q(et b)-.1 E(uf)-.2 E
(fer size)-.25 E F4<ad63>144 621.6 Q F0
(The maximum size of core \214les created)180 621.6 Q F4<ad64>144 633.6
Q F0(The maximum size of a process')180 633.6 Q 2.5(sd)-.55 G(ata se)
-2.5 E(gment)-.15 E F4<ad65>144 645.6 Q F0
(The maximum scheduling priority \("nice"\))180 645.6 Q F4<ad66>144
657.6 Q F0
<ad61>144 627.6 Q F0(All current limits are reported)180 627.6 Q F4
<ad62>144 639.6 Q F0(The maximum sock)180 639.6 Q(et b)-.1 E(uf)-.2 E
(fer size)-.25 E F4<ad63>144 651.6 Q F0
(The maximum size of core \214les created)180 651.6 Q F4<ad64>144 663.6
Q F0(The maximum size of a process')180 663.6 Q 2.5(sd)-.55 G(ata se)
-2.5 E(gment)-.15 E F4<ad65>144 675.6 Q F0
(The maximum scheduling priority \("nice"\))180 675.6 Q F4<ad66>144
687.6 Q F0
(The maximum size of \214les written by the shell and its children)180
657.6 Q F4<ad69>144 669.6 Q F0(The maximum number of pending signals)180
669.6 Q F4<ad6b>144 681.6 Q F0
(The maximum number of kqueues that may be allocated)180 681.6 Q F4
<ad6c>144 693.6 Q F0(The maximum size that may be lock)180 693.6 Q
(ed into memory)-.1 E F4<ad6d>144 705.6 Q F0
(The maximum resident set size \(man)180 705.6 Q 2.5(ys)-.15 G
(ystems do not honor this limit\))-2.5 E F4<ad6e>144 717.6 Q F0 .791(Th\
e maximum number of open \214le descriptors \(most systems do not allo)
180 717.6 R 3.29(wt)-.25 G .79(his v)-3.29 F .79(alue to)-.25 F
(be set\))180 729.6 Q(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(22)
198.725 E 0 Cg EP
687.6 Q F4<ad69>144 699.6 Q F0(The maximum number of pending signals)180
699.6 Q F4<ad6b>144 711.6 Q F0
(The maximum number of kqueues that may be allocated)180 711.6 Q
(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(22)198.725 E 0 Cg EP
%%Page: 23 23
%%BeginPageSetup
BP
%%EndPageSetup
/F0 10/Times-Roman@0 SF -.35(BA)72 48 S(SH_B).35 E(UIL)-.1 E 87.61
(TINS\(1\) General)-.92 F(Commands Manual)2.5 E -.35(BA)90.11 G(SH_B).35
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF<ad70>144 84 Q F0
(The pipe size in 512-byte blocks \(this may not be set\))180 84 Q F1
<ad71>144 96 Q F0(The maximum number of bytes in POSIX message queues)
180 96 Q F1<ad72>144 108 Q F0(The maximum real-time scheduling priority)
180 108 Q F1<ad73>144 120 Q F0(The maximum stack size)180 120 Q F1<ad74>
144 132 Q F0(The maximum amount of cpu time in seconds)180 132 Q F1
<ad75>144 144 Q F0(The maximum number of processes a)180 144 Q -.25(va)
-.2 G(ilable to a single user).25 E F1<ad76>144 156 Q F0 .47
(The maximum amount of virtual memory a)180 156 R -.25(va)-.2 G .47
(ilable to the shell and, on some systems, to).25 F(its children)180 168
Q F1<ad78>144 180 Q F0(The maximum number of \214le locks)180 180 Q F1
<ad50>144 192 Q F0(The maximum number of pseudoterminals)180 192 Q F1
<ad54>144 204 Q F0(The maximum number of threads)180 204 Q(If)144 220.8
E(UIL)-.1 E(TINS\(1\))-.92 E/F1 10/Times-Bold@0 SF<ad6c>144 84 Q F0
(The maximum size that may be lock)180 84 Q(ed into memory)-.1 E F1
<ad6d>144 96 Q F0(The maximum resident set size \(man)180 96 Q 2.5(ys)
-.15 G(ystems do not honor this limit\))-2.5 E F1<ad6e>144 108 Q F0 .791
(The maximum number of open \214le descriptors \(most systems do not al\
lo)180 108 R 3.29(wt)-.25 G .79(his v)-3.29 F .79(alue to)-.25 F
(be set\))180 120 Q F1<ad70>144 132 Q F0
(The pipe size in 512-byte blocks \(this may not be set\))180 132 Q F1
<ad71>144 144 Q F0(The maximum number of bytes in POSIX message queues)
180 144 Q F1<ad72>144 156 Q F0
(The maximum real-time scheduling priority)180 156 Q F1<ad73>144 168 Q
F0(The maximum stack size)180 168 Q F1<ad74>144 180 Q F0
(The maximum amount of cpu time in seconds)180 180 Q F1<ad75>144 192 Q
F0(The maximum number of processes a)180 192 Q -.25(va)-.2 G
(ilable to a single user).25 E F1<ad76>144 204 Q F0 .47
(The maximum amount of virtual memory a)180 204 R -.25(va)-.2 G .47
(ilable to the shell and, on some systems, to).25 F(its children)180 216
Q F1<ad78>144 228 Q F0(The maximum number of \214le locks)180 228 Q F1
<ad50>144 240 Q F0(The maximum number of pseudoterminals)180 240 Q F1
<ad54>144 252 Q F0(The maximum number of threads)180 252 Q(If)144 268.8
Q/F2 10/Times-Italic@0 SF(limit)3.058 E F0 .468(is gi)3.648 F -.15(ve)
-.25 G .468(n, and the).15 F F1<ad61>2.968 E F0 .468
(option is not used,)2.968 F F2(limit)2.968 E F0 .468(is the ne)2.968 F
2.968(wv)-.25 G .468(alue of the speci\214ed resource.)-3.218 F(If)5.468
E .044(no option is gi)144 232.8 R -.15(ve)-.25 G .044(n, then).15 F F1
E .044(no option is gi)144 280.8 R -.15(ve)-.25 G .044(n, then).15 F F1
<ad66>2.544 E F0 .045(is assumed.)2.545 F -1.11(Va)5.045 G .045
(lues are in 1024-byte increments, e)1.11 F .045(xcept for)-.15 F F1
<ad74>2.545 E F0 2.545(,w)C .045(hich is)-2.545 F 1.589(in seconds;)144
244.8 R F1<ad70>4.089 E F0 4.089(,w)C 1.589
292.8 R F1<ad70>4.089 E F0 4.089(,w)C 1.589
(hich is in units of 512-byte blocks;)-4.089 F F1<ad50>4.089 E F0(,)A F1
<ad54>4.089 E F0(,)A F1<ad62>4.089 E F0(,)A F1<ad6b>4.089 E F0(,)A F1
<ad6e>4.089 E F0 4.089(,a)C(nd)-4.089 E F1<ad75>4.089 E F0 4.088(,w)C
1.588(hich are)-4.088 F 1.438(unscaled v)144 256.8 R 1.438
1.588(hich are)-4.088 F 1.438(unscaled v)144 304.8 R 1.438
(alues; and, when in Posix mode,)-.25 F F1<ad63>3.939 E F0(and)3.939 E
F1<ad66>3.939 E F0 3.939(,w)C 1.439(hich are in 512-byte increments.)
-3.939 F(The)6.439 E .404(return status is 0 unless an in)144 268.8 R
-3.939 F(The)6.439 E .404(return status is 0 unless an in)144 316.8 R
-.25(va)-.4 G .404(lid option or ar).25 F .404
(gument is supplied, or an error occurs while setting)-.18 F 2.5(an)144
280.8 S .5 -.25(ew l)-2.5 H(imit.).25 E F1(umask)108 297.6 Q F0([)2.5 E
328.8 S .5 -.25(ew l)-2.5 H(imit.).25 E F1(umask)108 345.6 Q F0([)2.5 E
F1<ad70>A F0 2.5(][)C F1<ad53>-2.5 E F0 2.5(][)C F2(mode)-2.5 E F0(])A
.2(The user \214le-creation mask is set to)144 309.6 R F2(mode)2.7 E F0
.2(The user \214le-creation mask is set to)144 357.6 R F2(mode)2.7 E F0
5.2(.I).18 G(f)-5.2 E F2(mode)3.08 E F0(be)2.88 E .2
(gins with a digit, it is interpreted as an octal)-.15 F .066(number; o\
therwise it is interpreted as a symbolic mode mask similar to that acce\
pted by)144 321.6 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144
333.6 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382
pted by)144 369.6 R F2 -.15(ch)2.566 G(mod).15 E F0(\(1\).).77 E(If)144
381.6 Q F2(mode)3.262 E F0 .382(is omitted, the current v)3.062 F .382
(alue of the mask is printed.)-.25 F(The)5.382 E F1<ad53>2.882 E F0 .382
(option causes the mask to be)2.882 F .547
(printed in symbolic form; the def)144 345.6 R .547
(printed in symbolic form; the def)144 393.6 R .547
(ault output is an octal number)-.1 F 5.547(.I)-.55 G 3.047(ft)-5.547 G
(he)-3.047 E F1<ad70>3.047 E F0 .547(option is supplied, and)3.047 F F2
(mode)144.38 357.6 Q F0 .551
(mode)144.38 405.6 Q F0 .551
(is omitted, the output is in a form that may be reused as input.)3.231
F .552(The return status is 0 if the)5.552 F(mode w)144 369.6 Q
F .552(The return status is 0 if the)5.552 F(mode w)144 417.6 Q
(as successfully changed or if no)-.1 E F2(mode)2.5 E F0(ar)2.5 E
(gument w)-.18 E(as supplied, and f)-.1 E(alse otherwise.)-.1 E F1
(unalias)108 386.4 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0
(...])2.5 E(Remo)144 398.4 Q 1.955 -.15(ve e)-.15 H(ach).15 E F2(name)
(unalias)108 434.4 Q F0<5bad>2.5 E F1(a)A F0 2.5(][)C F2(name)-2.5 E F0
(...])2.5 E(Remo)144 446.4 Q 1.955 -.15(ve e)-.15 H(ach).15 E F2(name)
4.155 E F0 1.655(from the list of de\214ned aliases.)4.155 F(If)6.655 E
F1<ad61>4.155 E F0 1.655(is supplied, all alias de\214nitions are)4.155
F(remo)144 410.4 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E
F(remo)144 458.4 Q -.15(ve)-.15 G 2.5(d. The).15 F(return v)2.5 E
(alue is true unless a supplied)-.25 E F2(name)2.86 E F0
(is not a de\214ned alias.)2.68 E F1(unset)108 427.2 Q F0<5bad>2.5 E F1
(is not a de\214ned alias.)2.68 E F1(unset)108 475.2 Q F0<5bad>2.5 E F1
(fv)A F0 2.5(][)C<ad>-2.5 E F1(n)A F0 2.5(][)C F2(name)-2.5 E F0(...])
2.5 E -.15(Fo)144 439.2 S 3.827(re).15 G(ach)-3.827 E F2(name)3.827 E F0
2.5 E -.15(Fo)144 487.2 S 3.827(re).15 G(ach)-3.827 E F2(name)3.827 E F0
3.827(,r).18 G(emo)-3.827 E 1.627 -.15(ve t)-.15 H 1.327
(he corresponding v).15 F 1.327(ariable or function.)-.25 F 1.327
(If the)6.327 F F1<ad76>3.828 E F0 1.328(option is gi)3.828 F -.15(ve)
-.25 G 1.328(n, each).15 F F2(name)144.36 451.2 Q F0 1.551
-.25 G 1.328(n, each).15 F F2(name)144.36 499.2 Q F0 1.551
(refers to a shell v)4.231 F 1.551(ariable, and that v)-.25 F 1.551
(ariable is remo)-.25 F -.15(ve)-.15 G 4.05(d. Read-only).15 F -.25(va)
4.05 G 1.55(riables may not be).25 F 4.641(unset. If)144 463.2 R F1
4.05 G 1.55(riables may not be).25 F 4.641(unset. If)144 511.2 R F1
<ad66>4.641 E F0 2.141(is speci\214ed, each)4.641 F F2(name)5.001 E F0
2.141(refers to a shell function, and the function de\214nition is)4.821
F(remo)144 475.2 Q -.15(ve)-.15 G 2.538(d. If).15 F(the)2.537 E F1<ad6e>
F(remo)144 523.2 Q -.15(ve)-.15 G 2.538(d. If).15 F(the)2.537 E F1<ad6e>
2.537 E F0 .037(option is supplied, and)2.537 F F2(name)2.537 E F0 .037
(is a v)2.537 F .037(ariable with the)-.25 F F2(namer)2.537 E(ef)-.37 E
F0(attrib)2.537 E(ute,)-.2 E F2(name)2.537 E F0(will)2.537 E .492
(be unset rather than the v)144 487.2 R .492(ariable it references.)-.25
(be unset rather than the v)144 535.2 R .492(ariable it references.)-.25
F F1<ad6e>5.492 E F0 .492(has no ef)2.992 F .492(fect if the)-.25 F F1
<ad66>2.992 E F0 .492(option is supplied.)2.992 F .493(If no)5.493 F
.221(options are supplied, each)144 499.2 R F2(name)2.721 E F0 .221
.221(options are supplied, each)144 547.2 R F2(name)2.721 E F0 .221
(refers to a v)2.721 F .22(ariable; if there is no v)-.25 F .22
(ariable by that name, an)-.25 F 2.72(yf)-.15 G(unc-)-2.72 E 1.188
(tion with that name is unset.)144 511.2 R 1.189(Each unset v)6.189 F
(tion with that name is unset.)144 559.2 R 1.189(Each unset v)6.189 F
1.189(ariable or function is remo)-.25 F -.15(ve)-.15 G 3.689(df).15 G
1.189(rom the en)-3.689 F(vironment)-.4 E 3.206
(passed to subsequent commands.)144 523.2 R 3.206(If an)8.206 F 5.706
(passed to subsequent commands.)144 571.2 R 3.206(If an)8.206 F 5.706
(yo)-.15 G(f)-5.706 E/F3 9/Times-Bold@0 SF(COMP_W)5.706 E(ORDBREAKS)-.09
E/F4 9/Times-Roman@0 SF(,)A F3(RANDOM)5.455 E F4(,)A F3(SECONDS)5.455 E
F4(,)A F3(LINENO)144 535.2 Q F4(,)A F3(HISTCMD)4.347 E F4(,)A F3(FUNCN)
F4(,)A F3(LINENO)144 583.2 Q F4(,)A F3(HISTCMD)4.347 E F4(,)A F3(FUNCN)
4.347 E(AME)-.18 E F4(,)A F3(GR)4.347 E(OUPS)-.27 E F4(,)A F0(or)4.348 E
F3(DIRST)4.598 E -.495(AC)-.81 G(K).495 E F0 2.098(are unset, the)4.348
F 4.598(yl)-.15 G 2.098(ose their special)-4.598 F(properties, e)144
547.2 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he)-2.5 E 2.5(ya)-.15
595.2 Q -.15(ve)-.25 G 2.5(ni).15 G 2.5(ft)-2.5 G(he)-2.5 E 2.5(ya)-.15
G(re subsequently reset.)-2.5 E(The e)5 E(xit status is true unless a)
-.15 E F2(name)2.86 E F0(is readonly)2.68 E(.)-.65 E F1(wait)108 564 Q
-.15 E F2(name)2.86 E F0(is readonly)2.68 E(.)-.65 E F1(wait)108 612 Q
F0([)2.5 E F1<ad6e>A F0 2.5(][)C F2 2.5(n.)-2.5 G(..)-2.5 E F0(])A -.8
(Wa)144 576 S .027(it for each speci\214ed child process and return its\
(Wa)144 624 S .027(it for each speci\214ed child process and return its\
termination status.).8 F(Each)5.026 E F2(n)2.886 E F0 .026
(may be a process ID)2.766 F .256
(or a job speci\214cation; if a job spec is gi)144 588 R -.15(ve)-.25 G
(or a job speci\214cation; if a job spec is gi)144 636 R -.15(ve)-.25 G
.256(n, all processes in that job').15 F 2.756(sp)-.55 G .256
(ipeline are w)-2.756 F .256(aited for)-.1 F 5.256(.I)-.55 G(f)-5.256 E
F2(n)3.116 E F0 .318(is not gi)144 600 R -.15(ve)-.25 G .318
F2(n)3.116 E F0 .318(is not gi)144 648 R -.15(ve)-.25 G .318
(n, all currently acti).15 F .618 -.15(ve c)-.25 H .318
(hild processes are w).15 F .318(aited for)-.1 F 2.818(,a)-.4 G .318
(nd the return status is zero.)-2.818 F .317(If the)5.317 F F1<ad6e>144
612 Q F0 .361(option is supplied,)2.861 F F1(wait)2.861 E F0 -.1(wa)
660 Q F0 .361(option is supplied,)2.861 F F1(wait)2.861 E F0 -.1(wa)
2.861 G .361(its for an).1 F 2.862(yj)-.15 G .362
(ob to terminate and returns its e)-2.862 F .362(xit status.)-.15 F(If)
5.362 E F2(n)3.222 E F0(speci\214es)3.102 E 2.596(an)144 624 S(on-e)
5.362 E F2(n)3.222 E F0(speci\214es)3.102 E 2.596(an)144 672 S(on-e)
-2.596 E .096(xistent process or job, the return status is 127.)-.15 F
.095(Otherwise, the return status is the e)5.095 F .095(xit status)-.15
F(of the last process or job w)144 636 Q(aited for)-.1 E(.)-.55 E/F5
10.95/Times-Bold@0 SF(SEE ALSO)72 652.8 Q F0(bash\(1\), sh\(1\))108
664.8 Q(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(23)198.725 E 0 Cg EP
F(of the last process or job w)144 684 Q(aited for)-.1 E(.)-.55 E/F5
10.95/Times-Bold@0 SF(SEE ALSO)72 700.8 Q F0(bash\(1\), sh\(1\))108
712.8 Q(GNU Bash-4.2)72 768 Q(2004 Apr 20)148.735 E(23)198.725 E 0 Cg EP
%%Trailer
end
%%EOF
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.22.3
%%CreationDate: Mon Feb 8 10:16:54 2016
%%CreationDate: Mon Jun 20 15:38:03 2016
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.22 3
+3 -3
View File
@@ -2,10 +2,10 @@
Copyright (C) 1988-2016 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Mon Feb 8 10:16:20 EST 2016
@set LASTCHANGE Sun May 29 13:48:02 EDT 2016
@set EDITION 4.4
@set VERSION 4.4
@set UPDATED 8 February 2016
@set UPDATED-MONTH February 2016
@set UPDATED 29 May 2016
@set UPDATED-MONTH May 2016
+4 -1
View File
@@ -244,7 +244,10 @@ 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. */
if (interactive && bash_input.type != st_string)
/* 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. */
if (interactive && bash_input.type != st_string && parser_expanding_alias() == 0)
{
command_to_execute = get_string_value ("PROMPT_COMMAND");
if (command_to_execute)
+1 -1
View File
@@ -234,7 +234,7 @@ distclean maintainer-clean: clean
installdirs:
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(loadablesdir)
install-dev:
install-dev: installdirs
@$(INSTALL_DATA) Makefile.inc $(DESTDIR)$(loadablesdir)/Makefile.inc
@( cd $(BUILD_DIR) && ${MAKE} ${MFLAGS} DESTDIR="$(DESTDIR)" install-headers)
+6 -2
View File
@@ -11,6 +11,7 @@
* references to it do not attempt to access memory that is no longer part
* of this process's address space.
*/
#include <config.h>
#include <stdio.h>
#include <errno.h>
@@ -22,8 +23,11 @@
#define INIT_DYNAMIC_VAR(var, val, gfunc, afunc) \
do \
{ SHELL_VAR *v = bind_variable (var, (val), 0); \
v->dynamic_value = gfunc; \
v->assign_func = afunc; \
if (v) \
{ \
v->dynamic_value = gfunc; \
v->assign_func = afunc; \
} \
} \
while (0)
+62 -16
View File
@@ -1,6 +1,6 @@
/* execute_cmd.c -- Execute a COMMAND structure. */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -836,7 +836,9 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
#if !defined (JOB_CONTROL)
/* Do not wait for asynchronous processes started from
startup files. */
if (last_made_pid != last_asynchronous_pid)
if (last_made_pid != NO_PID && last_made_pid != last_asynchronous_pid)
#else
if (last_made_pid != NO_PID)
#endif
/* When executing a shell function that executes other
commands, this causes the last simple command in
@@ -2118,6 +2120,7 @@ coproc_fdrestore (cp)
void
coproc_pidchk (pid, status)
pid_t pid;
int status;
{
struct coproc *cp;
@@ -2149,6 +2152,7 @@ coproc_setvars (cp)
SHELL_VAR *v;
char *namevar, *t;
int l;
WORD_DESC w;
#if defined (ARRAY_VARS)
arrayind_t ind;
#endif
@@ -2156,11 +2160,40 @@ coproc_setvars (cp)
if (cp->c_name == 0)
return;
/* We could do more here but right now we only check the name, warn if it's
not a valid identifier, and refuse to create variables with invalid names
if a coproc with such a name is supplied. */
w.word = cp->c_name;
w.flags = 0;
if (check_identifier (&w, 1) == 0)
return;
l = strlen (cp->c_name);
namevar = xmalloc (l + 16);
#if defined (ARRAY_VARS)
v = find_variable (cp->c_name);
/* This is the same code as in find_or_make_array_variable */
if (v == 0)
{
v = find_variable_nameref_for_create (cp->c_name, 1);
if (v == INVALID_NAMEREF_VALUE)
return;
if (v && nameref_p (v))
{
free (cp->c_name);
cp->c_name = savestring (nameref_cell (v));
v = make_new_array_variable (cp->c_name);
}
}
if (v && (readonly_p (v) || noassign_p (v)))
{
if (readonly_p (v))
err_readonly (cp->c_name);
return;
}
if (v == 0)
v = make_new_array_variable (cp->c_name);
if (array_p (v) == 0)
@@ -2208,10 +2241,10 @@ coproc_unsetvars (cp)
namevar = xmalloc (l + 16);
sprintf (namevar, "%s_PID", cp->c_name);
unbind_variable (namevar);
unbind_variable_noref (namevar);
#if defined (ARRAY_VARS)
unbind_variable (cp->c_name);
check_unbind_variable (cp->c_name);
#else
sprintf (namevar, "%s_READ", cp->c_name);
unbind_variable (namevar);
@@ -2237,7 +2270,7 @@ execute_coproc (command, pipe_in, pipe_out, fds_to_close)
/* XXX -- can be removed after changes to handle multiple coprocs */
#if !MULTIPLE_COPROCS
if (sh_coproc.c_pid != NO_PID)
internal_warning ("execute_coproc: coproc [%d:%s] still exists", sh_coproc.c_pid, sh_coproc.c_name);
internal_warning (_("execute_coproc: coproc [%d:%s] still exists"), sh_coproc.c_pid, sh_coproc.c_name);
coproc_init (&sh_coproc);
#endif
@@ -2468,7 +2501,7 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close)
lstdin = wait_for (lastpid);
}
else
lstdin = wait_for_single_pid (lastpid); /* checks bgpids list */
lstdin = wait_for_single_pid (lastpid, 0); /* checks bgpids list */
#else
lstdin = wait_for (lastpid);
#endif
@@ -2732,17 +2765,24 @@ execute_for_command (for_command)
this_command_name = (char *)NULL;
/* XXX - special ksh93 for command index variable handling */
v = find_variable_last_nameref (identifier);
v = find_variable_last_nameref (identifier, 1);
if (v && nameref_p (v))
{
v = bind_variable_value (v, list->word->word, 0);
}
{
if (valid_nameref_value (list->word->word, 1) == 0)
{
sh_invalidid (list->word->word);
v = 0;
}
else
v = bind_variable_value (v, list->word->word, 0);
}
else
v = bind_variable (identifier, list->word->word, 0);
if (readonly_p (v) || noassign_p (v))
v = bind_variable (identifier, list->word->word, 0);
if (v == 0 || readonly_p (v) || noassign_p (v))
{
line_number = save_line_number;
if (readonly_p (v) && interactive_shell == 0 && posixly_correct)
if (v && readonly_p (v) && interactive_shell == 0 && posixly_correct)
{
last_command_exit_value = EXECUTION_FAILURE;
jump_to_top_level (FORCE_EOF);
@@ -2755,6 +2795,10 @@ execute_for_command (for_command)
return (EXECUTION_FAILURE);
}
}
if (ifsname (identifier))
setifs (v);
retval = execute_command (for_command->action);
REAP ();
QUIT;
@@ -3232,9 +3276,9 @@ execute_select_command (select_command)
}
v = bind_variable (identifier, selection, 0);
if (readonly_p (v) || noassign_p (v))
if (v == 0 || readonly_p (v) || noassign_p (v))
{
if (readonly_p (v) && interactive_shell == 0 && posixly_correct)
if (v && readonly_p (v) && interactive_shell == 0 && posixly_correct)
{
last_command_exit_value = EXECUTION_FAILURE;
jump_to_top_level (FORCE_EOF);
@@ -3765,7 +3809,8 @@ bind_lastarg (arg)
if (arg == 0)
arg = "";
var = bind_variable ("_", arg, 0);
VUNSETATTR (var, att_exported);
if (var)
VUNSETATTR (var, att_exported);
}
/* Execute a null command. Fork a subshell if the command uses pipes or is
@@ -5474,6 +5519,7 @@ shell_execve (command, args, env)
if (check_binary_file (sample, sample_len))
{
internal_error (_("%s: cannot execute binary file: %s"), command, strerror (i));
errno = i;
return (EX_BINARY_FILE);
}
}
+2
View File
@@ -77,6 +77,8 @@ extern void coproc_unsetvars __P((struct coproc *));
extern void close_all_files __P((void));
#endif
#if defined (ARRAY_VARS)
extern void restore_funcarray_state __P((struct func_array_state *));
#endif
#endif /* _EXECUTE_CMD_H_ */
+2
View File
@@ -116,6 +116,8 @@ extern int parser_expanding_alias __P((void));
extern void parser_save_alias __P((void));
extern void parser_restore_alias __P((void));
extern void clear_shell_input_line __P((void));
extern char *decode_prompt_string __P((char *));
extern int get_current_prompt_level __P((void));
+2 -2
View File
@@ -189,7 +189,7 @@ file_status (name)
/* Else we check whether `others' have permission to execute the file */
else
{
if (finfo.st_mode & S_IXOTH)
if (exec_name_should_ignore (name) == 0 && finfo.st_mode & S_IXOTH)
r |= FS_EXECABLE;
if (finfo.st_mode & S_IROTH)
r |= FS_READABLE;
@@ -568,7 +568,7 @@ find_in_path_element (name, path, flags, name_len, dotinfop)
/* The file is not executable, but it does exist. If we prefer
an executable, then remember this one if it is the first one
we have found. */
if ((flags & FS_EXEC_PREFERRED) && file_to_lose_on == 0)
if ((flags & FS_EXEC_PREFERRED) && file_to_lose_on == 0 && exec_name_should_ignore (full_path) == 0)
file_to_lose_on = savestring (full_path);
/* If we want only executable files, or we don't want directories and
+13 -3
View File
@@ -356,11 +356,17 @@ set_current_flags (bitmap)
void
reset_shell_flags ()
{
mark_modified_vars = exit_immediately_on_error = disallow_filename_globbing = 0;
mark_modified_vars = disallow_filename_globbing = 0;
place_keywords_in_env = read_but_dont_execute = just_one_command = 0;
noclobber = unbound_vars_is_error = echo_input_at_read = verbose_flag = 0;
noclobber = unbound_vars_is_error = 0;
echo_command_at_execute = jobs_m_flag = forced_interactive = 0;
no_symbolic_links = no_invisible_vars = privileged_mode = pipefail_opt = 0;
no_symbolic_links = no_invisible_vars = 0;
privileged_mode = pipefail_opt = 0;
error_trace_mode = function_trace_mode = 0;
exit_immediately_on_error = errexit_flag = 0;
echo_input_at_read = verbose_flag = 0;
hashing_enabled = interactive_comments = 1;
@@ -369,7 +375,11 @@ reset_shell_flags ()
#endif
#if defined (BANG_HISTORY)
# if defined (STRICT_POSIX)
history_expansion = 0;
# else
history_expansion = 1;
# endif /* STRICT_POSIX */
#endif
#if defined (BRACE_EXPANSION)
+56 -1
View File
@@ -1,6 +1,6 @@
/* general.c -- Stuff that is used by all files. */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -227,6 +227,57 @@ legal_identifier (name)
return (1);
}
/* Return 1 if NAME is a valid value that can be assigned to a nameref
variable. FLAGS can be 2, in which case the name is going to be used
to create a variable. Other values are currently unused, but could
be used to allow values to be stored and indirectly referenced, but
not used in assignments. */
int
valid_nameref_value (name, flags)
char *name;
int flags;
{
if (name == 0 || *name == 0)
return 0;
/* valid identifier */
#if defined (ARRAY_VARS)
if (legal_identifier (name) || (flags != 2 && valid_array_reference (name, 0)))
#else
if (legal_identifier (name))
#endif
return 1;
return 0;
}
int
check_selfref (name, value, flags)
const char *name;
const char *value;
int flags;
{
char *t;
if (STREQ (name, value))
return 1;
#if defined (ARRAY_VARS)
if (valid_array_reference (value, 0))
{
t = array_variable_name (value, (int *)NULL, (int *)NULL);
if (t && STREQ (name, t))
{
free (t);
return 1;
}
free (t);
}
#endif
return 0; /* not a self reference */
}
/* Make sure that WORD is a valid shell identifier, i.e.
does not contain a dollar sign, nor is quoted in any way. Nor
does it consist of all digits. If CHECK_WORD is non-zero,
@@ -1039,6 +1090,7 @@ bash_tilde_expand (s, assign_p)
int old_immed, old_term, r;
char *ret;
#if 0
old_immed = interrupt_immediately;
old_term = terminate_immediately;
/* We want to be able to interrupt tilde expansion. Ordinarily, we can just
@@ -1048,6 +1100,7 @@ bash_tilde_expand (s, assign_p)
if (any_signals_trapped () < 0)
interrupt_immediately = 1;
terminate_immediately = 1;
#endif
tilde_additional_prefixes = assign_p == 0 ? (char **)0
: (assign_p == 2 ? bash_tilde_prefixes2 : bash_tilde_prefixes);
@@ -1057,8 +1110,10 @@ bash_tilde_expand (s, assign_p)
r = (*s == '~') ? unquoted_tilde_word (s) : 1;
ret = r ? tilde_expand (s) : savestring (s);
#if 0
interrupt_immediately = old_immed;
terminate_immediately = old_term;
#endif
QUIT;
+3 -1
View File
@@ -1,6 +1,6 @@
/* general.h -- defines that everybody likes to use. */
/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -289,6 +289,8 @@ extern int legal_identifier __P((char *));
extern int importable_function_name __P((char *, size_t));
extern int exportable_function_name __P((char *));
extern int check_identifier __P((WORD_DESC *, int));
extern int valid_nameref_value __P((char *, int));
extern int check_selfref __P((const char *, const char *, int));
extern int legal_alias_name __P((char *, int));
extern int assignment __P((const char *, int));
+3 -3
View File
@@ -34,9 +34,8 @@
/* is_basic(c) tests whether the single-byte character c is in the
ISO C "basic character set".
This is a convenience function, and is in this file only to share code
between mbiter_multi.h and mbfile_multi.h. */
ISO C "basic character set". */
#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
@@ -79,6 +78,7 @@ is_basic (char c)
{
switch (c)
{
case '\b': case '\r': case '\n':
case '\t': case '\v': case '\f':
case ' ': case '!': case '"': case '#': case '%':
case '&': case '\'': case '(': case ')': case '*':
+29
View File
@@ -499,5 +499,34 @@ extern int locale_mb_cur_max; /* XXX */
\
goto add_string
# define SADD_MBCHAR_BODY(_dst, _src, _si, _srcsize) \
\
int i; \
mbstate_t state_bak; \
size_t mblength; \
\
i = is_basic (*((_src) + (_si))); \
if (i) \
mblength = 1; \
else \
{ \
state_bak = state; \
mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \
} \
if (mblength == (size_t)-1 || mblength == (size_t)-2) \
{ \
state = state_bak; \
mblength = 1; \
} \
if (mblength < 1) \
mblength = 1; \
\
(_dst) = (char *)xmalloc (mblength + 1); \
for (i = 0; i < mblength; i++) \
(_dst)[i+1] = (_src)[(_si)++]; \
(_dst)[mblength+1] = '\0'; \
\
goto add_string
#endif /* HANDLE_MULTIBYTE */
#endif /* _SH_MBUTIL_H_ */
+16 -5
View File
@@ -175,6 +175,8 @@ extern WORD_LIST *subst_assign_varlist;
extern SigHandler **original_signals;
extern void set_original_signal __P((int, SigHandler *));
static struct jobstats zerojs = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 };
struct jobstats js = { -1L, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NO_JOB, NO_JOB, 0, 0 };
@@ -1903,6 +1905,7 @@ make_child (command, async_p)
/* If we can't create any children, try to reap some dead ones. */
waitchld (-1, 0);
errno = EAGAIN; /* restore errno */
sys_error ("fork: retry");
RESET_SIGTERM;
@@ -2311,10 +2314,13 @@ find_last_pid (job, block)
This low-level function prints an error message if PID is not
a child of this shell. It returns -1 if it fails, or whatever
wait_for returns otherwise. If the child is not found in the
jobs table, it returns 127. */
jobs table, it returns 127. If FLAGS doesn't include 1, we
suppress the error message if PID isn't found. */
int
wait_for_single_pid (pid)
wait_for_single_pid (pid, flags)
pid_t pid;
int flags;
{
register PROCESS *child;
sigset_t set, oset;
@@ -2333,7 +2339,8 @@ wait_for_single_pid (pid)
if (child == 0)
{
internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid);
if (flags & 1)
internal_error (_("wait: pid %ld is not a child of this shell"), (long)pid);
return (127);
}
@@ -2393,7 +2400,7 @@ wait_for_background_pids ()
UNBLOCK_CHILD (oset);
QUIT;
errno = 0; /* XXX */
r = wait_for_single_pid (pid);
r = wait_for_single_pid (pid, 1);
if (r == -1)
{
/* If we're mistaken about job state, compensate. */
@@ -2787,7 +2794,11 @@ itrace("wait_for: blocking wait for %d returns %d child = %p", (int)pid, r, chil
if (job == NO_JOB)
itrace("wait_for: job == NO_JOB, giving the terminal to shell_pgrp (%ld)", (long)shell_pgrp);
#endif
/* Don't modify terminal pgrp if we are running in background or a subshell */
/* Don't modify terminal pgrp if we are running in background or a
subshell. Make sure subst.c:command_substitute uses the same
conditions to determine whether or not it should undo this and
give the terminal to pipeline_pgrp. */
if (running_in_background == 0 && (subshell_environment&(SUBSHELL_ASYNC|SUBSHELL_PIPE)) == 0)
give_terminal_to (shell_pgrp, 0);
}
+1 -1
View File
@@ -230,7 +230,7 @@ extern int set_tty_state __P((void));
extern int job_exit_status __P((int));
extern int job_exit_signal __P((int));
extern int wait_for_single_pid __P((pid_t));
extern int wait_for_single_pid __P((pid_t, int));
extern void wait_for_background_pids __P((void));
extern int wait_for __P((pid_t));
extern int wait_for_job __P((int));
+18 -6
View File
@@ -119,9 +119,6 @@ fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe);
break;
case '*': /* Match zero or more characters */
if (p == pe)
return 0;
if ((flags & FNM_PERIOD) && sc == L('.') &&
(n == string || ((flags & FNM_PATHNAME) && n[-1] == L('/'))))
/* `*' cannot match a `.' if it is the first character of the
@@ -129,6 +126,9 @@ fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe);
we are matching a pathname. */
return FNM_NOMATCH;
if (p == pe)
return 0;
/* Collapse multiple consecutive `*' and `?', but make sure that
one character of the string is consumed for each `?'. */
for (c = *p++; (c == L('?') || c == L('*')); c = *p++)
@@ -140,14 +140,26 @@ fprintf(stderr, "gmatch: pattern = %s; pe = %s\n", pattern, pe);
else if ((flags & FNM_EXTMATCH) && c == L('?') && *p == L('(')) /* ) */
{
CHAR *newn;
#if 0
for (newn = n; newn < se; ++newn)
{
if (EXTMATCH (c, newn, se, p, pe, flags) == 0)
return (0);
}
/* We didn't match. If we have a `?(...)', we can match 0
or 1 times. */
return 0;
#else
/* We can match 0 or 1 times. If we match, return success */
if (EXTMATCH (c, n, se, p, pe, flags) == 0)
return (0);
#endif
/* We didn't match the extended glob pattern, but
that's OK, since we can match 0 or 1 occurrences.
We need to skip the glob pattern and see if we
match the rest of the string. */
newn = PATSCAN (p + 1, pe, 0);
/* If NEWN is 0, we have an ill-formed pattern. */
p = newn ? newn : pe;
}
#endif
else if (c == L('?'))
+21 -8
View File
@@ -214,7 +214,7 @@ int _rl_colored_stats = 0;
/* Non-zero means to use a color (currently magenta) to indicate the common
prefix of a set of possible word completions. */
int _rl_colored_completion_prefix = 1;
int _rl_colored_completion_prefix = 0;
#endif
/* If non-zero, when completing in the middle of a word, don't insert
@@ -807,7 +807,7 @@ fnprint (to_print, prefix_bytes, real_pathname)
{
int printed_len, w;
const char *s;
int common_prefix_len;
int common_prefix_len, print_len;
#if defined (HANDLE_MULTIBYTE)
mbstate_t ps;
const char *end;
@@ -815,7 +815,8 @@ fnprint (to_print, prefix_bytes, real_pathname)
int width;
wchar_t wc;
end = to_print + strlen (to_print) + 1;
print_len = strlen (to_print);
end = to_print + print_len + 1;
memset (&ps, 0, sizeof (mbstate_t));
#endif
@@ -825,7 +826,7 @@ fnprint (to_print, prefix_bytes, real_pathname)
possible completions. Only cut off prefix_bytes if we're going to be
printing the ellipsis, which takes precedence over coloring the
completion prefix (see print_filename() below). */
if (_rl_completion_prefix_display_length > 0 && to_print[prefix_bytes] == '\0')
if (_rl_completion_prefix_display_length > 0 && prefix_bytes >= print_len)
prefix_bytes = 0;
#if defined (COLOR_SUPPORT)
@@ -1571,9 +1572,12 @@ rl_display_match_list (matches, len, max)
if (_rl_completion_prefix_display_length > 0)
{
t = printable_part (matches[0]);
temp = strrchr (t, '/'); /* check again in case of /usr/src/ */
/* check again in case of /usr/src/ */
temp = rl_filename_completion_desired ? strrchr (t, '/') : 0;
common_length = temp ? fnwidth (temp) : fnwidth (t);
sind = temp ? strlen (temp) : strlen (t);
if (common_length > max || sind > max)
common_length = sind = 0;
if (common_length > _rl_completion_prefix_display_length && common_length > ELLIPSIS_LEN)
max -= common_length - ELLIPSIS_LEN;
@@ -1584,9 +1588,11 @@ rl_display_match_list (matches, len, max)
else if (_rl_colored_completion_prefix > 0)
{
t = printable_part (matches[0]);
temp = strrchr (t, '/');
temp = rl_filename_completion_desired ? strrchr (t, '/') : 0;
common_length = temp ? fnwidth (temp) : fnwidth (t);
sind = temp ? RL_STRLEN (temp+1) : RL_STRLEN (t); /* want portion after final slash */
if (common_length > max || sind > max)
common_length = sind = 0;
}
#endif
@@ -1635,8 +1641,13 @@ rl_display_match_list (matches, len, max)
printed_len = print_filename (temp, matches[l], sind);
if (j + 1 < limit)
for (k = 0; k < max - printed_len; k++)
putc (' ', rl_outstream);
{
if (max <= printed_len)
putc (' ', rl_outstream);
else
for (k = 0; k < max - printed_len; k++)
putc (' ', rl_outstream);
}
}
l += count;
}
@@ -1683,6 +1694,8 @@ rl_display_match_list (matches, len, max)
return;
}
}
else if (max <= printed_len)
putc (' ', rl_outstream);
else
for (k = 0; k < max - printed_len; k++)
putc (' ', rl_outstream);
+61 -31
View File
@@ -826,7 +826,7 @@ rl_redisplay ()
lpos -= _rl_col_width (local_prompt, n0, num, 1) - wadjust;
else
#endif
lpos -= _rl_screenwidth - wadjust;
lpos -= _rl_screenwidth; /* all physical cursor positions */
}
prompt_last_screen_line = newlines;
@@ -1389,6 +1389,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
int current_invis_chars;
int col_lendiff, col_temp;
int bytes_to_insert;
int mb_cur_max = MB_CUR_MAX;
#if defined (HANDLE_MULTIBYTE)
mbstate_t ps_new, ps_old;
int new_offset, old_offset;
@@ -1399,7 +1400,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
the exact cursor position and cut-and-paste with certain terminal
emulators. In this calculation, TEMP is the physical screen
position of the cursor. */
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
temp = _rl_last_c_pos;
else
temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset);
@@ -1407,7 +1408,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
&& _rl_last_v_pos == current_line - 1)
{
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
wchar_t wc;
mbstate_t ps;
@@ -1421,7 +1422,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
_rl_clear_to_eol (line_state_visible->wrapped_line[current_line]);
memset (&ps, 0, sizeof (mbstate_t));
ret = mbrtowc (&wc, new, MB_CUR_MAX, &ps);
ret = mbrtowc (&wc, new, mb_cur_max, &ps);
if (MB_INVALIDCH (ret))
{
tempwidth = 1;
@@ -1441,7 +1442,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
_rl_last_c_pos = tempwidth;
_rl_last_v_pos++;
memset (&ps, 0, sizeof (mbstate_t));
ret = mbrtowc (&wc, old, MB_CUR_MAX, &ps);
ret = mbrtowc (&wc, old, mb_cur_max, &ps);
if (ret != 0 && bytes != 0)
{
if (MB_INVALIDCH (ret))
@@ -1480,7 +1481,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* Find first difference. */
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
/* See if the old line is a subset of the new line, so that the
only change is adding characters. */
@@ -1537,7 +1538,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
return;
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_utf8locale)
if (mb_cur_max > 1 && rl_byte_oriented == 0 && _rl_utf8locale)
{
wchar_t wc;
mbstate_t ps = { 0 };
@@ -1546,7 +1547,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* If the first character in the difference is a zero-width character,
assume it's a combining character and back one up so the two base
characters no longer compare equivalently. */
t = mbrtowc (&wc, ofd, MB_CUR_MAX, &ps);
t = mbrtowc (&wc, ofd, mb_cur_max, &ps);
if (t > 0 && UNICODE_COMBINING_CHAR (wc) && WCWIDTH (wc) == 0)
{
old_offset = _rl_find_prev_mbchar (old, ofd - old, MB_FIND_ANY);
@@ -1560,7 +1561,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
wsatend = 1; /* flag for trailing whitespace */
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
ols = old + _rl_find_prev_mbchar (old, oe - old, MB_FIND_ANY);
nls = new + _rl_find_prev_mbchar (new, ne - new, MB_FIND_ANY);
@@ -1618,14 +1619,14 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
{
if (*ols) /* don't step past the NUL */
{
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
ols = old + _rl_find_next_mbchar (old, ols - old, 1, MB_FIND_ANY);
else
ols++;
}
if (*nls)
{
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
nls = new + _rl_find_next_mbchar (new, nls - new, 1, MB_FIND_ANY);
else
nls++;
@@ -1642,7 +1643,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
visible_wrap_offset based on what we know. */
if (current_line == 0)
visible_wrap_offset = prompt_invis_chars_first_line; /* XXX */
if ((MB_CUR_MAX == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset)
if ((mb_cur_max == 1 || rl_byte_oriented) && current_line == 0 && visible_wrap_offset)
_rl_last_c_pos += visible_wrap_offset;
}
@@ -1687,7 +1688,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (modmark)
_rl_output_some_chars ("*", 1);
_rl_output_some_chars (local_prompt, lendiff);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
/* We take wrap_offset into account here so we can pass correct
information to _rl_move_cursor_relative. */
@@ -1723,7 +1724,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (temp > 0)
{
_rl_output_some_chars (nfd, temp);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
_rl_last_c_pos += _rl_col_width (new, nd, ne - new, 1);
else
_rl_last_c_pos += temp;
@@ -1746,7 +1747,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* We need to indicate that the cursor position is correct in the presence of
invisible characters in the prompt string. Let's see if setting this when
we make sure we're at the end of the drawn prompt string works. */
if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 &&
if (current_line == 0 && mb_cur_max > 1 && rl_byte_oriented == 0 &&
(_rl_last_c_pos > 0 || o_cpos > 0) &&
_rl_last_c_pos == prompt_physical_chars)
cpos_adjusted = 1;
@@ -1757,7 +1758,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
col_lendiff == difference on screen (columns)
When not using multibyte characters, these are equal */
lendiff = (nls - nfd) - (ols - ofd);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
col_lendiff = _rl_col_width (new, nfd - new, nls - new, 1) - _rl_col_width (old, ofd - old, ols - old, 1);
else
col_lendiff = lendiff;
@@ -1768,7 +1769,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
current_invis_chars != visible_wrap_offset)
{
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
lendiff += visible_wrap_offset - current_invis_chars;
col_lendiff += visible_wrap_offset - current_invis_chars;
@@ -1786,7 +1787,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
and writes TEMP bytes. */
/* Insert (diff (len (old), len (new)) ch. */
temp = ne - nfd;
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
col_temp = _rl_col_width (new, nfd - new, ne - new, 1);
else
col_temp = temp;
@@ -1837,7 +1838,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
_rl_last_c_pos == 0 &&
lendiff > prompt_visible_length &&
current_invis_chars > 0) == 0) &&
(((MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
(((mb_cur_max > 1 && rl_byte_oriented == 0) &&
current_line == 0 && wrap_offset &&
((nfd - new) <= prompt_last_invisible) &&
(col_lendiff < prompt_visible_length)) == 0) &&
@@ -1845,12 +1846,12 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
{
open_some_spaces (col_lendiff);
_rl_output_some_chars (nfd, bytes_to_insert);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
_rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1);
else
_rl_last_c_pos += bytes_to_insert;
}
else if ((MB_CUR_MAX == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0)
else if ((mb_cur_max == 1 || rl_byte_oriented != 0) && *ols == 0 && lendiff > 0)
{
/* At the end of a line the characters do not have to
be "inserted". They can just be placed on the screen. */
@@ -1865,7 +1866,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* If nfd begins before the last invisible character in the
prompt, adjust _rl_last_c_pos to account for wrap_offset
and set cpos_adjusted to let the caller know. */
if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible))
if ((mb_cur_max > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible))
{
_rl_last_c_pos -= wrap_offset;
cpos_adjusted = 1;
@@ -1878,7 +1879,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
/* If nfd begins before the last invisible character in the
prompt, adjust _rl_last_c_pos to account for wrap_offset
and set cpos_adjusted to let the caller know. */
if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible))
if ((mb_cur_max > 1 && rl_byte_oriented == 0) && current_line == 0 && displaying_prompt_first_line && wrap_offset && ((nfd - new) <= prompt_last_invisible))
{
_rl_last_c_pos -= wrap_offset;
cpos_adjusted = 1;
@@ -1898,7 +1899,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
crude attempt to compute how far into the new line buffer we are.
It doesn't work well in the face of multibyte characters and needs
to be rethought. XXX */
if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
if ((mb_cur_max > 1 && rl_byte_oriented == 0) &&
current_line == prompt_last_screen_line && wrap_offset &&
displaying_prompt_first_line &&
wrap_offset != prompt_invis_chars_first_line &&
@@ -1942,7 +1943,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
in a multibyte locale to account for the wrap offset and
set cpos_adjusted accordingly. */
_rl_output_some_chars (nfd, bytes_to_insert);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
_rl_last_c_pos += _rl_col_width (nfd, 0, bytes_to_insert, 1);
if (current_line == 0 && wrap_offset &&
@@ -1977,7 +1978,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
set cpos_adjusted accordingly. */
_rl_output_some_chars (nfd, temp);
_rl_last_c_pos += col_temp; /* XXX */
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
if (current_line == 0 && wrap_offset &&
displaying_prompt_first_line &&
@@ -1991,7 +1992,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
}
clear_rest_of_line:
lendiff = (oe - old) - (ne - new);
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
col_lendiff = _rl_col_width (old, 0, oe - old, 1) - _rl_col_width (new, 0, ne - new, 1);
else
col_lendiff = lendiff;
@@ -2001,7 +2002,7 @@ clear_rest_of_line:
space_to_eol will insert too many spaces. XXX - maybe we should
adjust col_lendiff based on the difference between _rl_last_c_pos
and _rl_screenwidth */
if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth)))
if (col_lendiff && ((mb_cur_max == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth)))
{
if (_rl_term_autowrap && current_line < inv_botlin)
space_to_eol (col_lendiff);
@@ -2027,6 +2028,34 @@ rl_on_new_line ()
return 0;
}
/* Clear all screen lines occupied by the current readline line buffer
(visible line) */
int
rl_clear_visible_line ()
{
int curr_line;
/* Make sure we move to column 0 so we clear the entire line */
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_last_c_pos = 0;
/* Move to the last screen line of the current visible line */
_rl_move_vert (_rl_vis_botlin);
/* And erase screen lines going up to line 0 (first visible line) */
for (curr_line = _rl_last_v_pos; curr_line >= 0; curr_line--)
{
_rl_move_vert (curr_line);
_rl_clear_to_eol (0);
}
return 0;
}
/* Tell the update routines that we have moved onto a new line with the
prompt already displayed. Code originally from the version of readline
distributed with CLISP. rl_expand_prompt must have already been called
@@ -2133,6 +2162,7 @@ _rl_move_cursor_relative (new, data)
int cpos, dpos; /* current and desired cursor positions */
int adjust;
int in_invisline;
int mb_cur_max = MB_CUR_MAX;
woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
cpos = _rl_last_c_pos;
@@ -2146,7 +2176,7 @@ _rl_move_cursor_relative (new, data)
this case, NEW's display position is not obvious and must be
calculated. We need to account for invisible characters in this line,
as long as we are past them and they are counted by _rl_col_width. */
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
adjust = 1;
/* Try to short-circuit common cases and eliminate a bunch of multibyte
@@ -2214,7 +2244,7 @@ _rl_move_cursor_relative (new, data)
of moving backwards. */
/* i == current physical cursor position. */
#if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
i = _rl_last_c_pos;
else
#endif
@@ -2249,7 +2279,7 @@ _rl_move_cursor_relative (new, data)
in the buffer and we have to go back to the beginning of the screen
line. In this case, we can use the terminal sequence to move forward
if it's available. */
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
if (mb_cur_max > 1 && rl_byte_oriented == 0)
{
if (_rl_term_forward_char)
{
+41 -1
View File
@@ -963,6 +963,10 @@ redisplay.
It should be used after setting @var{rl_already_prompted}.
@end deftypefun
@deftypefun int rl_clear_visible_line (void)
Clear the screen lines corresponding to the current line's contents.
@end deftypefun
@deftypefun int rl_reset_line_state (void)
Reset the display state to a clean state and redisplay the current line
starting on a new line.
@@ -1136,6 +1140,14 @@ that the terminal editing characters are bound to @code{rl_insert}.
The bindings are performed in @var{kmap}.
@end deftypefun
@deftypefun int rl_tty_set_echoing (int value)
Set Readline's idea of whether or not it is echoing output to its output
stream (@var{rl_outstream}). If @var{value} is 0, Readline does not display
output to @var{rl_outstream}; any other value enables output. The initial
value is set when Readline initializes the terminal settings.
This function returns the previous value.
@end deftypefun
@deftypefun int rl_reset_terminal (const char *terminal_name)
Reinitialize Readline's idea of the terminal settings using
@var{terminal_name} as the terminal type (e.g., @code{vt100}).
@@ -1423,12 +1435,16 @@ It understands the EOF character or "exit" to exit the program.
@example
/* Standard include files. stdio.h is required. */
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <locale.h>
/* Used for select(2) */
#include <sys/types.h>
#include <sys/select.h>
#include <signal.h>
#include <stdio.h>
/* Standard readline include files. */
@@ -1436,10 +1452,20 @@ It understands the EOF character or "exit" to exit the program.
#include <readline/history.h>
static void cb_linehandler (char *);
static void sighandler (int);
int running;
int sigwinch_received;
const char *prompt = "rltest$ ";
/* Handle SIGWINCH and window size changes when readline is not active and
reading a character. */
static void
sighandler (int sig)
@{
sigwinch_received = 1;
@}
/* Callback function called for each line when accept-line executed, EOF
seen, or EOF character read. This sets a flag and returns; it could
also call exit(3). */
@@ -1474,6 +1500,13 @@ main (int c, char **v)
fd_set fds;
int r;
/* Set the default locale values according to environment variables. */
setlocale (LC_ALL, "");
/* Handle window size changes when readline is not active and reading
characters. */
signal (SIGWINCH, sighandler);
/* Install the line handler. */
rl_callback_handler_install (prompt, cb_linehandler);
@@ -1488,12 +1521,19 @@ main (int c, char **v)
FD_SET (fileno (rl_instream), &fds);
r = select (FD_SETSIZE, &fds, NULL, NULL, NULL);
if (r < 0)
if (r < 0 && errno != EINTR)
@{
perror ("rltest: select");
rl_callback_handler_remove ();
break;
@}
if (sigwinch_received)
@{
rl_resize_terminal ();
sigwinch_received = 0;
}@
if (r < 0)
continue;
if (FD_ISSET (fileno (rl_instream), &fds))
rl_callback_read_char ();
+17 -10
View File
@@ -499,7 +499,9 @@ The default limit is @code{100}.
If set to @samp{on}, Readline will convert characters with the
eighth bit set to an @sc{ascii} key sequence by stripping the eighth
bit and prefixing an @key{ESC} character, converting them to a
meta-prefixed key sequence. The default value is @samp{on}.
meta-prefixed key sequence. The default value is @samp{on}, but
will be set to @samp{off} if the locale is one that contains
eight-bit characters.
@item disable-completion
@vindex disable-completion
@@ -507,6 +509,12 @@ If set to @samp{On}, Readline will inhibit word completion.
Completion characters will be inserted into the line as if they had
been mapped to @code{self-insert}. The default is @samp{off}.
@item echo-control-characters
@vindex echo-control-characters
When set to @samp{on}, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard. The default is @samp{on}.
@item editing-mode
@vindex editing-mode
The @code{editing-mode} variable controls which default set of
@@ -525,12 +533,6 @@ non-printing characters, which can be used to embed a terminal control
sequence into the mode string.
The default is @samp{@@}.
@item echo-control-characters
@vindex echo-control-characters
When set to @samp{on}, on operating systems that indicate they support it,
readline echoes a character corresponding to a signal generated from the
keyboard. The default is @samp{on}.
@item enable-bracketed-paste
@vindex enable-bracketed-paste
When set to @samp{On}, Readline will configure the terminal in a way
@@ -571,6 +573,8 @@ are saved.
If set to a value less than zero, the number of history entries is not
limited.
By default, the number of history entries is not limited.
If an attempt is made to set @var{history-size} to a non-numeric value,
the maximum number of history entries will be set to 500.
@item horizontal-scroll-mode
@vindex horizontal-scroll-mode
@@ -586,8 +590,9 @@ this variable is set to @samp{off}.
If set to @samp{on}, Readline will enable eight-bit input (it
will not clear the eighth bit in the characters it reads),
regardless of what the terminal claims it can support. The
default value is @samp{off}. The name @code{meta-flag} is a
synonym for this variable.
default value is @samp{off}, but Readline will set it to @samp{on} if the
locale contains eight-bit characters.
The name @code{meta-flag} is a synonym for this variable.
@item isearch-terminators
@vindex isearch-terminators
@@ -666,7 +671,9 @@ the list. The default is @samp{off}.
@vindex output-meta
If set to @samp{on}, Readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence. The default is @samp{off}.
sequence.
The default is @samp{off}, but Readline will set it to @samp{on} if the
locale contains eight-bit characters.
@item page-completions
@vindex page-completions
+3 -3
View File
@@ -4,7 +4,7 @@ Copyright (C) 1988-2016 Free Software Foundation, Inc.
@set EDITION 7.0
@set VERSION 7.0
@set UPDATED 25 January 2016
@set UPDATED-MONTH January 2016
@set UPDATED 20 April 2016
@set UPDATED-MONTH April 2016
@set LASTCHANGE Mon Jan 25 10:08:41 EST 2016
@set LASTCHANGE Wed Apr 20 13:32:48 PDT 2016
+2 -1
View File
@@ -1,6 +1,6 @@
/* funmap.c -- attach names to functions. */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 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.
@@ -194,6 +194,7 @@ static const FUNMAP default_funmap[] = {
{ "vi-set-mark", rl_vi_set_mark },
{ "vi-subst", rl_vi_subst },
{ "vi-tilde-expand", rl_vi_tilde_expand },
{ "vi-unix-word-rubout", rl_vi_unix_word_rubout },
{ "vi-yank-arg", rl_vi_yank_arg },
{ "vi-yank-pop", rl_vi_yank_pop },
{ "vi-yank-to", rl_vi_yank_to },
+28 -4
View File
@@ -1220,7 +1220,7 @@ history_expand (hstring, output)
ADD_STRING (temp);
xfree (temp);
}
only_printing = r == 1;
only_printing += r == 1;
i = eindex;
}
break;
@@ -1421,7 +1421,7 @@ history_tokenize_word (string, ind)
const char *string;
int ind;
{
register int i;
register int i, j;
int delimiter, nestdelim, delimopen;
i = ind;
@@ -1433,6 +1433,22 @@ history_tokenize_word (string, ind)
return i;
}
if (isdigit (string[i]))
{
j = i;
while (string[j] && isdigit (string[j]))
j++;
if (string[j] == 0)
return (j);
if (string[j] == '<' || string[j] == '>')
i = j; /* digit sequence is a file descriptor */
else
{
i = j;
goto get_word; /* digit sequence is part of a word */
}
}
if (member (string[i], "<>;&|$"))
{
int peek = string[i + 1];
@@ -1446,8 +1462,16 @@ history_tokenize_word (string, ind)
i += 2;
return i;
}
else if ((peek == '&' && (string[i] == '>' || string[i] == '<')) ||
(peek == '>' && string[i] == '&'))
else if (peek == '&' && (string[i] == '>' || string[i] == '<'))
{
j = i + 2;
while (string[j] && isdigit (string[j])) /* file descriptor */
j++;
if (string[j] =='-') /* <&[digits]-, >&[digits]- */
j++;
return j;
}
else if ((peek == '>' && string[i] == '&') || (peek == '|' && string[i] == '>'))
{
i += 2;
return i;
-3
View File
@@ -76,7 +76,4 @@ extern char *strchr ();
#define HISTORY_APPEND 0
#define HISTORY_OVERWRITE 1
/* Some variable definitions shared across history source files. */
extern int history_offset;
#endif /* !_HISTLIB_H_ */
-2
View File
@@ -56,8 +56,6 @@
static int rl_digit_loop PARAMS((void));
static void _rl_history_set_point PARAMS((void));
extern int history_offset;
/* Forward declarations used in this file */
void _rl_free_history_entry PARAMS((HIST_ENTRY *));
+1 -1
View File
@@ -965,7 +965,7 @@ _rl_dispatch_subseq (key, map, got_subseq)
/* Tentative inter-character timeout for potential multi-key
sequences? If no input within timeout, abort sequence and
act as if we got non-matching input. */
/* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued[B
/* _rl_keyseq_timeout specified in milliseconds; _rl_input_queued
takes microseconds, so multiply by 1000 */
if (_rl_keyseq_timeout > 0 &&
(RL_ISSTATE (RL_STATE_INPUTPENDING|RL_STATE_MACROINPUT) == 0) &&
+3 -1
View File
@@ -1,6 +1,6 @@
/* Readline.h -- the names of functions callable from within readline. */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 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.
@@ -253,6 +253,7 @@ extern int rl_vi_yank_pop PARAMS((int, int));
extern int rl_vi_rubout PARAMS((int, int));
extern int rl_vi_delete PARAMS((int, int));
extern int rl_vi_back_to_indent PARAMS((int, int));
extern int rl_vi_unix_word_rubout PARAMS((int, int));
extern int rl_vi_first_print PARAMS((int, int));
extern int rl_vi_char_search PARAMS((int, int));
extern int rl_vi_match PARAMS((int, int));
@@ -378,6 +379,7 @@ extern void rl_redisplay PARAMS((void));
extern int rl_on_new_line PARAMS((void));
extern int rl_on_new_line_with_prompt PARAMS((void));
extern int rl_forced_update_display PARAMS((void));
extern int rl_clear_visible_line PARAMS((void));
extern int rl_clear_message PARAMS((void));
extern int rl_reset_line_state PARAMS((void));
extern int rl_crlf PARAMS((void));
+19 -1
View File
@@ -1,7 +1,7 @@
/* rltty.c -- functions to prepare and restore the terminal for readline's
use. */
/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
/* Copyright (C) 1992-2016 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.
@@ -714,6 +714,19 @@ rl_deprep_terminal ()
_rl_release_sigint ();
}
#endif /* !NO_TTY_DRIVER */
/* Set readline's idea of whether or not it is echoing output to the terminal,
returning the old value. */
int
rl_tty_set_echoing (u)
int u;
{
int o;
o = _rl_echoing_p;
_rl_echoing_p = u;
return o;
}
/* **************************************************************** */
/* */
@@ -876,6 +889,11 @@ _rl_bind_tty_special_chars (kmap, ttybuff)
# endif /* VLNEXT && TERMIOS_TTY_DRIVER */
# if defined (VWERASE) && defined (TERMIOS_TTY_DRIVER)
# if defined (VI_MODE)
if (rl_editing_mode == vi_mode)
SET_SPECIAL (VWERASE, rl_vi_unix_word_rubout);
else
# endif
SET_SPECIAL (VWERASE, rl_unix_word_rubout);
# endif /* VWERASE && TERMIOS_TTY_DRIVER */
}
+1 -1
View File
@@ -572,7 +572,7 @@ rl_refresh_line (ignore1, ignore2)
_rl_clear_to_eol (0); /* arg of 0 means to not use spaces */
rl_forced_update_display ();
rl_redraw_prompt_last_line ();
rl_display_fixed = 1;
return 0;
+5 -1
View File
@@ -236,7 +236,11 @@ tilde_expand (string)
string += end;
expansion = tilde_expand_word (tilde_word);
xfree (tilde_word);
if (expansion == 0)
expansion = tilde_word;
else
xfree (tilde_word);
len = strlen (expansion);
#ifdef __CYGWIN__
+3 -3
View File
@@ -1,6 +1,6 @@
/* vi_keymap.c -- the keymap for vi_mode in readline (). */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 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.
@@ -55,7 +55,7 @@ KEYMAP_ENTRY_ARRAY vi_movement_keymap = {
{ ISFUNC, rl_transpose_chars }, /* Control-t */
{ ISFUNC, rl_unix_line_discard }, /* Control-u */
{ ISFUNC, rl_quoted_insert }, /* Control-v */
{ ISFUNC, rl_unix_word_rubout }, /* Control-w */
{ ISFUNC, rl_vi_unix_word_rubout }, /* Control-w */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Control-x */
{ ISFUNC, rl_yank }, /* Control-y */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Control-z */
@@ -334,7 +334,7 @@ KEYMAP_ENTRY_ARRAY vi_insertion_keymap = {
{ ISFUNC, rl_transpose_chars }, /* Control-t */
{ ISFUNC, rl_unix_line_discard }, /* Control-u */
{ ISFUNC, rl_quoted_insert }, /* Control-v */
{ ISFUNC, rl_unix_word_rubout }, /* Control-w */
{ ISFUNC, rl_vi_unix_word_rubout }, /* Control-w */
{ ISFUNC, rl_insert }, /* Control-x */
{ ISFUNC, rl_yank }, /* Control-y */
{ ISFUNC, rl_insert }, /* Control-z */
+57 -1
View File
@@ -1,7 +1,7 @@
/* vi_mode.c -- A vi emulation mode for Bash.
Derived from code written by Jeff Sparkes (jsparkes@bnr.ca). */
/* Copyright (C) 1987-2015 Free Software Foundation, Inc.
/* Copyright (C) 1987-2016 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.
@@ -1620,6 +1620,62 @@ rl_vi_delete (count, key)
return (0);
}
/* This does what Posix specifies vi-mode C-w to do: using whitespace and
punctuation characters as the word boundaries. */
#define vi_unix_word_boundary(c) (whitespace(c) || ispunct(c))
int
rl_vi_unix_word_rubout (count, key)
int count, key;
{
int orig_point;
if (rl_point == 0)
rl_ding ();
else
{
orig_point = rl_point;
if (count <= 0)
count = 1;
while (count--)
{
/* This isn't quite what ksh93 does but it seems to match what the
Posix description of sh specifies, with a few accommodations
for sequences of whitespace characters between words and at
the end of the line. */
/* Skip over whitespace at the end of the line as a special case */
if (rl_point > 0 && (rl_line_buffer[rl_point] == 0) &&
whitespace (rl_line_buffer[rl_point - 1]))
while (--rl_point > 0 && whitespace (rl_line_buffer[rl_point]))
;
/* If we're at the start of a word, move back to word boundary so we
move back to the `preceding' word */
if (rl_point > 0 && (vi_unix_word_boundary (rl_line_buffer[rl_point]) == 0) &&
vi_unix_word_boundary (rl_line_buffer[rl_point - 1]))
rl_point--;
/* If we are at a word boundary (whitespace/punct), move backward
past a sequence of word boundary characters. If we are at the
end of a word (non-word boundary), move back to a word boundary */
if (rl_point > 0 && vi_unix_word_boundary (rl_line_buffer[rl_point]))
while (rl_point && vi_unix_word_boundary (rl_line_buffer[rl_point - 1]))
rl_point--;
else if (rl_point > 0 && vi_unix_word_boundary (rl_line_buffer[rl_point]) == 0)
while (rl_point && (vi_unix_word_boundary (rl_line_buffer[rl_point - 1]) == 0))
rl_point--;
}
rl_kill_text (orig_point, rl_point);
}
return 0;
}
int
rl_vi_back_to_indent (count, key)
int count, key;
+1 -1
View File
@@ -52,7 +52,7 @@ isnetconn (fd)
l = sizeof(sa);
rv = getpeername(fd, &sa, &l);
/* Posix.2 says getpeername can return these errors. */
return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL)) ? 0 : 1);
return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL || errno == EBADF)) ? 0 : 1);
#else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */
# if defined (SVR4) || defined (SVR4_2)
/* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */
+1 -1
View File
@@ -92,7 +92,7 @@ sh_regmatch (string, pattern, flags)
/* Store the parenthesized subexpressions in the array BASH_REMATCH.
Element 0 is the portion that matched the entire regexp. Element 1
is the part that matched the first subexpression, and so on. */
unbind_variable ("BASH_REMATCH");
unbind_variable_noref ("BASH_REMATCH");
rematch = make_new_array_variable ("BASH_REMATCH");
amatch = array_cell (rematch);
+21 -1
View File
@@ -114,6 +114,23 @@ get_tmpdir (flags)
return tdir;
}
static void
sh_seedrand ()
{
#if HAVE_RANDOM
int d;
static int seeded = 0;
if (seeded == 0)
{
struct timeval tv;
gettimeofday (&tv, NULL);
srandom (tv.tv_sec ^ tv.tv_usec ^ (getpid () << 16) ^ (unsigned int)&d);
seeded = 1;
}
#endif
}
char *
sh_mktmpname (nameroot, flags)
char *nameroot;
@@ -122,6 +139,7 @@ sh_mktmpname (nameroot, flags)
char *filename, *tdir, *lroot;
struct stat sb;
int r, tdlen;
static int seeded = 0;
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags);
@@ -137,6 +155,7 @@ sh_mktmpname (nameroot, flags)
filename = NULL;
}
#else /* !USE_MKTEMP */
sh_seedrand ();
while (1)
{
filenum = (filenum << 1) ^
@@ -167,7 +186,7 @@ sh_mktmpfd (nameroot, flags, namep)
{
char *filename, *tdir, *lroot;
int fd, tdlen;
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags);
tdlen = strlen (tdir);
@@ -186,6 +205,7 @@ sh_mktmpfd (nameroot, flags, namep)
*namep = filename;
return fd;
#else /* !USE_MKSTEMP */
sh_seedrand ();
do
{
filenum = (filenum << 1) ^
+5 -1
View File
@@ -236,7 +236,11 @@ tilde_expand (string)
string += end;
expansion = tilde_expand_word (tilde_word);
xfree (tilde_word);
if (expansion == 0)
expansion = tilde_word;
else
xfree (tilde_word);
len = strlen (expansion);
#ifdef __CYGWIN__
+10
View File
@@ -46,6 +46,7 @@
#include "shell.h"
#include "jobs.h"
#include "execute_cmd.h"
#include "trap.h"
#include "builtins/builtext.h" /* for wait_builtin */
@@ -84,6 +85,8 @@ extern procenv_t wait_intr_buf;
extern int wait_intr_flag;
extern int wait_signal_received;
extern void set_original_signal __P((int, SigHandler *));
volatile pid_t last_made_pid = NO_PID;
volatile pid_t last_asynchronous_pid = NO_PID;
@@ -416,6 +419,7 @@ reap_dead_jobs ()
}
/* Initialize the job control mechanism, and set up the tty stuff. */
int
initialize_job_control (force)
int force;
{
@@ -423,6 +427,7 @@ initialize_job_control (force)
if (interactive)
get_tty_state ();
return 0;
}
/* Setup this shell to handle C-C, etc. */
@@ -927,6 +932,7 @@ static TTYSTRUCT shell_tty_info;
static int got_tty_state;
/* Fill the contents of shell_tty_info with the current tty info. */
int
get_tty_state ()
{
int tty;
@@ -939,6 +945,7 @@ get_tty_state ()
if (check_window_size)
get_new_window_size (0, (int *)0, (int *)0);
}
return 0;
}
/* Make the current tty use the state in shell_tty_info. */
@@ -958,10 +965,12 @@ set_tty_state ()
}
/* Give the terminal to PGRP. */
int
give_terminal_to (pgrp, force)
pid_t pgrp;
int force;
{
return 0;
}
/* Stop a pipeline. */
@@ -1008,6 +1017,7 @@ describe_pid (pid)
int
freeze_jobs_list ()
{
return 0;
}
void
+157 -15
View File
@@ -69,6 +69,8 @@
#if defined (JOB_CONTROL)
# include "jobs.h"
#else
extern int cleanup_dead_jobs __P((void));
#endif /* JOB_CONTROL */
#if defined (ALIAS)
@@ -1959,6 +1961,13 @@ parser_restore_alias ()
#endif
}
void
clear_shell_input_line ()
{
if (shell_input_line)
shell_input_line[shell_input_line_index = 0] = '\0';
}
/* Return a line of text, taken from wherever yylex () reads input.
If there is no more input, then we return NULL. If REMOVE_QUOTED_NEWLINE
is non-zero, we remove unquoted \<newline> pairs. This is used by
@@ -2312,7 +2321,7 @@ shell_getc (remove_quoted_newline)
if (n <= 2) /* we have to save 1 for the newline added below */
{
if (truncating == 0)
internal_warning("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%llu): line truncated", shell_input_line_size, (unsigned long)SIZE_MAX);
internal_warning(_("shell_getc: shell_input_line_size (%zu) exceeds SIZE_MAX (%lu): line truncated"), shell_input_line_size, (unsigned long)SIZE_MAX);
shell_input_line[i] = '\0';
truncating = 1;
}
@@ -3033,6 +3042,7 @@ reset_parser ()
free_string_list ();
#endif /* ALIAS || DPAREN_ARITHMETIC */
/* This is where we resynchronize to the next newline on error/reset */
if (shell_input_line)
{
free (shell_input_line);
@@ -3316,7 +3326,8 @@ tokword:
#define LEX_INHEREDOC 0x080
#define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */
#define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */
#define LEX_INWORD 0x400
#define LEX_QUOTEDDOC 0x400 /* here doc with quoted delim */
#define LEX_INWORD 0x800
#define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|')
@@ -3608,6 +3619,81 @@ parse_dollar_word:
return ret;
}
#if defined (DEBUG)
static void
dump_tflags (flags)
int flags;
{
int f;
f = flags;
fprintf (stderr, "%d -> ", f);
if (f & LEX_WASDOL)
{
f &= ~LEX_WASDOL;
fprintf (stderr, "LEX_WASDOL%s", f ? "|" : "");
}
if (f & LEX_CKCOMMENT)
{
f &= ~LEX_CKCOMMENT;
fprintf (stderr, "LEX_CKCOMMENT%s", f ? "|" : "");
}
if (f & LEX_INCOMMENT)
{
f &= ~LEX_INCOMMENT;
fprintf (stderr, "LEX_INCOMMENT%s", f ? "|" : "");
}
if (f & LEX_PASSNEXT)
{
f &= ~LEX_PASSNEXT;
fprintf (stderr, "LEX_PASSNEXT%s", f ? "|" : "");
}
if (f & LEX_RESWDOK)
{
f &= ~LEX_RESWDOK;
fprintf (stderr, "LEX_RESWDOK%s", f ? "|" : "");
}
if (f & LEX_CKCASE)
{
f &= ~LEX_CKCASE;
fprintf (stderr, "LEX_CKCASE%s", f ? "|" : "");
}
if (f & LEX_INCASE)
{
f &= ~LEX_INCASE;
fprintf (stderr, "LEX_INCASE%s", f ? "|" : "");
}
if (f & LEX_INHEREDOC)
{
f &= ~LEX_INHEREDOC;
fprintf (stderr, "LEX_INHEREDOC%s", f ? "|" : "");
}
if (f & LEX_HEREDELIM)
{
f &= ~LEX_HEREDELIM;
fprintf (stderr, "LEX_HEREDELIM%s", f ? "|" : "");
}
if (f & LEX_STRIPDOC)
{
f &= ~LEX_STRIPDOC;
fprintf (stderr, "LEX_WASDOL%s", f ? "|" : "");
}
if (f & LEX_QUOTEDDOC)
{
f &= ~LEX_QUOTEDDOC;
fprintf (stderr, "LEX_QUOTEDDOC%s", f ? "|" : "");
}
if (f & LEX_INWORD)
{
f &= ~LEX_INWORD;
fprintf (stderr, "LEX_INWORD%s", f ? "|" : "");
}
fprintf (stderr, "\n");
fflush (stderr);
}
#endif
/* Parse a $(...) command substitution. This is messier than I'd like, and
reproduces a lot more of the token-reading code than I'd like. */
static char *
@@ -3685,7 +3771,7 @@ eof_error:
tind++;
if (STREQN (ret + tind, heredelim, hdlen))
{
tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC);
tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC|LEX_QUOTEDDOC);
/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/
free (heredelim);
heredelim = 0;
@@ -3705,21 +3791,29 @@ eof_error:
if ((tflags & LEX_INHEREDOC) && ch == close && count == 1)
{
int tind;
/*itrace("parse_comsub: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", retind-lex_firstind, hdlen, retind);*/
/*itrace("parse_comsub:%d: in here doc, ch == close, retind - firstind = %d hdlen = %d retind = %d", line_number, retind-lex_firstind, hdlen, retind);*/
tind = lex_firstind;
while ((tflags & LEX_STRIPDOC) && ret[tind] == '\t')
tind++;
if (retind-tind == hdlen && STREQN (ret + tind, heredelim, hdlen))
{
tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC);
/*itrace("parse_comsub:%d: found here doc end `%s'", line_number, ret + tind);*/
tflags &= ~(LEX_STRIPDOC|LEX_INHEREDOC|LEX_QUOTEDDOC);
/*itrace("parse_comsub:%d: found here doc end `%*s'", line_number, hdlen, ret + tind);*/
free (heredelim);
heredelim = 0;
lex_firstind = -1;
}
}
/* Don't bother counting parens or doing anything else if in a comment */
/* Don't bother counting parens or doing anything else if in a comment or
here document (not exactly right for here-docs -- if we want to allow
recursive calls to parse_comsub to have their own here documents,
change the LEX_INHEREDOC to LEX_QUOTEDDOC here and uncomment the next
clause below. Note that to make this work completely, we need to make
additional changes to allow xparse_dolparen to work right when the
command substitution is parsed, because read_secondary_line doesn't know
to recursively parse through command substitutions embedded in here-
documents */
if (tflags & (LEX_INCOMMENT|LEX_INHEREDOC))
{
/* Add this character. */
@@ -3734,6 +3828,21 @@ eof_error:
continue;
}
#if 0
/* If we're going to recursively parse a command substitution inside a
here-document, make sure we call parse_comsub recursively below. See
above for additional caveats. */
if ((tflags & LEX_INHEREDOC) && ((tflags & LEX_WASDOL) == 0 || ch != '(')) /*)*/
{
/* Add this character. */
RESIZE_MALLOCED_BUFFER (ret, retind, 1, retsize, 64);
ret[retind++] = ch;
if MBTEST(ch == '$')
tflags |= LEX_WASDOL;
else
tflags &= ~LEX_WASDOL;
}
#endif
if (tflags & LEX_PASSNEXT) /* last char was backslash */
{
@@ -3814,6 +3923,8 @@ eof_error:
free (nestret);
hdlen = STRLEN(heredelim);
/*itrace("parse_comsub:%d: found here doc delimiter `%s' (%d)", line_number, heredelim, hdlen);*/
if (STREQ (heredelim, nestret) == 0)
tflags |= LEX_QUOTEDDOC;
}
if (ch == '\n')
{
@@ -3876,14 +3987,34 @@ eof_error:
if (STREQN (ret + retind - 4, "case", 4))
{
tflags |= LEX_INCASE;
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `case', lex_incase -> 1 lex_reswdok -> 0", line_number);*/
}
else if (STREQN (ret + retind - 4, "esac", 4))
{
tflags &= ~LEX_INCASE;
/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 0", line_number);*/
/*itrace("parse_comsub:%d: found `esac', lex_incase -> 0 lex_reswdok -> 1", line_number);*/
tflags |= LEX_RESWDOK;
lex_rwlen = 0;
}
else if (STREQN (ret + retind - 4, "done", 4) ||
STREQN (ret + retind - 4, "then", 4) ||
STREQN (ret + retind - 4, "else", 4) ||
STREQN (ret + retind - 4, "elif", 4) ||
STREQN (ret + retind - 4, "time", 4))
{
/* these are four-character reserved words that can be
followed by a reserved word; anything else turns off
the reserved-word-ok flag */
/*itrace("parse_comsub:%d: found `%.4s', lex_reswdok -> 1", line_number, ret+retind-4);*/
tflags |= LEX_RESWDOK;
lex_rwlen = 0;
}
else
{
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `%.4s', lex_reswdok -> 0", line_number, ret+retind-4);*/
}
tflags &= ~LEX_RESWDOK;
}
else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))
; /* don't modify LEX_RESWDOK if we're starting a comment */
@@ -4572,7 +4703,7 @@ read_token_word (character)
/* Non-zero means to ignore the value of the next character, and just
to add it no matter what. */
int pass_next_character;
int pass_next_character;
/* The current delimiting character. */
int cd;
@@ -4869,7 +5000,6 @@ read_token_word (character)
}
got_character:
if (character == CTLESC || character == CTLNUL)
{
RESIZE_MALLOCED_BUFFER (token, token_index, 2, token_buffer_size,
@@ -5331,7 +5461,7 @@ decode_prompt_string (string)
#if defined (PROMPT_STRING_DECODE)
int result_size, result_index;
int c, n, i;
char *temp, octal_string[4];
char *temp, *t_host, octal_string[4];
struct tm *tm;
time_t the_time;
char timebuf[128];
@@ -5479,7 +5609,11 @@ decode_prompt_string (string)
case 's':
temp = base_pathname (shell_name);
temp = savestring (temp);
/* Try to quote anything the user can set in the file system */
if (promptvars || posixly_correct)
temp = sh_backslash_quote_for_double_quotes (temp);
else
temp = savestring (temp);
goto add_string;
case 'v':
@@ -5569,9 +5703,17 @@ decode_prompt_string (string)
case 'h':
case 'H':
temp = savestring (current_host_name);
if (c == 'h' && (t = (char *)strchr (temp, '.')))
t_host = savestring (current_host_name);
if (c == 'h' && (t = (char *)strchr (t_host, '.')))
*t = '\0';
if (promptvars || posixly_correct)
/* Make sure that expand_prompt_string is called with a
second argument of Q_DOUBLE_QUOTES if we use this
function here. */
temp = sh_backslash_quote_for_double_quotes (t_host);
else
temp = savestring (t_host);
free (t_host);
goto add_string;
case '#':
+1 -1
View File
@@ -1,6 +1,6 @@
/* patchlevel.h -- current bash patch level */
/* Copyright (C) 2001-2012 Free Software Foundation, Inc.
/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
+8 -8
View File
@@ -1025,13 +1025,13 @@ static void
unbind_compfunc_variables (exported)
int exported;
{
unbind_variable ("COMP_LINE");
unbind_variable ("COMP_POINT");
unbind_variable ("COMP_TYPE");
unbind_variable ("COMP_KEY");
unbind_variable_noref ("COMP_LINE");
unbind_variable_noref ("COMP_POINT");
unbind_variable_noref ("COMP_TYPE");
unbind_variable_noref ("COMP_KEY");
#ifdef ARRAY_VARS
unbind_variable ("COMP_WORDS");
unbind_variable ("COMP_CWORD");
unbind_variable_noref ("COMP_WORDS");
unbind_variable_noref ("COMP_CWORD");
#endif
if (exported)
array_needs_making = 1;
@@ -1183,7 +1183,7 @@ gen_shell_function_matches (cs, cmd, text, line, ind, lwords, nw, cw, foundp)
}
/* XXX - should we unbind COMPREPLY here? */
unbind_variable ("COMPREPLY");
unbind_variable_noref ("COMPREPLY");
return (sl);
#endif
@@ -1643,7 +1643,7 @@ programmable_completions (cmd, word, start, end, foundp)
if (count > 32)
{
internal_warning ("programmable_completion: %s: possible retry loop", cmd);
internal_warning (_("programmable_completion: %s: possible retry loop"), cmd);
break;
}
}
BIN
View File
Binary file not shown.
+211 -166
View File
File diff suppressed because it is too large Load Diff
+212 -166
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+213 -163
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+216 -164
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+213 -166
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+213 -163
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+212 -163
View File
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