

index 4397bc42..16e48482 100644

--- a/

+++ b/ diff --git a/CHANGES b/CHANGESindex 4397bc42..16e48482 100644--- a/ CHANGES +++ b/ CHANGES @@ -1,3 +1,41 @@ +This document details the changes between this version, bash-5.0-rc1, and +the previous version, bash-5.0-beta2. + +1. Changes to Bash + +a. Fix to initial word completion detection code. + +b. Fixed a bug that caused issues with assignment statements containing ^A in + the value assigned when IFS contains ^A. + +c. Added a fallback to fnmatch() when strcoll can't correctly deal with + bracket expression character equivalence classes. + +d. Fixed a bug that caused $BASH_COMMAND to contain the trap handler command + when running a trap handler containing [[ or (( commands. + +e. Fixed a bug that caused nameref assignments in the temporary environment + to potentially create variables with invalid names. + +f. Fixed a bug that caused `local -' to turn off alias expansion in scripts. + +g. Fixed a parser issue with a command string containing EOF after an invalid + command as an argument to a special builtin not causing a posix-mode shell + to exit. + +h. Made a slight change to the FNV-1 string hash algorithm used for associative + arrays (corrected the initial seed). + +2. Changes to Readline + +3. New Features in Bash + +a. The `select' command now supports command forms without a word list + following `in'. + +4. New Features in Readline + +------------------------------------------------------------------------------ This document details the changes between this version, bash-5.0-beta2, and the previous version, bash-5.0-beta.

index 1bd376c8..411f1503 100644

--- a/

