From: Chet Ramey Date: Mon, 2 Jun 2025 16:05:51 +0000 (-0400) Subject: Bash-5.3-rc2 release X-Git-Tag: bash-5.3-rc2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fbash-5.3-testing;p=thirdparty%2Fbash.git Bash-5.3-rc2 release --- diff --git a/CHANGES b/CHANGES index 2b9718efd..fb826eab6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,45 @@ +This document details the changes between this version, bash-5.3-rc2, and +the previous version, bash-5.3-rc1. + +1. Changes to Bash + +a. Fixed a problem with invoking the correct programmable completion compspec + if the line contains a quoted command separator before point. + +b. Fixed a bug in the `read' builtin that caused it to skip the delimiter if + it appeared in an invalid multibyte character. + +c. Fixed a bug with parsing command substitutions that caused a syntax error + to pop too many input sources. + +d. Fixed an issue with recursive parsing that caused the parser to reset and + pop all the delimiters off the stack; the caller needs to check for that + possibility. + +e. Fixed an issue with interactive input that caused EOF not to exit the + shell if it was read as part of a here-document. + +f. Fixed an issue with a backslash-newline appearing after a right paren in + a nested subshell command. + +g. Fixed an issue with invalid sequence expressions in brace expansions. + +h. Fixed an issue with a nameref variable referencing an unset array element + when the nounset option is enabled. + +2. Changes to Readline + +a. The history library no longer skips blank lines while it is reading a + multiline history entry from a history file. + +3. New Features in Bash + +a. The `install-strip' and `strip' Makefile targets now deal with cross- + compiling. + +4. New Features in Readline + +------------------------------------------------------------------------------ This document details the changes between this version, bash-5.3-rc1, and the previous version, bash-5.3-beta. diff --git a/CWRU/changelog b/CWRU/changelog index b024047f4..62b60b15a 100644 --- a/CWRU/changelog +++ b/CWRU/changelog @@ -1,4 +1,3 @@ - 12/6/2020 --------- @@ -11103,3 +11102,169 @@ lib/sh/gettimeofday.c - updated from version in gnulib [bash-5.3-rc1 frozen] + + 4/4 + --- +examples/loadables/fltexpr.c + - add support for function calls; support almost all math function + calls in math.h + - add support for pi, gamma, e mathematical constants + + 4/7 + --- +doc/bash.1,doc/bashref.texi + - HISTFILESIZE: note that the history file will contain complete + history entries whose lines may total slightly more than + $HISTFILESIZE if the entries contain multiple lines + From a report from Jens Schmidt + - export: note that you can use -f with -p to display exported functions + From a report from Duncan Roe + +builtins/history.def + - add history -d start-end to the long doc + From a report from Duncan Roe + + 4/9 + --- +lib/readline/histfile.c + - read_history_range: changes to not skip blank lines if we are + reading a history file with multiline history entries. + From a report by Jens Schmidt + + 4/11 + ---- +bashline.c + - attempt_shell_completion: move the check for char_is_quoted from + check_redir to the caller, set in_command_position to 0 if the + command separator is quoted + From https://savannah.gnu.org/support/?111224 david@mandelberg.org + - check_extglob: break check for extended glob out into separate + function, call from attempted_shell_completion, set in_command_position + to -1 if it returns 1, as with the old call to check_redir + + 4/21 + ---- +builtins/read.def + - read_mbchar: if we read a delimiter character that makes an + incomplete multibyte character into an invalid multibyte character, + only push the delimiter back if we read that character ourselves + (i > 1). + Report from Greg Wooledge + + 4/23 + ---- +parse.y + - pop_delimiter: only decrement delimiter_depth if it's > 0, since + reset_parser() may have set it to 0 after the matching call to + push_delimiter + Report from Grisha Levit based on a report + from Александр Ушаков + + 4/25 + ---- +parse.y + - read_a_line: if the shell is interactive, and not reading from a + string, check whether a previous call to shell_getc has set + EOF_Reached and return EOF in this case, after resetting the + current token to '\n'. This makes EOFs that are not the first + character on the line `sticky' instead of just token delimiters. + From https://savannah.gnu.org/bugs/?67045 + - history_delimiting_chars: if it looks like we just finished a + subshell, and the line we're adding begins with an operator that + can't follow a semicolon, return a newline + From https://savannah.gnu.org/patch/?10517 + + 4/28 + ---- +parse.y + - parse_arith_command: if the character after the first right paren + isn't a right paren, making the construct a nested subshell, push + that character back and return the subshell command as the current + token string, which we push onto the pushed string list. Reading + one character more can cause synchronization problems with backslash + newline, among other things. + From https://savannah.gnu.org/patch/?10517 + + 4/29 + ---- +builtins/evalstring.c + - parse_string: only run the top-level unwind-protects if we're + actually going to be calling jump_to_top_level(); otherwise let + xparse_dolparen take care of it + From a report by Александр Ушаков + + 5/1 + --- +lib/sh/zread.c + - zungetc: rework to use a local 16-byte buffer so we can push back + multiple characters whether we use read or zread + - zread/zreadretry/zreadintr/zreadc/zreadcintr/zreadn: changed to use + zpopbuf to check whether we have pushed back bytes + - zreset,zsyncfd: reset the pushback buffer indices + +builtins/read.def + - read_mbchar: handle the delimiter being part of an invalid multibyte + character, not just the byte that makes the multibyte character + invalid: keep track of where the delimiter char is in the buffer and + use zungetc to push back that character and everything we read + after it so subsequent buffered (zread) or unbuffered (read) reads + will return them + + 5/2 + --- +lib/readline/display.c,lib/readline/histexpand.c,lib/readline/history.c, +lib/readline/input.c,lib/readline/search.c,lib/readline/shell.c, +lib/readline/util.c,lib/readline/readline.c,lib/readline/histfile.c + - fixes for issues (unused variables, etc.) uncovered by static + analysis + All from a report by Siteshwar Vashisht + + 5/16 + ---- +lib/readline/terminal.c + - NEED_EXTERN_PC: add __gnu_hurd__ to the systems that require this + if not using ncurses; rework the structure of the defines + Report from Collin Funk + +braces.c + - brace_gobbler: don't mark an expression as BRACE_SEQ if we've + already seen a comma and marked it as BRACE_COMMA, so we treat + it as a comma brace expansion. + From a report by Sam James + +support/install-sh + - new version from coreutils-git (2024-12-03.03); renamed from install.sh + +aclocal.m4 + - AM_PROG_INSTALL_SH, AM_PROG_INSTALL_STRIP: added from automake + +configure.ac + - call AM_PROG_INSTALL_SH, AM_PROG_INSTALL_STRIP + +Makefile.in + - STRIP: let configure substitute it from AC_CHECK_TOOL result + - INSTALL_STRIP_PROGRAM: let configure substitute it from + AM_PROG_INSTALL_STRIP + - install-strip: change to set INSTALL_PROGRAM=${INSTALL_STRIP_PROGRAM} + to avoid hard-coding `-s' in the recipe + All from a report by NR + + 5/18 + ---- +subst.c + - param_expand: if we expand a nameref that references an unset array + variable reference, make sure we enforce `nounset', with the usual + exceptions for `@' and `*' subscripts + From a report from Emanuele Torre + + 5/22 + ---- +buildconf.h.in + - add additional defines for conservative ISO C/POSIX environment + - add HAVE_C_BOOL define in case someone cross-compiles with a C23 + compiler + From a report by Bruce Dubbs + +builtins/mkbuiltins.c + - include buildconf.h instead of having separate defines when + cross-compiling diff --git a/ChangeLog b/ChangeLog index b024047f4..62b60b15a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,3 @@ - 12/6/2020 --------- @@ -11103,3 +11102,169 @@ lib/sh/gettimeofday.c - updated from version in gnulib [bash-5.3-rc1 frozen] + + 4/4 + --- +examples/loadables/fltexpr.c + - add support for function calls; support almost all math function + calls in math.h + - add support for pi, gamma, e mathematical constants + + 4/7 + --- +doc/bash.1,doc/bashref.texi + - HISTFILESIZE: note that the history file will contain complete + history entries whose lines may total slightly more than + $HISTFILESIZE if the entries contain multiple lines + From a report from Jens Schmidt + - export: note that you can use -f with -p to display exported functions + From a report from Duncan Roe + +builtins/history.def + - add history -d start-end to the long doc + From a report from Duncan Roe + + 4/9 + --- +lib/readline/histfile.c + - read_history_range: changes to not skip blank lines if we are + reading a history file with multiline history entries. + From a report by Jens Schmidt + + 4/11 + ---- +bashline.c + - attempt_shell_completion: move the check for char_is_quoted from + check_redir to the caller, set in_command_position to 0 if the + command separator is quoted + From https://savannah.gnu.org/support/?111224 david@mandelberg.org + - check_extglob: break check for extended glob out into separate + function, call from attempted_shell_completion, set in_command_position + to -1 if it returns 1, as with the old call to check_redir + + 4/21 + ---- +builtins/read.def + - read_mbchar: if we read a delimiter character that makes an + incomplete multibyte character into an invalid multibyte character, + only push the delimiter back if we read that character ourselves + (i > 1). + Report from Greg Wooledge + + 4/23 + ---- +parse.y + - pop_delimiter: only decrement delimiter_depth if it's > 0, since + reset_parser() may have set it to 0 after the matching call to + push_delimiter + Report from Grisha Levit based on a report + from Александр Ушаков + + 4/25 + ---- +parse.y + - read_a_line: if the shell is interactive, and not reading from a + string, check whether a previous call to shell_getc has set + EOF_Reached and return EOF in this case, after resetting the + current token to '\n'. This makes EOFs that are not the first + character on the line `sticky' instead of just token delimiters. + From https://savannah.gnu.org/bugs/?67045 + - history_delimiting_chars: if it looks like we just finished a + subshell, and the line we're adding begins with an operator that + can't follow a semicolon, return a newline + From https://savannah.gnu.org/patch/?10517 + + 4/28 + ---- +parse.y + - parse_arith_command: if the character after the first right paren + isn't a right paren, making the construct a nested subshell, push + that character back and return the subshell command as the current + token string, which we push onto the pushed string list. Reading + one character more can cause synchronization problems with backslash + newline, among other things. + From https://savannah.gnu.org/patch/?10517 + + 4/29 + ---- +builtins/evalstring.c + - parse_string: only run the top-level unwind-protects if we're + actually going to be calling jump_to_top_level(); otherwise let + xparse_dolparen take care of it + From a report by Александр Ушаков + + 5/1 + --- +lib/sh/zread.c + - zungetc: rework to use a local 16-byte buffer so we can push back + multiple characters whether we use read or zread + - zread/zreadretry/zreadintr/zreadc/zreadcintr/zreadn: changed to use + zpopbuf to check whether we have pushed back bytes + - zreset,zsyncfd: reset the pushback buffer indices + +builtins/read.def + - read_mbchar: handle the delimiter being part of an invalid multibyte + character, not just the byte that makes the multibyte character + invalid: keep track of where the delimiter char is in the buffer and + use zungetc to push back that character and everything we read + after it so subsequent buffered (zread) or unbuffered (read) reads + will return them + + 5/2 + --- +lib/readline/display.c,lib/readline/histexpand.c,lib/readline/history.c, +lib/readline/input.c,lib/readline/search.c,lib/readline/shell.c, +lib/readline/util.c,lib/readline/readline.c,lib/readline/histfile.c + - fixes for issues (unused variables, etc.) uncovered by static + analysis + All from a report by Siteshwar Vashisht + + 5/16 + ---- +lib/readline/terminal.c + - NEED_EXTERN_PC: add __gnu_hurd__ to the systems that require this + if not using ncurses; rework the structure of the defines + Report from Collin Funk + +braces.c + - brace_gobbler: don't mark an expression as BRACE_SEQ if we've + already seen a comma and marked it as BRACE_COMMA, so we treat + it as a comma brace expansion. + From a report by Sam James + +support/install-sh + - new version from coreutils-git (2024-12-03.03); renamed from install.sh + +aclocal.m4 + - AM_PROG_INSTALL_SH, AM_PROG_INSTALL_STRIP: added from automake + +configure.ac + - call AM_PROG_INSTALL_SH, AM_PROG_INSTALL_STRIP + +Makefile.in + - STRIP: let configure substitute it from AC_CHECK_TOOL result + - INSTALL_STRIP_PROGRAM: let configure substitute it from + AM_PROG_INSTALL_STRIP + - install-strip: change to set INSTALL_PROGRAM=${INSTALL_STRIP_PROGRAM} + to avoid hard-coding `-s' in the recipe + All from a report by NR + + 5/18 + ---- +subst.c + - param_expand: if we expand a nameref that references an unset array + variable reference, make sure we enforce `nounset', with the usual + exceptions for `@' and `*' subscripts + From a report from Emanuele Torre + + 5/22 + ---- +buildconf.h.in + - add additional defines for conservative ISO C/POSIX environment + - add HAVE_C_BOOL define in case someone cross-compiles with a C23 + compiler + From a report by Bruce Dubbs + +builtins/mkbuiltins.c + - include buildconf.h instead of having separate defines when + cross-compiling diff --git a/MANIFEST b/MANIFEST index 5dcd8cce1..5a09c72e2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -741,7 +741,7 @@ support/zecho.c f support/xcase.c f support/SYMLINKS f support/fixlinks f 755 -support/install.sh f 755 +support/install-sh f 755 support/texi2dvi f 755 support/texi2html f 755 #support/xenix-link.sh f 755 @@ -1294,6 +1294,7 @@ tests/history5.sub f tests/history6.sub f tests/history7.sub f tests/history8.sub f +tests/history9.sub f tests/ifs.tests f tests/ifs.right f tests/ifs1.sub f @@ -1366,6 +1367,7 @@ tests/nameref21.sub f tests/nameref22.sub f tests/nameref23.sub f tests/nameref24.sub f +tests/nameref25.sub f tests/nameref.right f tests/new-exp.tests f tests/new-exp1.sub f diff --git a/Makefile.in b/Makefile.in index 3e8e86586..c4a882f78 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile for bash-5.3, version 5.8 +# Makefile for bash-5.3, version 5.10 # # Copyright (C) 1996-2025 Free Software Foundation, Inc. @@ -79,15 +79,18 @@ AR = @AR@ ARFLAGS = @ARFLAGS@ RANLIB = @RANLIB@ SIZE = @SIZE@ -STRIP = strip +STRIP = @STRIP@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ INSTALLMODE= -m 0755 INSTALLMODE2 = -m 0555 +install_sh = @install_sh@ + CTAGS = ctags CTAGSFLAGS = -x ETAGS = etags @@ -923,7 +926,7 @@ install: .made installdirs -( cd $(LOADABLES_DIR) && $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) $@ ) install-strip: - $(MAKE) $(BASH_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ + $(MAKE) $(BASH_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_STRIP_PROGRAM)' \ prefix=${prefix} exec_prefix=${exec_prefix} \ DESTDIR=$(DESTDIR) install diff --git a/NEWS b/NEWS index 84b11c8dd..2107abef1 100644 --- a/NEWS +++ b/NEWS @@ -146,6 +146,9 @@ uu. If `exit' is run in a trap and not supplied an exit status argument, it vv. There is a new `fltexpr' builtin to perform floating-point arithmetic similarly to `let'. +ww. The `install-strip' and `strip' Makefile targets now deal with cross- + compiling. + 2. New Features in Readline a. Output a newline if there is no prompt and readline reads an empty line. diff --git a/aclocal.m4 b/aclocal.m4 index bd598666c..ae2d8aec9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2240,3 +2240,68 @@ else fi AC_DEFINE_UNQUOTED([FNMATCH_EQUIV_FALLBACK], [$bash_cv_fnmatch_equiv_value], [Whether fnmatch can be used for bracket equivalence classes]) ]) + +AC_DEFUN([BASH_FUNC_STRCHRNUL], +[ + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + AC_CACHE_CHECK([whether strchrnul works], + [bash_cv_func_strchrnul_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM( +[[ +#include +]], +[[const char *buf = "abc"; + return strchrnul (buf, 'd') != buf + 3; +]] +)], +[bash_cv_func_strchrnul_works=yes], [bash_cv_func_strchrnul_works=no], +[bash_cv_func_strchrnul_works=no] +)]) + +if test "$bash_cv_func_strchrnul_works" = "no"; then +AC_LIBOBJ([strchrnul]) +fi +]) + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +#if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +#fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) diff --git a/bashline.c b/bashline.c index 2b67baf22..fb8aeea20 100644 --- a/bashline.c +++ b/bashline.c @@ -1422,6 +1422,22 @@ bash_spell_correct_shellword (int count, int key) #define COMMAND_SEPARATORS_PLUS_WS ";|&{(` \t" /* )} */ +static inline int +check_extglob (int ti) +{ +#if defined (EXTENDED_GLOB) + int this_char, prev_char; + + this_char = rl_line_buffer[ti]; + prev_char = (ti > 0) ? rl_line_buffer[ti - 1] : 0; + + if (extended_glob && ti > 0 && this_char == '(' && /*)*/ + member (prev_char, "?*+@!") && char_is_quoted (rl_line_buffer, ti - 1) == 0) + return (1); +#endif + return (0); +} + /* check for redirections and other character combinations that are not command separators */ static inline int @@ -1440,27 +1456,11 @@ check_redir (int ti) return (1); else if (this_char == '{' && prev_char == '$' && FUNSUB_CHAR (next_char) == 0) /*}*/ return (1); -#if 0 /* Not yet */ - else if (this_char == '(' && prev_char == '$') /*)*/ - return (1); - else if (this_char == '(' && prev_char == '<') /*)*/ - return (1); -#if defined (EXTENDED_GLOB) - else if (extended_glob && this_char == '(' && prev_char == '!') /*)*/ - return (1); -#endif -#endif - else if (char_is_quoted (rl_line_buffer, ti)) - return (1); + return (0); } #if defined (PROGRAMMABLE_COMPLETION) -/* - * XXX - because of the <= start test, and setting os = s+1, this can - * potentially return os > start. This is probably not what we want to - * happen, but fix later after 2.05a-release. - */ static int find_cmd_start (int start) { @@ -1638,9 +1638,13 @@ attempt_shell_completion (const char *text, int start, int end) } else if (member (rl_line_buffer[ti], command_separator_chars)) { - in_command_position++; + if (char_is_quoted (rl_line_buffer, ti) == 0) + in_command_position++; + + if (in_command_position && rl_line_buffer[ti] == '(' && check_extglob (ti) == 1) /*)*/ + in_command_position = -1; - if (check_redir (ti) == 1) + if (in_command_position && check_redir (ti) == 1) in_command_position = -1; /* sentinel that we're not the first word on the line */ } else diff --git a/braces.c b/braces.c index 49bd770e6..fb9230e06 100644 --- a/braces.c +++ b/braces.c @@ -783,8 +783,9 @@ comsub: commas++; } else if (satisfy == '}' && STREQN (text+i, BRACE_SEQ_SPECIFIER, 2) && - text[i+2] != satisfy && level == 0) + text[i+2] != satisfy && level == 0 && btype == BRACE_NONE) { + /* The check against BRACE_NONE gives the comma higher precedence */ btype = BRACE_SEQ; commas++; } diff --git a/buildconf.h.in b/buildconf.h.in index 6d9b77dd3..b99d26ce9 100644 --- a/buildconf.h.in +++ b/buildconf.h.in @@ -33,6 +33,13 @@ #define HAVE_LOCALE_H 1 #define HAVE_UNISTD_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STDLIB_H 1 + +#define HAVE_RENAME + +/* defining this implies a C23 environment */ +#undef HAVE_C_BOOL /* Don't assume this; it's from C99; let syntax.h define a replacement */ /* #undef HAVE_ISBLANK */ diff --git a/builtins/evalstring.c b/builtins/evalstring.c index 8a9cf2d73..d962f825a 100644 --- a/builtins/evalstring.c +++ b/builtins/evalstring.c @@ -725,7 +725,8 @@ parse_string (char *string, const char *from_file, int flags, COMMAND **cmdp, ch if (current_token == yacc_EOF || current_token == shell_eof_token) { - if (current_token == shell_eof_token) + /* check for EOFTOKEN out of paranoia */ + if ((parser_state & PST_EOFTOKEN) && (current_token == shell_eof_token)) rewind_input_string (); break; } @@ -744,10 +745,10 @@ out: us, after doing cleanup */ if (should_jump_to_top_level) { - if (parse_and_execute_level == 0) - top_level_cleanup (); if (code == DISCARD) return -DISCARD; + if (parse_and_execute_level == 0) + top_level_cleanup (); jump_to_top_level (code); } diff --git a/builtins/history.def b/builtins/history.def index fa79c0b93..4c36416c2 100644 --- a/builtins/history.def +++ b/builtins/history.def @@ -33,6 +33,8 @@ Options: -c clear the history list by deleting all of the entries -d offset delete the history entry at position OFFSET. Negative offsets count back from the end of the history list + -d start-end delete the history entries beginning at position START + through position END. -a append history lines from this session to the history file -n read all history lines not already read from the history file diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c index 690a65c77..efa6314de 100644 --- a/builtins/mkbuiltins.c +++ b/builtins/mkbuiltins.c @@ -23,11 +23,7 @@ # include #else /* CROSS_COMPILING */ /* A conservative set of defines based on POSIX/SUS3/XPG6 */ -# define HAVE_UNISTD_H -# define HAVE_STRING_H -# define HAVE_STDLIB_H - -# define HAVE_RENAME +# include #endif /* CROSS_COMPILING */ #if defined (HAVE_UNISTD_H) diff --git a/builtins/read.def b/builtins/read.def index 3e908dc76..3b13385fa 100644 --- a/builtins/read.def +++ b/builtins/read.def @@ -1159,7 +1159,7 @@ static int read_mbchar (int fd, char *string, int ind, int ch, int delim, int unbuffered) { char mbchar[MB_LEN_MAX + 1]; - int i, n, r; + int i, n, r, delim_ind; char c; size_t ret; mbstate_t ps, ps_back; @@ -1167,7 +1167,8 @@ read_mbchar (int fd, char *string, int ind, int ch, int delim, int unbuffered) memset (&ps, '\0', sizeof (mbstate_t)); memset (&ps_back, '\0', sizeof (mbstate_t)); - + + delim_ind = 0; mbchar[0] = ch; i = 1; for (n = 0; n <= MB_LEN_MAX; n++) @@ -1187,19 +1188,24 @@ read_mbchar (int fd, char *string, int ind, int ch, int delim, int unbuffered) r = zreadc (fd, &c); if (r <= 0) goto mbchar_return; + if ((unsigned char)c == delim) + delim_ind = i; mbchar[i++] = c; continue; } else if (ret == (size_t)-1) { - /* If we read a delimiter character that makes this an invalid - multibyte character, we can't just add it to the input string - and treat it as a byte. We need to push it back so a subsequent - zread will pick it up. */ - if ((unsigned char)c == delim) + /* If we read (i > 1) a delimiter character (delim_ind >= 1) + that is a part of this invalid multibyte character, we can't + just add it to the input string and treat it as a byte. + We need to push it and everything we read after it back so a + subsequent zread will pick it up. */ + if (i > 1 && delim_ind >= 1) { - zungetc ((unsigned char)c); - mbchar[--i] = '\0'; /* unget the delimiter */ + size_t j; + for (j = delim_ind; j < i; j++) + zungetc ((unsigned char)mbchar[j]); + i = delim_ind; } break; /* invalid multibyte character */ } diff --git a/builtins/setattr.def b/builtins/setattr.def index 146b2e0d7..f4c362036 100644 --- a/builtins/setattr.def +++ b/builtins/setattr.def @@ -50,7 +50,7 @@ extern sh_builtin_func_t *this_shell_builtin; $BUILTIN export $FUNCTION export_builtin -$SHORT_DOC export [-fn] [name[=value] ...] or export -p +$SHORT_DOC export [-fn] [name[=value] ...] or export -p [-f] Set export attribute for shell variables. Marks each NAME for automatic export to the environment of subsequently @@ -59,7 +59,7 @@ executed commands. If VALUE is supplied, assign VALUE before exporting. Options: -f refer to shell functions -n remove the export property from each NAME - -p display a list of all exported variables and functions + -p display a list of all exported variables or functions An argument of `--' disables further option processing. diff --git a/config.h.in b/config.h.in index 7dac61a97..1367eaaa7 100644 --- a/config.h.in +++ b/config.h.in @@ -880,6 +880,9 @@ /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF +/* Define if you have the statfs function. */ +#undef HAVE_STATFS + /* Define if you have the strcasecmp function. */ #undef HAVE_STRCASECMP diff --git a/configure b/configure index c3707a85d..f71ebc5d4 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac for Bash 5.3, version 5.076. +# From configure.ac for Bash 5.3, version 5.080. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for bash 5.3-rc1. +# Generated by GNU Autoconf 2.72 for bash 5.3-rc2. # # Report bugs to . # @@ -605,8 +605,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bash' PACKAGE_TARNAME='bash' -PACKAGE_VERSION='5.3-rc1' -PACKAGE_STRING='bash 5.3-rc1' +PACKAGE_VERSION='5.3-rc2' +PACKAGE_STRING='bash 5.3-rc2' PACKAGE_BUGREPORT='bug-bash@gnu.org' PACKAGE_URL='' @@ -740,6 +740,9 @@ SED MKDIR_P SIZE MAKE_SHELL +INSTALL_STRIP_PROGRAM +STRIP +install_sh SET_MAKE YFLAGS YACC @@ -1465,7 +1468,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.3-rc1 to adapt to many kinds of systems. +'configure' configures bash 5.3-rc2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1531,7 +1534,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bash 5.3-rc1:";; + short | recursive ) echo "Configuration of bash 5.3-rc2:";; esac cat <<\_ACEOF @@ -1739,7 +1742,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bash configure 5.3-rc1 +bash configure 5.3-rc2 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -2417,7 +2420,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.3-rc1, which was +It was created by bash $as_me 5.3-rc2, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3216,7 +3219,7 @@ ac_config_headers="$ac_config_headers config.h buildconf.h" BASHVERS=5.3 -RELSTATUS=rc1 +RELSTATUS=rc2 case "$RELSTATUS" in alp*|bet*|dev*|rc*|releng*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;; @@ -6407,6 +6410,132 @@ printf "%s\n" "no" >&6; } fi + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +#if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +#fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + case "$ac_cv_prog_YACC" in *bison*) ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: bison not available; needed to process parse.y" >&5 @@ -9228,8 +9357,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$save_LIBS test $gl_pthread_api = yes && break done - echo "$as_me:9231: gl_pthread_api=$gl_pthread_api" >&5 - echo "$as_me:9232: LIBPTHREAD=$LIBPTHREAD" >&5 + echo "$as_me:9360: gl_pthread_api=$gl_pthread_api" >&5 + echo "$as_me:9361: LIBPTHREAD=$LIBPTHREAD" >&5 gl_pthread_in_glibc=no # On Linux with glibc >= 2.34, libc contains the fully functional @@ -9255,7 +9384,7 @@ rm -rf conftest* ;; esac - echo "$as_me:9258: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 + echo "$as_me:9387: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -9433,7 +9562,7 @@ fi fi fi - echo "$as_me:9436: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 + echo "$as_me:9565: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 printf %s "checking whether POSIX threads API is available... " >&6; } @@ -9680,8 +9809,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ LIBS=$save_LIBS test $gl_pthread_api = yes && break done - echo "$as_me:9683: gl_pthread_api=$gl_pthread_api" >&5 - echo "$as_me:9684: LIBPTHREAD=$LIBPTHREAD" >&5 + echo "$as_me:9812: gl_pthread_api=$gl_pthread_api" >&5 + echo "$as_me:9813: LIBPTHREAD=$LIBPTHREAD" >&5 gl_pthread_in_glibc=no # On Linux with glibc >= 2.34, libc contains the fully functional @@ -9707,7 +9836,7 @@ rm -rf conftest* ;; esac - echo "$as_me:9710: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 + echo "$as_me:9839: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&5 # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) @@ -9885,7 +10014,7 @@ fi fi fi - echo "$as_me:9888: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 + echo "$as_me:10017: LIBPMULTITHREAD=$LIBPMULTITHREAD" >&5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 printf %s "checking whether POSIX threads API is available... " >&6; } @@ -10655,7 +10784,6 @@ with_gnu_ld=$acl_cv_prog_gnu_ld - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 printf %s "checking for shared library run path origin... " >&6; } if test ${acl_cv_rpath+y} @@ -15581,6 +15709,12 @@ if test "x$ac_cv_func_setitimer" = xyes then : printf "%s\n" "#define HAVE_SETITIMER 1" >>confdefs.h +fi +ac_fn_c_check_func "$LINENO" "statfs" "ac_cv_func_statfs" +if test "x$ac_cv_func_statfs" = xyes +then : + printf "%s\n" "#define HAVE_STATFS 1" >>confdefs.h + fi ac_fn_c_check_func "$LINENO" "tcgetpgrp" "ac_cv_func_tcgetpgrp" if test "x$ac_cv_func_tcgetpgrp" = xyes @@ -16174,21 +16308,6 @@ esac esac fi -ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul" -if test "x$ac_cv_func_strchrnul" = xyes -then : - printf "%s\n" "#define HAVE_STRCHRNUL 1" >>confdefs.h - -else case e in #( - e) case " $LIBOBJS " in - *" strchrnul.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS strchrnul.$ac_objext" - ;; -esac - ;; -esac -fi - ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes then : @@ -18997,6 +19116,62 @@ fi fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5 +printf %s "checking whether strchrnul works... " >&6; } +if test ${bash_cv_func_strchrnul_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "$cross_compiling" = yes +then : + bash_cv_func_strchrnul_works=no + +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main (void) +{ +const char *buf = "abc"; + return strchrnul (buf, 'd') != buf + 3; + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + bash_cv_func_strchrnul_works=yes +else case e in #( + e) bash_cv_func_strchrnul_works=no ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strchrnul_works" >&5 +printf "%s\n" "$bash_cv_func_strchrnul_works" >&6; } + +if test "$bash_cv_func_strchrnul_works" = "no"; then +case " $LIBOBJS " in + *" strchrnul.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strchrnul.$ac_objext" + ;; +esac + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if dup2 fails to clear the close-on-exec flag" >&5 printf %s "checking if dup2 fails to clear the close-on-exec flag... " >&6; } if test ${bash_cv_dup2_broken+y} @@ -23639,7 +23814,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.3-rc1, which was +This file was extended by bash $as_me 5.3-rc2, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23707,7 +23882,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -bash config.status 5.3-rc1 +bash config.status 5.3-rc2 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 35639ed3d..846e55abf 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 . -AC_REVISION([for Bash 5.3, version 5.076])dnl +AC_REVISION([for Bash 5.3, version 5.080])dnl define(bashvers, 5.3) -define(relstatus, rc1) +define(relstatus, rc2) AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org]) @@ -32,7 +32,7 @@ dnl make sure we are using a recent autoconf version AC_PREREQ(2.69) AC_CONFIG_SRCDIR(shell.h) -dnl where to find install.sh, config.sub, and config.guess +dnl where to find install-sh, config.sub, and config.guess AC_CONFIG_AUX_DIR(./support) AC_CONFIG_HEADERS(config.h buildconf.h) @@ -695,6 +695,9 @@ AC_PROG_RANLIB AC_PROG_YACC AC_PROG_MAKE_SET +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP + case "$ac_cv_prog_YACC" in *bison*) ;; *) AC_MSG_WARN([bison not available; needed to process parse.y]) ;; @@ -874,7 +877,8 @@ AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \ gethostname getpagesize getpeername getrandom getrlimit \ getrusage gettimeofday kill killpg lstat nanosleep \ pselect readlink \ - select setdtablesize setitimer tcgetpgrp uname ulimit waitpid) + select setdtablesize setitimer statfs \ + tcgetpgrp uname ulimit waitpid) AC_REPLACE_FUNCS(rename) dnl checks for c library functions @@ -898,7 +902,6 @@ AC_REPLACE_FUNCS(getcwd memset) AC_REPLACE_FUNCS(strcasecmp strcasestr strerror strftime strnlen strpbrk strstr) AC_REPLACE_FUNCS(strtod strtol strtoul strtoll strtoull strtoumax) AC_REPLACE_FUNCS(dprintf) -AC_REPLACE_FUNCS(strchrnul) AC_REPLACE_FUNCS(strdup) AC_REPLACE_FUNCS(strlcpy) AC_REPLACE_FUNCS(reallocarray) @@ -1049,6 +1052,8 @@ if test "$ac_cv_func_lstat" = "no"; then BASH_FUNC_LSTAT fi +BASH_FUNC_STRCHRNUL + dnl behavior of system calls and library functions BASH_FUNC_DUP2_CLOEXEC_CHECK BASH_SYS_PGRP_SYNC diff --git a/doc/bash.0 b/doc/bash.0 index 37deeb587..e01a1afee 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -770,11 +770,11 @@ PPAARRAAMMEETTEERRSS value. The current value is usually an integer constant, but may be an expression. 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 the vari- - able's value. + 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 ap- + plied 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 @@ -1345,13 +1345,17 @@ PPAARRAAMMEETTEERRSS HHIISSTTFFIILLEESSIIZZEE The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is trun- - cated, if necessary, to contain no more than that number of - lines by removing the oldest entries. The history file is also - truncated to this size after writing it when a shell exits or by - the hhiissttoorryy builtin. If the value is 0, the history file is - truncated to zero size. Non-numeric values and numeric values - less than zero inhibit truncation. The shell sets the default - value to the value of HHIISSTTSSIIZZEE after reading any startup files. + cated, if necessary, to contain no more than the number of his- + tory entries that total no more than that number of lines by re- + moving the oldest entries. If the history list contains multi- + line entries, the history file may contain more lines than this + maximum to avoid leaving partial history entries. The history + file is also truncated to this size after writing it when a + shell exits or by the hhiissttoorryy builtin. If the value is 0, the + history file is truncated to zero size. Non-numeric values and + numeric values less than zero inhibit truncation. The shell + sets the default value to the value of HHIISSTTSSIIZZEE after reading + any startup files. HHIISSTTIIGGNNOORREE A colon-separated list of patterns used to decide which command lines should be saved on the history list. If a command line @@ -5730,21 +5734,23 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS on EEXXIITT is executed before the shell terminates. eexxppoorrtt [--ffnn] [_n_a_m_e[=_v_a_l_u_e]] ... - eexxppoorrtt --pp + eexxppoorrtt --pp [[--ff]] The supplied _n_a_m_e_s are marked for automatic export to the envi- ronment of subsequently executed commands. If the --ff option is given, the _n_a_m_e_s refer to functions. The --nn option unexports, or removes the export attribute, from - each _n_a_m_e. If no _n_a_m_e_s are given, or if the --pp option is sup- - plied, eexxppoorrtt prints a list of names of all exported variables - on the standard output. + each _n_a_m_e. If no _n_a_m_e_s are given, or if only the --pp option is + supplied, eexxppoorrtt displays a list of names of all exported vari- + ables on the standard output. Using --pp and --ff together displays + exported functions. The --pp option displays output in a form + that may be reused as input. - eexxppoorrtt allows the value of a variable to be set when it is ex- + eexxppoorrtt allows the value of a variable to be set when it is ex- ported or unexported by following the variable name with =_v_a_l_u_e. This sets the value of the variable to _v_a_l_u_e while modifying the - export attribute. eexxppoorrtt returns an exit status of 0 unless an - invalid option is encountered, one of the _n_a_m_e_s is not a valid + export attribute. eexxppoorrtt returns an exit status of 0 unless an + invalid option is encountered, one of the _n_a_m_e_s is not a valid shell variable name, or --ff is supplied with a _n_a_m_e that is not a function. @@ -5752,141 +5758,141 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ffcc [--ee _e_n_a_m_e] [--llnnrr] [_f_i_r_s_t] [_l_a_s_t] ffcc --ss [_p_a_t=_r_e_p] [_c_m_d] - The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t - from the history list and displays or edits and re-executes - them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate - the last command beginning with that string) or as a number (an - index into the history list, where a negative number is used as + The first form selects a range of commands from _f_i_r_s_t to _l_a_s_t + from the history list and displays or edits and re-executes + them. _F_i_r_s_t and _l_a_s_t may be specified as a string (to locate + the last command beginning with that string) or as a number (an + index into the history list, where a negative number is used as an offset from the current command number). When listing, a _f_i_r_s_t or _l_a_s_t of 0 is equivalent to -1 and -0 is equivalent to the current command (usually the ffcc command); oth- - erwise 0 is equivalent to -1 and -0 is invalid. If _l_a_s_t is not + erwise 0 is equivalent to -1 and -0 is invalid. If _l_a_s_t is not specified, it is set to the current command for listing (so that "fc -l -10" prints the last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t is not specified, it is set to the previous command for editing and -16 for listing. - If the --ll option is supplied, the commands are listed on the - standard output. The --nn option suppresses the command numbers + If the --ll option is supplied, the commands are listed on the + standard output. The --nn option suppresses the command numbers when listing. The --rr option reverses the order of the commands. - Otherwise, ffcc invokes the editor named by _e_n_a_m_e on a file con- - taining those commands. If _e_n_a_m_e is not supplied, ffcc uses the - value of the FFCCEEDDIITT variable, and the value of EEDDIITTOORR if FFCCEEDDIITT - is not set. If neither variable is set, ffcc uses _v_i_. When edit- - ing is complete, ffcc reads the file containing the edited com- + Otherwise, ffcc invokes the editor named by _e_n_a_m_e on a file con- + taining those commands. If _e_n_a_m_e is not supplied, ffcc uses the + value of the FFCCEEDDIITT variable, and the value of EEDDIITTOORR if FFCCEEDDIITT + is not set. If neither variable is set, ffcc uses _v_i_. When edit- + ing is complete, ffcc reads the file containing the edited com- mands and echoes and executes them. - In the second form, ffcc re-executes _c_o_m_m_a_n_d after replacing each - instance of _p_a_t with _r_e_p. _C_o_m_m_a_n_d is interpreted the same as + In the second form, ffcc re-executes _c_o_m_m_a_n_d after replacing each + instance of _p_a_t with _r_e_p. _C_o_m_m_a_n_d is interpreted the same as _f_i_r_s_t above. - A useful alias to use with ffcc is "r="fc -s"", so that typing "r + A useful alias to use with ffcc is "r="fc -s"", so that typing "r cc" runs the last command beginning with "cc" and typing "r" re- executes the last command. - If the first form is used, the return value is zero unless an - invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history - lines out of range. When editing and re-executing a file of + If the first form is used, the return value is zero unless an + invalid option is encountered or _f_i_r_s_t or _l_a_s_t specify history + lines out of range. When editing and re-executing a file of commands, the return value is the value of the last command exe- cuted or failure if an error occurs with the temporary file. If the second form is used, the return status is that of the re-ex- - ecuted command, unless _c_m_d does not specify a valid history en- + ecuted command, unless _c_m_d does not specify a valid history en- try, in which case ffcc returns a non-zero status. ffgg [_j_o_b_s_p_e_c] - Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. - If _j_o_b_s_p_e_c is not present, ffgg uses the shell's notion of the - _c_u_r_r_e_n_t _j_o_b. The return value is that of the command placed - into the foreground, or failure if run when job control is dis- + Resume _j_o_b_s_p_e_c in the foreground, and make it the current job. + If _j_o_b_s_p_e_c is not present, ffgg uses the shell's notion of the + _c_u_r_r_e_n_t _j_o_b. The return value is that of the command placed + into the foreground, or failure if run when job control is dis- abled or, when run with job control enabled, if _j_o_b_s_p_e_c does not - specify a valid job or _j_o_b_s_p_e_c specifies a job that was started + specify a valid job or _j_o_b_s_p_e_c specifies a job that was started without job control. ggeettooppttss _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g ...] - ggeettooppttss is used by shell scripts and functions to parse posi- - tional parameters and obtain options and their arguments. _o_p_t_- - _s_t_r_i_n_g contains the option characters to be recognized; if a + ggeettooppttss is used by shell scripts and functions to parse posi- + tional parameters and obtain options and their arguments. _o_p_t_- + _s_t_r_i_n_g contains the option characters to be recognized; if a character is followed by a colon, the option is expected to have - an argument, which should be separated from it by white space. + an argument, which should be separated from it by white space. The colon and question mark characters may not be used as option characters. - Each time it is invoked, ggeettooppttss places the next option in the + Each time it is invoked, ggeettooppttss places the next option in the shell variable _n_a_m_e, initializing _n_a_m_e if it does not exist, and the index of the next argument to be processed into the variable - OOPPTTIINNDD. OOPPTTIINNDD is initialized to 1 each time the shell or a - shell script is invoked. When an option requires an argument, + OOPPTTIINNDD. OOPPTTIINNDD is initialized to 1 each time the shell or a + shell script is invoked. When an option requires an argument, ggeettooppttss places that argument into the variable OOPPTTAARRGG. - The shell does not reset OOPPTTIINNDD automatically; it must be manu- - ally reset between multiple calls to ggeettooppttss within the same + The shell does not reset OOPPTTIINNDD automatically; it must be manu- + ally reset between multiple calls to ggeettooppttss within the same shell invocation to use a new set of parameters. - When it reaches the end of options, ggeettooppttss exits with a return - value greater than zero. OOPPTTIINNDD is set to the index of the + When it reaches the end of options, ggeettooppttss exits with a return + value greater than zero. OOPPTTIINNDD is set to the index of the first non-option argument, and _n_a_m_e is set to ?. - ggeettooppttss normally parses the positional parameters, but if more - arguments are supplied as _a_r_g values, ggeettooppttss parses those in- + ggeettooppttss normally parses the positional parameters, but if more + arguments are supplied as _a_r_g values, ggeettooppttss parses those in- stead. - ggeettooppttss can report errors in two ways. If the first character - of _o_p_t_s_t_r_i_n_g is a colon, ggeettooppttss uses _s_i_l_e_n_t error reporting. - In normal operation, ggeettooppttss prints diagnostic messages when it - encounters invalid options or missing option arguments. If the - variable OOPPTTEERRRR is set to 0, ggeettooppttss does not display any error - messages, even if the first character of _o_p_t_s_t_r_i_n_g is not a + ggeettooppttss can report errors in two ways. If the first character + of _o_p_t_s_t_r_i_n_g is a colon, ggeettooppttss uses _s_i_l_e_n_t error reporting. + In normal operation, ggeettooppttss prints diagnostic messages when it + encounters invalid options or missing option arguments. If the + variable OOPPTTEERRRR is set to 0, ggeettooppttss does not display any error + messages, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. If ggeettooppttss detects an invalid option, it places ? into _n_a_m_e and, - if not silent, prints an error message and unsets OOPPTTAARRGG. If - ggeettooppttss is silent, it assigns the option character found to OOPP-- + if not silent, prints an error message and unsets OOPPTTAARRGG. If + ggeettooppttss is silent, it assigns the option character found to OOPP-- TTAARRGG and does not print a diagnostic message. - If a required argument is not found, and ggeettooppttss is not silent, + If a required argument is not found, and ggeettooppttss is not silent, it sets the value of _n_a_m_e to a question mark (??), unsets OOPPTTAARRGG, - and prints a diagnostic message. If ggeettooppttss is silent, it sets - the value of _n_a_m_e to a colon (::) and sets OOPPTTAARRGG to the option + and prints a diagnostic message. If ggeettooppttss is silent, it sets + the value of _n_a_m_e to a colon (::) and sets OOPPTTAARRGG to the option character found. - ggeettooppttss returns true if an option, specified or unspecified, is + ggeettooppttss returns true if an option, specified or unspecified, is found. It returns false if the end of options is encountered or an error occurs. hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e] Each time hhaasshh is invoked, it remembers the full pathname of the - command _n_a_m_e as determined by searching the directories in - $$PPAATTHH. Any previously-remembered pathname associated with _n_a_m_e - is discarded. If the --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e + command _n_a_m_e as determined by searching the directories in + $$PPAATTHH. Any previously-remembered pathname associated with _n_a_m_e + is discarded. If the --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full pathname of the command. - The --rr option causes the shell to forget all remembered loca- - tions. Assigning to the PPAATTHH variable also clears all hashed - filenames. The --dd option causes the shell to forget the remem- + The --rr option causes the shell to forget all remembered loca- + tions. Assigning to the PPAATTHH variable also clears all hashed + filenames. The --dd option causes the shell to forget the remem- bered location of each _n_a_m_e. If the --tt option is supplied, hhaasshh prints the full pathname cor- - responding to each _n_a_m_e. If multiple _n_a_m_e arguments are sup- - plied with --tt, hhaasshh prints the _n_a_m_e before the corresponding + responding to each _n_a_m_e. If multiple _n_a_m_e arguments are sup- + plied with --tt, hhaasshh prints the _n_a_m_e before the corresponding hashed full pathname. The --ll option displays output in a format that may be reused as input. - If no arguments are given, or if only --ll is supplied, hhaasshh - prints information about remembered commands. The --tt, --dd, and - --pp options (the options that act on the _n_a_m_e arguments) are mu- + If no arguments are given, or if only --ll is supplied, hhaasshh + prints information about remembered commands. The --tt, --dd, and + --pp options (the options that act on the _n_a_m_e arguments) are mu- tually exclusive. Only one will be active. If more than one is - supplied, --tt has higher priority than --pp, and both have higher + supplied, --tt has higher priority than --pp, and both have higher priority than --dd. - The return status is zero unless a _n_a_m_e is not found or an in- + The return status is zero unless a _n_a_m_e is not found or an in- valid option is supplied. hheellpp [--ddmmss] [_p_a_t_t_e_r_n] - Display helpful information about builtin commands. If _p_a_t_t_e_r_n - is specified, hheellpp gives detailed help on all commands matching - _p_a_t_t_e_r_n as described below; otherwise it displays a list of all + Display helpful information about builtin commands. If _p_a_t_t_e_r_n + is specified, hheellpp gives detailed help on all commands matching + _p_a_t_t_e_r_n as described below; otherwise it displays a list of all the builtins and shell compound commands. Options, if supplied, have the follow meanings: @@ -5896,13 +5902,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS format --ss Display only a short usage synopsis for each _p_a_t_t_e_r_n - If _p_a_t_t_e_r_n contains pattern matching characters (see PPaatttteerrnn - MMaattcchhiinngg above) it's treated as a shell pattern and hheellpp prints + If _p_a_t_t_e_r_n contains pattern matching characters (see PPaatttteerrnn + MMaattcchhiinngg above) it's treated as a shell pattern and hheellpp prints the description of each help topic matching _p_a_t_t_e_r_n. - If not, and _p_a_t_t_e_r_n exactly matches the name of a help topic, - hheellpp prints the description associated with that topic. Other- - wise, hheellpp performs prefix matching and prints the descriptions + If not, and _p_a_t_t_e_r_n exactly matches the name of a help topic, + hheellpp prints the description associated with that topic. Other- + wise, hheellpp performs prefix matching and prints the descriptions of all matching help topics. The return status is 0 unless no command matches _p_a_t_t_e_r_n. @@ -5914,18 +5920,18 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] hhiissttoorryy --pp _a_r_g [_a_r_g ...] hhiissttoorryy --ss _a_r_g [_a_r_g ...] - With no options, display the command history list with numbers. - Entries prefixed with a ** have been modified. An argument of _n - lists only the last _n entries. If the shell variable HHIISSTTTTIIMMEE-- - FFOORRMMAATT is set and not null, it is used as a format string for - _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- - played history entry. If hhiissttoorryy uses HHIISSTTTTIIMMEEFFOORRMMAATT, it does - not print an intervening space between the formatted time stamp + With no options, display the command history list with numbers. + Entries prefixed with a ** have been modified. An argument of _n + lists only the last _n entries. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. If hhiissttoorryy uses HHIISSTTTTIIMMEEFFOORRMMAATT, it does + not print an intervening space between the formatted time stamp and the history entry. If _f_i_l_e_n_a_m_e is supplied, hhiissttoorryy uses it as the name of the his- - tory file; if not, it uses the value of HHIISSTTFFIILLEE. If _f_i_l_e_n_a_m_e - is not supplied and HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,, + tory file; if not, it uses the value of HHIISSTTFFIILLEE. If _f_i_l_e_n_a_m_e + is not supplied and HHIISSTTFFIILLEE is unset or null, the --aa,, --nn,, --rr,, and --ww options have no effect. Options, if supplied, have the following meanings: @@ -5933,20 +5939,20 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS can be used with the other options to replace the history list. --dd _o_f_f_s_e_t - Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t + Delete the history entry at position _o_f_f_s_e_t. If _o_f_f_s_e_t is negative, it is interpreted as relative to one greater than the last history position, so negative indices count - back from the end of the history, and an index of -1 + back from the end of the history, and an index of -1 refers to the current hhiissttoorryy --dd command. --dd _s_t_a_r_t-_e_n_d - Delete the range of history entries between positions - _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values + Delete the range of history entries between positions + _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values for _s_t_a_r_t and _e_n_d are interpreted as described above. - --aa Append the "new" history lines to the history file. - These are history lines entered since the beginning of + --aa Append the "new" history lines to the history file. + These are history lines entered since the beginning of the current bbaasshh session, but not already appended to the history file. - --nn Read the history lines not already read from the history + --nn Read the history lines not already read from the history file and add them to the current history list. These are lines appended to the history file since the beginning of the current bbaasshh session. @@ -5954,24 +5960,24 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS rent history list. --ww Write the current history list to the history file, over- writing the history file. - --pp Perform history substitution on the following _a_r_g_s and - display the result on the standard output, without stor- - ing the results in the history list. Each _a_r_g must be + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output, without stor- + ing the results in the history list. Each _a_r_g must be quoted to disable normal history expansion. - --ss Store the _a_r_g_s in the history list as a single entry. - The last command in the history list is removed before + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before adding the _a_r_g_s. - If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, hhiissttoorryy writes the time + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, hhiissttoorryy writes the time stamp information associated with each history entry to the his- - tory file, marked with the history comment character as de- - scribed above. When the history file is read, lines beginning - with the history comment character followed immediately by a - digit are interpreted as timestamps for the following history + tory file, marked with the history comment character as de- + scribed above. When the history file is read, lines beginning + with the history comment character followed immediately by a + digit are interpreted as timestamps for the following history entry. - The return value is 0 unless an invalid option is encountered, - an error occurs while reading or writing the history file, an + The return value is 0 unless an invalid option is encountered, + an error occurs while reading or writing the history file, an invalid _o_f_f_s_e_t or range is supplied as an argument to --dd, or the history expansion supplied as an argument to --pp fails. @@ -5980,14 +5986,14 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS The first form lists the active jobs. The options have the fol- lowing meanings: --ll List process IDs in addition to the normal information. - --nn Display information only about jobs that have changed + --nn Display information only about jobs that have changed status since the user was last notified of their status. - --pp List only the process ID of the job's process group + --pp List only the process ID of the job's process group leader. --rr Display only running jobs. --ss Display only stopped jobs. - If _j_o_b_s_p_e_c is supplied, jjoobbss restricts output to information + If _j_o_b_s_p_e_c is supplied, jjoobbss restricts output to information about that job. The return status is 0 unless an invalid option is encountered or an invalid _j_o_b_s_p_e_c is supplied. @@ -5997,433 +6003,433 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] _i_d [ ... ] kkiillll --ll|--LL [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] - Send the signal specified by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + Send the signal specified by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes named by each _i_d. Each _i_d may be a job specification _j_o_b_s_p_e_c or - a process ID _p_i_d. _s_i_g_s_p_e_c is either a case-insensitive signal - name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or a sig- - nal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not sup- + a process ID _p_i_d. _s_i_g_s_p_e_c is either a case-insensitive signal + name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or a sig- + nal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not sup- plied, then kkiillll sends SSIIGGTTEERRMM. The --ll option lists the signal names. If any arguments are sup- plied when --ll is given, kkiillll lists the names of the signals cor- - responding to the arguments, and the return status is 0. The - _e_x_i_t___s_t_a_t_u_s argument to --ll is a number specifying either a sig- - nal number or the exit status of a process terminated by a sig- - nal; if it is supplied, kkiillll prints the name of the signal that + responding to the arguments, and the return status is 0. The + _e_x_i_t___s_t_a_t_u_s argument to --ll is a number specifying either a sig- + nal number or the exit status of a process terminated by a sig- + nal; if it is supplied, kkiillll prints the name of the signal that caused the process to terminate. kkiillll assumes that process exit statuses are greater than 128; anything less than that is a sig- nal number. The --LL option is equivalent to --ll. - kkiillll returns true if at least one signal was successfully sent, + kkiillll returns true if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered. lleett _a_r_g [_a_r_g ...] - Each _a_r_g is evaluated as an arithmetic expression (see AARRIITTHH-- - MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett + Each _a_r_g is evaluated as an arithmetic expression (see AARRIITTHH-- + MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett returns 1; otherwise lleett returns 0. llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ... | - ] For each argument, create a local variable named _n_a_m_e and assign - it _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddee-- - ccllaarree. When llooccaall is used within a function, it causes the - variable _n_a_m_e to have a visible scope restricted to that func- - tion and its children. It is an error to use llooccaall when not + it _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddee-- + ccllaarree. When llooccaall is used within a function, it causes the + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. It is an error to use llooccaall when not within a function. - If _n_a_m_e is -, it makes the set of shell options local to the - function in which llooccaall is invoked: any shell options changed - using the sseett builtin inside the function after the call to lloo-- - ccaall are restored to their original values when the function re- - turns. The restore is performed as if a series of sseett commands - were executed to restore the values that were in place before + If _n_a_m_e is -, it makes the set of shell options local to the + function in which llooccaall is invoked: any shell options changed + using the sseett builtin inside the function after the call to lloo-- + ccaall are restored to their original values when the function re- + turns. The restore is performed as if a series of sseett commands + were executed to restore the values that were in place before the function. - With no operands, llooccaall writes a list of local variables to the + With no operands, llooccaall writes a list of local variables to the standard output. - The return status is 0 unless llooccaall is used outside a function, + The return status is 0 unless llooccaall is used outside a function, an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable. llooggoouutt [[_n]] - Exit a login shell, returning a status of _n to the shell's par- + Exit a login shell, returning a status of _n to the shell's par- ent. mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] - Read lines from the standard input, or from file descriptor _f_d - if the --uu option is supplied, into the indexed array variable - _a_r_r_a_y. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + Read lines from the standard input, or from file descriptor _f_d + if the --uu option is supplied, into the indexed array variable + _a_r_r_a_y. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if supplied, have the following meanings: - --dd Use the first character of _d_e_l_i_m to terminate each input + --dd Use the first character of _d_e_l_i_m to terminate each input line, rather than newline. If _d_e_l_i_m is the empty string, mmaappffiillee will terminate a line when it reads a NUL charac- ter. --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, copy all lines. - --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default index is 0. --ss Discard the first _c_o_u_n_t lines read. - --tt Remove a trailing _d_e_l_i_m (default newline) from each line + --tt Remove a trailing _d_e_l_i_m (default newline) from each line read. - --uu Read lines from file descriptor _f_d instead of the stan- + --uu Read lines from file descriptor _f_d instead of the stan- dard input. - --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The --cc option specifies _q_u_a_n_t_u_m. - --cc Specify the number of lines read between each call to + --cc Specify the number of lines read between each call to _c_a_l_l_b_a_c_k. - If --CC is specified without --cc, the default quantum is 5000. + If --CC is specified without --cc, the default quantum is 5000. When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that - element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after + element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after the line is read but before the array element is assigned. - If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- + If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- _r_a_y before assigning to it. mmaappffiillee returns zero unless an invalid option or option argument - is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is + is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is not an indexed array. ppooppdd [-nn] [+_n] [-_n] - Remove entries from the directory stack. The elements are num- - bered from 0 starting at the first directory listed by ddiirrss, so - ppooppdd is equivalent to "popd +0." With no arguments, ppooppdd re- - moves the top directory from the stack, and changes to the new + Remove entries from the directory stack. The elements are num- + bered from 0 starting at the first directory listed by ddiirrss, so + ppooppdd is equivalent to "popd +0." With no arguments, ppooppdd re- + moves the top directory from the stack, and changes to the new top directory. Arguments, if supplied, have the following mean- ings: --nn Suppress the normal change of directory when removing di- rectories from the stack, only manipulate the stack. - ++_n Remove the _nth entry counting from the left of the list - shown by ddiirrss, starting with zero, from the stack. For + ++_n Remove the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero, from the stack. For example: "popd +0" removes the first directory, "popd +1" the second. - --_n Remove the _nth entry counting from the right of the list - shown by ddiirrss, starting with zero. For example: "popd - -0" removes the last directory, "popd -1" the next to + --_n Remove the _nth entry counting from the right of the list + shown by ddiirrss, starting with zero. For example: "popd + -0" removes the last directory, "popd -1" the next to last. - If the top element of the directory stack is modified, and the - _-_n option was not supplied, ppooppdd uses the ccdd builtin to change + If the top element of the directory stack is modified, and the + _-_n option was not supplied, ppooppdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppooppdd returns a non-zero value. - Otherwise, ppooppdd returns false if an invalid option is supplied, - the directory stack is empty, or _n specifies a non-existent di- + Otherwise, ppooppdd returns false if an invalid option is supplied, + the directory stack is empty, or _n specifies a non-existent di- rectory stack entry. - If the ppooppdd command is successful, bbaasshh runs ddiirrss to show the - final contents of the directory stack, and the return status is + If the ppooppdd command is successful, bbaasshh runs ddiirrss to show the + final contents of the directory stack, and the return status is 0. pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] - Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the - control of the _f_o_r_m_a_t. The --vv option assigns the output to the + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The --vv option assigns the output to the variable _v_a_r rather than printing it to the standard output. - The _f_o_r_m_a_t is a character string which contains three types of - objects: plain characters, which are simply copied to standard - output, character escape sequences, which are converted and - copied to the standard output, and format specifications, each - of which causes printing of the next successive _a_r_g_u_m_e_n_t. In - addition to the standard _p_r_i_n_t_f(3) format characters ccCCssSS-- + The _f_o_r_m_a_t is a character string which contains three types of + objects: plain characters, which are simply copied to standard + output, character escape sequences, which are converted and + copied to the standard output, and format specifications, each + of which causes printing of the next successive _a_r_g_u_m_e_n_t. In + addition to the standard _p_r_i_n_t_f(3) format characters ccCCssSS-- nnddiioouuxxXXeeEEffFFggGGaaAA, pprriinnttff interprets the following additional for- mat specifiers: %%bb causes pprriinnttff to expand backslash escape sequences in the corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee. - %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a - format that can be reused as shell input. %%qq and %%QQ use - the $$'''' quoting style if any characters in the argument - string require it, and backslash quoting otherwise. If - the format string uses the _p_r_i_n_t_f alternate form, these + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. %%qq and %%QQ use + the $$'''' quoting style if any characters in the argument + string require it, and backslash quoting otherwise. If + the format string uses the _p_r_i_n_t_f alternate form, these two formats quote the argument string using single quotes. - %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- + %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- _m_e_n_t before quoting it. %%((_d_a_t_e_f_m_t))TT - causes pprriinnttff to output the date-time string resulting - from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). The corresponding _a_r_g_u_m_e_n_t is an integer representing the number of seconds since the epoch. This format specifier recognizes two special argument values: -1 represents the - current time, and -2 represents the time the shell was + current time, and -2 represents the time the shell was invoked. If no argument is specified, conversion behaves - as if -1 had been supplied. This is an exception to the + as if -1 had been supplied. This is an exception to the usual pprriinnttff behavior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that - many bytes from (or use that wide a field for) the expanded ar- - gument, which usually contains more characters than the origi- + many bytes from (or use that wide a field for) the expanded ar- + gument, which usually contains more characters than the origi- nal. The %n format specifier accepts a corresponding argument that is treated as a shell variable name. - The %s and %c format specifiers accept an l (long) modifier, + The %s and %c format specifiers accept an l (long) modifier, which forces them to convert the argument string to a wide-char- acter string and apply any supplied field width and precision in terms of characters, not bytes. The %S and %C format specifiers are equivalent to %ls and %lc, respectively. - Arguments to non-string format specifiers are treated as C con- + Arguments to non-string format specifiers are treated as C con- stants, except that a leading plus or minus sign is allowed, and - if the leading character is a single or double quote, the value - is the numeric value of the following character, using the cur- + if the leading character is a single or double quote, the value + is the numeric value of the following character, using the cur- rent locale. - The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, - the extra format specifications behave as if a zero value or - null string, as appropriate, had been supplied. The return - value is zero on success, non-zero if an invalid option is sup- + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return + value is zero on success, non-zero if an invalid option is sup- plied or a write or assignment error occurs. ppuusshhdd [--nn] [+_n] [-_n] ppuusshhdd [--nn] [_d_i_r] Add a directory to the top of the directory stack, or rotate the - stack, making the new top of the stack the current working di- - rectory. With no arguments, ppuusshhdd exchanges the top two ele- - ments of the directory stack. Arguments, if supplied, have the + stack, making the new top of the stack the current working di- + rectory. With no arguments, ppuusshhdd exchanges the top two ele- + ments of the directory stack. Arguments, if supplied, have the following meanings: - --nn Suppress the normal change of directory when rotating or - adding directories to the stack, only manipulate the + --nn Suppress the normal change of directory when rotating or + adding directories to the stack, only manipulate the stack. ++_n Rotate the stack so that the _nth directory (counting from - the left of the list shown by ddiirrss, starting with zero) + the left of the list shown by ddiirrss, starting with zero) is at the top. - --_n Rotates the stack so that the _nth directory (counting - from the right of the list shown by ddiirrss, starting with + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with zero) is at the top. _d_i_r Adds _d_i_r to the directory stack at the top. After the stack has been modified, if the --nn option was not sup- - plied, ppuusshhdd uses the ccdd builtin to change to the directory at + plied, ppuusshhdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero value. - Otherwise, if no arguments are supplied, ppuusshhdd returns zero un- - less the directory stack is empty. When rotating the directory + Otherwise, if no arguments are supplied, ppuusshhdd returns zero un- + less the directory stack is empty. When rotating the directory stack, ppuusshhdd returns zero unless the directory stack is empty or _n specifies a non-existent directory stack element. - If the ppuusshhdd command is successful, bbaasshh runs ddiirrss to show the + If the ppuusshhdd command is successful, bbaasshh runs ddiirrss to show the final contents of the directory stack. ppwwdd [--LLPP] - Print the absolute pathname of the current working directory. + Print the absolute pathname of the current working directory. The pathname printed contains no symbolic links if the --PP option is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command - is enabled. If the --LL option is used, the pathname printed may - contain symbolic links. The return status is 0 unless an error + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error occurs while reading the name of the current directory or an in- valid option is supplied. rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] Read one line from the standard input, or from the file descrip- - tor _f_d supplied as an argument to the --uu option, split it into - words as described above under WWoorrdd SSpplliittttiinngg, and assign the - first word to the first _n_a_m_e, the second word to the second - _n_a_m_e, and so on. If there are more words than names, the re- - maining words and their intervening delimiters are assigned to - the last _n_a_m_e. If there are fewer words read from the input - stream than names, the remaining names are assigned empty val- - ues. The characters in the value of the IIFFSS variable are used + tor _f_d supplied as an argument to the --uu option, split it into + words as described above under WWoorrdd SSpplliittttiinngg, and assign the + first word to the first _n_a_m_e, the second word to the second + _n_a_m_e, and so on. If there are more words than names, the re- + maining words and their intervening delimiters are assigned to + the last _n_a_m_e. If there are fewer words read from the input + stream than names, the remaining names are assigned empty val- + ues. The characters in the value of the IIFFSS variable are used to split the line into words using the same rules the shell uses for expansion (described above under WWoorrdd SSpplliittttiinngg). The back- - slash character (\\) removes any special meaning for the next + slash character (\\) removes any special meaning for the next character read and is used for line continuation. Options, if supplied, have the following meanings: --aa _a_n_a_m_e The words are assigned to sequential indices of the array variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any - new values are assigned. Other _n_a_m_e arguments are ig- + new values are assigned. Other _n_a_m_e arguments are ig- nored. --dd _d_e_l_i_m - The first character of _d_e_l_i_m terminates the input line, - rather than newline. If _d_e_l_i_m is the empty string, rreeaadd + The first character of _d_e_l_i_m terminates the input line, + rather than newline. If _d_e_l_i_m is the empty string, rreeaadd will terminate a line when it reads a NUL character. - --ee If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE above) to obtain the line. - RReeaaddlliinnee uses the current (or default, if line editing - was not previously active) editing settings, but uses + --ee If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE above) to obtain the line. + RReeaaddlliinnee uses the current (or default, if line editing + was not previously active) editing settings, but uses rreeaaddlliinnee's default filename completion. - --EE If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE above) to obtain the line. - RReeaaddlliinnee uses the current (or default, if line editing - was not previously active) editing settings, but uses + --EE If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE above) to obtain the line. + RReeaaddlliinnee uses the current (or default, if line editing + was not previously active) editing settings, but uses bash's default completion, including programmable comple- tion. --ii _t_e_x_t - If rreeaaddlliinnee is being used to read the line, rreeaadd places + If rreeaaddlliinnee is being used to read the line, rreeaadd places _t_e_x_t into the editing buffer before editing begins. --nn _n_c_h_a_r_s - rreeaadd returns after reading _n_c_h_a_r_s characters rather than - waiting for a complete line of input, unless it encoun- - ters EOF or rreeaadd times out, but honors a delimiter if it + rreeaadd returns after reading _n_c_h_a_r_s characters rather than + waiting for a complete line of input, unless it encoun- + ters EOF or rreeaadd times out, but honors a delimiter if it reads fewer than _n_c_h_a_r_s characters before the delimiter. --NN _n_c_h_a_r_s - rreeaadd returns after reading exactly _n_c_h_a_r_s characters - rather than waiting for a complete line of input, unless + rreeaadd returns after reading exactly _n_c_h_a_r_s characters + rather than waiting for a complete line of input, unless it encounters EOF or rreeaadd times out. Any delimiter char- - acters in the input are not treated specially and do not + acters in the input are not treated specially and do not cause rreeaadd to return until it has read _n_c_h_a_r_s characters. The result is not split on the characters in IIFFSS; the in- tent is that the variable is assigned exactly the charac- - ters read (with the exception of backslash; see the --rr + ters read (with the exception of backslash; see the --rr option below). --pp _p_r_o_m_p_t Display _p_r_o_m_p_t on standard error, without a trailing new- - line, before attempting to read any input, but only if + line, before attempting to read any input, but only if input is coming from a terminal. --rr Backslash does not act as an escape character. The back- - slash is considered to be part of the line. In particu- - lar, a backslash-newline pair may not then be used as a + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not then be used as a line continuation. --ss Silent mode. If input is coming from a terminal, charac- ters are not echoed. --tt _t_i_m_e_o_u_t - Cause rreeaadd to time out and return failure if it does not - read a complete line of input (or a specified number of - characters) within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a - decimal number with a fractional portion following the - decimal point. This option is only effective if rreeaadd is - reading input from a terminal, pipe, or other special - file; it has no effect when reading from regular files. - If rreeaadd times out, it saves any partial input read into - the specified variable _n_a_m_e, and the exit status is - greater than 128. If _t_i_m_e_o_u_t is 0, rreeaadd returns immedi- - ately, without trying to read any data. In this case, - the exit status is 0 if input is available on the speci- - fied file descriptor, or the read will return EOF, non- + Cause rreeaadd to time out and return failure if it does not + read a complete line of input (or a specified number of + characters) within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a + decimal number with a fractional portion following the + decimal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. + If rreeaadd times out, it saves any partial input read into + the specified variable _n_a_m_e, and the exit status is + greater than 128. If _t_i_m_e_o_u_t is 0, rreeaadd returns immedi- + ately, without trying to read any data. In this case, + the exit status is 0 if input is available on the speci- + fied file descriptor, or the read will return EOF, non- zero otherwise. - --uu _f_d Read input from file descriptor _f_d instead of the stan- + --uu _f_d Read input from file descriptor _f_d instead of the stan- dard input. - Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig- + Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig- nores any NUL characters in the input. - If no _n_a_m_e_s are supplied, rreeaadd assigns the line read, without - the ending delimiter but otherwise unmodified, to the variable + If no _n_a_m_e_s are supplied, rreeaadd assigns the line read, without + the ending delimiter but otherwise unmodified, to the variable RREEPPLLYY. The exit status is zero, unless end-of-file is encountered, rreeaadd - times out (in which case the status is greater than 128), a + times out (in which case the status is greater than 128), a variable assignment error (such as assigning to a readonly vari- - able) occurs, or an invalid file descriptor is supplied as the + able) occurs, or an invalid file descriptor is supplied as the argument to --uu. rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...] - The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s may not be changed by subsequent assignment or unset. If the --ff - option is supplied, each _n_a_m_e refers to a shell function. The - --aa option restricts the variables to indexed arrays; the --AA op- + option is supplied, each _n_a_m_e refers to a shell function. The + --aa option restricts the variables to indexed arrays; the --AA op- tion restricts the variables to associative arrays. If both op- - tions are supplied, --AA takes precedence. If no _n_a_m_e arguments - are supplied, or if the --pp option is supplied, print a list of - all readonly names. The other options may be used to restrict + tions are supplied, --AA takes precedence. If no _n_a_m_e arguments + are supplied, or if the --pp option is supplied, print a list of + all readonly names. The other options may be used to restrict the output to a subset of the set of readonly names. The --pp op- tion displays output in a format that may be reused as input. - rreeaaddoonnllyy allows the value of a variable to be set at the same + rreeaaddoonnllyy allows the value of a variable to be set at the same time the readonly attribute is changed by following the variable - name with =_v_a_l_u_e. This sets the value of the variable is to + name with =_v_a_l_u_e. This sets the value of the variable is to _v_a_l_u_e while modifying the readonly attribute. - The return status is 0 unless an invalid option is encountered, - one of the _n_a_m_e_s is not a valid shell variable name, or --ff is + The return status is 0 unless an invalid option is encountered, + one of the _n_a_m_e_s is not a valid shell variable name, or --ff is supplied with a _n_a_m_e that is not a function. rreettuurrnn [_n] - Stop executing a shell function or sourced file and return the + Stop executing a shell function or sourced file and return the value specified by _n to its caller. If _n is omitted, the return - status is that of the last command executed. If rreettuurrnn is exe- - cuted by a trap handler, the last command used to determine the + status is that of the last command executed. If rreettuurrnn is exe- + cuted by a trap handler, the last command used to determine the status is the last command executed before the trap handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last command used to - determine the status is the last command executed by the trap + determine the status is the last command executed by the trap handler before rreettuurrnn was invoked. When rreettuurrnn is used to terminate execution of a script being ex- - ecuted by the .. (ssoouurrccee) command, it causes the shell to stop - executing that script and return either _n or the exit status of - the last command executed within the script as the exit status - of the script. If _n is supplied, the return value is its least + ecuted by the .. (ssoouurrccee) command, it causes the shell to stop + executing that script and return either _n or the exit status of + the last command executed within the script as the exit status + of the script. If _n is supplied, the return value is its least significant 8 bits. - Any command associated with the RREETTUURRNN trap is executed before + Any command associated with the RREETTUURRNN trap is executed before execution resumes after the function or script. - The return status is non-zero if rreettuurrnn is supplied a non-nu- + The return status is non-zero if rreettuurrnn is supplied a non-nu- meric argument, or is used outside a function and not during ex- ecution of a script by .. or ssoouurrccee. sseett [--aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [--oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...] sseett [++aabbeeffhhkkmmnnppttuuvvxxBBCCEEHHPPTT] [++oo _o_p_t_i_o_n_-_n_a_m_e] [----] [--] [_a_r_g ...] sseett --oo - sseett ++oo Without options, display the name and value of each shell vari- - able in a format that can be reused as input for setting or re- + sseett ++oo Without options, display the name and value of each shell vari- + able in a format that can be reused as input for setting or re- setting the currently-set variables. Read-only variables cannot - be reset. In posix mode, only shell variables are listed. The - output is sorted according to the current locale. When options - are specified, they set or unset shell attributes. Any argu- - ments remaining after option processing are treated as values + be reset. In posix mode, only shell variables are listed. The + output is sorted according to the current locale. When options + are specified, they set or unset shell attributes. Any argu- + ments remaining after option processing are treated as values for the positional parameters and are assigned, in order, to $$11, - $$22, ..., $$_n. Options, if specified, have the following mean- + $$22, ..., $$_n. Options, if specified, have the following mean- ings: --aa Each variable or function that is created or modified is - given the export attribute and marked for export to the + given the export attribute and marked for export to the environment of subsequent commands. - --bb Report the status of terminated background jobs immedi- + --bb Report the status of terminated background jobs immedi- ately, rather than before the next primary prompt or af- - ter a foreground command terminates. This is effective + ter a foreground command terminates. This is effective only when job control is enabled. - --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a - single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d + --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a + single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d (see SSHHEELLLL GGRRAAMMMMAARR above), exits with a non-zero status. - The shell does not exit if the command that fails is - part of the command list immediately following a wwhhiillee - or uunnttiill reserved word, part of the test following the - iiff or eelliiff reserved words, part of any command executed - in a &&&& or |||| list except the command following the fi- - nal &&&& or ||||, any command in a pipeline but the last - (subject to the state of the ppiippeeffaaiill shell option), or - if the command's return value is being inverted with !!. - If a compound command other than a subshell returns a - non-zero status because a command failed while --ee was - being ignored, the shell does not exit. A trap on EERRRR, + The shell does not exit if the command that fails is + part of the command list immediately following a wwhhiillee + or uunnttiill reserved word, part of the test following the + iiff or eelliiff reserved words, part of any command executed + in a &&&& or |||| list except the command following the fi- + nal &&&& or ||||, any command in a pipeline but the last + (subject to the state of the ppiippeeffaaiill shell option), or + if the command's return value is being inverted with !!. + If a compound command other than a subshell returns a + non-zero status because a command failed while --ee was + being ignored, the shell does not exit. A trap on EERRRR, if set, is executed before the shell exits. This option applies to the shell environment and each subshell envi- - ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT above), and may cause subshells to exit before executing all the commands in the subshell. - If a compound command or shell function executes in a - context where --ee is being ignored, none of the commands - executed within the compound command or function body - will be affected by the --ee setting, even if --ee is set - and a command returns a failure status. If a compound - command or shell function sets --ee while executing in a - context where --ee is ignored, that setting will not have - any effect until the compound command or the command + If a compound command or shell function executes in a + context where --ee is being ignored, none of the commands + executed within the compound command or function body + will be affected by the --ee setting, even if --ee is set + and a command returns a failure status. If a compound + command or shell function sets --ee while executing in a + context where --ee is ignored, that setting will not have + any effect until the compound command or the command containing the function call completes. --ff Disable pathname expansion. - --hh Remember the location of commands as they are looked up + --hh Remember the location of commands as they are looked up for execution. This is enabled by default. - --kk All arguments in the form of assignment statements are - placed in the environment for a command, not just those + --kk All arguments in the form of assignment statements are + placed in the environment for a command, not just those that precede the command name. - --mm Monitor mode. Job control is enabled. This option is - on by default for interactive shells on systems that - support it (see JJOOBB CCOONNTTRROOLL above). All processes run + --mm Monitor mode. Job control is enabled. This option is + on by default for interactive shells on systems that + support it (see JJOOBB CCOONNTTRROOLL above). All processes run in a separate process group. When a background job com- pletes, the shell prints a line containing its exit sta- tus. --nn Read commands but do not execute them. This may be used - to check a shell script for syntax errors. This is ig- + to check a shell script for syntax errors. This is ig- nored by interactive shells. --oo _o_p_t_i_o_n_-_n_a_m_e The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: @@ -6431,10 +6437,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Same as --aa. bbrraacceeeexxppaanndd Same as --BB. - eemmaaccss Use an emacs-style command line editing inter- + eemmaaccss Use an emacs-style command line editing inter- face. This is enabled by default when the shell is interactive, unless the shell is started with - the ----nnooeeddiittiinngg option. This also affects the + the ----nnooeeddiittiinngg option. This also affects the editing interface used for rreeaadd --ee. eerrrreexxiitt Same as --ee. eerrrrttrraaccee @@ -6448,7 +6454,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS HHIISSTTOORRYY. This option is on by default in inter- active shells. iiggnnoorreeeeooff - The effect is as if the shell command + The effect is as if the shell command "IGNOREEOF=10" had been executed (see SShheellll VVaarriiaabblleess above). kkeeyywwoorrdd Same as --kk. @@ -6464,184 +6470,184 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS pphhyyssiiccaall Same as --PP. ppiippeeffaaiill - If set, the return value of a pipeline is the - value of the last (rightmost) command to exit - with a non-zero status, or zero if all commands - in the pipeline exit successfully. This option + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option is disabled by default. - ppoossiixx Enable posix mode; change the behavior of bbaasshh - where the default operation differs from the - POSIX standard to match the standard. See SSEEEE - AALLSSOO below for a reference to a document that + ppoossiixx Enable posix mode; change the behavior of bbaasshh + where the default operation differs from the + POSIX standard to match the standard. See SSEEEE + AALLSSOO below for a reference to a document that details how posix mode affects bash's behavior. pprriivviilleeggeedd Same as --pp. vveerrbboossee Same as --vv. - vvii Use a vi-style command line editing interface. + vvii Use a vi-style command line editing interface. This also affects the editing interface used for rreeaadd --ee. xxttrraaccee Same as --xx. - If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the - current shell option settings. If ++oo is supplied with - no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to - recreate the current option settings on the standard + If --oo is supplied with no _o_p_t_i_o_n_-_n_a_m_e, sseett prints the + current shell option settings. If ++oo is supplied with + no _o_p_t_i_o_n_-_n_a_m_e, sseett prints a series of sseett commands to + recreate the current option settings on the standard output. - --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the shell does - not read the $$EENNVV and $$BBAASSHH__EENNVV files, shell functions - are not inherited from the environment, and the SSHHEELL-- - LLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if - they appear in the environment, are ignored. If the - shell is started with the effective user (group) id not - equal to the real user (group) id, and the --pp option is - not supplied, these actions are taken and the effective + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the shell does + not read the $$EENNVV and $$BBAASSHH__EENNVV files, shell functions + are not inherited from the environment, and the SSHHEELL-- + LLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if + they appear in the environment, are ignored. If the + shell is started with the effective user (group) id not + equal to the real user (group) id, and the --pp option is + not supplied, these actions are taken and the effective user id is set to the real user id. If the --pp option is supplied at startup, the effective user id is not reset. - Turning this option off causes the effective user and + Turning this option off causes the effective user and group ids to be set to the real user and group ids. --rr Enable restricted shell mode. This option cannot be un- set once it has been set. --tt Exit after reading and executing one command. --uu Treat unset variables and parameters other than the spe- - cial parameters "@" and "*", or array variables sub- - scripted with "@" or "*", as an error when performing - parameter expansion. If expansion is attempted on an - unset variable or parameter, the shell prints an error - message, and, if not interactive, exits with a non-zero + cial parameters "@" and "*", or array variables sub- + scripted with "@" or "*", as an error when performing + parameter expansion. If expansion is attempted on an + unset variable or parameter, the shell prints an error + message, and, if not interactive, exits with a non-zero status. --vv Print shell input lines as they are read. - --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee + --xx After expanding each _s_i_m_p_l_e _c_o_m_m_a_n_d, ffoorr command, ccaassee command, sseelleecctt command, or arithmetic ffoorr command, dis- - play the expanded value of PPSS44, followed by the command - and its expanded arguments or associated word list, to + play the expanded value of PPSS44, followed by the command + and its expanded arguments or associated word list, to the standard error. - --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn + --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn above). This is on by default. - --CC If set, bbaasshh does not overwrite an existing file with - the >>, >>&&, and <<>> redirection operators. Using the - redirection operator >>|| instead of >> will override this + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. Using the + redirection operator >>|| instead of >> will override this and force the creation of an output file. --EE If set, any trap on EERRRR is inherited by shell functions, - command substitutions, and commands executed in a sub- - shell environment. The EERRRR trap is normally not inher- + command substitutions, and commands executed in a sub- + shell environment. The EERRRR trap is normally not inher- ited in such cases. --HH Enable !! style history substitution. This option is on by default when the shell is interactive. - --PP If set, the shell does not resolve symbolic links when - executing commands such as ccdd that change the current + --PP If set, the shell does not resolve symbolic links when + executing commands such as ccdd that change the current working directory. It uses the physical directory structure instead. By default, bbaasshh follows the logical - chain of directories when performing commands which + chain of directories when performing commands which change the current directory. - --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by + --TT If set, any traps on DDEEBBUUGG and RREETTUURRNN are inherited by shell functions, command substitutions, and commands ex- - ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN + ecuted in a subshell environment. The DDEEBBUUGG and RREETTUURRNN traps are normally not inherited in such cases. ---- If no arguments follow this option, unset the positional parameters. Otherwise, set the positional parameters to the _a_r_gs, even if some of them begin with a --. -- Signal the end of options, and assign all remaining _a_r_gs to the positional parameters. The --xx and --vv options are - turned off. If there are no _a_r_gs, the positional para- + turned off. If there are no _a_r_gs, the positional para- meters remain unchanged. - The options are off by default unless otherwise noted. Using + - rather than - causes these options to be turned off. The op- + The options are off by default unless otherwise noted. Using + + rather than - causes these options to be turned off. The op- tions can also be specified as arguments to an invocation of the - shell. The current set of options may be found in $$--. The re- - turn status is always zero unless an invalid option is encoun- + shell. The current set of options may be found in $$--. The re- + turn status is always zero unless an invalid option is encoun- tered. sshhiifftt [_n] Rename positional parameters from _n+1 ... to $$11 ........ Parameters - represented by the numbers $$## down to $$##-_n+1 are unset. _n must - be a non-negative number less than or equal to $$##. If _n is 0, - no parameters are changed. If _n is not given, it is assumed to - be 1. If _n is greater than $$##, the positional parameters are - not changed. The return status is greater than zero if _n is + represented by the numbers $$## down to $$##-_n+1 are unset. _n must + be a non-negative number less than or equal to $$##. If _n is 0, + no parameters are changed. If _n is not given, it is assumed to + be 1. If _n is greater than $$##, the positional parameters are + not changed. The return status is greater than zero if _n is greater than $$## or less than zero; otherwise 0. sshhoopptt [--ppqqssuu] [--oo] [_o_p_t_n_a_m_e ...] - Toggle the values of settings controlling optional shell behav- - ior. The settings can be either those listed below, or, if the + Toggle the values of settings controlling optional shell behav- + ior. The settings can be either those listed below, or, if the --oo option is used, those available with the --oo option to the sseett builtin command. - With no options, or with the --pp option, display a list of all - settable options, with an indication of whether or not each is - set; if any _o_p_t_n_a_m_e_s are supplied, the output is restricted to + With no options, or with the --pp option, display a list of all + settable options, with an indication of whether or not each is + set; if any _o_p_t_n_a_m_e_s are supplied, the output is restricted to those options. The --pp option displays output in a form that may be reused as input. Other options have the following meanings: --ss Enable (set) each _o_p_t_n_a_m_e. --uu Disable (unset) each _o_p_t_n_a_m_e. - --qq Suppresses normal output (quiet mode); the return status + --qq Suppresses normal output (quiet mode); the return status indicates whether the _o_p_t_n_a_m_e is set or unset. If multi- - ple _o_p_t_n_a_m_e arguments are supplied with --qq, the return + ple _o_p_t_n_a_m_e arguments are supplied with --qq, the return status is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero oth- erwise. - --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for + --oo Restricts the values of _o_p_t_n_a_m_e to be those defined for the --oo option to the sseett builtin. - If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt - shows only those options which are set or unset, respectively. - Unless otherwise noted, the sshhoopptt options are disabled (unset) + If either --ss or --uu is used with no _o_p_t_n_a_m_e arguments, sshhoopptt + shows only those options which are set or unset, respectively. + Unless otherwise noted, the sshhoopptt options are disabled (unset) by default. - The return status when listing options is zero if all _o_p_t_n_a_m_e_s - are enabled, non-zero otherwise. When setting or unsetting op- - tions, the return status is zero unless an _o_p_t_n_a_m_e is not a + The return status when listing options is zero if all _o_p_t_n_a_m_e_s + are enabled, non-zero otherwise. When setting or unsetting op- + tions, the return status is zero unless an _o_p_t_n_a_m_e is not a valid shell option. The list of sshhoopptt options is: aarrrraayy__eexxppaanndd__oonnccee - If set, the shell suppresses multiple evaluation of as- + If set, the shell suppresses multiple evaluation of as- sociative and indexed array subscripts during arithmetic expression evaluation, while executing builtins that can - perform variable assignments, and while executing + perform variable assignments, and while executing builtins that perform array dereferencing. aassssoocc__eexxppaanndd__oonnccee Deprecated; a synonym for aarrrraayy__eexxppaanndd__oonnccee. - aauuttooccdd If set, a command name that is the name of a directory - is executed as if it were the argument to the ccdd com- + aauuttooccdd If set, a command name that is the name of a directory + is executed as if it were the argument to the ccdd com- mand. This option is only used by interactive shells. bbaasshh__ssoouurrccee__ffuullllppaatthh - If set, filenames added to the BBAASSHH__SSOOUURRCCEE array vari- - able are converted to full pathnames (see SShheellll VVaarrii-- + If set, filenames added to the BBAASSHH__SSOOUURRCCEE array vari- + able are converted to full pathnames (see SShheellll VVaarrii-- aabblleess above). ccddaabbllee__vvaarrss - If set, an argument to the ccdd builtin command that is - not a directory is assumed to be the name of a variable + If set, an argument to the ccdd builtin command that is + not a directory is assumed to be the name of a variable whose value is the directory to change to. - ccddssppeellll If set, the ccdd command attempts to correct minor errors - in the spelling of a directory component. Minor errors - include transposed characters, a missing character, and + ccddssppeellll If set, the ccdd command attempts to correct minor errors + in the spelling of a directory component. Minor errors + include transposed characters, a missing character, and one extra character. If ccdd corrects the directory name, - it prints the corrected filename, and the command pro- + it prints the corrected filename, and the command pro- ceeds. This option is only used by interactive shells. cchheecckkhhaasshh If set, bbaasshh checks that a command found in the hash ta- - ble exists before trying to execute it. If a hashed - command no longer exists, bbaasshh performs a normal path + ble exists before trying to execute it. If a hashed + command no longer exists, bbaasshh performs a normal path search. cchheecckkjjoobbss If set, bbaasshh lists the status of any stopped and running - jobs before exiting an interactive shell. If any jobs + jobs before exiting an interactive shell. If any jobs are running, bbaasshh defers the exit until a second exit is - attempted without an intervening command (see JJOOBB CCOONN-- - TTRROOLL above). The shell always postpones exiting if any + attempted without an intervening command (see JJOOBB CCOONN-- + TTRROOLL above). The shell always postpones exiting if any jobs are stopped. cchheecckkwwiinnssiizzee - If set, bbaasshh checks the window size after each external - (non-builtin) command and, if necessary, updates the - values of LLIINNEESS and CCOOLLUUMMNNSS, using the file descriptor - associated with the standard error if it is a terminal. + If set, bbaasshh checks the window size after each external + (non-builtin) command and, if necessary, updates the + values of LLIINNEESS and CCOOLLUUMMNNSS, using the file descriptor + associated with the standard error if it is a terminal. This option is enabled by default. - ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- - line command in the same history entry. This allows - easy re-editing of multi-line commands. This option is - enabled by default, but only has an effect if command + ccmmddhhiisstt If set, bbaasshh attempts to save all lines of a multiple- + line command in the same history entry. This allows + easy re-editing of multi-line commands. This option is + enabled by default, but only has an effect if command history is enabled, as described above under HHIISSTTOORRYY. ccoommppaatt3311 ccoommppaatt3322 @@ -6650,143 +6656,143 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ccoommppaatt4422 ccoommppaatt4433 ccoommppaatt4444 - These control aspects of the shell's compatibility mode + These control aspects of the shell's compatibility mode (see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE below). ccoommpplleettee__ffuullllqquuoottee - If set, bbaasshh quotes all shell metacharacters in file- - names and directory names when performing completion. + If set, bbaasshh quotes all shell metacharacters in file- + names and directory names when performing completion. If not set, bbaasshh removes metacharacters such as the dol- - lar sign from the set of characters that will be quoted - in completed filenames when these metacharacters appear - in shell variable references in words to be completed. - This means that dollar signs in variable names that ex- - pand to directories will not be quoted; however, any - dollar signs appearing in filenames will not be quoted, - either. This is active only when bash is using back- - slashes to quote completed filenames. This variable is - set by default, which is the default bash behavior in + lar sign from the set of characters that will be quoted + in completed filenames when these metacharacters appear + in shell variable references in words to be completed. + This means that dollar signs in variable names that ex- + pand to directories will not be quoted; however, any + dollar signs appearing in filenames will not be quoted, + either. This is active only when bash is using back- + slashes to quote completed filenames. This variable is + set by default, which is the default bash behavior in versions through 4.2. ddiirreexxppaanndd - If set, bbaasshh replaces directory names with the results - of word expansion when performing filename completion. + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. This changes the contents of the rreeaaddlliinnee editing - buffer. If not set, bbaasshh attempts to preserve what the + buffer. If not set, bbaasshh attempts to preserve what the user typed. ddiirrssppeellll - If set, bbaasshh attempts spelling correction on directory - names during word completion if the directory name ini- + If set, bbaasshh attempts spelling correction on directory + names during word completion if the directory name ini- tially supplied does not exist. - ddoottgglloobb If set, bbaasshh includes filenames beginning with a "." in - the results of pathname expansion. The filenames _. and + ddoottgglloobb If set, bbaasshh includes filenames beginning with a "." in + the results of pathname expansion. The filenames _. and _._. must always be matched explicitly, even if ddoottgglloobb is set. eexxeeccffaaiill If set, a non-interactive shell will not exit if it can- - not execute the file specified as an argument to the - eexxeecc builtin. An interactive shell does not exit if + not execute the file specified as an argument to the + eexxeecc builtin. An interactive shell does not exit if eexxeecc fails. eexxppaanndd__aalliiaasseess - If set, aliases are expanded as described above under + If set, aliases are expanded as described above under AALLIIAASSEESS. This option is enabled by default for interac- tive shells. eexxttddeebbuugg - If set at shell invocation, or in a shell startup file, + If set at shell invocation, or in a shell startup file, arrange to execute the debugger profile before the shell - starts, identical to the ----ddeebbuuggggeerr option. If set af- - ter invocation, behavior intended for use by debuggers + starts, identical to the ----ddeebbuuggggeerr option. If set af- + ter invocation, behavior intended for use by debuggers is enabled: 11.. The --FF option to the ddeeccllaarree builtin displays the source file name and line number corresponding to each function name supplied as an argument. - 22.. If the command run by the DDEEBBUUGG trap returns a - non-zero value, the next command is skipped and + 22.. If the command run by the DDEEBBUUGG trap returns a + non-zero value, the next command is skipped and not executed. - 33.. If the command run by the DDEEBBUUGG trap returns a - value of 2, and the shell is executing in a sub- - routine (a shell function or a shell script exe- - cuted by the .. or ssoouurrccee builtins), the shell + 33.. If the command run by the DDEEBBUUGG trap returns a + value of 2, and the shell is executing in a sub- + routine (a shell function or a shell script exe- + cuted by the .. or ssoouurrccee builtins), the shell simulates a call to rreettuurrnn. - 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described in their descriptions above). - 55.. Function tracing is enabled: command substitu- + 55.. Function tracing is enabled: command substitu- tion, shell functions, and subshells invoked with (( _c_o_m_m_a_n_d )) inherit the DDEEBBUUGG and RREETTUURRNN traps. - 66.. Error tracing is enabled: command substitution, - shell functions, and subshells invoked with (( + 66.. Error tracing is enabled: command substitution, + shell functions, and subshells invoked with (( _c_o_m_m_a_n_d )) inherit the EERRRR trap. - eexxttgglloobb If set, enable the extended pattern matching features + eexxttgglloobb If set, enable the extended pattern matching features described above under PPaatthhnnaammee EExxppaannssiioonn. eexxttqquuoottee - If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed - within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double + If set, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quoting is performed + within $${{_p_a_r_a_m_e_t_e_r}} expansions enclosed in double quotes. This option is enabled by default. ffaaiillgglloobb - If set, patterns which fail to match filenames during + If set, patterns which fail to match filenames during pathname expansion result in an expansion error. ffoorrccee__ffiiggnnoorree - If set, the suffixes specified by the FFIIGGNNOORREE shell - variable cause words to be ignored when performing word + If set, the suffixes specified by the FFIIGGNNOORREE shell + variable cause words to be ignored when performing word completion even if the ignored words are the only possi- - ble completions. See SShheellll VVaarriiaabblleess above for a de- - scription of FFIIGGNNOORREE. This option is enabled by de- + ble completions. See SShheellll VVaarriiaabblleess above for a de- + scription of FFIIGGNNOORREE. This option is enabled by de- fault. gglloobbaasscciiiirraannggeess - If set, range expressions used in pattern matching - bracket expressions (see PPaatttteerrnn MMaattcchhiinngg above) behave - as if in the traditional C locale when performing com- - parisons. That is, pattern matching does not take the - current locale's collating sequence into account, so bb - will not collate between AA and BB, and upper-case and + If set, range expressions used in pattern matching + bracket expressions (see PPaatttteerrnn MMaattcchhiinngg above) behave + as if in the traditional C locale when performing com- + parisons. That is, pattern matching does not take the + current locale's collating sequence into account, so bb + will not collate between AA and BB, and upper-case and lower-case ASCII characters will collate together. gglloobbsskkiippddoottss - If set, pathname expansion will never match the file- - names _. and _._., even if the pattern begins with a ".". + If set, pathname expansion will never match the file- + names _. and _._., even if the pattern begins with a ".". This option is enabled by default. gglloobbssttaarr If set, the pattern **** used in a pathname expansion con- - text will match all files and zero or more directories - and subdirectories. If the pattern is followed by a //, + text will match all files and zero or more directories + and subdirectories. If the pattern is followed by a //, only directories and subdirectories match. ggnnuu__eerrrrffmmtt If set, shell error messages are written in the standard GNU error message format. hhiissttaappppeenndd - If set, the history list is appended to the file named + If set, the history list is appended to the file named by the value of the HHIISSTTFFIILLEE variable when the shell ex- its, rather than overwriting the file. hhiissttrreeeeddiitt - If set, and rreeaaddlliinnee is being used, the user is given - the opportunity to re-edit a failed history substitu- + If set, and rreeaaddlliinnee is being used, the user is given + the opportunity to re-edit a failed history substitu- tion. hhiissttvveerriiffyy - If set, and rreeaaddlliinnee is being used, the results of his- - tory substitution are not immediately passed to the - shell parser. Instead, the resulting line is loaded + If set, and rreeaaddlliinnee is being used, the results of his- + tory substitution are not immediately passed to the + shell parser. Instead, the resulting line is loaded into the rreeaaddlliinnee editing buffer, allowing further modi- fication. hhoossttccoommpplleettee If set, and rreeaaddlliinnee is being used, bbaasshh will attempt to - perform hostname completion when a word containing a @@ - is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE + perform hostname completion when a word containing a @@ + is being completed (see CCoommpplleettiinngg under RREEAADDLLIINNEE above). This is enabled by default. hhuuppoonneexxiitt If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter- active login shell exits. iinnhheerriitt__eerrrreexxiitt - If set, command substitution inherits the value of the - eerrrreexxiitt option, instead of unsetting it in the subshell - environment. This option is enabled when posix mode is + If set, command substitution inherits the value of the + eerrrreexxiitt option, instead of unsetting it in the subshell + environment. This option is enabled when posix mode is enabled. iinntteerraaccttiivvee__ccoommmmeennttss - In an interactive shell, a word beginning with ## causes - that word and all remaining characters on that line to - be ignored, as in a non-interactive shell (see CCOOMMMMEENNTTSS + In an interactive shell, a word beginning with ## causes + that word and all remaining characters on that line to + be ignored, as in a non-interactive shell (see CCOOMMMMEENNTTSS above). This option is enabled by default. llaassttppiippee - If set, and job control is not active, the shell runs + If set, and job control is not active, the shell runs the last command of a pipeline not executed in the back- ground in the current shell environment. - lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible. llooccaallvvaarr__iinnhheerriitt @@ -6795,37 +6801,37 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS scope before any new value is assigned. The nameref at- tribute is not inherited. llooccaallvvaarr__uunnsseett - If set, calling uunnsseett on local variables in previous - function scopes marks them so subsequent lookups find + If set, calling uunnsseett on local variables in previous + function scopes marks them so subsequent lookups find them unset until that function returns. This is identi- - cal to the behavior of unsetting local variables at the + cal to the behavior of unsetting local variables at the current function scope. llooggiinn__sshheellll - The shell sets this option if it is started as a login - shell (see IINNVVOOCCAATTIIOONN above). The value may not be + The shell sets this option if it is started as a login + shell (see IINNVVOOCCAATTIIOONN above). The value may not be changed. mmaaiillwwaarrnn - If set, and a file that bbaasshh is checking for mail has - been accessed since the last time it was checked, bbaasshh - displays the message "The mail in _m_a_i_l_f_i_l_e has been + If set, and a file that bbaasshh is checking for mail has + been accessed since the last time it was checked, bbaasshh + displays the message "The mail in _m_a_i_l_f_i_l_e has been read". nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn If set, and rreeaaddlliinnee is being used, bbaasshh does not search - PPAATTHH for possible completions when completion is at- + PPAATTHH for possible completions when completion is at- tempted on an empty line. nnooccaasseegglloobb - If set, bbaasshh matches filenames in a case-insensitive + If set, bbaasshh matches filenames in a case-insensitive fashion when performing pathname expansion (see PPaatthhnnaammee EExxppaannssiioonn above). nnooccaasseemmaattcchh - If set, bbaasshh matches patterns in a case-insensitive + If set, bbaasshh matches patterns in a case-insensitive fashion when performing matching while executing ccaassee or [[[[ conditional commands, when performing pattern substi- - tution word expansions, or when filtering possible com- + tution word expansions, or when filtering possible com- pletions as part of programmable completion. nnooeexxppaanndd__ttrraannssllaattiioonn - If set, bbaasshh encloses the translated results of $$""..."" - quoting in single quotes instead of double quotes. If + If set, bbaasshh encloses the translated results of $$""..."" + quoting in single quotes instead of double quotes. If the string is not translated, this has no effect. nnuullllgglloobb If set, pathname expansion patterns which match no files @@ -6833,73 +6839,73 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS removed, rather than expanding to themselves. ppaattssuubb__rreeppllaacceemmeenntt If set, bbaasshh expands occurrences of && in the replacement - string of pattern substitution to the text matched by - the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn + string of pattern substitution to the text matched by + the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn above. This option is enabled by default. pprrooggccoommpp - If set, enable the programmable completion facilities + If set, enable the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn above). This option is en- abled by default. pprrooggccoommpp__aalliiaass - If set, and programmable completion is enabled, bbaasshh - treats a command name that doesn't have any completions + If set, and programmable completion is enabled, bbaasshh + treats a command name that doesn't have any completions as a possible alias and attempts alias expansion. If it - has an alias, bbaasshh attempts programmable completion us- + has an alias, bbaasshh attempts programmable completion us- ing the command word resulting from the expanded alias. pprroommppttvvaarrss If set, prompt strings undergo parameter expansion, com- - mand substitution, arithmetic expansion, and quote re- - moval after being expanded as described in PPRROOMMPPTTIINNGG + mand substitution, arithmetic expansion, and quote re- + moval after being expanded as described in PPRROOMMPPTTIINNGG above. This option is enabled by default. rreessttrriicctteedd__sshheellll - The shell sets this option if it is started in re- - stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value - may not be changed. This is not reset when the startup - files are executed, allowing the startup files to dis- + The shell sets this option if it is started in re- + stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). The value + may not be changed. This is not reset when the startup + files are executed, allowing the startup files to dis- cover whether or not a shell is restricted. sshhiifftt__vveerrbboossee - If set, the sshhiifftt builtin prints an error message when + If set, the sshhiifftt builtin prints an error message when the shift count exceeds the number of positional parame- ters. ssoouurrcceeppaatthh If set, the .. (ssoouurrccee) builtin uses the value of PPAATTHH to - find the directory containing the file supplied as an - argument when the --pp option is not supplied. This op- + find the directory containing the file supplied as an + argument when the --pp option is not supplied. This op- tion is enabled by default. vvaarrrreeddiirr__cclloossee - If set, the shell automatically closes file descriptors - assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see + If set, the shell automatically closes file descriptors + assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see RREEDDIIRREECCTTIIOONN above) instead of leaving them open when the command completes. xxppgg__eecchhoo - If set, the eecchhoo builtin expands backslash-escape se- - quences by default. If the ppoossiixx shell option is also + If set, the eecchhoo builtin expands backslash-escape se- + quences by default. If the ppoossiixx shell option is also enabled, eecchhoo does not interpret any options. ssuussppeenndd [--ff] - Suspend the execution of this shell until it receives a SSIIGGCCOONNTT - signal. A login shell, or a shell without job control enabled, - cannot be suspended; the --ff option will override this and force - the suspension. The return status is 0 unless the shell is a - login shell or job control is not enabled and --ff is not sup- + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. A login shell, or a shell without job control enabled, + cannot be suspended; the --ff option will override this and force + the suspension. The return status is 0 unless the shell is a + login shell or job control is not enabled and --ff is not sup- plied. tteesstt _e_x_p_r [[ _e_x_p_r ]] Return a status of 0 (true) or 1 (false) depending on the evalu- - ation of the conditional expression _e_x_p_r. Each operator and - operand must be a separate argument. Expressions are composed - of the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. - tteesstt does not accept any options, nor does it accept and ignore + ation of the conditional expression _e_x_p_r. Each operator and + operand must be a separate argument. Expressions are composed + of the primaries described above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + tteesstt does not accept any options, nor does it accept and ignore an argument of ---- as signifying the end of options. - Expressions may be combined using the following operators, - listed in decreasing order of precedence. The evaluation de- + Expressions may be combined using the following operators, + listed in decreasing order of precedence. The evaluation de- pends on the number of arguments; see below. tteesstt uses operator precedence when there are five or more arguments. !! _e_x_p_r True if _e_x_p_r is false. (( _e_x_p_r )) - Returns the value of _e_x_p_r. This may be used to override + Returns the value of _e_x_p_r. This may be used to override normal operator precedence. _e_x_p_r_1 -aa _e_x_p_r_2 True if both _e_x_p_r_1 and _e_x_p_r_2 are true. @@ -6916,111 +6922,111 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS null. 2 arguments If the first argument is !!, the expression is true if and - only if the second argument is null. If the first argu- - ment is one of the unary conditional operators listed - above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is true if the unary test is true. If the first argument is not a valid unary conditional operator, the expression is false. 3 arguments The following conditions are applied in the order listed. - If the second argument is one of the binary conditional + If the second argument is one of the binary conditional operators listed above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the result of the expression is the result of the binary test - using the first and third arguments as operands. The --aa - and --oo operators are considered binary operators when - there are three arguments. If the first argument is !!, - the value is the negation of the two-argument test using + using the first and third arguments as operands. The --aa + and --oo operators are considered binary operators when + there are three arguments. If the first argument is !!, + the value is the negation of the two-argument test using the second and third arguments. If the first argument is exactly (( and the third argument is exactly )), the result - is the one-argument test of the second argument. Other- + is the one-argument test of the second argument. Other- wise, the expression is false. 4 arguments The following conditions are applied in the order listed. If the first argument is !!, the result is the negation of - the three-argument expression composed of the remaining - arguments. If the first argument is exactly (( and the + the three-argument expression composed of the remaining + arguments. If the first argument is exactly (( and the fourth argument is exactly )), the result is the two-argu- - ment test of the second and third arguments. Otherwise, - the expression is parsed and evaluated according to + ment test of the second and third arguments. Otherwise, + the expression is parsed and evaluated according to precedence using the rules listed above. 5 or more arguments - The expression is parsed and evaluated according to + The expression is parsed and evaluated according to precedence using the rules listed above. When the shell is in posix mode, or if the expression is part of the [[[[ command, the << and >> operators sort using the current lo- - cale. If the shell is not in posix mode, the tteesstt and [[ com- + cale. If the shell is not in posix mode, the tteesstt and [[ com- mands sort lexicographically using ASCII ordering. - The historical operator-precedence parsing with 4 or more argu- - ments can lead to ambiguities when it encounters strings that - look like primaries. The POSIX standard has deprecated the --aa - and --oo primaries and enclosing expressions within parentheses. - Scripts should no longer use them. It's much more reliable to - restrict test invocations to a single primary, and to replace + The historical operator-precedence parsing with 4 or more argu- + ments can lead to ambiguities when it encounters strings that + look like primaries. The POSIX standard has deprecated the --aa + and --oo primaries and enclosing expressions within parentheses. + Scripts should no longer use them. It's much more reliable to + restrict test invocations to a single primary, and to replace uses of --aa and --oo with the shell's &&&& and |||| list operators. - ttiimmeess Print the accumulated user and system times for the shell and + ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. ttrraapp [--llppPP] [[_a_c_t_i_o_n] _s_i_g_s_p_e_c ...] The _a_c_t_i_o_n is a command that is read and executed when the shell - receives any of the signals _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and + receives any of the signals _s_i_g_s_p_e_c. If _a_c_t_i_o_n is absent (and there is a single _s_i_g_s_p_e_c) or --, each specified _s_i_g_s_p_e_c is reset - to the value it had when the shell was started. If _a_c_t_i_o_n is - the null string the signal specified by each _s_i_g_s_p_e_c is ignored + to the value it had when the shell was started. If _a_c_t_i_o_n is + the null string the signal specified by each _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. - If no arguments are supplied, ttrraapp displays the actions associ- + If no arguments are supplied, ttrraapp displays the actions associ- ated with each trapped signal as a set of ttrraapp commands that can - be reused as shell input to restore the current signal disposi- - tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp - displays the actions associated with each _s_i_g_s_p_e_c or, if none + be reused as shell input to restore the current signal disposi- + tions. If --pp is given, and _a_c_t_i_o_n is not present, then ttrraapp + displays the actions associated with each _s_i_g_s_p_e_c or, if none are supplied, for all trapped signals, as a set of ttrraapp commands - that can be reused as shell input to restore the current signal - dispositions. The --PP option behaves similarly, but displays - only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- - quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options may - be used in a subshell environment (e.g., command substitution) - and, as long as they are used before ttrraapp is used to change a + that can be reused as shell input to restore the current signal + dispositions. The --PP option behaves similarly, but displays + only the actions associated with each _s_i_g_s_p_e_c argument. --PP re- + quires at least one _s_i_g_s_p_e_c argument. The --PP or --pp options may + be used in a subshell environment (e.g., command substitution) + and, as long as they are used before ttrraapp is used to change a signal's handling, will display the state of its parent's traps. - The --ll option prints a list of signal names and their corre- - sponding numbers. Each _s_i_g_s_p_e_c is either a signal name defined + The --ll option prints a list of signal names and their corre- + sponding numbers. Each _s_i_g_s_p_e_c is either a signal name defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are case insen- - sitive and the SSIIGG prefix is optional. If --ll is supplied with + sitive and the SSIIGG prefix is optional. If --ll is supplied with no _s_i_g_s_p_e_c arguments, it prints a list of valid signal names. - If a _s_i_g_s_p_e_c is EEXXIITT (0), _a_c_t_i_o_n is executed on exit from the - shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, _a_c_t_i_o_n is executed before every - _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, _s_e_l_e_c_t command, (( - arithmetic command, [[ conditional command, arithmetic _f_o_r com- - mand, and before the first command executes in a shell function - (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the description of the - eexxttddeebbuugg shell option (see sshhoopptt above) for details of its ef- - fect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, _a_c_t_i_o_n is exe- + If a _s_i_g_s_p_e_c is EEXXIITT (0), _a_c_t_i_o_n is executed on exit from the + shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, _a_c_t_i_o_n is executed before every + _s_i_m_p_l_e _c_o_m_m_a_n_d, _f_o_r command, _c_a_s_e command, _s_e_l_e_c_t command, (( + arithmetic command, [[ conditional command, arithmetic _f_o_r com- + mand, and before the first command executes in a shell function + (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the description of the + eexxttddeebbuugg shell option (see sshhoopptt above) for details of its ef- + fect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, _a_c_t_i_o_n is exe- cuted each time a shell function or a script executed with the .. or ssoouurrccee builtins finishes executing. - If a _s_i_g_s_p_e_c is EERRRR, _a_c_t_i_o_n is executed whenever a pipeline - (which may consist of a single simple command), a list, or a - compound command returns a non-zero exit status, subject to the - following conditions. The EERRRR trap is not executed if the + If a _s_i_g_s_p_e_c is EERRRR, _a_c_t_i_o_n is executed whenever a pipeline + (which may consist of a single simple command), a list, or a + compound command returns a non-zero exit status, subject to the + following conditions. The EERRRR trap is not executed if the failed command is part of the command list immediately following a wwhhiillee or uunnttiill reserved word, part of the test in an _i_f state- - ment, part of a command executed in a &&&& or |||| list except the - command following the final &&&& or ||||, any command in a pipeline - but the last (subject to the state of the ppiippeeffaaiill shell op- - tion), or if the command's return value is being inverted using + ment, part of a command executed in a &&&& or |||| list except the + command following the final &&&& or ||||, any command in a pipeline + but the last (subject to the state of the ppiippeeffaaiill shell op- + tion), or if the command's return value is being inverted using !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) op- tion. When the shell is not interactive, signals ignored upon entry to the shell cannot be trapped or reset. Interactive shells permit trapping signals ignored on entry. Trapped signals that are not - being ignored are reset to their original values in a subshell - or subshell environment when one is created. The return status + being ignored are reset to their original values in a subshell + or subshell environment when one is created. The return status is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true. ttrruuee Does nothing, returns a 0 status. @@ -7029,61 +7035,61 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Indicate how each _n_a_m_e would be interpreted if used as a command name. - If the --tt option is used, ttyyppee prints a string which is one of - _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or _f_i_l_e if _n_a_m_e is an alias, - shell reserved word, function, builtin, or executable file, re- - spectively. If the _n_a_m_e is not found, ttyyppee prints nothing and + If the --tt option is used, ttyyppee prints a string which is one of + _a_l_i_a_s, _k_e_y_w_o_r_d, _f_u_n_c_t_i_o_n, _b_u_i_l_t_i_n, or _f_i_l_e if _n_a_m_e is an alias, + shell reserved word, function, builtin, or executable file, re- + spectively. If the _n_a_m_e is not found, ttyyppee prints nothing and returns a non-zero exit status. - If the --pp option is used, ttyyppee either returns the pathname of - the executable file that would be found by searching $$PPAATTHH for + If the --pp option is used, ttyyppee either returns the pathname of + the executable file that would be found by searching $$PPAATTHH for _n_a_m_e or nothing if "type -t name" would not return _f_i_l_e. The --PP - option forces a PPAATTHH search for each _n_a_m_e, even if "type -t + option forces a PPAATTHH search for each _n_a_m_e, even if "type -t name" would not return _f_i_l_e. If _n_a_m_e is present in the table of - hashed commands, --pp and --PP print the hashed value, which is not + hashed commands, --pp and --PP print the hashed value, which is not necessarily the file that appears first in PPAATTHH. - If the --aa option is used, ttyyppee prints all of the places that - contain a command named _n_a_m_e. This includes aliases, reserved - words, functions, and builtins, but the path search options (--pp - and --PP) can be supplied to restrict the output to executable - files. ttyyppee does not consult the table of hashed commands when + If the --aa option is used, ttyyppee prints all of the places that + contain a command named _n_a_m_e. This includes aliases, reserved + words, functions, and builtins, but the path search options (--pp + and --PP) can be supplied to restrict the output to executable + files. ttyyppee does not consult the table of hashed commands when using --aa with --pp, and only performs a PPAATTHH search for _n_a_m_e. The --ff option suppresses shell function lookup, as with the ccoomm-- - mmaanndd builtin. ttyyppee returns true if all of the arguments are + mmaanndd builtin. ttyyppee returns true if all of the arguments are found, false if any are not found. uulliimmiitt [--HHSS] --aa uulliimmiitt [--HHSS] [--bbccddeeffiikkllmmnnppqqrrssttuuvvxxPPRRTT [_l_i_m_i_t]] - Provides control over the resources available to the shell and + Provides control over the resources available to the shell and to processes it starts, on systems that allow such control. - The --HH and --SS options specify whether the hard or soft limit is + The --HH and --SS options specify whether the hard or soft limit is set for the given resource. A hard limit cannot be increased by a non-root user once it is set; a soft limit may be increased up - to the value of the hard limit. If neither --HH nor --SS is speci- + to the value of the hard limit. If neither --HH nor --SS is speci- fied, uulliimmiitt sets both the soft and hard limits. The value of _l_i_m_i_t can be a number in the unit specified for the - resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, - which stand for the current hard limit, the current soft limit, - and no limit, respectively. If _l_i_m_i_t is omitted, uulliimmiitt prints - the current value of the soft limit of the resource, unless the - --HH option is given. When more than one resource is specified, - the limit name and unit, if appropriate, are printed before the + resource or one of the special values hhaarrdd, ssoofftt, or uunnlliimmiitteedd, + which stand for the current hard limit, the current soft limit, + and no limit, respectively. If _l_i_m_i_t is omitted, uulliimmiitt prints + the current value of the soft limit of the resource, unless the + --HH option is given. When more than one resource is specified, + the limit name and unit, if appropriate, are printed before the value. Other options are interpreted as follows: --aa Report all current limits; no limits are set. --bb The maximum socket buffer size. --cc The maximum size of core files created. --dd The maximum size of a process's data segment. --ee The maximum scheduling priority ("nice"). - --ff The maximum size of files written by the shell and its + --ff The maximum size of files written by the shell and its children. --ii The maximum number of pending signals. --kk The maximum number of kqueues that may be allocated. --ll The maximum size that may be locked into memory. - --mm The maximum resident set size (many systems do not honor + --mm The maximum resident set size (many systems do not honor this limit). --nn The maximum number of open file descriptors (most systems do not allow this value to be set). @@ -7092,146 +7098,146 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --rr The maximum real-time scheduling priority. --ss The maximum stack size. --tt The maximum amount of cpu time in seconds. - --uu The maximum number of processes available to a single + --uu The maximum number of processes available to a single user. - --vv The maximum amount of virtual memory available to the + --vv The maximum amount of virtual memory available to the shell and, on some systems, to its children. --xx The maximum number of file locks. --PP The maximum number of pseudoterminals. - --RR The maximum time a real-time process can run before + --RR The maximum time a real-time process can run before blocking, in microseconds. --TT The maximum number of threads. - If _l_i_m_i_t is supplied, and the --aa option is not used, _l_i_m_i_t is - the new value of the specified resource. If no option is sup- + If _l_i_m_i_t is supplied, and the --aa option is not used, _l_i_m_i_t is + the new value of the specified resource. If no option is sup- plied, then --ff is assumed. - Values are in 1024-byte increments, except for --tt, which is in - seconds; --RR, which is in microseconds; --pp, which is in units of - 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and --uu, which are unscaled - values; and, when in posix mode, --cc and --ff, which are in - 512-byte increments. The return status is 0 unless an invalid + Values are in 1024-byte increments, except for --tt, which is in + seconds; --RR, which is in microseconds; --pp, which is in units of + 512-byte blocks; --PP, --TT, --bb, --kk, --nn, and --uu, which are unscaled + values; and, when in posix mode, --cc and --ff, which are in + 512-byte increments. The return status is 0 unless an invalid option or argument is supplied, or an error occurs while setting a new limit. uummaasskk [--pp] [--SS] [_m_o_d_e] - Set the user file-creation mask to _m_o_d_e. If _m_o_d_e begins with a + Set the user file-creation mask to _m_o_d_e. If _m_o_d_e begins with a digit, it is interpreted as an octal number; otherwise it is in- - terpreted as a symbolic mode mask similar to that accepted by + terpreted as a symbolic mode mask similar to that accepted by _c_h_m_o_d(1). If _m_o_d_e is omitted, uummaasskk prints the current value of the mask. The --SS option without a _m_o_d_e argument prints the mask in a symbolic format; the default output is an octal number. If the --pp option is supplied, and _m_o_d_e is omitted, the output is in - a form that may be reused as input. The return status is zero - if the mode was successfully changed or if no _m_o_d_e argument was + a form that may be reused as input. The return status is zero + if the mode was successfully changed or if no _m_o_d_e argument was supplied, and non-zero otherwise. uunnaalliiaass [-aa] [_n_a_m_e ...] - Remove each _n_a_m_e from the list of defined aliases. If --aa is - supplied, remove all alias definitions. The return value is + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, remove all alias definitions. The return value is true unless a supplied _n_a_m_e is not a defined alias. uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] - For each _n_a_m_e, remove the corresponding variable or function. + For each _n_a_m_e, remove the corresponding variable or function. If the --vv option is given, each _n_a_m_e refers to a shell variable, - and that variable is removed. If --ff is specified, each _n_a_m_e - refers to a shell function, and the function definition is re- - moved. If the --nn option is supplied, and _n_a_m_e is a variable - with the _n_a_m_e_r_e_f attribute, _n_a_m_e will be unset rather than the - variable it references. --nn has no effect if the --ff option is - supplied. Read-only variables and functions may not be unset. - When variables or functions are removed, they are also removed - from the environment passed to subsequent commands. If no op- - tions are supplied, each _n_a_m_e refers to a variable; if there is - no variable by that name, a function with that name, if any, is - unset. Some shell variables may not be unset. If any of + and that variable is removed. If --ff is specified, each _n_a_m_e + refers to a shell function, and the function definition is re- + moved. If the --nn option is supplied, and _n_a_m_e is a variable + with the _n_a_m_e_r_e_f attribute, _n_a_m_e will be unset rather than the + variable it references. --nn has no effect if the --ff option is + supplied. Read-only variables and functions may not be unset. + When variables or functions are removed, they are also removed + from the environment passed to subsequent commands. If no op- + tions are supplied, each _n_a_m_e refers to a variable; if there is + no variable by that name, a function with that name, if any, is + unset. Some shell variables may not be unset. If any of BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBB-- - SSHHEELLLL, BBAASSHHPPIIDD, CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, - EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECC-- - OONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, - even if they are subsequently reset. The exit status is true + SSHHEELLLL, BBAASSHHPPIIDD, CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, + EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECC-- + OONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, + even if they are subsequently reset. The exit status is true unless a _n_a_m_e is readonly or may not be unset. wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d ...] Wait for each specified child process _i_d and return the termina- - tion status of the last _i_d. Each _i_d may be a process ID _p_i_d or - a job specification _j_o_b_s_p_e_c; if a jobspec is supplied, wwaaiitt + tion status of the last _i_d. Each _i_d may be a process ID _p_i_d or + a job specification _j_o_b_s_p_e_c; if a jobspec is supplied, wwaaiitt waits for all processes in the job. - If no options or _i_ds are supplied, wwaaiitt waits for all running - background jobs and the last-executed process substitution, if + If no options or _i_ds are supplied, wwaaiitt waits for all running + background jobs and the last-executed process substitution, if its process id is the same as $$!!, and the return status is zero. - If the --nn option is supplied, wwaaiitt waits for any one of the + If the --nn option is supplied, wwaaiitt waits for any one of the given _i_ds or, if no _i_ds are supplied, any job or process substi- tution, to complete and returns its exit status. If none of the - supplied _i_ds is a child of the shell, or if no _i_ds are supplied - and the shell has no unwaited-for children, the exit status is + supplied _i_ds is a child of the shell, or if no _i_ds are supplied + and the shell has no unwaited-for children, the exit status is 127. - If the --pp option is supplied, wwaaiitt assigns the process or job - identifier of the job for which the exit status is returned to - the variable _v_a_r_n_a_m_e named by the option argument. The vari- - able, which cannot be readonly, will be unset initially, before - any assignment. This is useful only when used with the --nn op- + If the --pp option is supplied, wwaaiitt assigns the process or job + identifier of the job for which the exit status is returned to + the variable _v_a_r_n_a_m_e named by the option argument. The vari- + able, which cannot be readonly, will be unset initially, before + any assignment. This is useful only when used with the --nn op- tion. - Supplying the --ff option, when job control is enabled, forces - wwaaiitt to wait for each _i_d to terminate before returning its sta- + Supplying the --ff option, when job control is enabled, forces + wwaaiitt to wait for each _i_d to terminate before returning its sta- tus, instead of returning when it changes status. - If none of the _i_ds specify one of the shell's active child - processes, the return status is 127. If wwaaiitt is interrupted by - a signal, any _v_a_r_n_a_m_e will remain unset, and the return status - will be greater than 128, as described under SSIIGGNNAALLSS above. + If none of the _i_ds specify one of the shell's active child + processes, the return status is 127. If wwaaiitt is interrupted by + a signal, any _v_a_r_n_a_m_e will remain unset, and the return status + will be greater than 128, as described under SSIIGGNNAALLSS above. Otherwise, the return status is the exit status of the last _i_d. SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE - Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- + Bash-4.0 introduced the concept of a _s_h_e_l_l _c_o_m_p_a_t_i_b_i_l_i_t_y _l_e_v_e_l, speci- fied as a set of options to the shopt builtin (ccoommppaatt3311, ccoommppaatt3322, ccoomm-- - ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility + ppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibility level -- each option is mutually exclusive. The compatibility level is - intended to allow users to select behavior from previous versions that - is incompatible with newer versions while they migrate scripts to use - current features and behavior. It's intended to be a temporary solu- + intended to allow users to select behavior from previous versions that + is incompatible with newer versions while they migrate scripts to use + current features and behavior. It's intended to be a temporary solu- tion. - This section does not mention behavior that is standard for a particu- - lar version (e.g., setting ccoommppaatt3322 means that quoting the right hand - side of the regexp matching operator quotes special regexp characters - in the word, which is default behavior in bash-3.2 and subsequent ver- + This section does not mention behavior that is standard for a particu- + lar version (e.g., setting ccoommppaatt3322 means that quoting the right hand + side of the regexp matching operator quotes special regexp characters + in the word, which is default behavior in bash-3.2 and subsequent ver- sions). - If a user enables, say, ccoommppaatt3322, it may affect the behavior of other - compatibility levels up to and including the current compatibility - level. The idea is that each compatibility level controls behavior - that changed in that version of bbaasshh, but that behavior may have been - present in earlier versions. For instance, the change to use locale- - based comparisons with the [[[[ command came in bash-4.1, and earlier + If a user enables, say, ccoommppaatt3322, it may affect the behavior of other + compatibility levels up to and including the current compatibility + level. The idea is that each compatibility level controls behavior + that changed in that version of bbaasshh, but that behavior may have been + present in earlier versions. For instance, the change to use locale- + based comparisons with the [[[[ command came in bash-4.1, and earlier versions used ASCII-based comparisons, so enabling ccoommppaatt3322 will enable - ASCII-based comparisons as well. That granularity may not be suffi- - cient for all uses, and as a result users should employ compatibility - levels carefully. Read the documentation for a particular feature to + ASCII-based comparisons as well. That granularity may not be suffi- + cient for all uses, and as a result users should employ compatibility + levels carefully. Read the documentation for a particular feature to find out the current behavior. - Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- + Bash-4.3 introduced a new shell variable: BBAASSHH__CCOOMMPPAATT. The value as- signed to this variable (a decimal version number like 4.2, or an inte- - ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- + ger corresponding to the ccoommppaatt_N_N option, like 42) determines the com- patibility level. Starting with bash-4.4, bbaasshh began deprecating older compatibility lev- els. Eventually, the options will be removed in favor of BBAASSHH__CCOOMMPPAATT. - Bash-5.0 was the final version for which there was an individual shopt - option for the previous version. BBAASSHH__CCOOMMPPAATT is the only mechanism to + Bash-5.0 was the final version for which there was an individual shopt + option for the previous version. BBAASSHH__CCOOMMPPAATT is the only mechanism to control the compatibility level in versions newer than bash-5.0. - The following table describes the behavior changes controlled by each + The following table describes the behavior changes controlled by each compatibility level setting. The ccoommppaatt_N_N tag is used as shorthand for setting the compatibility level to _N_N using one of the following mecha- - nisms. For versions prior to bash-5.0, the compatibility level may be - set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and - later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- + nisms. For versions prior to bash-5.0, the compatibility level may be + set using the corresponding ccoommppaatt_N_N shopt option. For bash-4.3 and + later versions, the BBAASSHH__CCOOMMPPAATT variable is preferred, and it is re- quired for bash-5.1 and later versions. ccoommppaatt3311 @@ -7239,173 +7245,173 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE ator (=~) has no special effect. ccoommppaatt3322 - +o The << and >> operators to the [[[[ command do not consider + +o The << and >> operators to the [[[[ command do not consider the current locale when comparing strings; they use ASCII ordering. ccoommppaatt4400 - +o The << and >> operators to the [[[[ command do not consider + +o The << and >> operators to the [[[[ command do not consider the current locale when comparing strings; they use ASCII ordering. BBaasshh versions prior to bash-4.1 use ASCII col- - lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current + lation and _s_t_r_c_m_p(3); bash-4.1 and later use the current locale's collation sequence and _s_t_r_c_o_l_l(3). ccoommppaatt4411 - +o In posix mode, ttiimmee may be followed by options and still + +o In posix mode, ttiimmee may be followed by options and still be recognized as a reserved word (this is POSIX interpre- tation 267). +o In _p_o_s_i_x mode, the parser requires that an even number of - single quotes occur in the _w_o_r_d portion of a double- - quoted parameter expansion and treats them specially, so - that characters within the single quotes are considered + single quotes occur in the _w_o_r_d portion of a double- + quoted parameter expansion and treats them specially, so + that characters within the single quotes are considered quoted (this is POSIX interpretation 221). ccoommppaatt4422 +o The replacement string in double-quoted pattern substitu- - tion does not undergo quote removal, as it does in ver- + tion does not undergo quote removal, as it does in ver- sions after bash-4.2. - +o In posix mode, single quotes are considered special when - expanding the _w_o_r_d portion of a double-quoted parameter - expansion and can be used to quote a closing brace or - other special character (this is part of POSIX interpre- - tation 221); in later versions, single quotes are not + +o In posix mode, single quotes are considered special when + expanding the _w_o_r_d portion of a double-quoted parameter + expansion and can be used to quote a closing brace or + other special character (this is part of POSIX interpre- + tation 221); in later versions, single quotes are not special within double-quoted word expansions. ccoommppaatt4433 - +o Word expansion errors are considered non-fatal errors - that cause the current command to fail, even in posix - mode (the default behavior is to make them fatal errors + +o Word expansion errors are considered non-fatal errors + that cause the current command to fail, even in posix + mode (the default behavior is to make them fatal errors that cause the shell to exit). - +o When executing a shell function, the loop state + +o When executing a shell function, the loop state (while/until/etc.) is not reset, so bbrreeaakk or ccoonnttiinnuuee in that function will break or continue loops in the calling context. Bash-4.4 and later reset the loop state to pre- vent this. ccoommppaatt4444 - +o The shell sets up the values used by BBAASSHH__AARRGGVV and - BBAASSHH__AARRGGCC so they can expand to the shell's positional - parameters even if extended debugging mode is not en- + +o The shell sets up the values used by BBAASSHH__AARRGGVV and + BBAASSHH__AARRGGCC so they can expand to the shell's positional + parameters even if extended debugging mode is not en- abled. - +o A subshell inherits loops from its parent context, so - bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. - Bash-5.0 and later reset the loop state to prevent the + +o A subshell inherits loops from its parent context, so + bbrreeaakk or ccoonnttiinnuuee will cause the subshell to exit. + Bash-5.0 and later reset the loop state to prevent the exit - +o Variable assignments preceding builtins like eexxppoorrtt and + +o Variable assignments preceding builtins like eexxppoorrtt and rreeaaddoonnllyy that set attributes continue to affect variables with the same name in the calling environment even if the shell is not in posix mode. ccoommppaatt5500 - +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- - duce slightly more randomness. If the shell compatibil- + +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- + duce slightly more randomness. If the shell compatibil- ity level is set to 50 or lower, it reverts to the method - from bash-5.0 and previous versions, so seeding the ran- - dom number generator by assigning a value to RRAANNDDOOMM will + from bash-5.0 and previous versions, so seeding the ran- + dom number generator by assigning a value to RRAANNDDOOMM will produce the same sequence as in bash-5.0. - +o If the command hash table is empty, bash versions prior - to bash-5.1 printed an informational message to that ef- - fect, even when producing output that can be reused as - input. Bash-5.1 suppresses that message when the --ll op- + +o If the command hash table is empty, bash versions prior + to bash-5.1 printed an informational message to that ef- + fect, even when producing output that can be reused as + input. Bash-5.1 suppresses that message when the --ll op- tion is supplied. ccoommppaatt5511 - +o The uunnsseett builtin treats attempts to unset array sub- - scripts @@ and ** differently depending on whether the ar- - ray is indexed or associative, and differently than in + +o The uunnsseett builtin treats attempts to unset array sub- + scripts @@ and ** differently depending on whether the ar- + ray is indexed or associative, and differently than in previous versions. +o Arithmetic commands ( ((((...)))) ) and the expressions in an arithmetic for statement can be expanded more than once. - +o Expressions used as arguments to arithmetic operators in - the [[[[ conditional command can be expanded more than + +o Expressions used as arguments to arithmetic operators in + the [[[[ conditional command can be expanded more than once. - +o The expressions in substring parameter brace expansion + +o The expressions in substring parameter brace expansion can be expanded more than once. +o The expressions in the $$((((...)))) word expansion can be ex- panded more than once. - +o Arithmetic expressions used as indexed array subscripts + +o Arithmetic expressions used as indexed array subscripts can be expanded more than once. - +o tteesstt --vv, when given an argument of AA[[@@]], where AA is an + +o tteesstt --vv, when given an argument of AA[[@@]], where AA is an existing associative array, will return true if the array - has any set elements. Bash-5.2 will look for and report + has any set elements. Bash-5.2 will look for and report on a key named @@. +o The ${_p_a_r_a_m_e_t_e_r[[::]]==_v_a_l_u_e} word expansion will return - _v_a_l_u_e, before any variable-specific transformations have + _v_a_l_u_e, before any variable-specific transformations have been performed (e.g., converting to lowercase). Bash-5.2 will return the final value assigned to the variable. - +o Parsing command substitutions will behave as if extended + +o Parsing command substitutions will behave as if extended globbing (see the description of the sshhoopptt builtin above) - is enabled, so that parsing a command substitution con- + is enabled, so that parsing a command substitution con- taining an extglob pattern (say, as part of a shell func- - tion) will not fail. This assumes the intent is to en- - able extglob before the command is executed and word ex- - pansions are performed. It will fail at word expansion - time if extglob hasn't been enabled by the time the com- + tion) will not fail. This assumes the intent is to en- + able extglob before the command is executed and word ex- + pansions are performed. It will fail at word expansion + time if extglob hasn't been enabled by the time the com- mand is executed. ccoommppaatt5522 - +o The tteesstt builtin uses its historical algorithm to parse - parenthesized subexpressions when given five or more ar- + +o The tteesstt builtin uses its historical algorithm to parse + parenthesized subexpressions when given five or more ar- guments. - +o If the --pp or --PP option is supplied to the bbiinndd builtin, + +o If the --pp or --PP option is supplied to the bbiinndd builtin, bbiinndd treats any arguments remaining after option process- - ing as bindable command names, and displays any key se- - quences bound to those commands, instead of treating the + ing as bindable command names, and displays any key se- + quences bound to those commands, instead of treating the arguments as key sequences to bind. RREESSTTRRIICCTTEEDD SSHHEELLLL If bbaasshh is started with the name rrbbaasshh, or the --rr option is supplied at - invocation, the shell becomes _r_e_s_t_r_i_c_t_e_d. A restricted shell is used - to set up an environment more controlled than the standard shell. It - behaves identically to bbaasshh with the exception that the following are + invocation, the shell becomes _r_e_s_t_r_i_c_t_e_d. A restricted shell is used + to set up an environment more controlled than the standard shell. It + behaves identically to bbaasshh with the exception that the following are disallowed or not performed: +o Changing directories with ccdd. - +o Setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV, + +o Setting or unsetting the values of SSHHEELLLL, PPAATTHH, HHIISSTTFFIILLEE, EENNVV, or BBAASSHH__EENNVV. +o Specifying command names containing //. - +o Specifying a filename containing a // as an argument to the .. + +o Specifying a filename containing a // as an argument to the .. builtin command. - +o Using the --pp option to the .. builtin command to specify a + +o Using the --pp option to the .. builtin command to specify a search path. - +o Specifying a filename containing a slash as an argument to the + +o Specifying a filename containing a slash as an argument to the hhiissttoorryy builtin command. - +o Specifying a filename containing a slash as an argument to the + +o Specifying a filename containing a slash as an argument to the --pp option to the hhaasshh builtin command. - +o Importing function definitions from the shell environment at + +o Importing function definitions from the shell environment at startup. - +o Parsing the values of BBAASSHHOOPPTTSS and SSHHEELLLLOOPPTTSS from the shell en- + +o Parsing the values of BBAASSHHOOPPTTSS and SSHHEELLLLOOPPTTSS from the shell en- vironment at startup. - +o Redirecting output using the >, >|, <>, >&, &>, and >> redirec- + +o Redirecting output using the >, >|, <>, >&, &>, and >> redirec- tion operators. +o Using the eexxeecc builtin command to replace the shell with another command. - +o Adding or deleting builtin commands with the --ff and --dd options + +o Adding or deleting builtin commands with the --ff and --dd options to the eennaabbllee builtin command. - +o Using the eennaabbllee builtin command to enable disabled shell + +o Using the eennaabbllee builtin command to enable disabled shell builtins. +o Specifying the --pp option to the ccoommmmaanndd builtin command. - +o Turning off restricted mode with sseett ++rr or sshhoopptt --uu rree-- + +o Turning off restricted mode with sseett ++rr or sshhoopptt --uu rree-- ssttrriicctteedd__sshheellll. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed (see CCOOMM-- - MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell + MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell spawned to execute the script. SSEEEE AALLSSOO @@ -7430,10 +7436,10 @@ FFIILLEESS _~_/_._b_a_s_h_r_c The individual per-interactive-shell startup file _~_/_._b_a_s_h___l_o_g_o_u_t - The individual login shell cleanup file, executed when a login + The individual login shell cleanup file, executed when a login shell exits _~_/_._b_a_s_h___h_i_s_t_o_r_y - The default value of HHIISSTTFFIILLEE, the file in which bash saves the + The default value of HHIISSTTFFIILLEE, the file in which bash saves the command history _~_/_._i_n_p_u_t_r_c Individual _r_e_a_d_l_i_n_e initialization file @@ -7447,15 +7453,15 @@ AAUUTTHHOORRSS BBUUGG RREEPPOORRTTSS If you find a bug in bbaasshh, you should report it. But first, you should - make sure that it really is a bug, and that it appears in the latest - version of bbaasshh. The latest version is always available from + make sure that it really is a bug, and that it appears in the latest + version of bbaasshh. The latest version is always available from _f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_g_n_u_/_b_a_s_h_/ and _h_t_t_p_:_/_/_g_i_t_._s_a_v_a_n_- _n_a_h_._g_n_u_._o_r_g_/_c_g_i_t_/_b_a_s_h_._g_i_t_/_s_n_a_p_s_h_o_t_/_b_a_s_h_-_m_a_s_t_e_r_._t_a_r_._g_z. - Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g - command to submit a bug report. If you have a fix, you are encouraged + Once you have determined that a bug actually exists, use the _b_a_s_h_b_u_g + command to submit a bug report. If you have a fix, you are encouraged to mail that as well! You may send suggestions and "philosophical" bug - reports to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or post them to the Usenet newsgroup + reports to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or post them to the Usenet newsgroup ggnnuu..bbaasshh..bbuugg. ALL bug reports should include: @@ -7466,7 +7472,7 @@ BBUUGG RREEPPOORRTTSS A description of the bug behavior A short script or "recipe" which exercises the bug - _b_a_s_h_b_u_g inserts the first three items automatically into the template + _b_a_s_h_b_u_g inserts the first three items automatically into the template it provides for filing a bug report. Comments and bug reports concerning this manual page should be directed @@ -7482,14 +7488,14 @@ BBUUGGSS Shell builtin commands and functions are not stoppable/restartable. - Compound commands and command lists of the form "a ; b ; c" are not - handled gracefully when combined with process suspension. When a - process is stopped, the shell immediately executes the next command in - the list or breaks out of any existing loops. It suffices to enclose - the command in parentheses to force it into a subshell, which may be - stopped as a unit, or to start the command in the background and imme- + Compound commands and command lists of the form "a ; b ; c" are not + handled gracefully when combined with process suspension. When a + process is stopped, the shell immediately executes the next command in + the list or breaks out of any existing loops. It suffices to enclose + the command in parentheses to force it into a subshell, which may be + stopped as a unit, or to start the command in the background and imme- diately bring it into the foreground. Array variables may not (yet) be exported. -GNU Bash 5.3 2025 February 24 _B_A_S_H(1) +GNU Bash 5.3 2025 April 7 _B_A_S_H(1) diff --git a/doc/bash.1 b/doc/bash.1 index 4e2eb5f1d..5af3492f7 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,7 +5,7 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Mon Feb 24 16:09:49 EST 2025 +.\" Last Change: Mon Apr 7 16:59:13 EDT 2025 .\" .\" For bash_builtins, strip all but "SHELL BUILTIN COMMANDS" section .\" For rbash, strip all but "RESTRICTED SHELL" section @@ -21,7 +21,7 @@ .ds zY \" empty .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2025 February 24" "GNU Bash 5.3" +.TH BASH 1 "2025 April 7" "GNU Bash 5.3" .\" .ie \n(.g \{\ .ds ' \(aq @@ -1449,7 +1449,7 @@ is applied to an array variable using compound assignment below), the variable's value is not unset (as it is when using -.@ = ), +.Q = ), 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. @@ -2617,8 +2617,13 @@ the shell does not save the command history when it exits. .B HISTFILESIZE The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, -if necessary, to contain no more than that number of lines +if necessary, to contain no more than +the number of history entries +that total no more than that number of lines by removing the oldest entries. +If the history list contains multi-line entries, +the history file may contain more lines than this maximum +to avoid leaving partial history entries. The history file is also truncated to this size after writing it when a shell exits or by the .B \%history @@ -10174,7 +10179,7 @@ is executed before the shell terminates. \fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIvalue\fP]] .\|.\|. .PD 0 .TP -.B export \-p +.B export \-p [\fB\-f\fP\^] .PD The supplied .I names @@ -10191,10 +10196,13 @@ The option unexports, or removes the export attribute, from each \fIname\fP. If no .I names -are given, or if the +are given, or if only the .B \-p -option is supplied, \fBexport\fP prints a list of names of all exported +option is supplied, +\fBexport\fP displays a list of names of all exported variables on the standard output. +Using \fB\-p\fP and \fB\-f\fP together displays exported functions. +The \fB\-p\fP option displays output in a form that may be reused as input. .IP \fBexport\fP allows the value of a variable to be set when it is exported or unexported by following the variable name with =\fIvalue\fP. diff --git a/doc/bash.html b/doc/bash.html index c83ae0486..07c854448 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2025 February 24BASH(1) +BASH(1)2025 April 7BASH(1)