+++ b/ diff --git a/CWRU/changelog b/CWRU/changelogindex 1bd376c8..411f1503 100644--- a/ CWRU/changelog +++ b/ CWRU/changelog @@ -4762,3 +4762,151 @@ bashline.c from Luca Boccassi <bluca@debian.org> [bash-5.0-beta2 frozen] + + 11/27 + ----- +bashline.c + - attempt_shell_completion: better fix for problems with fix from + 11/16. Report and fix from Tom Ryder <tom@sanctum.geek.nz> + +expr.c + - expr_skipsubscript: fix return type. Report and fix from + Andreas Schwab <schwab@linux-m68k.org> + + 11/29 + ----- +subst.c + - quote_escapes_internal: refactored quote_escapes into a function + that takes an additional flag saying whether or not we are going + to split the result. If we are not, and CTLESC is in IFS, we quote + the CTLESC (ditto for CTLNUL) to prevent it being removed when the + string is dequoted. + - quote_escapes: call quote_escapes_internal with FLAGS == 0 + - quote_rhs: new function, calls quote_escapes with FLAGS == PF_NOSPLIT2 + so that a CTLESC will be quoted if CTLESC is in $IFS + - parameter_brace_expand_word: call quote_rhs on the value of a variable + if PFLAGS includes PF_ASSIGNRHS, indicating that we will not be + splitting the word, but we will be dequoting it. Fixes bug reported + by Martijn Dekker <martijn@inlv.org> + - param_expand: same change as for parameter_brace_expand_word + +execute_cmd.c + - execute_in_subshell: if we are running a trap (running_trap > 0), + turn off the SIG_INPROGRESS and SIG_CHANGED flags for that signal + by calling run_trap_cleanup and reset running_trap to 0 (watch the + second part!). Tagged for bash-5.1. + + 11/30 + ----- +lib/readline/doc/rltech.texi + - rl_set_keymap_name: correct typo in the name; some updates to the + description that clarify usage. Report from <hirooih@gmail.com> + + 12/4 + ---- +aclocal.m4 + - BASH_FUNC_FNMATCH_EQUIV_FALLBACK: a test of whether fnmatch(3) + understands bracket equivalence classes ([=c=]) for characters + that collate with equal weights but are not identical + +configure.ac,config.h.in + - call BASH_FUNC_FNMATCH_EQUIV_FALLBACK and define + FNMATCH_EQUIV_FALLBACK to 1 if it can be used for equivalence + classes + + 12/5 + ---- +execute_cmd.c + - eval_arith_for_expr,execute_arith_command,execute_cond_command: make + sure running_trap == 0 before we reset the_printed_command_except_trap + Report from Peng Yu <pengyu.ut@gmail.com> + +lib/glob/smatch.c + - _fnmatch_fallback_wc: new function, takes two wide characters c1 and + c2, converts them to a pattern ([[=c2=]]) and a string (c1) for + fnmatch to determine whether or not they are members of the same + equivalence class + - collequiv_wc: call _fnmatch_fallback_wc if rangecmp_wc returns + non-zero if FNMATCH_EQUIV_FALLBACK is defined, so we know that + fnmatch understands equivalence classes. Another Posix test suite + issue from Martin Rehak <martin.rehak@oracle.com> + + 12/6 + ---- +redir.c + - add missing cases to switch statements to shut up gcc + + 12/7 + ---- +builtins/set.def + - find_minus_o_option: new helper function, returns index into + o_options given option name + - minus_o_option_value,set_minus_o_option: use find_minus_o_option + +general.c + - new table of variables (currently all shopt options) that are + modified by going into and out of posix mode; num_posix_options() + returns the number of variables + - get_posix_options: fill in a bitmap passed as an argument (or return + a new one) of values of posix-mode-modified variables in the table + - set_posix_options: set values of posix-mode-modified variables from + the table using the passed bitmap for values + +builtins/set.def + - get_current_options: make the bitmap large enough to hold the options + in the set table and the table of posix-mode-modified variables; call + get_posix_options to fill in those values after the values from the + o_options table + - set_current_options: call set_posix_options to reset the values of + the posix-mode-modified variables at the end of the bitmap, after + the o_options values. Fixes issue reported by PJ Eby + <pje@telecommunity.com> + + 12/9 + ---- +parse.y + - select_command: add two additional productions to support select + commands without a word_list following the `in'. Fixes omission + reported by Martijn Dekker <martijn@inlv.org> + + 12/11 + ----- +variables.c + - assign_in_env: don't allow namerefs in temporary environment + assignments to create variables with invalid names for export. Fixes + bug reported by Grisha Levit <grishalevit@gmail.com> + + 12/14 + ----- +parse.y + - don't change last_command_exit_value in the 'error yacc_EOF' production + if the parser sets it to something non-zero; just make sure it + indicates an error. Fixes problem with unexpected EOF in eval + reported by Martijn Dekker <martijn@inlv.org> + + 12/17 + ----- +expr.c + - exp2 -> expmuldiv + +lib/sh/smatch.c + - fnmatch: add extern declaration if FNMATCH_EQUIV_FALLBACK is being + used + +hashlib.c + - hash_string: add FNV offset as initial value for hash instead of + starting at 0, changes hash for associative arrays and requires a + bunch of changes to the "right" test suite files + +variables.c + - rseed: make it explicitly 32 bits; that's all we're interested in + anyway + + 12/18 + ----- + +variables.c + - brand: add some comments, make the constants explicitly 32 bits; + use signed 32-bit values for the intermediate calculations. The + algorithm is still minstd +

index 77edcbc1..44996811 100644

--- a/

+++ b/ diff --git a/MANIFEST b/MANIFESTindex 77edcbc1..44996811 100644--- a/ MANIFEST +++ b/ MANIFEST @@ -941,7 +941,6 @@ tests/cond-regexp2.sub f tests/cond-regexp3.sub f tests/coproc.tests f tests/coproc.right f -tests/coproc1.sub f tests/cprint.tests f tests/cprint.right f tests/dbg-support.right f

index 76dc9bc9..1413267f 100644

--- a/

+++ b/ diff --git a/aclocal.m4 b/aclocal.m4index 76dc9bc9..1413267f 100644--- a/ aclocal.m4 +++ b/ aclocal.m4 @@ -4223,3 +4223,40 @@ main(int c, char **v) [Define if you have a working sbrk function.]) fi ]) + +AC_DEFUN(BASH_FUNC_FNMATCH_EQUIV_FALLBACK, +[AC_MSG_CHECKING(whether fnmatch can be used to check bracket equivalence classes) +AC_CACHE_VAL(bash_cv_fnmatch_equiv_fallback, +[AC_TRY_RUN([ +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> +#include <fnmatch.h> +#include <locale.h> + +char *pattern = "[[=a=]]"; + +/* char *string = "ä"; */ +unsigned char string[4] = { '\xc3', '\xa4', '\0' }; + +int +main (int c, char **v) +{ + setlocale (LC_ALL, "de_DE.UTF-8"); + if (fnmatch (pattern, (const char *)string, 0) != FNM_NOMATCH) + exit (0); + exit (1); +} + +], bash_cv_fnmatch_equiv_fallback=yes, bash_cv_fnmatch_equiv_fallback=no, + [AC_MSG_WARN(cannot check fnmatch if cross compiling -- defaulting to no) + bash_cv_fnmatch_equiv_fallback=no] +)]) +AC_MSG_RESULT($bash_cv_fnmatch_equiv_fallback) +if test "$bash_cv_fnmatch_equiv_fallback" = "yes" ; then + bash_cv_fnmatch_equiv_value=1 +else + bash_cv_fnmatch_equiv_value=0 +fi +AC_DEFINE_UNQUOTED([FNMATCH_EQUIV_FALLBACK], [$bash_cv_fnmatch_equiv_value], [Whether fnmatch can be used for bracket equivalence classes]) +])

index d56cd79d..2846aabf 100644

--- a/

+++ b/ diff --git a/bashline.c b/bashline.cindex d56cd79d..2846aabf 100644--- a/ bashline.c +++ b/ bashline.c @@ -1583,7 +1583,8 @@ attempt_shell_completion (text, start, end) /* command completion if programmable completion fails */ /* If we have a completion for the initial word, we can prefer that */ in_command_position = s == start && (iw_compspec || STREQ (n, text)); /* XXX */ - foundcs = foundcs && (iw_compspec == 0); + if (iw_compspec && in_command_position) + foundcs = 0; } /* empty command name following command separator */ else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0 &&

index 1ea308bd..76b3eedd 100644

--- a/

+++ b/ diff --git a/builtins/complete.def b/builtins/complete.defindex 1ea308bd..76b3eedd 100644--- a/ builtins/complete.def +++ b/ builtins/complete.def @@ -38,7 +38,7 @@ Options: without any specific completion defined -E apply the completions and actions to "empty" commands -- completion attempted on a blank line - -I apply the completions and actions to the intial (usually the + -I apply the completions and actions to the initial (usually the command) word When completion is attempted, the actions are applied in the order the

index b0eda849..4e2243db 100644

--- a/

+++ b/ diff --git a/builtins/echo.def b/builtins/echo.defindex b0eda849..4e2243db 100644--- a/ builtins/echo.def +++ b/ builtins/echo.def @@ -1,7 +1,7 @@ This file is echo.def, from which is created echo.c. It implements the builtin "echo" in Bash. -Copyright (C) 1987-2016 Free Software Foundation, Inc. +Copyright (C) 1987-2018 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -62,6 +62,10 @@ Options: 0 to 3 octal digits \xHH the eight-bit character whose value is HH (hexadecimal). HH can be one or two hex digits + \uHHHH the Unicode character whose value is the hexadecimal value HHHH. + HHHH can be one to four hex digits. + \UHHHHHHHH the Unicode character whose value is the hexadecimal value + HHHHHHHH. HHHHHHHH can be one to eight hex digits. Exit Status: Returns success unless a write error occurs.

index d99e096a..d2bba434 100644

--- a/

+++ b/ diff --git a/builtins/set.def b/builtins/set.defindex d99e096a..d2bba434 100644--- a/ builtins/set.def +++ b/ builtins/set.def @@ -1,7 +1,7 @@ This file is set.def, from which is created set.c. It implements the "set" and "unset" builtins in Bash. -Copyright (C) 1987-2015 Free Software Foundation, Inc. +Copyright (C) 1987-2018 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -154,6 +154,8 @@ $END typedef int setopt_set_func_t __P((int, char *)); typedef int setopt_get_func_t __P((char *)); +static int find_minus_o_option __P((char *)); + static void print_minus_o_option __P((char *, int, int)); static void print_all_shell_variables __P((void)); @@ -242,6 +244,18 @@ const struct { ((o_options[i].set_func) ? (*o_options[i].set_func) (onoff, name) \ : (*o_options[i].variable = (onoff == FLAG_ON))) +static int +find_minus_o_option (name) + char *name; +{ + register int i; + + for (i = 0; o_options[i].name; i++) + if (STREQ (name, o_options[i].name)) + return i; + return -1; +} + int minus_o_option_value (name) char *name; @@ -249,21 +263,17 @@ minus_o_option_value (name) register int i; int *on_or_off; - for (i = 0; o_options[i].name; i++) + i = find_minus_o_option (name); + if (i < 0) + return (-1); + + if (o_options[i].letter) { - if (STREQ (name, o_options[i].name)) - { - if (o_options[i].letter) - { - on_or_off = find_flag (o_options[i].letter); - return ((on_or_off == FLAG_UNKNOWN) ? -1 : *on_or_off); - } - else - return (GET_BINARY_O_OPTION_VALUE (i, name)); - } + on_or_off = find_flag (o_options[i].letter); + return ((on_or_off == FLAG_UNKNOWN) ? -1 : *on_or_off); } - - return (-1); + else + return (GET_BINARY_O_OPTION_VALUE (i, name)); } #define MINUS_O_FORMAT "%-15s\t%s

" @@ -323,9 +333,12 @@ char * get_current_options () { char *temp; - int i; + int i, posixopts; - temp = (char *)xmalloc (1 + N_O_OPTIONS); + posixopts = num_posix_options (); /* shopts modified by posix mode */ + /* Make the buffer big enough to hold the set -o options and the shopt + options modified by posix mode. */ + temp = (char *)xmalloc (1 + N_O_OPTIONS + posixopts); for (i = 0; o_options[i].name; i++) { if (o_options[i].letter) @@ -333,7 +346,11 @@ get_current_options () else temp[i] = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name); } - temp[i] = '\0'; + + /* Add the shell options that are modified by posix mode to the end of the + bitmap. They will be handled in set_current_options() */ + get_posix_options (temp+i); + temp[i+posixopts] = '\0'; return (temp); } @@ -345,6 +362,7 @@ set_current_options (bitmap) if (bitmap == 0) return; + for (i = 0; o_options[i].name; i++) { if (o_options[i].letter) @@ -352,6 +370,9 @@ set_current_options (bitmap) else SET_BINARY_O_OPTION_VALUE (i, bitmap[i] ? FLAG_ON : FLAG_OFF, o_options[i].name); } + + /* Now reset the variables changed by posix mode */ + set_posix_options (bitmap+i); } static int @@ -451,32 +472,29 @@ set_minus_o_option (on_or_off, option_name) { register int i; - for (i = 0; o_options[i].name; i++) + i = find_minus_o_option (option_name); + if (i < 0) { - if (STREQ (option_name, o_options[i].name)) - { - if (o_options[i].letter == 0) - { - previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name); - SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name); - return (EXECUTION_SUCCESS); - } - else - { - if ((previous_option_value = change_flag (o_options[i].letter, on_or_off)) == FLAG_ERROR) - { - sh_invalidoptname (option_name); - return (EXECUTION_FAILURE); - } - else - return (EXECUTION_SUCCESS); - } + sh_invalidoptname (option_name); + return (EX_USAGE); + } + if (o_options[i].letter == 0) + { + previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name); + SET_BINARY_O_OPTION_VALUE (i, on_or_off, option_name); + return (EXECUTION_SUCCESS); + } + else + { + if ((previous_option_value = change_flag (o_options[i].letter, on_or_off)) == FLAG_ERROR) + { + sh_invalidoptname (option_name); + return (EXECUTION_FAILURE); } + else + return (EXECUTION_SUCCESS); } - - sh_invalidoptname (option_name); - return (EX_USAGE); } static void

index aa0c0312..8554aecc 100644

--- a/

+++ b/ diff --git a/config.h.in b/config.h.inindex aa0c0312..8554aecc 100644--- a/ config.h.in +++ b/ config.h.in @@ -612,6 +612,9 @@ /* Define if you have the fnmatch function. */ #undef HAVE_FNMATCH +/* Can fnmatch be used as a fallback to match [=equiv=] with collation weights? */ +#undef FNMATCH_EQUIV_FALLBACK + /* Define if you have the fpurge/__fpurge function. */ #undef HAVE_FPURGE #undef HAVE___FPURGE

index 07289da3..dd4c4e02 100755

--- a/

+++ b/ diff --git a/configure b/configureindex 07289da3..dd4c4e02 100755--- a/ configure +++ b/ configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac for Bash 5.0, version 5.003. +# From configure.ac for Bash 5.0, version 5.005. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bash 5.0-beta2. +# Generated by GNU Autoconf 2.69 for bash 5.0-rc1. # # Report bugs to <bug-bash@gnu.org>. # @@ -581,8 +581,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bash' PACKAGE_TARNAME='bash' -PACKAGE_VERSION='5.0-beta2' -PACKAGE_STRING='bash 5.0-beta2' +PACKAGE_VERSION='5.0-rc1' +PACKAGE_STRING='bash 5.0-rc1' PACKAGE_BUGREPORT='bug-bash@gnu.org' PACKAGE_URL='' @@ -1394,7 +1394,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bash 5.0-beta2 to adapt to many kinds of systems. +\`configure' configures bash 5.0-rc1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1459,7 +1459,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bash 5.0-beta2:";; + short | recursive ) echo "Configuration of bash 5.0-rc1:";; esac cat <<\_ACEOF @@ -1655,7 +1655,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bash configure 5.0-beta2 +bash configure 5.0-rc1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2364,7 +2364,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bash $as_me 5.0-beta2, which was +It was created by bash $as_me 5.0-rc1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2759,7 +2759,7 @@ ac_config_headers="$ac_config_headers config.h" BASHVERS=5.0 -RELSTATUS=beta2 +RELSTATUS=rc1 case "$RELSTATUS" in alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;; @@ -4938,12 +4938,6 @@ fi CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} # LDFLAGS=${LDFLAGS="$AUTO_LDFLAGS"} # XXX -# turn off paren warnings in gcc -if test "$GCC" = yes # && test -n "$DEBUG" -then - CFLAGS="$CFLAGS -Wno-parentheses -Wno-format-security" -fi - if test "$opt_profiling" = "yes"; then PROFILE_FLAGS=-pg case "$host_os" in @@ -15275,6 +15269,67 @@ $as_echo "#define HAVE_PRINTF_A_FORMAT 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fnmatch can be used to check bracket equivalence classes" >&5 +$as_echo_n "checking whether fnmatch can be used to check bracket equivalence classes... " >&6; } +if ${bash_cv_fnmatch_equiv_fallback+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot check fnmatch if cross compiling -- defaulting to no" >&5 +$as_echo "$as_me: WARNING: cannot check fnmatch if cross compiling -- defaulting to no" >&2;} + bash_cv_fnmatch_equiv_fallback=no + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <unistd.h> +#include <stdio.h> +#include <fnmatch.h> +#include <locale.h> + +char *pattern = "[[=a=]]"; + +/* char *string = "ä"; */ +unsigned char string[4] = { '\xc3', '\xa4', '\0' }; + +int +main (int c, char **v) +{ + setlocale (LC_ALL, "de_DE.UTF-8"); + if (fnmatch (pattern, (const char *)string, 0) != FNM_NOMATCH) + exit (0); + exit (1); +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + bash_cv_fnmatch_equiv_fallback=yes +else + bash_cv_fnmatch_equiv_fallback=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bash_cv_fnmatch_equiv_fallback" >&5 +$as_echo "$bash_cv_fnmatch_equiv_fallback" >&6; } +if test "$bash_cv_fnmatch_equiv_fallback" = "yes" ; then + bash_cv_fnmatch_equiv_value=1 +else + bash_cv_fnmatch_equiv_value=0 +fi + +cat >>confdefs.h <<_ACEOF +#define FNMATCH_EQUIV_FALLBACK $bash_cv_fnmatch_equiv_value +_ACEOF + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if signal handlers must be reinstalled when invoked" >&5 @@ -16301,6 +16356,16 @@ m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;; mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; esac +# turn off paren warnings in gcc +if test "$GCC" = yes # && test -n "$DEBUG" +then + CFLAGS="$CFLAGS -Wno-parentheses -Wno-format-security" +# if test -n "$DEBUG" +# then +# CFLAGS="$CFLAGS -Werror" +# fi +fi + # # Shared object configuration section. These values are generated by # ${srcdir}/support/shobj-conf @@ -16903,7 +16968,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bash $as_me 5.0-beta2, which was +This file was extended by bash $as_me 5.0-rc1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16969,7 +17034,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bash config.status 5.0-beta2 +bash config.status 5.0-rc1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\"

index 38a06a0c..20f9111e 100644

--- a/

+++ b/ diff --git a/configure.ac b/configure.acindex 38a06a0c..20f9111e 100644--- a/ configure.ac +++ b/ configure.ac @@ -21,10 +21,10 @@ dnl Process this file with autoconf to produce a configure script. # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -AC_REVISION([for Bash 5.0, version 5.003])dnl +AC_REVISION([for Bash 5.0, version 5.005])dnl define(bashvers, 5.0) -define(relstatus, beta2) +define(relstatus, rc1) AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) @@ -474,12 +474,6 @@ dnl default values CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} # LDFLAGS=${LDFLAGS="$AUTO_LDFLAGS"} # XXX -# turn off paren warnings in gcc -if test "$GCC" = yes # && test -n "$DEBUG" -then - CFLAGS="$CFLAGS -Wno-parentheses -Wno-format-security" -fi - dnl handle options that alter how bash is compiled and linked dnl these must come after the test for cc/gcc if test "$opt_profiling" = "yes"; then @@ -1030,6 +1024,8 @@ fi BASH_FUNC_PRINTF_A_FORMAT +BASH_FUNC_FNMATCH_EQUIV_FALLBACK + dnl presence and behavior of OS functions BASH_SYS_REINSTALL_SIGHANDLERS BASH_SYS_JOB_CONTROL_MISSING @@ -1157,6 +1153,16 @@ m88k-motorola-sysv3) LOCAL_CFLAGS=-DWAITPID_BROKEN ;; mips-pyramid-sysv4) LOCAL_CFLAGS=-Xa ;; esac +# turn off paren warnings in gcc +if test "$GCC" = yes # && test -n "$DEBUG" +then + CFLAGS="$CFLAGS -Wno-parentheses -Wno-format-security" +# if test -n "$DEBUG" +# then +# CFLAGS="$CFLAGS -Werror" +# fi +fi + # # Shared object configuration section. These values are generated by # ${srcdir}/support/shobj-conf

index c9f7c6e4..3a4d3d64 100644

--- a/

+++ b/ diff --git a/doc/bash.0 b/doc/bash.0index c9f7c6e4..3a4d3d64 100644--- a/ doc/bash.0 +++ b/ doc/bash.0 @@ -305,107 +305,108 @@ SSHHEELLLL GGRRAAMMMMAARR If a command is terminated by the control operator &&, the shell exe- cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not - wait for the command to finish, and the return status is 0. Commands - separated by a ;; 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. - - AND and OR lists are sequences of one or more pipelines separated by - the &&&& and |||| control operators, respectively. AND and OR lists are + wait for the command to finish, and the return status is 0. These are + referred to as _a_s_y_n_c_h_r_o_n_o_u_s commands. Commands separated by a ;; are + executed sequentially; the shell waits for each command to terminate in + turn. The return status is the exit status of the last command exe- + cuted. + + AND and OR lists are sequences of one or more pipelines separated by + the &&&& and |||| control operators, respectively. AND and OR lists are executed with left associativity. An AND list has the form _c_o_m_m_a_n_d_1 &&&& _c_o_m_m_a_n_d_2 - _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status of zero (success). An OR list has the form _c_o_m_m_a_n_d_1 |||| _c_o_m_m_a_n_d_2 - _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns a non-zero exit - status. The return status of AND and OR lists is the exit status of + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns a non-zero exit + status. The return status of AND and OR lists is the exit status of the last command executed in the list. CCoommppoouunndd CCoommmmaannddss - A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a - command's description may be separated from the rest of the command by - one or more newlines, and may be followed by a newline in place of a + A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a + command's description may be separated from the rest of the command by + one or more newlines, and may be followed by a newline in place of a semicolon. - (_l_i_s_t) _l_i_s_t is executed in a subshell environment (see CCOOMMMMAANNDD EEXXEECCUU-- - TTIIOONN EENNVVIIRROONNMMEENNTT below). Variable assignments and builtin com- - mands that affect the shell's environment do not remain in - effect after the command completes. The return status is the + (_l_i_s_t) _l_i_s_t is executed in a subshell environment (see CCOOMMMMAANNDD EEXXEECCUU-- + TTIIOONN EENNVVIIRROONNMMEENNTT below). Variable assignments and builtin com- + mands that affect the shell's environment do not remain in + effect after the command completes. The return status is the exit status of _l_i_s_t. { _l_i_s_t; } - _l_i_s_t is simply executed in the current shell environment. _l_i_s_t - must be terminated with a newline or semicolon. This is known - as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of - _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are + _l_i_s_t is simply executed in the current shell environment. _l_i_s_t + must be terminated with a newline or semicolon. This is known + as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of + _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are _r_e_s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted - to be recognized. Since they do not cause a word break, they - must be separated from _l_i_s_t by whitespace or another shell + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell metacharacter. ((_e_x_p_r_e_s_s_i_o_n)) - The _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules described - below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of the expres- - sion is non-zero, the return status is 0; otherwise the return + The _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules described + below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of the expres- + sion is non-zero, the return status is 0; otherwise the return status is 1. This is exactly equivalent to lleett ""_e_x_p_r_e_s_s_i_o_n"". [[[[ _e_x_p_r_e_s_s_i_o_n ]]]] - Return a status of 0 or 1 depending on the evaluation of the - conditional expression _e_x_p_r_e_s_s_i_o_n. Expressions are composed of - the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. - Word splitting and pathname expansion are not performed on the - words between the [[[[ and ]]]]; tilde expansion, parameter and - variable expansion, arithmetic expansion, command substitution, - process substitution, and quote removal are performed. Condi- + Return a status of 0 or 1 depending on the evaluation of the + conditional expression _e_x_p_r_e_s_s_i_o_n. Expressions are composed of + the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + Word splitting and pathname expansion are not performed on the + words between the [[[[ and ]]]]; tilde expansion, parameter and + variable expansion, arithmetic expansion, command substitution, + process substitution, and quote removal are performed. Condi- tional operators such as --ff must be unquoted to be recognized as primaries. - When used with [[[[, the << and >> operators sort lexicographically + When used with [[[[, the << and >> operators sort lexicographically using the current locale. - When the ==== and !!== operators are used, the string to the right + When the ==== and !!== operators are used, the string to the right of the operator is considered a pattern and matched according to the rules described below under PPaatttteerrnn MMaattcchhiinngg, as if the eexxtt-- gglloobb shell option were enabled. The == operator is equivalent to - ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is - performed without regard to the case of alphabetic characters. - The return value is 0 if the string matches (====) or does not - match (!!==) the pattern, and 1 otherwise. Any part of the pat- - tern may be quoted to force the quoted portion to be matched as + ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is + performed without regard to the case of alphabetic characters. + The return value is 0 if the string matches (====) or does not + match (!!==) the pattern, and 1 otherwise. Any part of the pat- + tern may be quoted to force the quoted portion to be matched as a string. - An additional binary operator, ==~~, is available, with the same - precedence as ==== and !!==. When it is used, the string to the - right of the operator is considered a POSIX extended regular + An additional binary operator, ==~~, is available, with the same + precedence as ==== and !!==. When it is used, the string to the + right of the operator is considered a POSIX extended regular expression and matched accordingly (as in _r_e_g_e_x(3)). The return - value is 0 if the string matches the pattern, and 1 otherwise. + value is 0 if the string matches the pattern, and 1 otherwise. If the regular expression is syntactically incorrect, the condi- tional expression's return value is 2. If the nnooccaasseemmaattcchh shell - option is enabled, the match is performed without regard to the - case of alphabetic characters. Any part of the pattern may be - quoted to force the quoted portion to be matched as a string. + option is enabled, the match is performed without regard to the + case of alphabetic characters. Any part of the pattern may be + quoted to force the quoted portion to be matched as a string. Bracket expressions in regular expressions must be treated care- - fully, since normal quoting characters lose their meanings + fully, since normal quoting characters lose their meanings between brackets. If the pattern is stored in a shell variable, - quoting the variable expansion forces the entire pattern to be + quoting the variable expansion forces the entire pattern to be matched as a string. Substrings matched by parenthesized subex- - pressions within the regular expression are saved in the array + pressions within the regular expression are saved in the array variable BBAASSHH__RREEMMAATTCCHH. The element of BBAASSHH__RREEMMAATTCCHH with index 0 is the portion of the string matching the entire regular expres- - sion. The element of BBAASSHH__RREEMMAATTCCHH with index _n is the portion + sion. The element of BBAASSHH__RREEMMAATTCCHH with index _n is the portion of the string matching the _nth parenthesized subexpression. - Expressions may be combined using the following operators, + Expressions may be combined using the following operators, listed in decreasing order of precedence: (( _e_x_p_r_e_s_s_i_o_n )) - Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to + Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to override the normal precedence of operators. !! _e_x_p_r_e_s_s_i_o_n True if _e_x_p_r_e_s_s_i_o_n is false. @@ -415,198 +416,198 @@ SSHHEELLLL GGRRAAMMMMAARR True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. The &&&& and |||| operators do not evaluate _e_x_p_r_e_s_s_i_o_n_2 if the value - of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of + of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of the entire conditional expression. ffoorr _n_a_m_e [ [ iinn [ _w_o_r_d _._._. ] ] ; ] ddoo _l_i_s_t ; ddoonnee The list of words following iinn is expanded, generating a list of items. The variable _n_a_m_e is set to each element of this list in - turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omit- - ted, the ffoorr command executes _l_i_s_t once for each positional + turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omit- + ted, the ffoorr command executes _l_i_s_t once for each positional parameter that is set (see PPAARRAAMMEETTEERRSS below). The return status - is the exit status of the last command that executes. If the + is the exit status of the last command that executes. If the expansion of the items following iinn results in an empty list, no commands are executed, and the return status is 0. ffoorr (( _e_x_p_r_1 ; _e_x_p_r_2 ; _e_x_p_r_3 )) ; ddoo _l_i_s_t ; ddoonnee First, the arithmetic expression _e_x_p_r_1 is evaluated according to - the rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. The - arithmetic expression _e_x_p_r_2 is then evaluated repeatedly until - it evaluates to zero. Each time _e_x_p_r_2 evaluates to a non-zero - value, _l_i_s_t is executed and the arithmetic expression _e_x_p_r_3 is - evaluated. If any expression is omitted, it behaves as if it + the rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. The + arithmetic expression _e_x_p_r_2 is then evaluated repeatedly until + it evaluates to zero. Each time _e_x_p_r_2 evaluates to a non-zero + value, _l_i_s_t is executed and the arithmetic expression _e_x_p_r_3 is + evaluated. If any expression is omitted, it behaves as if it evaluates to 1. The return value is the exit status of the last command in _l_i_s_t that is executed, or false if any of the expres- sions is invalid. sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee The list of words following iinn is expanded, generating a list of - items. The set of expanded words is printed on the standard - error, each preceded by a number. If the iinn _w_o_r_d is omitted, - the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). - The PPSS33 prompt is then displayed and a line read from the stan- - dard input. If the line consists of a number corresponding to - one of the displayed words, then the value of _n_a_m_e is set to - that word. If the line is empty, the words and prompt are dis- + items. The set of expanded words is printed on the standard + error, each preceded by a number. If the iinn _w_o_r_d is omitted, + the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). + The PPSS33 prompt is then displayed and a line read from the stan- + dard input. If the line consists of a number corresponding to + one of the displayed words, then the value of _n_a_m_e is set to + that word. If the line is empty, the words and prompt are dis- played again. If EOF is read, the command completes. Any other - value read causes _n_a_m_e to be set to null. The line read is - saved in the variable RREEPPLLYY. The _l_i_s_t is executed after each + value read causes _n_a_m_e to be set to null. The line read is + saved in the variable RREEPPLLYY. The _l_i_s_t is executed after each selection until a bbrreeaakk command is executed. The exit status of - sseelleecctt is the exit status of the last command executed in _l_i_s_t, + sseelleecctt is the exit status of the last command executed in _l_i_s_t, or zero if no commands were executed. ccaassee _w_o_r_d iinn [ [(] _p_a_t_t_e_r_n [ || _p_a_t_t_e_r_n ] ... ) _l_i_s_t ;; ] ... eessaacc A ccaassee command first expands _w_o_r_d, and tries to match it against - each _p_a_t_t_e_r_n in turn, using the matching rules described under + each _p_a_t_t_e_r_n in turn, using the matching rules described under PPaatttteerrnn MMaattcchhiinngg below. The _w_o_r_d is expanded using tilde expan- - sion, parameter and variable expansion, arithmetic expansion, - command substitution, process substitution and quote removal. + sion, parameter and variable expansion, arithmetic expansion, + command substitution, process substitution and quote removal. Each _p_a_t_t_e_r_n examined is expanded using tilde expansion, parame- - ter and variable expansion, arithmetic expansion, command sub- - stitution, and process substitution. If the nnooccaasseemmaattcchh shell - option is enabled, the match is performed without regard to the - case of alphabetic characters. When a match is found, the cor- - responding _l_i_s_t is executed. 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 - _l_i_s_t associated with the next set of patterns. Using ;;;;&& in - place of ;;;; causes the shell to test the next pattern list in + ter and variable expansion, arithmetic expansion, command sub- + stitution, and process substitution. If the nnooccaasseemmaattcchh shell + option is enabled, the match is performed without regard to the + case of alphabetic characters. When a match is found, the cor- + responding _l_i_s_t is executed. 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 + _l_i_s_t associated with the next set of patterns. Using ;;;;&& in + place of ;;;; causes the shell to test the next pattern list in the statement, if any, and execute any associated _l_i_s_t on a suc- - cessful match. The exit status is zero if no pattern matches. + cessful match. The exit status is zero if no pattern matches. Otherwise, it is the exit status of the last command executed in _l_i_s_t. iiff _l_i_s_t; tthheenn _l_i_s_t; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii - The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn - _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in - turn, and if its exit status is zero, the corresponding tthheenn + The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn + _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in + turn, and if its exit status is zero, the corresponding tthheenn _l_i_s_t is executed and the command completes. Otherwise, the eellssee - _l_i_s_t is executed, if present. The exit status is the exit sta- + _l_i_s_t is executed, if present. The exit status is the exit sta- tus of the last command executed, or zero if no condition tested true. wwhhiillee _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee uunnttiill _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee - The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long + The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long as the last command in the list _l_i_s_t_-_1 returns an exit status of - zero. The uunnttiill command is identical to the wwhhiillee command, - except that the test is negated: _l_i_s_t_-_2 is executed as long as - the last command in _l_i_s_t_-_1 returns a non-zero exit status. The - exit status of the wwhhiillee and uunnttiill commands is the exit status + zero. The uunnttiill command is identical to the wwhhiillee command, + except that the test is negated: _l_i_s_t_-_2 is executed as long as + the last command in _l_i_s_t_-_1 returns a non-zero exit status. The + exit status of the wwhhiillee and uunnttiill commands is the exit status of the last command executed in _l_i_s_t_-_2, or zero if none was exe- cuted. CCoopprroocceesssseess A _c_o_p_r_o_c_e_s_s is a shell command preceded by the ccoopprroocc reserved word. A - coprocess is executed asynchronously in a subshell, as if the command - had been terminated with the && control operator, with a two-way pipe + coprocess is executed asynchronously in a subshell, as if the command + had been terminated with the && control operator, with a two-way pipe established between the executing shell and the coprocess. The format for a coprocess is: ccoopprroocc [_N_A_M_E] _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s] - This creates a coprocess named _N_A_M_E. If _N_A_M_E is not supplied, the + This creates a coprocess named _N_A_M_E. If _N_A_M_E is not supplied, the default name is CCOOPPRROOCC. _N_A_M_E must not be supplied if _c_o_m_m_a_n_d is a _s_i_m_- _p_l_e _c_o_m_m_a_n_d (see above); otherwise, it is interpreted as the first word - of the simple command. When the coprocess is executed, the shell cre- - ates an array variable (see AArrrraayyss below) named _N_A_M_E in the context of + of the simple command. When the coprocess is executed, the shell cre- + ates an array variable (see AArrrraayyss below) named _N_A_M_E in the context of the executing shell. The standard output of _c_o_m_m_a_n_d is connected via a - pipe to a file descriptor in the executing shell, and that file - descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is - connected via a pipe to a file descriptor in the executing shell, and - that file descriptor is assigned to _N_A_M_E[1]. This pipe is established - before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN - below). The file descriptors can be utilized as arguments to shell - commands and redirections using standard word expansions. Other than - those created to execute command and process substitutions, the file - descriptors are not available in subshells. The process ID of the + pipe to a file descriptor in the executing shell, and that file + descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is + connected via a pipe to a file descriptor in the executing shell, and + that file descriptor is assigned to _N_A_M_E[1]. This pipe is established + before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN + below). The file descriptors can be utilized as arguments to shell + commands and redirections using standard word expansions. Other than + those created to execute command and process substitutions, the file + descriptors are not available in subshells. The process ID of the shell spawned to execute the coprocess is available as the value of the - variable _N_A_M_E_PID. The wwaaiitt builtin command may be used to wait for + variable _N_A_M_E_PID. The wwaaiitt builtin command may be used to wait for the coprocess to terminate. - Since the coprocess is created as an asynchronous command, the ccoopprroocc - command always returns success. The return status of a coprocess is + Since the coprocess is created as an asynchronous command, the ccoopprroocc + command always returns success. The return status of a coprocess is the exit status of _c_o_m_m_a_n_d. SShheellll FFuunnccttiioonn DDeeffiinniittiioonnss - A shell function is an object that is called like a simple command and - executes a compound command with a new set of positional parameters. + A shell function is an object that is called like a simple command and + executes a compound command with a new set of positional parameters. Shell functions are declared as follows: _n_a_m_e () _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] ffuunnccttiioonn _n_a_m_e [()] _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] - This defines a function named _n_a_m_e. The reserved word ffuunnccttiioonn - is optional. If the ffuunnccttiioonn reserved word is supplied, the - parentheses are optional. The _b_o_d_y of the function is the com- - pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). - That command is usually a _l_i_s_t of commands between { and }, but - may be any command listed under CCoommppoouunndd CCoommmmaannddss above, with - one exception: If the ffuunnccttiioonn reserved word is used, but the - parentheses are not supplied, the braces are required. _c_o_m_- + This defines a function named _n_a_m_e. The reserved word ffuunnccttiioonn + is optional. If the ffuunnccttiioonn reserved word is supplied, the + parentheses are optional. The _b_o_d_y of the function is the com- + pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). + That command is usually a _l_i_s_t of commands between { and }, but + may be any command listed under CCoommppoouunndd CCoommmmaannddss above, with + one exception: If the ffuunnccttiioonn reserved word is used, but the + parentheses are not supplied, the braces are required. _c_o_m_- _p_o_u_n_d_-_c_o_m_m_a_n_d is executed whenever _n_a_m_e is specified as the name - of a simple command. When in _p_o_s_i_x _m_o_d_e, _n_a_m_e may not be the - name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. Any redirections + of a simple command. When in _p_o_s_i_x _m_o_d_e, _n_a_m_e may not be the + name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. Any redirections (see RREEDDIIRREECCTTIIOONN below) specified when a function is defined are - performed when the function is executed. The exit status of a - function definition is zero unless a syntax error occurs or a - readonly function with the same name already exists. When exe- - cuted, the exit status of a function is the exit status of the + performed when the function is executed. The exit status of a + function definition is zero unless a syntax error occurs or a + readonly function with the same name already exists. When exe- + cuted, the exit status of a function is the exit status of the last command executed in the body. (See FFUUNNCCTTIIOONNSS below.) CCOOMMMMEENNTTSS In a non-interactive shell, or an interactive shell in which the iinntteerr-- - aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## causes that word and - all remaining characters on that line to be ignored. An interactive - shell without the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow + aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## causes that word and + all remaining characters on that line to be ignored. An interactive + shell without the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow comments. The iinntteerraaccttiivvee__ccoommmmeennttss option is on by default in interac- tive shells. QQUUOOTTIINNGG - _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or - words to the shell. Quoting can be used to disable special treatment + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or + words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. - Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special + Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special meaning to the shell and must be quoted if it is to represent itself. - When the command history expansion facilities are being used (see HHIISS-- + When the command history expansion facilities are being used (see HHIISS-- TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must be quoted to prevent history expansion. - There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single + There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single quotes, and double quotes. - A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the literal value of the next character that follows, with the exception of - <newline>. If a \\<newline> pair appears, and the backslash is not - itself quoted, the \\<newline> is treated as a line continuation (that + <newline>. If a \\<newline> pair appears, and the backslash is not + itself quoted, the \\<newline> is treated as a line continuation (that is, it is removed from the input stream and effectively ignored). - Enclosing characters in single quotes preserves the literal value of + Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. - Enclosing characters in double quotes preserves the literal value of - all characters within the quotes, with the exception of $$, ``, \\, and, + Enclosing characters in double quotes preserves the literal value of + all characters within the quotes, with the exception of $$, ``, \\, and, when history expansion is enabled, !!. When the shell is in _p_o_s_i_x _m_o_d_e, - the !! has no special meaning within double quotes, even when history - expansion is enabled. The characters $$ and `` retain their special - meaning within double quotes. The backslash retains its special mean- - ing only when followed by one of the following characters: $$, ``, "", \\, - or <<nneewwlliinnee>>. A double quote may be quoted within double quotes by - preceding it with a backslash. If enabled, history expansion will be - performed unless an !! appearing in double quotes is escaped using a + the !! has no special meaning within double quotes, even when history + expansion is enabled. The characters $$ and `` retain their special + meaning within double quotes. The backslash retains its special mean- + ing only when followed by one of the following characters: $$, ``, "", \\, + or <<nneewwlliinnee>>. A double quote may be quoted within double quotes by + preceding it with a backslash. If enabled, history expansion will be + performed unless an !! appearing in double quotes is escaped using a backslash. The backslash preceding the !! is not removed. - The special parameters ** and @@ have special meaning when in double + The special parameters ** and @@ have special meaning when in double quotes (see PPAARRAAMMEETTEERRSS below). Words of the form $$'_s_t_r_i_n_g' are treated specially. The word expands to - _s_t_r_i_n_g, with backslash-escaped characters replaced as specified by the - ANSI C standard. Backslash escape sequences, if present, are decoded + _s_t_r_i_n_g, with backslash-escaped characters replaced as specified by the + ANSI C standard. Backslash escape sequences, if present, are decoded as follows: \\aa alert (bell) \\bb backspace @@ -621,263 +622,263 @@ QQUUOOTTIINNGG \\'' single quote \\"" double quote \\?? question mark - \\_n_n_n the eight-bit character whose value is the octal value + \\_n_n_n the eight-bit character whose value is the octal value _n_n_n (one to three octal digits) - \\xx_H_H the eight-bit character whose value is the hexadecimal + \\xx_H_H the eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits) - \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the + \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits) \\UU_H_H_H_H_H_H_H_H - the Unicode (ISO/IEC 10646) character whose value is the + the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) \\cc_x a control-_x character - The expanded result is single-quoted, as if the dollar sign had not + The expanded result is single-quoted, as if the dollar sign had not been present. A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") will cause - the string to be translated according to the current locale. If the - current locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the + the string to be translated according to the current locale. If the + current locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted. PPAARRAAMMEETTEERRSS - A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- + A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- ber, or one of the special characters listed below under SSppeecciiaall PPaarraamm-- - eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a - _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the + eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a + _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). A parameter is set if it has been assigned a value. The null string is - a valid value. Once a variable is set, it may be unset only by using + a valid value. Once a variable is set, it may be unset only by using the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form _n_a_m_e=[_v_a_l_u_e] - If _v_a_l_u_e is not given, the variable is assigned the null string. All - _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- - mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- + If _v_a_l_u_e is not given, the variable is assigned the null string. All + _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- + mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e is evaluated as an arithmetic expression even if the $((...)) expansion - is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not - performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall - PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- - ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, - eexxppoorrtt, rreeaaddoonnllyy, and llooccaall builtin commands (_d_e_c_l_a_r_a_t_i_o_n commands). + is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not + performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall + PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- + ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, + eexxppoorrtt, rreeaaddoonnllyy, and llooccaall builtin commands (_d_e_c_l_a_r_a_t_i_o_n commands). When in _p_o_s_i_x _m_o_d_e, these builtins may appear in a command after one or - more instances of the ccoommmmaanndd builtin and retain these assignment + more instances of the ccoommmmaanndd builtin and retain these assignment statement properties. - In the context where an assignment statement is assigning a value to a + In the context where an assignment statement is assigning a value to a shell variable or array index, the += operator can be used to append to - or add to the variable's previous value. This includes arguments to - builtin commands such as ddeeccllaarree that accept assignment statements + or add to the variable's previous value. This includes arguments to + builtin commands such as ddeeccllaarree that accept assignment statements (_d_e_c_l_a_r_a_t_i_o_n commands). When += is applied to a variable for which the - _i_n_t_e_g_e_r attribute has been set, _v_a_l_u_e is evaluated as an arithmetic - expression and added to the variable's current value, which is also - evaluated. When += is applied to an array variable using compound + _i_n_t_e_g_e_r attribute has been set, _v_a_l_u_e is evaluated as an arithmetic + expression and added to the variable's current value, which is also + evaluated. When += is applied to an array variable using compound assignment (see AArrrraayyss below), the variable's value is not unset (as it is when using =), and new values are appended to the array beginning at - one greater than the array's maximum index (for indexed arrays) or - added as additional key-value pairs in an associative array. When - applied to a string-valued variable, _v_a_l_u_e is expanded and appended to + one greater than the array's maximum index (for indexed arrays) or + added as additional key-value pairs in an associative array. When + applied to a string-valued variable, _v_a_l_u_e is expanded and appended to the variable's value. A variable can be assigned the _n_a_m_e_r_e_f attribute using the --nn option to - the ddeeccllaarree or llooccaall builtin commands (see the descriptions of ddeeccllaarree - and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari- - able. This allows variables to be manipulated indirectly. Whenever - the nameref variable is referenced, assigned to, unset, or has its + the ddeeccllaarree or llooccaall builtin commands (see the descriptions of ddeeccllaarree + and llooccaall below) to create a _n_a_m_e_r_e_f, or a reference to another vari- + able. This allows variables to be manipulated indirectly. Whenever + the nameref variable is referenced, assigned to, unset, or has its attributes modified (other than using or changing the _n_a_m_e_r_e_f attribute - itself), the operation is actually performed on the variable specified - by the nameref variable's value. A nameref is commonly used within + 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 argu- - ment to the function. For instance, if a variable name is passed to a + ment 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 rreeff whose value is the + inside the function creates a nameref variable rreeff whose value is the variable name passed as the first argument. References and assignments - to rreeff, and changes to its attributes, are treated as references, + to rreeff, and changes to its attributes, are treated as references, assignments, and attribute modifications to the variable whose name was - passed as $$11. If the control variable in a ffoorr loop has the nameref - attribute, the list of words can be a list of shell variables, and a - name reference will be established for each word in the list, in turn, + passed as $$11. If the control variable in a ffoorr loop has the nameref + attribute, the list of words can be a list of shell variables, and a + name reference will be established for each word in the list, in turn, when the loop is executed. Array variables cannot be given the nnaammeerreeff - attribute. However, nameref variables can reference array variables - and subscripted array variables. Namerefs can be unset using the --nn - option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the - name of a nameref variable as an argument, the variable referenced by + attribute. However, nameref variables can reference array variables + and subscripted array variables. Namerefs can be unset using the --nn + option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the + name of a nameref variable as an argument, the variable referenced by the nameref variable will be unset. PPoossiittiioonnaall PPaarraammeetteerrss - A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, other than the single digit 0. Positional parameters are assigned from - the shell's arguments when it is invoked, and may be reassigned using - the sseett builtin command. Positional parameters may not be assigned to - with assignment statements. The positional parameters are temporarily + the shell's arguments when it is invoked, and may be reassigned using + the sseett builtin command. Positional parameters may not be assigned to + with assignment statements. The positional parameters are temporarily replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). - When a positional parameter consisting of more than a single digit is + When a positional parameter consisting of more than a single digit is expanded, it must be enclosed in braces (see EEXXPPAANNSSIIOONN below). SSppeecciiaall PPaarraammeetteerrss - The shell treats several parameters specially. These parameters may + The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. - ** Expands to the positional parameters, starting from one. When - the expansion is not within double quotes, each positional - parameter expands to a separate word. In contexts where it is + ** Expands to the positional parameters, starting from one. When + the expansion is not within double quotes, each positional + parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and - pathname expansion. When the expansion occurs within double - quotes, it expands to a single word with the value of each - parameter separated by the first character of the IIFFSS special - variable. That is, "$$**" is equivalent to "$$11_c$$22_c......", where _c + pathname expansion. When the expansion occurs within double + quotes, it expands to a single word with the value of each + parameter separated by the first character of the IIFFSS special + variable. That is, "$$**" is equivalent to "$$11_c$$22_c......", where _c is the first character of the value of the IIFFSS variable. If IIFFSS - is unset, the parameters are separated by spaces. If IIFFSS is + is unset, the parameters are separated by spaces. If IIFFSS is null, the parameters are joined without intervening separators. - @@ Expands to the positional parameters, starting from one. In - contexts where word splitting is performed, this expands each - positional parameter to a separate word; if not within double - quotes, these words are subject to word splitting. In contexts - where word splitting is not performed, this expands to a single - word with each positional parameter separated by a space. When + @@ Expands to the positional parameters, starting from one. In + contexts where word splitting is performed, this expands each + positional parameter to a separate word; if not within double + quotes, these words are subject to word splitting. In contexts + where word splitting is not performed, this expands to a single + word with each positional parameter separated by a space. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$$@@" is equivalent to "$$11" - "$$22" ... If the double-quoted expansion occurs within a word, - the expansion of the first parameter is joined with the begin- - ning part of the original word, and the expansion of the last - parameter is joined with the last part of the original word. - When there are no positional parameters, "$$@@" and $$@@ expand to + "$$22" ... If the double-quoted expansion occurs within a word, + the expansion of the first parameter is joined with the begin- + ning part of the original word, and the expansion of the last + parameter is joined with the last part of the original word. + When there are no positional parameters, "$$@@" and $$@@ expand to nothing (i.e., they are removed). ## Expands to the number of positional parameters in decimal. - ?? Expands to the exit status of the most recently executed fore- + ?? Expands to the exit status of the most recently executed fore- ground pipeline. - -- Expands to the current option flags as specified upon invoca- - tion, by the sseett builtin command, or those set by the shell + -- Expands to the current option flags as specified upon invoca- + tion, by the sseett builtin command, or those set by the shell itself (such as the --ii option). - $$ Expands to the process ID of the shell. In a () subshell, it - expands to the process ID of the current shell, not the sub- + $$ Expands to the process ID of the shell. In a () subshell, it + expands to the process ID of the current shell, not the sub- shell. - !! Expands to the process ID of the job most recently placed into - the background, whether executed as an asynchronous command or + !! Expands to the process ID of the job most recently placed into + the background, whether executed as an asynchronous command or using the bbgg builtin (see JJOOBB CCOONNTTRROOLL below). - 00 Expands to the name of the shell or shell script. This is set + 00 Expands to the name of the shell or shell script. This is set at shell initialization. If bbaasshh is invoked with a file of com- - mands, $$00 is set to the name of that file. If bbaasshh is started - with the --cc option, then $$00 is set to the first argument after - the string to be executed, if one is present. Otherwise, it is - set to the filename used to invoke bbaasshh, as given by argument + mands, $$00 is set to the name of that file. If bbaasshh is started + with the --cc option, then $$00 is set to the first argument after + the string to be executed, if one is present. Otherwise, it is + set to the filename used to invoke bbaasshh, as given by argument zero. - __ At shell startup, set to the absolute pathname used to invoke - the shell or shell script being executed as passed in the envi- - ronment or argument list. Subsequently, expands to the last - argument to the previous simple command executed in the fore- - ground, after expansion. Also set to the full pathname used to - invoke each command executed and placed in the environment - exported to that command. When checking mail, this parameter + __ At shell startup, set to the absolute pathname used to invoke + the shell or shell script being executed as passed in the envi- + ronment or argument list. Subsequently, expands to the last + argument to the previous simple command executed in the fore- + ground, after expansion. Also set to the full pathname used to + invoke each command executed and placed in the environment + exported to that command. When checking mail, this parameter holds the name of the mail file currently being checked. SShheellll VVaarriiaabblleess The following variables are set by the shell: - BBAASSHH Expands to the full filename used to invoke this instance of + BBAASSHH Expands to the full filename used to invoke this instance of bbaasshh. BBAASSHHOOPPTTSS - A colon-separated list of enabled shell options. Each word in - the list is a valid argument for the --ss option to the sshhoopptt + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --ss option to the sshhoopptt builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If - this variable is in the environment when bbaasshh starts up, each - shell option in the list will be enabled before reading any + appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any startup files. This variable is read-only. BBAASSHHPPIIDD - Expands to the process ID of the current bbaasshh process. This - differs from $$$$ under certain circumstances, such as subshells - that do not require bbaasshh to be re-initialized. Assignments to - BBAASSHHPPIIDD have no effect. If BBAASSHHPPIIDD is unset, it loses its spe- + Expands to the process ID of the current bbaasshh process. This + differs from $$$$ under certain circumstances, such as subshells + that do not require bbaasshh to be re-initialized. Assignments to + BBAASSHHPPIIDD have no effect. If BBAASSHHPPIIDD is unset, it loses its spe- cial properties, even if it is subsequently reset. BBAASSHH__AALLIIAASSEESS - An associative array variable whose members correspond to the - internal list of aliases as maintained by the aalliiaass builtin. - Elements added to this array appear in the alias list; however, - unsetting array elements currently does not cause aliases to be + An associative array variable whose members correspond to the + internal list of aliases as maintained by the aalliiaass builtin. + Elements added to this array appear in the alias list; however, + unsetting array elements currently does not cause aliases to be removed from the alias list. If BBAASSHH__AALLIIAASSEESS is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__AARRGGCC - An array variable whose values are the number of parameters in + An array variable whose values are the number of parameters in each frame of the current bbaasshh execution call stack. The number - of parameters to the current subroutine (shell function or - script executed with .. or ssoouurrccee) is at the top of the stack. - When a subroutine is executed, the number of parameters passed + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in - extended debugging mode (see the description of the eexxttddeebbuugg - option to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the + extended debugging mode (see the description of the eexxttddeebbuugg + option to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the shell has started to execute a script, or referencing this vari- - able when eexxttddeebbuugg is not set, may result in inconsistent val- + able when eexxttddeebbuugg is not set, may result in inconsistent val- ues. BBAASSHH__AARRGGVV - An array variable containing all of the parameters in the cur- + An array variable containing all of the parameters in the cur- rent bbaasshh execution call stack. The final parameter of the last - subroutine call is at the top of the stack; the first parameter + subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is exe- - cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The - shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see - the description of the eexxttddeebbuugg option to the sshhoopptt builtin + cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The + shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see + the description of the eexxttddeebbuugg option to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the shell has started to execute a script, or referencing this variable when eexxttddeebbuugg is not set, may result in inconsistent values. BBAASSHH__AARRGGVV00 - When referenced, this variable expands to the name of the shell + When referenced, this variable expands to the name of the shell or shell script (identical to $$00; see the description of special - parameter 0 above). Assignment to BBAASSHH__AARRGGVV00 causes the value - assigned to also be assigned to $$00. If BBAASSHH__AARRGGVV00 is unset, it + parameter 0 above). Assignment to BBAASSHH__AARRGGVV00 causes the value + assigned to also be assigned to $$00. If BBAASSHH__AARRGGVV00 is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__CCMMDDSS - An associative array variable whose members correspond to the - internal hash table of commands as maintained by the hhaasshh + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the hhaasshh builtin. Elements added to this array appear in the hash table; - however, unsetting array elements currently does not cause com- - mand names to be removed from the hash table. If BBAASSHH__CCMMDDSS is - unset, it loses its special properties, even if it is subse- + however, unsetting array elements currently does not cause com- + mand names to be removed from the hash table. If BBAASSHH__CCMMDDSS is + unset, it loses its special properties, even if it is subse- quently reset. BBAASSHH__CCOOMMMMAANNDD - The command currently being executed or about to be executed, + The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, - in which case it is the command executing at the time of the + in which case it is the command executing at the time of the trap. BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG The command argument to the --cc invocation option. BBAASSHH__LLIINNEENNOO - An array variable whose members are the line numbers in source - files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. + An array variable whose members are the line numbers in source + files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file ($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or - $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- + $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- tion). Use LLIINNEENNOO to obtain the current line number. BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH - A colon-separated list of directories in which the shell looks - for dynamically loadable builtins specified by the eennaabbllee com- + A colon-separated list of directories in which the shell looks + for dynamically loadable builtins specified by the eennaabbllee com- mand. BBAASSHH__RREEMMAATTCCHH - An array variable whose members are assigned by the ==~~ binary - operator to the [[[[ conditional command. The element with index - 0 is the portion of the string matching the entire regular - expression. The element with index _n is the portion of the + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular + expression. The element with index _n is the portion of the string matching the _nth parenthesized subexpression. This vari- able is read-only. BBAASSHH__SSOOUURRCCEE - An array variable whose members are the source filenames where - the corresponding shell function names in the FFUUNNCCNNAAMMEE array - variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is - defined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from + An array variable whose members are the source filenames where + the corresponding shell function names in the FFUUNNCCNNAAMMEE array + variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is + defined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. BBAASSHH__SSUUBBSSHHEELLLL - Incremented by one within each subshell or subshell environment - when the shell begins executing in that environment. The ini- + Incremented by one within each subshell or subshell environment + when the shell begins executing in that environment. The ini- tial value is 0. BBAASSHH__VVEERRSSIINNFFOO A readonly array variable whose members hold version information - for this instance of bbaasshh. The values assigned to the array + for this instance of bbaasshh. The values assigned to the array members are as follows: BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). @@ -886,137 +887,137 @@ PPAARRAAMMEETTEERRSS BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a_1). BBAASSHH__VVEERRSSIINNFFOO[[5]] The value of MMAACCHHTTYYPPEE. BBAASSHH__VVEERRSSIIOONN - Expands to a string describing the version of this instance of + Expands to a string describing the version of this instance of bbaasshh. CCOOMMPP__CCWWOORRDD - An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current + An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current cursor position. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__KKEEYY The key (or final key of a key sequence) used to invoke the cur- rent completion function. CCOOMMPP__LLIINNEE - The current command line. This variable is available only in - shell functions and external commands invoked by the program- + The current command line. This variable is available only in + shell functions and external commands invoked by the program- mable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__PPOOIINNTT - The index of the current cursor position relative to the begin- - ning of the current command. If the current cursor position is + The index of the current cursor position relative to the begin- + ning of the current command. If the current cursor position is at the end of the current command, the value of this variable is - equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in - shell functions and external commands invoked by the program- + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the program- mable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__TTYYPPEE - Set to an integer value corresponding to the type of completion - attempted that caused a completion function to be called: _T_A_B, - for normal completion, _?, for listing completions after succes- - sive tabs, _!, for listing alternatives on partial word comple- - tion, _@, to list completions if the word is not unmodified, or - _%, for menu completion. This variable is available only in - shell functions and external commands invoked by the program- + Set to an integer value corresponding to the type of completion + attempted that caused a completion function to be called: _T_A_B, + for normal completion, _?, for listing completions after succes- + sive tabs, _!, for listing alternatives on partial word comple- + tion, _@, to list completions if the word is not unmodified, or + _%, for menu completion. This variable is available only in + shell functions and external commands invoked by the program- mable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__WWOORRDDBBRREEAAKKSS - The set of characters that the rreeaaddlliinnee library treats as word - separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS - is unset, it loses its special properties, even if it is subse- + The set of characters that the rreeaaddlliinnee library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- quently reset. CCOOMMPP__WWOORRDDSS - An array variable (see AArrrraayyss below) consisting of the individ- - ual words in the current command line. The line is split into - words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The line is split into + words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as described above. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). - CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file - descriptors for output from and input to an unnamed coprocess + CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file + descriptors for output from and input to an unnamed coprocess (see CCoopprroocceesssseess above). DDIIRRSSTTAACCKK An array variable (see AArrrraayyss below) containing the current con- - tents of the directory stack. Directories appear in the stack - in the order they are displayed by the ddiirrss builtin. Assigning + tents of the directory stack. Directories appear in the stack + in the order they are displayed by the ddiirrss builtin. Assigning to members of this array variable may be used to modify directo- - ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must be used to add and remove directories. Assignment to this vari- - able will not change the current directory. If DDIIRRSSTTAACCKK is - unset, it loses its special properties, even if it is subse- + able will not change the current directory. If DDIIRRSSTTAACCKK is + unset, it loses its special properties, even if it is subse- quently reset. EEPPOOCCHHRREEAALLTTIIMMEE Each time this parameter is referenced, it expands to the number - of seconds since the Unix Epoch (see _t_i_m_e(3)) as a floating + of seconds since the Unix Epoch (see _t_i_m_e(3)) as a floating point value with micro-second granularity. Assignments to - EEPPOOCCHHRREEAALLTTIIMMEE are ignored. If EEPPOOCCHHRREEAALLTTIIMMEE is unset, it loses + EEPPOOCCHHRREEAALLTTIIMMEE are ignored. If EEPPOOCCHHRREEAALLTTIIMMEE is unset, it loses its special properties, even if it is subsequently reset. EEPPOOCCHHSSEECCOONNDDSS Each time this parameter is referenced, it expands to the number - of seconds since the Unix Epoch (see _t_i_m_e(3)). Assignments to - EEPPOOCCHHSSEECCOONNDDSS are ignored. If EEPPOOCCHHSSEECCOONNDDSS is unset, it loses + of seconds since the Unix Epoch (see _t_i_m_e(3)). Assignments to + EEPPOOCCHHSSEECCOONNDDSS are ignored. If EEPPOOCCHHSSEECCOONNDDSS is unset, it loses its special properties, even if it is subsequently reset. - EEUUIIDD Expands to the effective user ID of the current user, initial- + EEUUIIDD Expands to the effective user ID of the current user, initial- ized at shell startup. This variable is readonly. FFUUNNCCNNAAMMEE - An array variable containing the names of all shell functions + An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bot- - tom-most element (the one with the highest index) is "main". - This variable exists only when a shell function is executing. - Assignments to FFUUNNCCNNAAMMEE have no effect. If FFUUNNCCNNAAMMEE is unset, - it loses its special properties, even if it is subsequently + tom-most element (the one with the highest index) is "main". + This variable exists only when a shell function is executing. + Assignments to FFUUNNCCNNAAMMEE have no effect. If FFUUNNCCNNAAMMEE is unset, + it loses its special properties, even if it is subsequently reset. - This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. - Each element of FFUUNNCCNNAAMMEE has corresponding elements in - BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE to describe the call stack. For - instance, $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called from the file - $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}} at line number $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}}. The + This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. + Each element of FFUUNNCCNNAAMMEE has corresponding elements in + BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE to describe the call stack. For + instance, $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called from the file + $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}} at line number $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}}. The ccaalllleerr builtin displays the current call stack using this infor- mation. - GGRROOUUPPSS An array variable containing the list of groups of which the + GGRROOUUPPSS An array variable containing the list of groups of which the current user is a member. Assignments to GGRROOUUPPSS have no effect. - If GGRROOUUPPSS is unset, it loses its special properties, even if it + If GGRROOUUPPSS is unset, it loses its special properties, even if it is subsequently reset. HHIISSTTCCMMDD The history number, or index in the history list, of the current - command. If HHIISSTTCCMMDD is unset, it loses its special properties, + command. If HHIISSTTCCMMDD is unset, it loses its special properties, even if it is subsequently reset. HHOOSSTTNNAAMMEE Automatically set to the name of the current host. HHOOSSTTTTYYPPEE - Automatically set to a string that uniquely describes the type - of machine on which bbaasshh is executing. The default is system- + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- dependent. - LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a - decimal number representing the current sequential line number - (starting with 1) within a script or function. When not in a - script or function, the value substituted is not guaranteed to + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to be meaningful. If LLIINNEENNOO is unset, it loses its special proper- ties, even if it is subsequently reset. MMAACCHHTTYYPPEE - Automatically set to a string that fully describes the system - type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- + Automatically set to a string that fully describes the system + type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- _p_a_n_y_-_s_y_s_t_e_m format. The default is system-dependent. MMAAPPFFIILLEE - An array variable (see AArrrraayyss below) created to hold the text + An array variable (see AArrrraayyss below) created to hold the text read by the mmaappffiillee builtin when no variable name is supplied. OOLLDDPPWWDD The previous working directory as set by the ccdd command. - OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss + OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss + OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOSSTTYYPPEE Automatically set to a string that describes the operating sys- - tem on which bbaasshh is executing. The default is system-depen- + OOSSTTYYPPEE Automatically set to a string that describes the operating sys- + tem on which bbaasshh is executing. The default is system-depen- dent. PPIIPPEESSTTAATTUUSS - An array variable (see AArrrraayyss below) containing a list of exit - status values from the processes in the most-recently-executed + An array variable (see AArrrraayyss below) containing a list of exit + status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command). - PPPPIIDD The process ID of the shell's parent. This variable is read- + PPPPIIDD The process ID of the shell's parent. This variable is read- only. PPWWDD The current working directory as set by the ccdd command. RRAANNDDOOMM Each time this parameter is referenced, a random integer between 0 and 32767 is generated. The sequence of random numbers may be initialized by assigning a value to RRAANNDDOOMM. If RRAANNDDOOMM is unset, - it loses its special properties, even if it is subsequently + it loses its special properties, even if it is subsequently reset. RREEAADDLLIINNEE__LLIINNEE The contents of the rreeaaddlliinnee line buffer, for use with "bind -x" @@ -1024,301 +1025,301 @@ PPAARRAAMMEETTEERRSS RREEAADDLLIINNEE__PPOOIINNTT The position of the insertion point in the rreeaaddlliinnee line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when no arguments are supplied. SSEECCOONNDDSS - Each time this parameter is referenced, the number of seconds - since shell invocation is returned. If a value is assigned to - SSEECCOONNDDSS, the value returned upon subsequent references is the - number of seconds since the assignment plus the value assigned. + Each time this parameter is referenced, the number of seconds + since shell invocation is returned. If a value is assigned to + SSEECCOONNDDSS, the value returned upon subsequent references is the + number of seconds since the assignment plus the value assigned. If SSEECCOONNDDSS is unset, it loses its special properties, even if it is subsequently reset. SSHHEELLLLOOPPTTSS - A colon-separated list of enabled shell options. Each word in - the list is a valid argument for the --oo option to the sseett + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --oo option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If - this variable is in the environment when bbaasshh starts up, each - shell option in the list will be enabled before reading any + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any startup files. This variable is read-only. SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. UUIIDD Expands to the user ID of the current user, initialized at shell startup. This variable is readonly. - The following variables are used by the shell. In some cases, bbaasshh + The following variables are used by the shell. In some cases, bbaasshh assigns a default value to a variable; these cases are noted below. BBAASSHH__CCOOMMPPAATT - The value is used to set the shell's compatibility level. See - the description of the sshhoopptt builtin below under SSHHEELLLL BBUUIILLTTIINN - CCOOMMMMAANNDDSS for a description of the various compatibility levels - and their effects. The value may be a decimal number (e.g., - 4.2) or an integer (e.g., 42) corresponding to the desired com- - patibility level. If BBAASSHH__CCOOMMPPAATT is unset or set to the empty - string, the compatibility level is set to the default for the - current version. If BBAASSHH__CCOOMMPPAATT is set to a value that is not + The value is used to set the shell's compatibility level. See + the description of the sshhoopptt builtin below under SSHHEELLLL BBUUIILLTTIINN + CCOOMMMMAANNDDSS for a description of the various compatibility levels + and their effects. The value may be a decimal number (e.g., + 4.2) or an integer (e.g., 42) corresponding to the desired com- + patibility level. If BBAASSHH__CCOOMMPPAATT is unset or set to the empty + string, the compatibility level is set to the default for the + current version. If BBAASSHH__CCOOMMPPAATT is set to a value that is not one of the valid compatibility levels, the shell prints an error - message and sets the compatibility level to the default for the - current version. The valid compatibility levels correspond to - the compatibility options accepted by the sshhoopptt builtin + message and sets the compatibility level to the default for the + current version. The valid compatibility levels correspond to + the compatibility options accepted by the sshhoopptt builtin described below (for example, ccoommppaatt4422 means that 4.2 and 42 are valid values). The current version is also a valid value. BBAASSHH__EENNVV - If this parameter is set when bbaasshh is executing a shell script, - its value is interpreted as a filename containing commands to + If this parameter is set when bbaasshh is executing a shell script, + its value is interpreted as a filename containing commands to initialize the shell, as in _~_/_._b_a_s_h_r_c. The value of BBAASSHH__EENNVV is - subjected to parameter expansion, command substitution, and - arithmetic expansion before being interpreted as a filename. + subjected to parameter expansion, command substitution, and + arithmetic expansion before being interpreted as a filename. PPAATTHH is not used to search for the resultant filename. BBAASSHH__XXTTRRAACCEEFFDD - If set to an integer corresponding to a valid file descriptor, - bbaasshh will write the trace output generated when _s_e_t _-_x is - enabled to that file descriptor. The file descriptor is closed - when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting - BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace - output to be sent to the standard error. Note that setting + If set to an integer corresponding to a valid file descriptor, + bbaasshh will write the trace output generated when _s_e_t _-_x is + enabled to that file descriptor. The file descriptor is closed + when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting + BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace + output to be sent to the standard error. Note that setting BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed. - CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated - list of directories in which the shell looks for destination - directories specified by the ccdd command. A sample value is + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + list of directories in which the shell looks for destination + directories specified by the ccdd command. A sample value is ".:~:/usr". CCHHIILLDD__MMAAXX - Set the number of exited child status values for the shell to - remember. Bash will not allow this value to be decreased below - a POSIX-mandated minimum, and there is a maximum value (cur- - rently 8192) that this may not exceed. The minimum value is + Set the number of exited child status values for the shell to + remember. Bash will not allow this value to be decreased below + a POSIX-mandated minimum, and there is a maximum value (cur- + rently 8192) that this may not exceed. The minimum value is system-dependent. CCOOLLUUMMNNSS - Used by the sseelleecctt compound command to determine the terminal - width when printing selection lists. Automatically set if the - cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + Used by the sseelleecctt compound command to determine the terminal + width when printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon receipt of a SSIIGGWWIINNCCHH. CCOOMMPPRREEPPLLYY An array variable from which bbaasshh reads the possible completions - generated by a shell function invoked by the programmable com- - pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each + generated by a shell function invoked by the programmable com- + pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each array element contains one possible completion. - EEMMAACCSS If bbaasshh finds this variable in the environment when the shell - starts with value "t", it assumes that the shell is running in + EEMMAACCSS If bbaasshh finds this variable in the environment when the shell + starts with value "t", it assumes that the shell is running in an Emacs shell buffer and disables line editing. - EENNVV Similar to BBAASSHH__EENNVV; used when the shell is invoked in _p_o_s_i_x + EENNVV Similar to BBAASSHH__EENNVV; used when the shell is invoked in _p_o_s_i_x _m_o_d_e. EEXXEECCIIGGNNOORREE - A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) - defining the list of filenames to be ignored by command search - using PPAATTHH. Files whose full pathnames match one of these pat- - terns are not considered executable files for the purposes of + A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) + defining the list of filenames to be ignored by command search + using PPAATTHH. Files whose full pathnames match one of these pat- + terns are not considered executable files for the purposes of completion and command execution via PPAATTHH lookup. This does not affect the behavior of the [[, tteesstt, and [[[[ commands. Full path- - names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. - Use this variable to ignore shared library files that have the - executable bit set, but are not executable files. The pattern + names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. + 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 eexxttgglloobb shell option. FFCCEEDDIITT The default editor for the ffcc builtin command. FFIIGGNNOORREE - A colon-separated list of suffixes to ignore when performing + A colon-separated list of suffixes to ignore when performing filename completion (see RREEAADDLLIINNEE below). A filename whose suf- - fix matches one of the entries in FFIIGGNNOORREE is excluded from the + fix matches one of the entries in FFIIGGNNOORREE is excluded from the list of matched filenames. A sample value is ".o:~". FFUUNNCCNNEESSTT - If set to a numeric value greater than 0, defines a maximum - function nesting level. Function invocations that exceed this + If set to a numeric value greater than 0, defines a maximum + function nesting level. Function invocations that exceed this nesting level will cause the current command to abort. GGLLOOBBIIGGNNOORREE - A colon-separated list of patterns defining the set of file - names to be ignored by pathname expansion. If a file name - matched by a pathname expansion pattern also matches one of the + A colon-separated list of patterns defining the set of file + names to be ignored by pathname expansion. If a file name + matched by a pathname expansion pattern also matches one of the patterns in GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. HHIISSTTCCOONNTTRROOLL - A colon-separated list of values controlling how commands are - saved on the history list. If the list of values includes - _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not - saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not + saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines matching the previous history entry to not be saved. A value of _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line - to be removed from the history list before that line is saved. - Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is - unset, or does not include a valid value, all lines read by the + to be removed from the history list before that line is saved. + Any value not in the above lis