Index @@ -3291,8 +3291,13 @@ the shell does not save the command history when it exits.
The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, -if necessary, to contain no more than that number of lines +if necessary, to contain no more than +the number of history entries +that total no more than that number of lines by removing the oldest entries. +If the history list contains multi-line entries, +the history file may contain more lines than this maximum +to avoid leaving partial history entries. The history file is also truncated to this size after writing it when a shell exits or by the history @@ -12740,7 +12745,7 @@ Any trap on is executed before the shell terminates.
export [-fn] [name[=value]] ...
-
export -p +
export -p [-f]
@@ -12764,11 +12769,14 @@ option unexports, or removes the export attribute, from each name. If no names -are given, or if the +are given, or if only the -p -option is supplied, export prints a list of names of all exported +option is supplied, +export displays a list of names of all exported variables on the standard output. +Using -p and -f together displays exported functions. +The -p option displays output in a form that may be reused as input.
export allows the value of a variable to be set when it is exported or unexported by following the variable name with =value. @@ -16813,7 +16821,7 @@ Array variables may not (yet) be exported.
-
GNU Bash 5.32025 February 24BASH(1) +GNU Bash 5.32025 April 7BASH(1)

@@ -16922,7 +16930,7 @@ Array variables may not (yet) be exported.
BUGS

-This document was created by man2html from bash.1.
-Time: 31 March 2025 10:28:01 EDT +This document was created by man2html from /usr/local/src/bash/bash-20250502/doc/bash.1.
+Time: 04 May 2025 17:25:09 EDT diff --git a/doc/bash.info b/doc/bash.info index 625ddd0ca..c95e7dc56 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -1,9 +1,9 @@ This is bash.info, produced by makeinfo version 7.1 from bashref.texi. This text is a brief description of the features that are present in the -Bash shell (version 5.3, 24 February 2025). +Bash shell (version 5.3, 7 April 2025). - This is Edition 5.3, last updated 24 February 2025, of ‘The GNU Bash + This is Edition 5.3, last updated 7 April 2025, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Copyright © 1988-2025 Free Software Foundation, Inc. @@ -26,10 +26,10 @@ Bash Features ************* This text is a brief description of the features that are present in the -Bash shell (version 5.3, 24 February 2025). The Bash home page is +Bash shell (version 5.3, 7 April 2025). The Bash home page is . - This is Edition 5.3, last updated 24 February 2025, of ‘The GNU Bash + This is Edition 5.3, last updated 7 April 2025, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some @@ -3597,9 +3597,10 @@ standard. to shell functions; otherwise the names refer to shell variables. The ‘-n’ option means to unexport each name: no longer mark it for - export. If no NAMEs are supplied, or if the ‘-p’ option is given, - ‘export’ displays a list of names of all exported variables on the - standard output. The ‘-p’ option displays output in a form that + export. If no NAMEs are supplied, or if only the ‘-p’ option is + given, ‘export’ displays a list of names of all exported variables + on the standard output. Using ‘-p’ and ‘-f’ together displays + exported functions. The ‘-p’ option displays output in a form that may be reused as input. ‘export’ allows the value of a variable to be set at the same time @@ -6104,13 +6105,16 @@ Variables::). ‘HISTFILESIZE’ The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, - if necessary, to contain no more than that number of lines by - removing the oldest entries. The history file is also truncated to - this size after writing it when a shell exits or by the ‘history’ - builtin. If the value is 0, the history file is truncated to zero - size. Non-numeric values and numeric values less than zero inhibit - truncation. The shell sets the default value to the value of - ‘HISTSIZE’ after reading any startup files. + if necessary, to contain no more than the number of history entries + that total no more than that number of lines by removing the oldest + entries. If the history list contains multi-line entries, the + history file may contain more lines than this maximum to avoid + leaving partial history entries. The history file is also + truncated to this size after writing it when a shell exits or by + the ‘history’ builtin. If the value is 0, the history file is + truncated to zero size. Non-numeric values and numeric values less + than zero inhibit truncation. The shell sets the default value to + the value of ‘HISTSIZE’ after reading any startup files. ‘HISTIGNORE’ A colon-separated list of patterns used to decide which command @@ -12825,7 +12829,7 @@ D.1 Index of Shell Builtin Commands * .: Bourne Shell Builtins. (line 17) * [: Bourne Shell Builtins. - (line 338) + (line 339) * alias: Bash Builtins. (line 11) * bg: Job Control Builtins. (line 7) @@ -12861,15 +12865,15 @@ D.1 Index of Shell Builtin Commands * export: Bourne Shell Builtins. (line 152) * false: Bourne Shell Builtins. - (line 174) + (line 175) * fc: Bash History Builtins. (line 10) * fg: Job Control Builtins. (line 17) * getopts: Bourne Shell Builtins. - (line 179) + (line 180) * hash: Bourne Shell Builtins. - (line 231) + (line 232) * help: Bash Builtins. (line 375) * history: Bash History Builtins. (line 59) @@ -12885,38 +12889,38 @@ D.1 Index of Shell Builtin Commands (line 37) * printf: Bash Builtins. (line 488) * pushd: Directory Stack Builtins. - (line 70) + (line 71) * pwd: Bourne Shell Builtins. - (line 263) + (line 264) * read: Bash Builtins. (line 558) * readarray: Bash Builtins. (line 669) * readonly: Bourne Shell Builtins. - (line 275) + (line 276) * return: Bourne Shell Builtins. - (line 300) + (line 301) * set: The Set Builtin. (line 11) * shift: Bourne Shell Builtins. - (line 325) + (line 326) * shopt: The Shopt Builtin. (line 9) * source: Bash Builtins. (line 678) * suspend: Job Control Builtins. (line 139) * test: Bourne Shell Builtins. - (line 338) + (line 339) * times: Bourne Shell Builtins. - (line 438) + (line 439) * trap: Bourne Shell Builtins. - (line 444) + (line 445) * true: Bourne Shell Builtins. - (line 510) + (line 511) * type: Bash Builtins. (line 683) * typeset: Bash Builtins. (line 720) * ulimit: Bash Builtins. (line 726) * umask: Bourne Shell Builtins. - (line 515) + (line 516) * unalias: Bash Builtins. (line 834) * unset: Bourne Shell Builtins. - (line 533) + (line 534) * wait: Job Control Builtins. (line 86) @@ -13093,51 +13097,51 @@ D.3 Parameter and Variable Index * HISTCONTROL: Bash Variables. (line 443) * HISTFILE: Bash Variables. (line 461) * HISTFILESIZE: Bash Variables. (line 467) -* HISTIGNORE: Bash Variables. (line 478) +* HISTIGNORE: Bash Variables. (line 481) * history-preserve-point: Readline Init File Syntax. (line 234) * history-size: Readline Init File Syntax. (line 240) -* HISTSIZE: Bash Variables. (line 502) -* HISTTIMEFORMAT: Bash Variables. (line 509) +* HISTSIZE: Bash Variables. (line 505) +* HISTTIMEFORMAT: Bash Variables. (line 512) * HOME: Bourne Shell Variables. (line 13) * horizontal-scroll-mode: Readline Init File Syntax. (line 250) -* HOSTFILE: Bash Variables. (line 518) -* HOSTNAME: Bash Variables. (line 529) -* HOSTTYPE: Bash Variables. (line 532) +* HOSTFILE: Bash Variables. (line 521) +* HOSTNAME: Bash Variables. (line 532) +* HOSTTYPE: Bash Variables. (line 535) * IFS: Bourne Shell Variables. (line 18) -* IGNOREEOF: Bash Variables. (line 535) +* IGNOREEOF: Bash Variables. (line 538) * input-meta: Readline Init File Syntax. (line 258) -* INPUTRC: Bash Variables. (line 544) -* INSIDE_EMACS: Bash Variables. (line 548) +* INPUTRC: Bash Variables. (line 547) +* INSIDE_EMACS: Bash Variables. (line 551) * isearch-terminators: Readline Init File Syntax. (line 269) * keymap: Readline Init File Syntax. (line 276) * LANG: Creating Internationalized Scripts. (line 51) -* LANG <1>: Bash Variables. (line 554) -* LC_ALL: Bash Variables. (line 558) -* LC_COLLATE: Bash Variables. (line 562) -* LC_CTYPE: Bash Variables. (line 569) +* LANG <1>: Bash Variables. (line 557) +* LC_ALL: Bash Variables. (line 561) +* LC_COLLATE: Bash Variables. (line 565) +* LC_CTYPE: Bash Variables. (line 572) * LC_MESSAGES: Creating Internationalized Scripts. (line 51) -* LC_MESSAGES <1>: Bash Variables. (line 574) -* LC_NUMERIC: Bash Variables. (line 578) -* LC_TIME: Bash Variables. (line 582) -* LINENO: Bash Variables. (line 586) -* LINES: Bash Variables. (line 593) -* MACHTYPE: Bash Variables. (line 599) +* LC_MESSAGES <1>: Bash Variables. (line 577) +* LC_NUMERIC: Bash Variables. (line 581) +* LC_TIME: Bash Variables. (line 585) +* LINENO: Bash Variables. (line 589) +* LINES: Bash Variables. (line 596) +* MACHTYPE: Bash Variables. (line 602) * MAIL: Bourne Shell Variables. (line 24) -* MAILCHECK: Bash Variables. (line 603) +* MAILCHECK: Bash Variables. (line 606) * MAILPATH: Bourne Shell Variables. (line 29) -* MAPFILE: Bash Variables. (line 611) +* MAPFILE: Bash Variables. (line 614) * mark-modified-lines: Readline Init File Syntax. (line 306) * mark-symlinked-directories: Readline Init File Syntax. @@ -13148,46 +13152,46 @@ D.3 Parameter and Variable Index (line 323) * meta-flag: Readline Init File Syntax. (line 258) -* OLDPWD: Bash Variables. (line 615) +* OLDPWD: Bash Variables. (line 618) * OPTARG: Bourne Shell Variables. (line 36) -* OPTERR: Bash Variables. (line 618) +* OPTERR: Bash Variables. (line 621) * OPTIND: Bourne Shell Variables. (line 40) -* OSTYPE: Bash Variables. (line 623) +* OSTYPE: Bash Variables. (line 626) * output-meta: Readline Init File Syntax. (line 328) * page-completions: Readline Init File Syntax. (line 337) * PATH: Bourne Shell Variables. (line 44) -* PIPESTATUS: Bash Variables. (line 626) -* POSIXLY_CORRECT: Bash Variables. (line 636) -* PPID: Bash Variables. (line 646) -* PROMPT_COMMAND: Bash Variables. (line 650) -* PROMPT_DIRTRIM: Bash Variables. (line 656) -* PS0: Bash Variables. (line 662) +* PIPESTATUS: Bash Variables. (line 629) +* POSIXLY_CORRECT: Bash Variables. (line 639) +* PPID: Bash Variables. (line 649) +* PROMPT_COMMAND: Bash Variables. (line 653) +* PROMPT_DIRTRIM: Bash Variables. (line 659) +* PS0: Bash Variables. (line 665) * PS1: Bourne Shell Variables. (line 53) * PS2: Bourne Shell Variables. (line 58) -* PS3: Bash Variables. (line 667) -* PS4: Bash Variables. (line 672) -* PWD: Bash Variables. (line 680) -* RANDOM: Bash Variables. (line 683) -* READLINE_ARGUMENT: Bash Variables. (line 691) -* READLINE_LINE: Bash Variables. (line 695) -* READLINE_MARK: Bash Variables. (line 699) -* READLINE_POINT: Bash Variables. (line 705) -* REPLY: Bash Variables. (line 709) +* PS3: Bash Variables. (line 670) +* PS4: Bash Variables. (line 675) +* PWD: Bash Variables. (line 683) +* RANDOM: Bash Variables. (line 686) +* READLINE_ARGUMENT: Bash Variables. (line 694) +* READLINE_LINE: Bash Variables. (line 698) +* READLINE_MARK: Bash Variables. (line 702) +* READLINE_POINT: Bash Variables. (line 708) +* REPLY: Bash Variables. (line 712) * revert-all-at-newline: Readline Init File Syntax. (line 350) * search-ignore-case: Readline Init File Syntax. (line 357) -* SECONDS: Bash Variables. (line 713) -* SHELL: Bash Variables. (line 723) -* SHELLOPTS: Bash Variables. (line 728) -* SHLVL: Bash Variables. (line 738) +* SECONDS: Bash Variables. (line 716) +* SHELL: Bash Variables. (line 726) +* SHELLOPTS: Bash Variables. (line 731) +* SHLVL: Bash Variables. (line 741) * show-all-if-ambiguous: Readline Init File Syntax. (line 362) * show-all-if-unmodified: Readline Init File Syntax. @@ -13196,15 +13200,15 @@ D.3 Parameter and Variable Index (line 377) * skip-completed-text: Readline Init File Syntax. (line 383) -* SRANDOM: Bash Variables. (line 743) +* SRANDOM: Bash Variables. (line 746) * TEXTDOMAIN: Creating Internationalized Scripts. (line 51) * TEXTDOMAINDIR: Creating Internationalized Scripts. (line 51) -* TIMEFORMAT: Bash Variables. (line 752) -* TMOUT: Bash Variables. (line 791) -* TMPDIR: Bash Variables. (line 803) -* UID: Bash Variables. (line 807) +* TIMEFORMAT: Bash Variables. (line 755) +* TMOUT: Bash Variables. (line 794) +* TMPDIR: Bash Variables. (line 806) +* UID: Bash Variables. (line 810) * vi-cmd-mode-string: Readline Init File Syntax. (line 396) * vi-ins-mode-string: Readline Init File Syntax. @@ -13599,138 +13603,138 @@ D.5 Concept Index  Tag Table: -Node: Top901 -Node: Introduction2842 -Node: What is Bash?3055 -Node: What is a shell?4188 -Node: Definitions6798 -Node: Basic Shell Features10125 -Node: Shell Syntax11349 -Node: Shell Operation12376 -Node: Quoting13667 -Node: Escape Character15005 -Node: Single Quotes15540 -Node: Double Quotes15889 -Node: ANSI-C Quoting17234 -Node: Locale Translation18628 -Node: Creating Internationalized Scripts20031 -Node: Comments24229 -Node: Shell Commands24996 -Node: Reserved Words25935 -Node: Simple Commands26800 -Node: Pipelines27462 -Node: Lists30718 -Node: Compound Commands32590 -Node: Looping Constructs33599 -Node: Conditional Constructs36148 -Node: Command Grouping51218 -Node: Coprocesses52710 -Node: GNU Parallel55396 -Node: Shell Functions56314 -Node: Shell Parameters64762 -Node: Positional Parameters69663 -Node: Special Parameters70753 -Node: Shell Expansions74214 -Node: Brace Expansion76403 -Node: Tilde Expansion79739 -Node: Shell Parameter Expansion82694 -Node: Command Substitution103337 -Node: Arithmetic Expansion106866 -Node: Process Substitution108042 -Node: Word Splitting109150 -Node: Filename Expansion111594 -Node: Pattern Matching114818 -Node: Quote Removal120541 -Node: Redirections120845 -Node: Executing Commands131108 -Node: Simple Command Expansion131775 -Node: Command Search and Execution133883 -Node: Command Execution Environment136327 -Node: Environment139775 -Node: Exit Status141678 -Node: Signals143736 -Node: Shell Scripts148665 -Node: Shell Builtin Commands151963 -Node: Bourne Shell Builtins154074 -Node: Bash Builtins180644 -Node: Modifying Shell Behavior217568 -Node: The Set Builtin217910 -Node: The Shopt Builtin229904 -Node: Special Builtins246956 -Node: Shell Variables247945 -Node: Bourne Shell Variables248379 -Node: Bash Variables250887 -Node: Bash Features289792 -Node: Invoking Bash290806 -Node: Bash Startup Files297390 -Node: Interactive Shells302632 -Node: What is an Interactive Shell?303040 -Node: Is this Shell Interactive?303702 -Node: Interactive Shell Behavior304526 -Node: Bash Conditional Expressions308287 -Node: Shell Arithmetic313704 -Node: Aliases317033 -Node: Arrays320167 -Node: The Directory Stack327755 -Node: Directory Stack Builtins328552 -Node: Controlling the Prompt332997 -Node: The Restricted Shell335882 -Node: Bash POSIX Mode338764 -Node: Shell Compatibility Mode357121 -Node: Job Control366128 -Node: Job Control Basics366585 -Node: Job Control Builtins372953 -Node: Job Control Variables379635 -Node: Command Line Editing380866 -Node: Introduction and Notation382569 -Node: Readline Interaction384921 -Node: Readline Bare Essentials386109 -Node: Readline Movement Commands387917 -Node: Readline Killing Commands388913 -Node: Readline Arguments390936 -Node: Searching391993 -Node: Readline Init File394236 -Node: Readline Init File Syntax395539 -Node: Conditional Init Constructs422364 -Node: Sample Init File426749 -Node: Bindable Readline Commands429869 -Node: Commands For Moving431407 -Node: Commands For History433871 -Node: Commands For Text439261 -Node: Commands For Killing443386 -Node: Numeric Arguments446174 -Node: Commands For Completion447326 -Node: Keyboard Macros453022 -Node: Miscellaneous Commands453723 -Node: Readline vi Mode460290 -Node: Programmable Completion461267 -Node: Programmable Completion Builtins470004 -Node: A Programmable Completion Example481741 -Node: Using History Interactively487086 -Node: Bash History Facilities487767 -Node: Bash History Builtins491502 -Node: History Interaction497973 -Node: Event Designators502923 -Node: Word Designators504501 -Node: Modifiers506893 -Node: Installing Bash508830 -Node: Basic Installation509946 -Node: Compilers and Options513822 -Node: Compiling For Multiple Architectures514572 -Node: Installation Names516325 -Node: Specifying the System Type518559 -Node: Sharing Defaults519305 -Node: Operation Controls520019 -Node: Optional Features521038 -Node: Reporting Bugs533418 -Node: Major Differences From The Bourne Shell534775 -Node: GNU Free Documentation License556201 -Node: Indexes581378 -Node: Builtin Index581829 -Node: Reserved Word Index588927 -Node: Variable Index591372 -Node: Function Index608785 -Node: Concept Index622780 +Node: Top893 +Node: Introduction2826 +Node: What is Bash?3039 +Node: What is a shell?4172 +Node: Definitions6782 +Node: Basic Shell Features10109 +Node: Shell Syntax11333 +Node: Shell Operation12360 +Node: Quoting13651 +Node: Escape Character14989 +Node: Single Quotes15524 +Node: Double Quotes15873 +Node: ANSI-C Quoting17218 +Node: Locale Translation18612 +Node: Creating Internationalized Scripts20015 +Node: Comments24213 +Node: Shell Commands24980 +Node: Reserved Words25919 +Node: Simple Commands26784 +Node: Pipelines27446 +Node: Lists30702 +Node: Compound Commands32574 +Node: Looping Constructs33583 +Node: Conditional Constructs36132 +Node: Command Grouping51202 +Node: Coprocesses52694 +Node: GNU Parallel55380 +Node: Shell Functions56298 +Node: Shell Parameters64746 +Node: Positional Parameters69647 +Node: Special Parameters70737 +Node: Shell Expansions74198 +Node: Brace Expansion76387 +Node: Tilde Expansion79723 +Node: Shell Parameter Expansion82678 +Node: Command Substitution103321 +Node: Arithmetic Expansion106850 +Node: Process Substitution108026 +Node: Word Splitting109134 +Node: Filename Expansion111578 +Node: Pattern Matching114802 +Node: Quote Removal120525 +Node: Redirections120829 +Node: Executing Commands131092 +Node: Simple Command Expansion131759 +Node: Command Search and Execution133867 +Node: Command Execution Environment136311 +Node: Environment139759 +Node: Exit Status141662 +Node: Signals143720 +Node: Shell Scripts148649 +Node: Shell Builtin Commands151947 +Node: Bourne Shell Builtins154058 +Node: Bash Builtins180705 +Node: Modifying Shell Behavior217629 +Node: The Set Builtin217971 +Node: The Shopt Builtin229965 +Node: Special Builtins247017 +Node: Shell Variables248006 +Node: Bourne Shell Variables248440 +Node: Bash Variables250948 +Node: Bash Features290072 +Node: Invoking Bash291086 +Node: Bash Startup Files297670 +Node: Interactive Shells302912 +Node: What is an Interactive Shell?303320 +Node: Is this Shell Interactive?303982 +Node: Interactive Shell Behavior304806 +Node: Bash Conditional Expressions308567 +Node: Shell Arithmetic313984 +Node: Aliases317313 +Node: Arrays320447 +Node: The Directory Stack328035 +Node: Directory Stack Builtins328832 +Node: Controlling the Prompt333277 +Node: The Restricted Shell336162 +Node: Bash POSIX Mode339044 +Node: Shell Compatibility Mode357401 +Node: Job Control366408 +Node: Job Control Basics366865 +Node: Job Control Builtins373233 +Node: Job Control Variables379915 +Node: Command Line Editing381146 +Node: Introduction and Notation382849 +Node: Readline Interaction385201 +Node: Readline Bare Essentials386389 +Node: Readline Movement Commands388197 +Node: Readline Killing Commands389193 +Node: Readline Arguments391216 +Node: Searching392273 +Node: Readline Init File394516 +Node: Readline Init File Syntax395819 +Node: Conditional Init Constructs422644 +Node: Sample Init File427029 +Node: Bindable Readline Commands430149 +Node: Commands For Moving431687 +Node: Commands For History434151 +Node: Commands For Text439541 +Node: Commands For Killing443666 +Node: Numeric Arguments446454 +Node: Commands For Completion447606 +Node: Keyboard Macros453302 +Node: Miscellaneous Commands454003 +Node: Readline vi Mode460570 +Node: Programmable Completion461547 +Node: Programmable Completion Builtins470284 +Node: A Programmable Completion Example482021 +Node: Using History Interactively487366 +Node: Bash History Facilities488047 +Node: Bash History Builtins491782 +Node: History Interaction498253 +Node: Event Designators503203 +Node: Word Designators504781 +Node: Modifiers507173 +Node: Installing Bash509110 +Node: Basic Installation510226 +Node: Compilers and Options514102 +Node: Compiling For Multiple Architectures514852 +Node: Installation Names516605 +Node: Specifying the System Type518839 +Node: Sharing Defaults519585 +Node: Operation Controls520299 +Node: Optional Features521318 +Node: Reporting Bugs533698 +Node: Major Differences From The Bourne Shell535055 +Node: GNU Free Documentation License556481 +Node: Indexes581658 +Node: Builtin Index582109 +Node: Reserved Word Index589207 +Node: Variable Index591652 +Node: Function Index609065 +Node: Concept Index623060  End Tag Table diff --git a/doc/bash.pdf b/doc/bash.pdf index 75d9d704e..d9c80d938 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bashref.dvi b/doc/bashref.dvi index 7042cc245..bc0a1fba7 100644 Binary files a/doc/bashref.dvi and b/doc/bashref.dvi differ diff --git a/doc/bashref.html b/doc/bashref.html index eb4d54b89..2cc315067 100644 --- a/doc/bashref.html +++ b/doc/bashref.html @@ -4,9 +4,9 @@