From: Chet Ramey Date: Thu, 9 Jan 2025 21:13:16 +0000 (-0500) Subject: documentation updates; test suite updates to reduce extraneous diff output; don't... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ea356081dbfbac2c791f9b8072ed4b824e3d9df;p=thirdparty%2Fbash.git documentation updates; test suite updates to reduce extraneous diff output; don't export BASHOPTS into running tests --- diff --git a/CHANGES b/CHANGES index 4b826d0a..16cd0e35 100644 --- a/CHANGES +++ b/CHANGES @@ -152,7 +152,7 @@ l. There is a new `bash_source_fullpath' shopt option, which makes bash put at configure time. m. Posix mode now forces job notifications to occur when the new edition of - POSIX specifes (since it now specifies them). + POSIX specifies (since it now specifies them). n. Interactive shells don't print job notifications while sourcing scripts. @@ -325,7 +325,7 @@ vv. Fixed a bug that caused unset not to remove a function named a[b] if ww. Posix mode doesn't perform function lookup for function names containing a slash. -xx. <( and >( can now be used in funtion names. +xx. <( and >( can now be used in function names. yy. Fixed a bug that caused tilde expansion not to be performed on some array subscripts. @@ -451,7 +451,7 @@ oooo. If the cd builtin uses $OLDPWD, allow it to use $CDPATH if the user has set it to something that's not a full pathname. pppp. The test builtin only supports the optional argument to -t if parsing - an expression with more than four aguments and not in posix mode. + an expression with more than four arguments and not in posix mode. qqqq. Changes to filename quoting and rewriting to deal with NFC and NFD Unicode forms (primarily for macOS). @@ -618,7 +618,7 @@ a. Fixed a bug in clearing the visible line structure before redisplay. b. Fix a bug where setlocale(3) returning NULL caused a crash. c. Fixed signal checking in callback mode to handle signals that arrive before - readline restore's the application's signal handlers. + readline restores the application's signal handlers. d. Fixed a bug with word completion where the directory name needs to be dequoted and tilde-expanded. @@ -675,7 +675,7 @@ u. Call the filename rewrite hook on the word being completed before comparing strings. v. Fix infinite recursion that can happen if someone binds a key that doesn't - have a different upper and lower case represenation to do-lowercase-version. + have a different upper and lower case representation to do-lowercase-version. w. Check for non-ANSI (dumb) terminals a little more thoroughly. @@ -718,12 +718,12 @@ j. `trap' has a new -P option that prints the trap action associated with each signal argument. k. The `command' builtin preceding a declaration builtin (e.g., `declare') - preserves the special asisgnment statement parsing for the declation + preserves the special assignment statement parsing for the declation builtin. This is a new POSIX requirement. l. `printf' uses the `alternate form' for %q and %Q to force single quoting. -m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings +m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings and characters, respectively, when in a multibyte locale. n. The shell can be compiled with a different default value for the @@ -817,6 +817,8 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former case, anything bound to quoted-insert) to quote characters in the search string. +j. There is a new rl_print_keybinding function that prints the key bindings + for a single bindable function specified by name. ------------------------------------------------------------------------------ This document details the changes between this version, bash-5.2-release, and the previous version, bash-5.2-rc4. diff --git a/CHANGES-5.3 b/CHANGES-5.3 index 286c9ff9..806be742 100644 --- a/CHANGES-5.3 +++ b/CHANGES-5.3 @@ -152,7 +152,7 @@ l. There is a new `bash_source_fullpath' shopt option, which makes bash put at configure time. m. Posix mode now forces job notifications to occur when the new edition of - POSIX specifes (since it now specifies them). + POSIX specifies (since it now specifies them). n. Interactive shells don't print job notifications while sourcing scripts. @@ -325,7 +325,7 @@ vv. Fixed a bug that caused unset not to remove a function named a[b] if ww. Posix mode doesn't perform function lookup for function names containing a slash. -xx. <( and >( can now be used in funtion names. +xx. <( and >( can now be used in function names. yy. Fixed a bug that caused tilde expansion not to be performed on some array subscripts. @@ -451,7 +451,7 @@ oooo. If the cd builtin uses $OLDPWD, allow it to use $CDPATH if the user has set it to something that's not a full pathname. pppp. The test builtin only supports the optional argument to -t if parsing - an expression with more than four aguments and not in posix mode. + an expression with more than four arguments and not in posix mode. qqqq. Changes to filename quoting and rewriting to deal with NFC and NFD Unicode forms (primarily for macOS). @@ -618,7 +618,7 @@ a. Fixed a bug in clearing the visible line structure before redisplay. b. Fix a bug where setlocale(3) returning NULL caused a crash. c. Fixed signal checking in callback mode to handle signals that arrive before - readline restore's the application's signal handlers. + readline restores the application's signal handlers. d. Fixed a bug with word completion where the directory name needs to be dequoted and tilde-expanded. @@ -675,7 +675,7 @@ u. Call the filename rewrite hook on the word being completed before comparing strings. v. Fix infinite recursion that can happen if someone binds a key that doesn't - have a different upper and lower case represenation to do-lowercase-version. + have a different upper and lower case representation to do-lowercase-version. w. Check for non-ANSI (dumb) terminals a little more thoroughly. @@ -718,12 +718,12 @@ j. `trap' has a new -P option that prints the trap action associated with each signal argument. k. The `command' builtin preceding a declaration builtin (e.g., `declare') - preserves the special asisgnment statement parsing for the declation + preserves the special asisgnment statement parsing for the declaration builtin. This is a new POSIX requirement. l. `printf' uses the `alternate form' for %q and %Q to force single quoting. -m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings +m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings and characters, respectively, when in a multibyte locale. n. The shell can be compiled with a different default value for the @@ -816,3 +816,6 @@ h. execute-named-command: a new bindable command that reads the name of a i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former case, anything bound to quoted-insert) to quote characters in the search string. + +j. There is a new rl_print_keybinding function that prints the key bindings + for a single bindable function specified by name. diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 20d8bb32..d5c1792e 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -10790,3 +10790,9 @@ lib/readline/util.c tests/printf7.sub,tests/cond-regexp2.sub - accommodate different error messages across different systems + + 1/2/2025 + -------- +tests/run-all, tests/run-minimal + - BASHOPTS: unset or unexport as appropriate, same as SHELLOPTS + From a report by Martin D Kealey diff --git a/NEWS b/NEWS index 3bd189d7..41aecda2 100644 --- a/NEWS +++ b/NEWS @@ -29,12 +29,12 @@ j. `trap' has a new -P option that prints the trap action associated with each signal argument. k. The `command' builtin preceding a declaration builtin (e.g., `declare') - preserves the special asisgnment statement parsing for the declation + preserves the special asisgnment statement parsing for the declaration builtin. This is a new POSIX requirement. l. `printf' uses the `alternate form' for %q and %Q to force single quoting. -m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings +m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings and characters, respectively, when in a multibyte locale. n. The shell can be compiled with a different default value for the @@ -129,7 +129,7 @@ pp. There is a new `bash_source_fullpath' shopt option, which makes bash put at configure time. qq. Posix mode now forces job notifications to occur when the new edition of - POSIX specifes (since it now specifies them). + POSIX specifies (since it now specifies them). rr. Interactive shells don't print job notifications while sourcing scripts. @@ -175,16 +175,19 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former case, anything bound to quoted-insert) to quote characters in the search string. -j. Documentation has been significantly updated. +j. There is a new rl_print_keybinding function that prints the key bindings + for a single bindable function specified by name. -k. New `force-meta-prefix' bindable variable, which forces the use of ESC as +k. Documentation has been significantly updated. + +l. New `force-meta-prefix' bindable variable, which forces the use of ESC as the meta prefix when using "\M-" in key bindings instead of overloading convert-meta. -l. The default value for `readline-colored-completion-prefix' no longer has a +m. The default value for `readline-colored-completion-prefix' no longer has a leading `.'; the original report was based on a misunderstanding. -m. There is a new bindable command, `export-completions', which writes the +n. There is a new bindable command, `export-completions', which writes the possible completions for a word to the standard output in a defined format. ------------------------------------------------------------------------------- diff --git a/NEWS-5.3 b/NEWS-5.3 index 1d2f647d..f143571f 100644 --- a/NEWS-5.3 +++ b/NEWS-5.3 @@ -29,12 +29,12 @@ j. `trap' has a new -P option that prints the trap action associated with each signal argument. k. The `command' builtin preceding a declaration builtin (e.g., `declare') - preserves the special asisgnment statement parsing for the declation + preserves the special asisgnment statement parsing for the declaration builtin. This is a new POSIX requirement. l. `printf' uses the `alternate form' for %q and %Q to force single quoting. -m. `printf' now interprets %ls (%S) and %lc (%C)nas referring to wide strings +m. `printf' now interprets %ls (%S) and %lc (%C) as referring to wide strings and characters, respectively, when in a multibyte locale. n. The shell can be compiled with a different default value for the @@ -129,7 +129,7 @@ pp. There is a new `bash_source_fullpath' shopt option, which makes bash put at configure time. qq. Posix mode now forces job notifications to occur when the new edition of - POSIX specifes (since it now specifies them). + POSIX specifies (since it now specifies them). rr. Interactive shells don't print job notifications while sourcing scripts. @@ -175,14 +175,17 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former case, anything bound to quoted-insert) to quote characters in the search string. -j. Documentation has been significantly updated. +j. There is a new rl_print_keybinding function that prints the key bindings + for a single bindable function specified by name. -k. New `force-meta-prefix' bindable variable, which forces the use of ESC as +k. Documentation has been significantly updated. + +l. New `force-meta-prefix' bindable variable, which forces the use of ESC as the meta prefix when using "\M-" in key bindings instead of overloading convert-meta. -l. The default value for `readline-colored-completion-prefix' no longer has a +m. The default value for `readline-colored-completion-prefix' no longer has a leading `.'; the original report was based on a misunderstanding. -m. There is a new bindable command, `export-completions', which writes the +n. There is a new bindable command, `export-completions', which writes the possible completions for a word to the standard output in a defined format. diff --git a/doc/bash.0 b/doc/bash.0 index d8aa1ad2..9cb764df 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -7,29 +7,34 @@ SSYYNNOOPPSSIISS bbaasshh [options] [command_string | file] CCOOPPYYRRIIGGHHTT - Bash is Copyright (C) 1989-2024 by the Free Software Foundation, Inc. + Bash is Copyright (C) 1989-2025 by the Free Software Foundation, Inc. DDEESSCCRRIIPPTTIIOONN - BBaasshh is an sshh-compatible command language interpreter that executes - commands read from the standard input, from a string, or from a file. - BBaasshh also incorporates useful features from the _K_o_r_n and _C shells (kksshh - and ccsshh). - - POSIX is the name for a family of computing standards based on Unix. - BBaasshh is intended to be a conformant implementation of the Shell and - Utilities portion of the IEEE POSIX specification (IEEE Standard - 1003.1). BBaasshh can be configured to be POSIX-conformant by default. + BBaasshh is a command language interpreter that executes commands read from + the standard input, from a string, or from a file. It is a reimplemen- + tation and extension of the Bourne shell, the historical Unix command + language interpreter. BBaasshh also incorporates useful features from the + _K_o_r_n and _C shells (kksshh and ccsshh). + + POSIX is the name for a family of computing standards based on Unix. + BBaasshh is intended to be a conformant implementation of the Shell and + Utilities portion of the IEEE POSIX specification (IEEE Standard + 1003.1). BBaasshh POSIX mode (hereafter referred to as _p_o_s_i_x _m_o_d_e) changes + the shell's behavior where its default operation differs from the stan- + dard to strictly conform to the standard. See SSEEEE AALLSSOO below for a + reference to a document that details how posix mode affects bbaasshh's be- + havior. BBaasshh can be configured to be POSIX-conformant by default. OOPPTTIIOONNSS All of the single-character shell options documented in the description - of the sseett builtin command, including --oo, can be used as options when - the shell is invoked. In addition, bbaasshh interprets the following op- + of the sseett builtin command, including --oo, can be used as options when + the shell is invoked. In addition, bbaasshh interprets the following op- tions when it is invoked: - --cc If the --cc option is present, then commands are read from the + --cc If the --cc option is present, then commands are read from the first non-option argument _c_o_m_m_a_n_d___s_t_r_i_n_g. If there are argu- - ments after the _c_o_m_m_a_n_d___s_t_r_i_n_g, the first argument is as- - signed to $$00 and any remaining arguments are assigned to the + ments after the _c_o_m_m_a_n_d___s_t_r_i_n_g, the first argument is as- + signed to $$00 and any remaining arguments are assigned to the positional parameters. The assignment to $$00 sets the name of the shell, which is used in warning and error messages. @@ -38,72 +43,72 @@ OOPPTTIIOONNSS --ll Make bbaasshh act as if it had been invoked as a login shell (see IINNVVOOCCAATTIIOONN below). - --rr If the --rr option is present, the shell becomes _r_e_s_t_r_i_c_t_e_d + --rr If the --rr option is present, the shell becomes _r_e_s_t_r_i_c_t_e_d (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). - --ss If the --ss option is present, or if no arguments remain after + --ss If the --ss option is present, or if no arguments remain after option processing, the shell reads commands from the standard - input. This option allows the positional parameters to be - set when invoking an interactive shell or when reading input + input. This option allows the positional parameters to be + set when invoking an interactive shell or when reading input through a pipe. - --DD Print a list of all double-quoted strings preceded by $$ on - the standard output. These are the strings that are subject - to language translation when the current locale is not CC or - PPOOSSIIXX. This implies the --nn option; no commands will be exe- + --DD Print a list of all double-quoted strings preceded by $$ on + the standard output. These are the strings that are subject + to language translation when the current locale is not CC or + PPOOSSIIXX. This implies the --nn option; no commands will be exe- cuted. [[--++]]OO [[_s_h_o_p_t___o_p_t_i_o_n]] - _s_h_o_p_t___o_p_t_i_o_n is one of the shell options accepted by the - sshhoopptt builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). If + _s_h_o_p_t___o_p_t_i_o_n is one of the shell options accepted by the + sshhoopptt builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). If _s_h_o_p_t___o_p_t_i_o_n is present, --OO sets the value of that option; ++OO - unsets it. If _s_h_o_p_t___o_p_t_i_o_n is not supplied, bbaasshh prints the - names and values of the shell options accepted by sshhoopptt on - the standard output. If the invocation option is ++OO, the + unsets it. If _s_h_o_p_t___o_p_t_i_o_n is not supplied, bbaasshh prints the + names and values of the shell options accepted by sshhoopptt on + the standard output. If the invocation option is ++OO, the output is displayed in a format that may be reused as input. - ---- A ---- signals the end of options and disables further option - processing. Any arguments after the ---- are treated as a - shell script filename (see below) and arguments passed to + ---- A ---- signals the end of options and disables further option + processing. Any arguments after the ---- are treated as a + shell script filename (see below) and arguments passed to that script. An argument of -- is equivalent to ----. - BBaasshh also interprets a number of multi-character options. These op- - tions must appear on the command line before the single-character op- + BBaasshh also interprets a number of multi-character options. These op- + tions must appear on the command line before the single-character op- tions to be recognized. ----ddeebbuuggggeerr Arrange for the debugger profile to be executed before the shell - starts. Turns on extended debugging mode (see the description + starts. Turns on extended debugging mode (see the description of the eexxttddeebbuugg option to the sshhoopptt builtin below). ----dduummpp--ppoo--ssttrriinnggss - Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t "po" + Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t "po" (portable object) file format. ----dduummpp--ssttrriinnggss Equivalent to --DD. - ----hheellpp Display a usage message on standard output and exit success- + ----hheellpp Display a usage message on standard output and exit success- fully. ----iinniitt--ffiillee _f_i_l_e ----rrccffiillee _f_i_l_e Execute commands from _f_i_l_e instead of the standard personal ini- - tialization file _~_/_._b_a_s_h_r_c if the shell is interactive (see IINN-- + tialization file _~_/_._b_a_s_h_r_c if the shell is interactive (see IINN-- VVOOCCAATTIIOONN below). ----llooggiinn Equivalent to --ll. ----nnooeeddiittiinngg - Do not use the GNU rreeaaddlliinnee library to read command lines when + Do not use the GNU rreeaaddlliinnee library to read command lines when the shell is interactive. ----nnoopprrooffiillee - Do not read either the system-wide startup file _/_e_t_c_/_p_r_o_f_i_l_e or - any of the personal initialization files _~_/_._b_a_s_h___p_r_o_f_i_l_e, - _~_/_._b_a_s_h___l_o_g_i_n, or _~_/_._p_r_o_f_i_l_e. By default, bbaasshh reads these - files when it is invoked as a login shell (see IINNVVOOCCAATTIIOONN be- + Do not read either the system-wide startup file _/_e_t_c_/_p_r_o_f_i_l_e or + any of the personal initialization files _~_/_._b_a_s_h___p_r_o_f_i_l_e, + _~_/_._b_a_s_h___l_o_g_i_n, or _~_/_._p_r_o_f_i_l_e. By default, bbaasshh reads these + files when it is invoked as a login shell (see IINNVVOOCCAATTIIOONN be- low). ----nnoorrcc Do not read and execute the personal initialization file @@ -111,10 +116,8 @@ OOPPTTIIOONNSS fault if the shell is invoked as sshh. ----ppoossiixx - Change the behavior of bbaasshh where the default operation differs - from the POSIX standard to match the standard (_p_o_s_i_x _m_o_d_e). See - SSEEEE AALLSSOO below for a reference to a document that details how - posix mode affects BBaasshh's behavior. + Enable posix mode; change the behavior of bbaasshh where the default + operation differs from the POSIX standard to match the standard. ----rreessttrriicctteedd The shell becomes restricted (see RREESSTTRRIICCTTEEDD SSHHEELLLL below). @@ -123,58 +126,58 @@ OOPPTTIIOONNSS Equivalent to --vv. ----vveerrssiioonn - Show version information for this instance of bbaasshh on the stan- + Show version information for this instance of bbaasshh on the stan- dard output and exit successfully. AARRGGUUMMEENNTTSS If arguments remain after option processing, and neither the --cc nor the - --ss option has been supplied, the first argument is assumed to be the - name of a file containing shell commands (a _s_h_e_l_l _s_c_r_i_p_t). If bbaasshh is - invoked in this fashion, $$00 is set to the name of the file, and the po- - sitional parameters are set to the remaining arguments. BBaasshh reads and - executes commands from this file, then exits. BBaasshh's exit status is + --ss option has been supplied, the first argument is treated as the name + of a file containing shell commands (a _s_h_e_l_l _s_c_r_i_p_t). When bbaasshh is in- + voked in this fashion, $$00 is set to the name of the file, and the posi- + tional parameters are set to the remaining arguments. BBaasshh reads and + executes commands from this file, then exits. BBaasshh's exit status is the exit status of the last command executed in the script. If no com- - mands are executed, the exit status is 0. Bash first attempts to open - the file in the current directory, and, if no file is found, then - searches the directories in PPAATTHH for the script. + mands are executed, the exit status is 0. BBaasshh first attempts to open + the file in the current directory, and, if no file is found, searches + the directories in PPAATTHH for the script. IINNVVOOCCAATTIIOONN - A _l_o_g_i_n _s_h_e_l_l is one whose first character of argument zero is a --, or + A _l_o_g_i_n _s_h_e_l_l is one whose first character of argument zero is a --, or one started with the ----llooggiinn option. - An _i_n_t_e_r_a_c_t_i_v_e shell is one started without non-option arguments (un- - less --ss is specified) and without the --cc option, whose standard input - and standard error are both connected to terminals (as determined by - _i_s_a_t_t_y(3)), or one started with the --ii option. BBaasshh sets PPSS11 and $$-- - includes ii if the shell is interactive, so a shell script or a startup + An _i_n_t_e_r_a_c_t_i_v_e _s_h_e_l_l is one started without non-option arguments (un- + less --ss is specified) and without the --cc option, and whose standard in- + put and standard error are both connected to terminals (as determined + by _i_s_a_t_t_y(3)), or one started with the --ii option. BBaasshh sets PPSS11 and $$-- + includes ii if the shell is interactive, so a shell script or a startup file can test this state. - The following paragraphs describe how bbaasshh executes its startup files. - If any of the files exist but cannot be read, bbaasshh reports an error. - Tildes are expanded in filenames as described below under TTiillddee EExxppaann-- + The following paragraphs describe how bbaasshh executes its startup files. + If any of the files exist but cannot be read, bbaasshh reports an error. + Tildes are expanded in filenames as described below under TTiillddee EExxppaann-- ssiioonn in the EEXXPPAANNSSIIOONN section. - When bbaasshh is invoked as an interactive login shell, or as a non-inter- - active shell with the ----llooggiinn option, it first reads and executes com- - mands from the file _/_e_t_c_/_p_r_o_f_i_l_e, if that file exists. After reading + When bbaasshh is invoked as an interactive login shell, or as a non-inter- + active shell with the ----llooggiinn option, it first reads and executes com- + mands from the file _/_e_t_c_/_p_r_o_f_i_l_e, if that file exists. After reading that file, it looks for _~_/_._b_a_s_h___p_r_o_f_i_l_e, _~_/_._b_a_s_h___l_o_g_i_n, and _~_/_._p_r_o_f_i_l_e, - in that order, and reads and executes commands from the first one that - exists and is readable. The ----nnoopprrooffiillee option may be used when the + in that order, and reads and executes commands from the first one that + exists and is readable. The ----nnoopprrooffiillee option may be used when the shell is started to inhibit this behavior. When an interactive login shell exits, or a non-interactive login shell - executes the eexxiitt builtin command, bbaasshh reads and executes commands + executes the eexxiitt builtin command, bbaasshh reads and executes commands from the file _~_/_._b_a_s_h___l_o_g_o_u_t, if it exists. - When an interactive shell that is not a login shell is started, bbaasshh - reads and executes commands from _~_/_._b_a_s_h_r_c, if that file exists. The - ----nnoorrcc option inhibits this behavior. The ----rrccffiillee _f_i_l_e option causes + When an interactive shell that is not a login shell is started, bbaasshh + reads and executes commands from _~_/_._b_a_s_h_r_c, if that file exists. The + ----nnoorrcc option inhibits this behavior. The ----rrccffiillee _f_i_l_e option causes bbaasshh to use _f_i_l_e instead of _~_/_._b_a_s_h_r_c. - When bbaasshh is started non-interactively, to run a shell script, for ex- - ample, it looks for the variable BBAASSHH__EENNVV in the environment, expands - its value if it appears there, and uses the expanded value as the name - of a file to read and execute. BBaasshh behaves as if the following com- + When bbaasshh is started non-interactively, to run a shell script, for ex- + ample, it looks for the variable BBAASSHH__EENNVV in the environment, expands + its value if it appears there, and uses the expanded value as the name + of a file to read and execute. BBaasshh behaves as if the following com- mand were executed: if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi @@ -182,60 +185,62 @@ IINNVVOOCCAATTIIOONN but does not use the value of the PPAATTHH variable to search for the file- name. - If bbaasshh is invoked with the name sshh, it tries to mimic the startup be- - havior of historical versions of sshh as closely as possible, while con- - forming to the POSIX standard as well. When invoked as an interactive - login shell, or a non-interactive shell with the ----llooggiinn option, it - first attempts to read and execute commands from _/_e_t_c_/_p_r_o_f_i_l_e and + If bbaasshh is invoked with the name sshh, it tries to mimic the startup be- + havior of historical versions of sshh as closely as possible, while con- + forming to the POSIX standard as well. When invoked as an interactive + login shell, or a non-interactive shell with the ----llooggiinn option, it + first attempts to read and execute commands from _/_e_t_c_/_p_r_o_f_i_l_e and _~_/_._p_r_o_f_i_l_e, in that order. The ----nnoopprrooffiillee option inhibits this behav- ior. When invoked as an interactive shell with the name sshh, bbaasshh looks - for the variable EENNVV, expands its value if it is defined, and uses the - expanded value as the name of a file to read and execute. Since a - shell invoked as sshh does not attempt to read and execute commands from - any other startup files, the ----rrccffiillee option has no effect. A non-in- - teractive shell invoked with the name sshh does not attempt to read any - other startup files. When invoked as sshh, bbaasshh enters posix mode after - reading the startup files. - - When bbaasshh is started in posix mode, as with the ----ppoossiixx command line + for the variable EENNVV, expands its value if it is defined, and uses the + expanded value as the name of a file to read and execute. Since a + shell invoked as sshh does not attempt to read and execute commands from + any other startup files, the ----rrccffiillee option has no effect. A non-in- + teractive shell invoked with the name sshh does not attempt to read any + other startup files. + + When invoked as sshh, bbaasshh enters posix mode after reading the startup + files. + + When bbaasshh is started in posix mode, as with the ----ppoossiixx command line option, it follows the POSIX standard for startup files. In this mode, - interactive shells expand the EENNVV variable and read and execute com- + interactive shells expand the EENNVV variable and read and execute com- mands from the file whose name is the expanded value. No other startup files are read. BBaasshh attempts to determine when it is being run with its standard input - connected to a network connection, as when executed by the historical - and rarely-seen remote shell daemon, usually _r_s_h_d, or the secure shell - daemon _s_s_h_d. If bbaasshh determines it is being run non-interactively in - this fashion, it reads and executes commands from _~_/_._b_a_s_h_r_c, if that - file exists and is readable. BBaasshh does not read this file if invoked - as sshh. The ----nnoorrcc option inhibits this behavior, and the ----rrccffiillee op- - tion makes bbaasshh use a different file instead of _~_/_._b_a_s_h_r_c, but neither - _r_s_h_d nor _s_s_h_d generally invoke the shell with those options or allow + connected to a network connection, as when executed by the historical + and rarely-seen remote shell daemon, usually _r_s_h_d, or the secure shell + daemon _s_s_h_d. If bbaasshh determines it is being run non-interactively in + this fashion, it reads and executes commands from _~_/_._b_a_s_h_r_c, if that + file exists and is readable. BBaasshh does not read this file if invoked + as sshh. The ----nnoorrcc option inhibits this behavior, and the ----rrccffiillee op- + tion makes bbaasshh use a different file instead of _~_/_._b_a_s_h_r_c, but neither + _r_s_h_d nor _s_s_h_d generally invoke the shell with those options or allow them to be specified. 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, no startup files are read, shell functions are not inherited from the environment, - the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- - pear in the environment, are ignored, and the effective user id is set - to the real user id. If the --pp option is supplied at invocation, the + the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- + pear in the environment, are ignored, and the effective user id is set + to the real user id. If the --pp option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset. DDEEFFIINNIITTIIOONNSS - The following definitions are used throughout the rest of this docu- + The following definitions are used throughout the rest of this docu- ment. bbllaannkk A space or tab. wwhhiitteessppaaccee - A character belonging to the ssppaaccee character class in the cur- + A character belonging to the ssppaaccee character class in the cur- rent locale, or for which _i_s_s_p_a_c_e(3) returns true. - wwoorrdd A sequence of characters considered as a single unit by the + wwoorrdd A sequence of characters considered as a single unit by the shell. Also known as a ttookkeenn. - nnaammee A _w_o_r_d consisting only of alphanumeric characters and under- - scores, and beginning with an alphabetic character or an under- + nnaammee A _w_o_r_d consisting only of alphanumeric characters and under- + scores, and beginning with an alphabetic character or an under- score. Also referred to as an iiddeennttiiffiieerr. mmeettaacchhaarraacctteerr - A character that, when unquoted, separates words. One of the + A character that, when unquoted, separates words. One of the following: || && ;; (( )) << >> ssppaaccee ttaabb nneewwlliinnee ccoonnttrrooll ooppeerraattoorr @@ -246,204 +251,204 @@ DDEEFFIINNIITTIIOONNSS RREESSEERRVVEEDD WWOORRDDSS _R_e_s_e_r_v_e_d _w_o_r_d_s are words that have a special meaning to the shell. The following words are recognized as reserved when unquoted and either the - first word of a command (see SSHHEELLLL GGRRAAMMMMAARR below), the third word of a - ccaassee or sseelleecctt command (only iinn is valid), or the third word of a ffoorr + first word of a command (see SSHHEELLLL GGRRAAMMMMAARR below), the third word of a + ccaassee or sseelleecctt command (only iinn is valid), or the third word of a ffoorr command (only iinn and ddoo are valid): - !! ccaassee ccoopprroocc ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt + !! ccaassee ccoopprroocc ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt tthheenn uunnttiill wwhhiillee {{ }} ttiimmee [[[[ ]]]] SSHHEELLLL GGRRAAMMMMAARR - This section describes the syntax of the various forms of shell com- + This section describes the syntax of the various forms of shell com- mands. SSiimmppllee CCoommmmaannddss - A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- - lowed by bbllaannkk-separated words and redirections, and terminated by a + A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- + lowed by bbllaannkk-separated words and redirections, and terminated by a _c_o_n_t_r_o_l _o_p_e_r_a_t_o_r. The first word specifies the command to be executed, - and is passed as argument zero. The remaining words are passed as ar- + and is passed as argument zero. The remaining words are passed as ar- guments to the invoked command. - The return value of a _s_i_m_p_l_e _c_o_m_m_a_n_d is its exit status, or 128+_n if + The return value of a _s_i_m_p_l_e _c_o_m_m_a_n_d is its exit status, or 128+_n if the command is terminated by signal _n. PPiippeelliinneess - A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by one of + A _p_i_p_e_l_i_n_e is a sequence of one or more commands separated by one of the control operators || or ||&&. The format for a pipeline is: [ttiimmee [--pp]] [ ! ] _c_o_m_m_a_n_d_1 [ [|||||&&] _c_o_m_m_a_n_d_2 ... ] The standard output of _c_o_m_m_a_n_d_1 is connected via a pipe to the standard - input of _c_o_m_m_a_n_d_2. This connection is performed before any redirec- - tions specified by the _c_o_m_m_a_n_d_1(see RREEDDIIRREECCTTIIOONN below). If ||&& is the - pipeline operator, _c_o_m_m_a_n_d_1's standard error, in addition to its stan- - dard output, is connected to _c_o_m_m_a_n_d_2's standard input through the - pipe; it is shorthand for 22>>&&11 ||. This implicit redirection of the - standard error to the standard output is performed after any redirec- + input of _c_o_m_m_a_n_d_2. This connection is performed before any redirec- + tions specified by the _c_o_m_m_a_n_d_1(see RREEDDIIRREECCTTIIOONN below). If ||&& is the + pipeline operator, _c_o_m_m_a_n_d_1's standard error, in addition to its stan- + dard output, is connected to _c_o_m_m_a_n_d_2's standard input through the + pipe; it is shorthand for 22>>&&11 ||. This implicit redirection of the + standard error to the standard output is performed after any redirec- tions specified by _c_o_m_m_a_n_d_1. The return status of a pipeline is the exit status of the last command, - unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the - pipeline's return status is the value of the last (rightmost) command - to exit with a non-zero status, or zero if all commands exit success- + unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the + pipeline's return status is the value of the last (rightmost) command + to exit with a non-zero status, or zero if all commands exit success- fully. If the reserved word !! precedes a pipeline, the exit status of - that pipeline is the logical negation of the exit status as described - above. If a pipeline is executed synchronously, the shell waits for + that pipeline is the logical negation of the exit status as described + above. If a pipeline is executed synchronously, the shell waits for all commands in the pipeline to terminate before returning a value. - If the ttiimmee reserved word precedes a pipeline, the shell reports the - elapsed as well as user and system time consumed by its execution when - the pipeline terminates. The --pp option changes the output format to - that specified by POSIX. When the shell is in posix mode, it does not - recognize ttiimmee as a reserved word if the next token begins with a "-". - The value of the TTIIMMEEFFOORRMMAATT variable is a format string that specifies - how the timing information should be displayed; see the description of + If the ttiimmee reserved word precedes a pipeline, the shell reports the + elapsed as well as user and system time consumed by its execution when + the pipeline terminates. The --pp option changes the output format to + that specified by POSIX. When the shell is in posix mode, it does not + recognize ttiimmee as a reserved word if the next token begins with a "-". + The value of the TTIIMMEEFFOORRMMAATT variable is a format string that specifies + how the timing information should be displayed; see the description of TTIIMMEEFFOORRMMAATT below under SShheellll VVaarriiaabblleess. - When the shell is in posix mode, ttiimmee may appear by itself as the only - word in a simple command. In this case, the shell displays the total + When the shell is in posix mode, ttiimmee may appear by itself as the only + word in a simple command. In this case, the shell displays the total user and system time consumed by the shell and its children. The TTIIMMEE-- FFOORRMMAATT variable specifies the format of the time information. - Each command in a multi-command pipeline, where pipes are created, is - executed in a _s_u_b_s_h_e_l_l, which is a separate process. See CCOOMMMMAANNDD EEXXEE-- - CCUUTTIIOONN EENNVVIIRROONNMMEENNTT for a description of subshells and a subshell envi- - ronment. If the llaassttppiippee option is enabled using the sshhoopptt builtin - (see the description of sshhoopptt below), and job control is not active, + Each command in a multi-command pipeline, where pipes are created, is + executed in a _s_u_b_s_h_e_l_l, which is a separate process. See CCOOMMMMAANNDD EEXXEE-- + CCUUTTIIOONN EENNVVIIRROONNMMEENNTT for a description of subshells and a subshell envi- + ronment. If the llaassttppiippee option is enabled using the sshhoopptt builtin + (see the description of sshhoopptt below), and job control is not active, the last element of a pipeline may be run by the shell process. LLiissttss - A _l_i_s_t is a sequence of one or more pipelines separated by one of the + A _l_i_s_t is a sequence of one or more pipelines separated by one of the operators ;;, &&, &&&&, or ||||, and optionally terminated by one of ;;, &&, or <>. Of these list operators, &&&& and |||| have equal precedence, followed by ;; and &&, which have equal precedence. - A sequence of one or more newlines may appear in a _l_i_s_t instead of a + A sequence of one or more newlines may appear in a _l_i_s_t instead of a semicolon to delimit commands. - If a command is terminated by the control operator &&, the shell exe- - cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not - wait for the command to finish, and the return status is 0. These are - referred to as _a_s_y_n_c_h_r_o_n_o_u_s commands. Commands separated by a ;; are + If a command is terminated by the control operator &&, the shell exe- + cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not + wait for the command to finish, and the return status is 0. These are + referred to as _a_s_y_n_c_h_r_o_n_o_u_s commands. Commands separated by a ;; are executed sequentially; the shell waits for each command to terminate in - turn. The return status is the exit status of the last command exe- + turn. The return status is the exit status of the last command exe- cuted. - AND and OR lists are sequences of one or more pipelines separated by - the &&&& and |||| control operators, respectively. AND and OR lists are + AND and OR lists are sequences of one or more pipelines separated by + the &&&& and |||| control operators, respectively. AND and OR lists are executed with left associativity. An AND list has the form _c_o_m_m_a_n_d_1 &&&& _c_o_m_m_a_n_d_2 - _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns an exit status of zero (success). An OR list has the form _c_o_m_m_a_n_d_1 |||| _c_o_m_m_a_n_d_2 - _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns a non-zero exit - status. The return status of AND and OR lists is the exit status of + _c_o_m_m_a_n_d_2 is executed if, and only if, _c_o_m_m_a_n_d_1 returns a non-zero exit + status. The return status of AND and OR lists is the exit status of the last command executed in the list. CCoommppoouunndd CCoommmmaannddss - A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a - command's description may be separated from the rest of the command by - one or more newlines, and may be followed by a newline in place of a + A _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d is one of the following. In most cases a _l_i_s_t in a + command's description may be separated from the rest of the command by + one or more newlines, and may be followed by a newline in place of a semicolon. - (_l_i_s_t) _l_i_s_t is executed in a subshell (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONN-- - MMEENNTT below for a description of a subshell environment). Vari- - able assignments and builtin commands that affect the shell's + (_l_i_s_t) _l_i_s_t is executed in a subshell (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONN-- + MMEENNTT below for a description of a subshell environment). Vari- + able assignments and builtin commands that affect the shell's environment do not remain in effect after the command completes. The return status is the exit status of _l_i_s_t. { _l_i_s_t; } _l_i_s_t is executed in the current shell environment. _l_i_s_t must be - terminated with a newline or semicolon. This is known as a + terminated with a newline or semicolon. This is known as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of _l_i_s_t. - Note that unlike the metacharacters (( and )), {{ and }} are _r_e_- - _s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted - to be recognized. Since they do not cause a word break, they - must be separated from _l_i_s_t by whitespace or another shell + Note that unlike the metacharacters (( and )), {{ and }} are _r_e_- + _s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell metacharacter. ((_e_x_p_r_e_s_s_i_o_n)) - The arithmetic _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules - described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of - the expression is non-zero, the return status is 0; otherwise - the return status is 1. The _e_x_p_r_e_s_s_i_o_n undergoes the same ex- - pansions as if it were within double quotes, but double quote - characters in _e_x_p_r_e_s_s_i_o_n are not treated specially and are re- + The arithmetic _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules + described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of + the expression is non-zero, the return status is 0; otherwise + the return status is 1. The _e_x_p_r_e_s_s_i_o_n undergoes the same ex- + pansions as if it were within double quotes, but double quote + characters in _e_x_p_r_e_s_s_i_o_n are not treated specially and are re- moved. [[[[ _e_x_p_r_e_s_s_i_o_n ]]]] Evaluate the conditional expression _e_x_p_r_e_s_s_i_o_n and return a sta- - tus of zero (true) or non-zero (false). Expressions are com- + tus of zero (true) or non-zero (false). Expressions are com- posed of the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- - SSIIOONNSS. The words between the [[[[ and ]]]] do not undergo word - splitting and pathname expansion. The shell performs tilde ex- + SSIIOONNSS. The words between the [[[[ and ]]]] do not undergo word + splitting and pathname expansion. The shell performs tilde ex- pansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on - those words. Conditional operators such as --ff must be unquoted + those words. Conditional operators such as --ff must be unquoted to be recognized as primaries. - When used with [[[[, the << and >> operators sort lexicographically + When used with [[[[, the << and >> operators sort lexicographically using the current locale. - When the ==== and !!== operators are used, the string to the right + When the ==== and !!== operators are used, the string to the right of the operator is considered a pattern and matched according to the rules described below under PPaatttteerrnn MMaattcchhiinngg, as if the eexxtt-- gglloobb shell option were enabled. The == operator is equivalent to - ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is - performed without regard to the case of alphabetic characters. - The return value is 0 if the string matches (====) or does not - match (!!==) the pattern, and 1 otherwise. If any part of the - pattern is quoted, the quoted portion is matched as a string: + ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is + performed without regard to the case of alphabetic characters. + The return value is 0 if the string matches (====) or does not + match (!!==) the pattern, and 1 otherwise. If any part of the + pattern is quoted, the quoted portion is matched as a string: every character in the quoted portion matches itself, instead of having any special pattern matching meaning. - An additional binary operator, ==~~, is available, with the same - precedence as ==== and !!==. When it is used, the string to the + An additional binary operator, ==~~, is available, with the same + precedence as ==== and !!==. When it is used, the string to the right of the operator is considered a POSIX extended regular ex- - pression and matched accordingly (using the POSIX _r_e_g_c_o_m_p and - _r_e_g_e_x_e_c interfaces usually described in _r_e_g_e_x(3)). The return - value is 0 if the string matches the pattern, and 1 otherwise. + pression and matched accordingly (using the POSIX _r_e_g_c_o_m_p and + _r_e_g_e_x_e_c interfaces usually described in _r_e_g_e_x(3)). The return + value is 0 if the string matches the pattern, and 1 otherwise. If the regular expression is syntactically incorrect, the condi- tional expression's return value is 2. If the nnooccaasseemmaattcchh shell - option is enabled, the match is performed without regard to the + option is enabled, the match is performed without regard to the case of alphabetic characters. - If any part of the pattern is quoted, the quoted portion is - matched literally, as above. If the pattern is stored in a + If any part of the pattern is quoted, the quoted portion is + matched literally, as above. If the pattern is stored in a shell variable, quoting the variable expansion forces the entire - pattern to be matched literally. Treat bracket expressions in - regular expressions carefully, since normal quoting and pattern + pattern to be matched literally. Treat bracket expressions in + regular expressions carefully, since normal quoting and pattern characters lose their meanings between brackets. - The match succeeds if the pattern matches any part of the + The match succeeds if the pattern matches any part of the string. Anchor the pattern using the ^^ and $$ regular expression operators to force it to match the entire string. - The array variable BBAASSHH__RREEMMAATTCCHH records which parts of the - string matched the pattern. The element of BBAASSHH__RREEMMAATTCCHH with - index 0 contains the portion of the string matching the entire - regular expression. Substrings matched by parenthesized subex- + The array variable BBAASSHH__RREEMMAATTCCHH records which parts of the + string matched the pattern. The element of BBAASSHH__RREEMMAATTCCHH with + index 0 contains the portion of the string matching the entire + regular expression. Substrings matched by parenthesized subex- pressions within the regular expression are saved in the remain- - ing BBAASSHH__RREEMMAATTCCHH indices. The element of BBAASSHH__RREEMMAATTCCHH with in- - dex _n is the portion of the string matching the _nth parenthe- - sized subexpression. BBaasshh sets BBAASSHH__RREEMMAATTCCHH in the global - scope; declaring it as a local variable will lead to unexpected + ing BBAASSHH__RREEMMAATTCCHH indices. The element of BBAASSHH__RREEMMAATTCCHH with in- + dex _n is the portion of the string matching the _nth parenthe- + sized subexpression. BBaasshh sets BBAASSHH__RREEMMAATTCCHH in the global + scope; declaring it as a local variable will lead to unexpected results. - Expressions may be combined using the following operators, + Expressions may be combined using the following operators, listed in decreasing order of precedence: (( _e_x_p_r_e_s_s_i_o_n )) - Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to + Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to override the normal precedence of operators. !! _e_x_p_r_e_s_s_i_o_n True if _e_x_p_r_e_s_s_i_o_n is false. @@ -453,72 +458,72 @@ SSHHEELLLL GGRRAAMMMMAARR True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. The &&&& and |||| operators do not evaluate _e_x_p_r_e_s_s_i_o_n_2 if the value - of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of + of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of the entire conditional expression. ffoorr _n_a_m_e [ [ iinn [ _w_o_r_d _._._. ] ] ; ] ddoo _l_i_s_t ; ddoonnee - First, expand The list of words following iinn, generating a list - of items. Then, the variable _n_a_m_e is set to each element of - this list in turn, and _l_i_s_t is executed each time. If the iinn + First, expand The list of words following iinn, generating a list + of items. Then, the variable _n_a_m_e is set to each element of + this list in turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omitted, the ffoorr command executes _l_i_s_t once for each po- - sitional parameter that is set (see PPAARRAAMMEETTEERRSS below). The re- - turn status is the exit status of the last command that exe- + sitional parameter that is set (see PPAARRAAMMEETTEERRSS below). The re- + turn status is the exit status of the last command that exe- cutes. If the expansion of the items following iinn results in an - empty list, no commands are executed, and the return status is + empty list, no commands are executed, and the return status is 0. ffoorr (( _e_x_p_r_1 ; _e_x_p_r_2 ; _e_x_p_r_3 )) ; ddoo _l_i_s_t ; ddoonnee First, evaluate the arithmetic expression _e_x_p_r_1 according to the - rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. Then, re- + rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. Then, re- peatedly evaluate the arithmetic expression _e_x_p_r_2 until it eval- - uates to zero. Each time _e_x_p_r_2 evaluates to a non-zero value, - execute _l_i_s_t and evaluate the arithmetic expression _e_x_p_r_3. If - any expression is omitted, it behaves as if it evaluates to 1. - The return value is the exit status of the last command in _l_i_s_t - that is executed, or non-zero if any of the expressions is in- + uates to zero. Each time _e_x_p_r_2 evaluates to a non-zero value, + execute _l_i_s_t and evaluate the arithmetic expression _e_x_p_r_3. If + any expression is omitted, it behaves as if it evaluates to 1. + The return value is the exit status of the last command in _l_i_s_t + that is executed, or non-zero if any of the expressions is in- valid. - Use the bbrreeaakk and ccoonnttiinnuuee builtins (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + Use the bbrreeaakk and ccoonnttiinnuuee builtins (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) to control loop execution. sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee - First, expand the list of words following iinn, generating a list - of items, and print the set of expanded words the standard er- - ror, each preceded by a number. If the iinn _w_o_r_d is omitted, - print the positional parameters (see PPAARRAAMMEETTEERRSS below). sseelleecctt - then displays the PPSS33 prompt and reads a line from the standard + First, expand the list of words following iinn, generating a list + of items, and print the set of expanded words the standard er- + ror, each preceded by a number. If the iinn _w_o_r_d is omitted, + print the positional parameters (see PPAARRAAMMEETTEERRSS below). sseelleecctt + then displays the PPSS33 prompt and reads a line from the standard input. If the line consists of a number corresponding to one of - the displayed words, then sseelleecctt sets the value of _n_a_m_e to that - word. If the line is empty, sseelleecctt displays the words and - prompt again. If EOF is read, sseelleecctt completes and returns 1. - Any other value sets _n_a_m_e to null. The line read is saved in - the variable RREEPPLLYY. The _l_i_s_t is executed after each selection + the displayed words, then sseelleecctt sets the value of _n_a_m_e to that + word. If the line is empty, sseelleecctt displays the words and + prompt again. If EOF is read, sseelleecctt completes and returns 1. + Any other value sets _n_a_m_e to null. The line read is saved in + the variable RREEPPLLYY. The _l_i_s_t is executed after each selection until a bbrreeaakk command is executed. The exit status of sseelleecctt is the exit status of the last command executed in _l_i_s_t, or zero if no commands were executed. ccaassee _w_o_r_d iinn [ [(] _p_a_t_t_e_r_n [ || _p_a_t_t_e_r_n ] ... ) _l_i_s_t ;; ] ... eessaacc A ccaassee command first expands _w_o_r_d, and tries to match it against - each _p_a_t_t_e_r_n in turn, proceeding from first to last, using the - matching rules described under PPaatttteerrnn MMaattcchhiinngg below. A pat- - tern list is a set of one or more patterns separated by , and - the ) operator terminates the pattern list. The _w_o_r_d is ex- - panded using tilde expansion, parameter and variable expansion, + each _p_a_t_t_e_r_n in turn, proceeding from first to last, using the + matching rules described under PPaatttteerrnn MMaattcchhiinngg below. A pat- + tern list is a set of one or more patterns separated by , and + the ) operator terminates the pattern list. The _w_o_r_d is ex- + panded using tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution - and quote removal. Each _p_a_t_t_e_r_n examined is expanded using - tilde expansion, parameter and variable expansion, arithmetic + and quote removal. Each _p_a_t_t_e_r_n examined is expanded using + tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote - removal. If the nnooccaasseemmaattcchh shell option is enabled, the match - is performed without regard to the case of alphabetic charac- + removal. If the nnooccaasseemmaattcchh shell option is enabled, the match + is performed without regard to the case of alphabetic charac- ters. A _c_l_a_u_s_e is a pattern list and an associated _l_i_s_t. When a match is found, ccaassee executes the corresponding _l_i_s_t. If - the ;;;; operator terminates the case clause, the ccaassee command + the ;;;; operator terminates the case clause, the ccaassee command completes after the first match. Using ;;&& in place of ;;;; causes - execution to continue with the _l_i_s_t associated with the next + execution to continue with the _l_i_s_t associated with the next pattern list. Using ;;;;&& in place of ;;;; causes the shell to test - the next pattern list in the statement, if any, and execute any - associated _l_i_s_t if the match succeeds. continuing the case + the next pattern list in the statement, if any, and execute any + associated _l_i_s_t if the match succeeds, continuing the case statement execution as if the pattern list had not matched. The exit status is zero if no pattern matches. @@ -526,19 +531,19 @@ SSHHEELLLL GGRRAAMMMMAARR the last _l_i_s_t executed. iiff _l_i_s_t; tthheenn _l_i_s_t; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii - The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn - _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in - turn, and if its exit status is zero, the corresponding tthheenn + The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn + _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in + turn, and if its exit status is zero, the corresponding tthheenn _l_i_s_t is executed and the command completes. Otherwise, the eellssee - _l_i_s_t is executed, if present. The exit status is the exit sta- + _l_i_s_t is executed, if present. The exit status is the exit sta- tus of the last command executed, or zero if no condition tested true. wwhhiillee _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee uunnttiill _l_i_s_t_-_1; ddoo _l_i_s_t_-_2; ddoonnee - The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long + The wwhhiillee command continuously executes the list _l_i_s_t_-_2 as long as the last command in the list _l_i_s_t_-_1 returns an exit status of - zero. The uunnttiill command is identical to the wwhhiillee command, ex- + zero. The uunnttiill command is identical to the wwhhiillee command, ex- cept that the test is negated: _l_i_s_t_-_2 is executed as long as the last command in _l_i_s_t_-_1 returns a non-zero exit status. The exit status of the wwhhiillee and uunnttiill commands is the exit status of the @@ -546,143 +551,143 @@ SSHHEELLLL GGRRAAMMMMAARR CCoopprroocceesssseess A _c_o_p_r_o_c_e_s_s is a shell command preceded by the ccoopprroocc reserved word. A - coprocess is executed asynchronously in a subshell, as if the command - had been terminated with the && control operator, with a two-way pipe + coprocess is executed asynchronously in a subshell, as if the command + had been terminated with the && control operator, with a two-way pipe established between the executing shell and the coprocess. The syntax for a coprocess is: ccoopprroocc [_N_A_M_E] _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s] - This creates a coprocess named _N_A_M_E. _c_o_m_m_a_n_d may be either a simple - command or a compound command (see above). _N_A_M_E is a shell variable + This creates a coprocess named _N_A_M_E. _c_o_m_m_a_n_d may be either a simple + command or a compound command (see above). _N_A_M_E is a shell variable name. If _N_A_M_E is not supplied, the default name is CCOOPPRROOCC. The recommended form to use for a coprocess is ccoopprroocc _N_A_M_E { _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s]; } - This form is preferred because simple commands result in the coprocess - always being named CCOOPPRROOCC, and it is simpler to use and more complete + This form is preferred because simple commands result in the coprocess + always being named CCOOPPRROOCC, and it is simpler to use and more complete than the other compound commands. - If _c_o_m_m_a_n_d is a compound command, _N_A_M_E is optional. The word following - ccoopprroocc determines whether that word is interpreted as a variable name: - it is interpreted as _N_A_M_E if it is not a reserved word that introduces - a compound command. If _c_o_m_m_a_n_d is a simple command, _N_A_M_E is not al- - lowed; this is to avoid confusion between _N_A_M_E and the first word of + If _c_o_m_m_a_n_d is a compound command, _N_A_M_E is optional. The word following + ccoopprroocc determines whether that word is interpreted as a variable name: + it is interpreted as _N_A_M_E if it is not a reserved word that introduces + a compound command. If _c_o_m_m_a_n_d is a simple command, _N_A_M_E is not al- + lowed; this is to avoid confusion between _N_A_M_E and the first word of the simple command. - When the coprocess is executed, the shell creates an array variable - (see AArrrraayyss below) named _N_A_M_E in the context of the executing shell. - The standard output of _c_o_m_m_a_n_d is connected via a pipe to a file de- - scriptor in the executing shell, and that file descriptor is assigned + When the coprocess is executed, the shell creates an array variable + (see AArrrraayyss below) named _N_A_M_E in the context of the executing shell. + The standard output of _c_o_m_m_a_n_d is connected via a pipe to a file de- + scriptor in the executing shell, and that file descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is connected via a pipe to a file descriptor in the executing shell, and that file descriptor is as- - signed to _N_A_M_E[1]. This pipe is established before any redirections + signed to _N_A_M_E[1]. This pipe is established before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN below). The file descriptors - can be utilized as arguments to shell commands and redirections using - standard word expansions. Other than those created to execute command - and process substitutions, the file descriptors are not available in + can be utilized as arguments to shell commands and redirections using + standard word expansions. Other than those created to execute command + and process substitutions, the file descriptors are not available in subshells. - The process ID of the shell spawned to execute the coprocess is avail- - able as the value of the variable _N_A_M_E_PID. The wwaaiitt builtin may be + The process ID of the shell spawned to execute the coprocess is avail- + able as the value of the variable _N_A_M_E_PID. The wwaaiitt builtin may be used to wait for the coprocess to terminate. - Since the coprocess is created as an asynchronous command, the ccoopprroocc - command always returns success. The return status of a coprocess is + Since the coprocess is created as an asynchronous command, the ccoopprroocc + command always returns success. The return status of a coprocess is the exit status of _c_o_m_m_a_n_d. SShheellll FFuunnccttiioonn DDeeffiinniittiioonnss - A shell function is an object that is called like a simple command and - executes a compound command with a new set of positional parameters. + A shell function is an object that is called like a simple command and + executes a compound command with a new set of positional parameters. Shell functions are declared as follows: _f_n_a_m_e () _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] ffuunnccttiioonn _f_n_a_m_e [()] _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] This defines a function named _f_n_a_m_e. The reserved word ffuunnccttiioonn - is optional. If the ffuunnccttiioonn reserved word is supplied, the - parentheses are optional. The _b_o_d_y of the function is the com- - pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). - That command is usually a _l_i_s_t of commands between { and }, but + is optional. If the ffuunnccttiioonn reserved word is supplied, the + parentheses are optional. The _b_o_d_y of the function is the com- + pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). + That command is usually a _l_i_s_t of commands between { and }, but may be any command listed under CCoommppoouunndd CCoommmmaannddss above. If the ffuunnccttiioonn reserved word is used, but the parentheses are not sup- plied, the braces are recommended. _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d is executed - whenever _f_n_a_m_e is specified as the name of a simple command. + whenever _f_n_a_m_e is specified as the name of a simple command. When in posix mode, _f_n_a_m_e must be a valid shell _n_a_m_e and may not - be the name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. In default - mode, a function name can be any unquoted shell word that does + be the name of one of the POSIX _s_p_e_c_i_a_l _b_u_i_l_t_i_n_s. In default + mode, a function name can be any unquoted shell word that does not contain $$. - Any redirections (see RREEDDIIRREECCTTIIOONN below) specified when a function is + Any redirections (see RREEDDIIRREECCTTIIOONN below) specified when a function is defined are performed when the function is executed. - The exit status of a function definition is zero unless a syntax error - occurs or a readonly function with the same name already exists. When - executed, the exit status of a function is the exit status of the last + The exit status of a function definition is zero unless a syntax error + occurs or a readonly function with the same name already exists. When + executed, the exit status of a function is the exit status of the last command executed in the body. (See FFUUNNCCTTIIOONNSS below.) CCOOMMMMEENNTTSS In a non-interactive shell, or an interactive shell in which the iinntteerr-- - aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## introduces a comment. + aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## introduces a comment. A word begins at the beginning of a line, after unquoted whitespace, or - after an operator. The comment causes that word and all remaining - characters on that line to be ignored. An interactive shell without - the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow comments. The + after an operator. The comment causes that word and all remaining + characters on that line to be ignored. An interactive shell without + the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow comments. The iinntteerraaccttiivvee__ccoommmmeennttss option is enabled by default in interactive shells. QQUUOOTTIINNGG - _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or - words to the shell. Quoting can be used to disable special treatment + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or + words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. - Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special + Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special meaning to the shell and must be quoted if it is to represent itself. - When the command history expansion facilities are being used (see HHIISS-- + When the command history expansion facilities are being used (see HHIISS-- TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must be quoted to prevent history expansion. There are four quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single quotes, double quotes, and dollar-single quotes. - A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the - literal value of the next character that follows, removing any special - meaning it has, with the exception of . If a \\ pair - appears, and the backslash is not itself quoted, the \\ is - treated as a line continuation (that is, it is removed from the input + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + literal value of the next character that follows, removing any special + meaning it has, with the exception of . If a \\ pair + appears, and the backslash is not itself quoted, the \\ is + treated as a line continuation (that is, it is removed from the input stream and effectively ignored). - Enclosing characters in single quotes preserves the literal value of + Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. - Enclosing characters in double quotes preserves the literal value of - all characters within the quotes, with the exception of $$, ``, \\, and, + Enclosing characters in double quotes preserves the literal value of + all characters within the quotes, with the exception of $$, ``, \\, and, when history expansion is enabled, !!. When the shell is in posix mode, - the !! has no special meaning within double quotes, even when history - expansion is enabled. The characters $$ and `` retain their special - meaning within double quotes. The backslash retains its special mean- - ing only when followed by one of the following characters: $$, ``, "", \\, + the !! has no special meaning within double quotes, even when history + expansion is enabled. The characters $$ and `` retain their special + meaning within double quotes. The backslash retains its special mean- + ing only when followed by one of the following characters: $$, ``, "", \\, or <>. Backslashes preceding characters without a special mean- ing are left unmodified. - A double quote may be quoted within double quotes by preceding it with + A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an - !! appearing in double quotes is escaped using a backslash. The back- + !! appearing in double quotes is escaped using a backslash. The back- slash preceding the !! is not removed. - The special parameters ** and @@ have special meaning when in double + The special parameters ** and @@ have special meaning when in double quotes (see PPAARRAAMMEETTEERRSS below). - Character sequences of the form $$'_s_t_r_i_n_g' are treated as a special - variant of single quotes. The sequence expands to _s_t_r_i_n_g, with back- - slash-escaped characters in _s_t_r_i_n_g replaced as specified by the ANSI C - standard. Backslash escape sequences, if present, are decoded as fol- + Character sequences of the form $$'_s_t_r_i_n_g' are treated as a special + variant of single quotes. The sequence expands to _s_t_r_i_n_g, with back- + slash-escaped characters in _s_t_r_i_n_g replaced as specified by the ANSI C + standard. Backslash escape sequences, if present, are decoded as fol- lows: \\aa alert (bell) \\bb backspace @@ -697,77 +702,77 @@ QQUUOOTTIINNGG \\'' single quote \\"" double quote \\?? question mark - \\_n_n_n The eight-bit character whose value is the octal value + \\_n_n_n The eight-bit character whose value is the octal value _n_n_n (one to three octal digits). - \\xx_H_H The eight-bit character whose value is the hexadecimal + \\xx_H_H The eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits). - \\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the + \\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits). \\UU_H_H_H_H_H_H_H_H - The Unicode (ISO/IEC 10646) character whose value is the + The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits). \\cc_x A control-_x character. - The expanded result is single-quoted, as if the dollar sign had not + The expanded result is single-quoted, as if the dollar sign had not been present. TTrraannssllaattiinngg SSttrriinnggss A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") causes the - string to be translated according to the current locale. The _g_e_t_t_e_x_t - infrastructure performs the lookup and translation, using the LLCC__MMEESS-- - SSAAGGEESS, TTEEXXTTDDOOMMAAIINNDDIIRR, and TTEEXXTTDDOOMMAAIINN shell variables. If the current + string to be translated according to the current locale. The _g_e_t_t_e_x_t + infrastructure performs the lookup and translation, using the LLCC__MMEESS-- + SSAAGGEESS, TTEEXXTTDDOOMMAAIINNDDIIRR, and TTEEXXTTDDOOMMAAIINN shell variables. If the current locale is CC or PPOOSSIIXX, if there are no translations available, or if the string is not translated, the dollar sign is ignored, and the string is - treated as double-quoted as described above. This is a form of double + treated as double-quoted as described above. This is a form of double quoting, so the string remains double-quoted by default, whether or not - it is translated and replaced. If the nnooeexxppaanndd__ttrraannssllaattiioonn option is - enabled using the sshhoopptt builtin, translated strings are single-quoted - instead of double-quoted. See the description of sshhoopptt below under + it is translated and replaced. If the nnooeexxppaanndd__ttrraannssllaattiioonn option is + enabled using the sshhoopptt builtin, translated strings are single-quoted + instead of double-quoted. See the description of sshhoopptt below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS. PPAARRAAMMEETTEERRSS - A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- - ber, or one of the special characters listed below under SSppeecciiaall PPaarraa-- + A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- + ber, or one of the special characters listed below under SSppeecciiaall PPaarraa-- mmeetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a - _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the - ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). + _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the + ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). The eexxppoorrtt and rreeaaddoonnllyy builtins assign specific attributes. A parameter is set if it has been assigned a value. The null string is - a valid value. Once a variable is set, it may be unset only by using + a valid value. Once a variable is set, it may be unset only by using the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form _n_a_m_e=[_v_a_l_u_e] - If _v_a_l_u_e is not given, the variable is assigned the null string. All - _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- - mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- + If _v_a_l_u_e is not given, the variable is assigned the null string. All + _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- + mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e is evaluated as an arithmetic expression even if the $$((((...)))) expansion is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting and path- - name expansion are not performed. Assignment statements may also ap- + name expansion are not performed. Assignment statements may also ap- pear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, eexxppoorrtt, rreeaaddoonnllyy, and - llooccaall builtin commands (_d_e_c_l_a_r_a_t_i_o_n commands). When in posix mode, - these builtins may appear in a command after one or more instances of + llooccaall builtin commands (_d_e_c_l_a_r_a_t_i_o_n commands). When in posix mode, + these builtins may appear in a command after one or more instances of the ccoommmmaanndd builtin and retain these assignment statement properties. - In the context where an assignment statement is assigning a value to a - shell variable or array index, the += operator appends to or adds to - the variable's previous value. This includes arguments to _d_e_c_l_a_r_a_t_i_o_n - commands such as ddeeccllaarree that accept assignment statements. When += is - applied to a variable for which the iinntteeggeerr attribute has been set, the - variable's current value and _v_a_l_u_e are each evaluated as arithmetic ex- - pressions, and the sum of the results is assigned as the variable's + In the context where an assignment statement is assigning a value to a + shell variable or array index, the "+=" operator appends to or adds to + the variable's previous value. This includes arguments to _d_e_c_l_a_r_a_t_i_o_n + commands such as ddeeccllaarree that accept assignment statements. When "+=" + is applied to a variable for which the iinntteeggeerr attribute has been set, + the variable's current value and _v_a_l_u_e are each evaluated as arithmetic + expressions, and the sum of the results is assigned as the variable's value. The current value is usually an integer constant, but may be an - expression. When += is applied to an array variable using compound as- - signment (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 ap- - plied to a string-valued variable, _v_a_l_u_e is expanded and appended to - the variable's value. + 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. 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 @@ -797,6 +802,10 @@ PPAARRAAMMEETTEERRSS a nameref variable as an argument, the variable referenced by the nameref variable is unset. + When the shell starts, it reads its environment and creates a shell + variable from each environment variable that has a valid name, as de- + scribed below (see EENNVVIIRROONNMMEENNTT). + PPoossiittiioonnaall PPaarraammeetteerrss A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, other than the single digit 0. Positional parameters are assigned from @@ -954,7 +963,7 @@ PPAARRAAMMEETTEERRSS ments to BBAASSHH__LLIINNEENNOO have no effect, and it may not be unset. BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH A colon-separated list of directories in which the eennaabbllee com- - mand. looks for dynamically loadable builtins. + mand looks for dynamically loadable builtins. BBAASSHH__MMOONNOOSSEECCOONNDDSS Each time this variable is referenced, it expands to the value returned by the system's monotonic clock, if one is available. @@ -1169,193 +1178,199 @@ PPAARRAAMMEETTEERRSS appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If this variable is in the environment when bbaasshh starts up, the shell enables each option in the list before reading any startup - files. This variable is read-only. + files. If this variable is exported, child shells will enable + each option in the list. This variable is read-only. SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. SSRRAANNDDOOMM - Each time it is referenced, this variable expands to a 32-bit + Each time it is referenced, this variable expands to a 32-bit pseudo-random number. The random number generator is not linear - on systems that support _/_d_e_v_/_u_r_a_n_d_o_m or _a_r_c_4_r_a_n_d_o_m(3), so each + on systems that support _/_d_e_v_/_u_r_a_n_d_o_m or _a_r_c_4_r_a_n_d_o_m(3), so each returned number has no relationship to the numbers preceding it. - The random number generator cannot be seeded, so assignments to + The random number generator cannot be seeded, so assignments to this variable have no effect. If SSRRAANNDDOOMM is unset, it loses its special properties, even if it is subsequently reset. UUIIDD Expands to the user ID of the current user, initialized at shell startup. This variable is readonly. - The shell uses the following variables. In some cases, bbaasshh assigns a + The shell uses the following variables. In some cases, bbaasshh assigns a default value to a variable; these cases are noted below. BBAASSHH__CCOOMMPPAATT - The value is used to set the shell's compatibility level. See - SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE below for a description of the various + The value is used to set the shell's compatibility level. See + SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE below for a description of the various compatibility levels and their effects. The value may be a dec- - imal number (e.g., 4.2) or an integer (e.g., 42) corresponding - to the desired compatibility level. If BBAASSHH__CCOOMMPPAATT is unset or - set to the empty string, the compatibility level is set to the - default for the current version. If BBAASSHH__CCOOMMPPAATT is set to a - value that is not one of the valid compatibility levels, the - shell prints an error message and sets the compatibility level - to the default for the current version. A subset of the valid - values correspond to the compatibility levels described below - under SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE. For example, 4.2 and 42 are - valid values that correspond to the ccoommppaatt4422 sshhoopptt option and - set the compatibility level to 42. The current version is also + imal number (e.g., 4.2) or an integer (e.g., 42) corresponding + to the desired compatibility level. If BBAASSHH__CCOOMMPPAATT is unset or + set to the empty string, the compatibility level is set to the + default for the current version. If BBAASSHH__CCOOMMPPAATT is set to a + value that is not one of the valid compatibility levels, the + shell prints an error message and sets the compatibility level + to the default for the current version. A subset of the valid + values correspond to the compatibility levels described below + under SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE. For example, 4.2 and 42 are + valid values that correspond to the ccoommppaatt4422 sshhoopptt option and + set the compatibility level to 42. The current version is also a valid value. BBAASSHH__EENNVV - If this parameter is set when bbaasshh is executing a shell script, - its expanded value is interpreted as a filename containing com- - mands to initialize the shell before it reads and executes com- - mands from the script. The value of BBAASSHH__EENNVV is subjected to + If this parameter is set when bbaasshh is executing a shell script, + its expanded value is interpreted as a filename containing com- + mands to initialize the shell before it reads and executes com- + mands from the script. The value of BBAASSHH__EENNVV is subjected to parameter expansion, command substitution, and arithmetic expan- - sion before being interpreted as a filename. PPAATTHH is not used + sion before being interpreted as a filename. PPAATTHH is not used to search for the resultant filename. BBAASSHH__XXTTRRAACCEEFFDD - If set to an integer corresponding to a valid file descriptor, - bbaasshh writes the trace output generated when "set -x" is enabled - to that file descriptor, instead of the standard error. The - file descriptor is closed when BBAASSHH__XXTTRRAACCEEFFDD is unset or as- + If set to an integer corresponding to a valid file descriptor, + bbaasshh writes the trace output generated when "set -x" is enabled + to that file descriptor, instead of the standard error. The + file descriptor is closed when BBAASSHH__XXTTRRAACCEEFFDD is unset or as- signed a new value. Unsetting BBAASSHH__XXTTRRAACCEEFFDD or assigning it the - empty string causes the trace output to be sent to the standard + empty string causes the trace output to be sent to the standard error. Note that setting BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error - file descriptor) and then unsetting it will result in the stan- + file descriptor) and then unsetting it will result in the stan- dard error being closed. - CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated list of directories where the shell looks for directories speci- - fied as arguments to the ccdd command. A sample value is + fied as arguments to the ccdd command. A sample value is ".:~:/usr". CCHHIILLDD__MMAAXX - Set the number of exited child status values for the shell to - remember. BBaasshh will not allow this value to be decreased below - a POSIX-mandated minimum, and there is a maximum value (cur- - rently 8192) that this may not exceed. The minimum value is + Set the number of exited child status values for the shell to + remember. BBaasshh will not allow this value to be decreased below + a POSIX-mandated minimum, and there is a maximum value (cur- + rently 8192) that this may not exceed. The minimum value is system-dependent. CCOOLLUUMMNNSS - Used by the sseelleecctt compound command to determine the terminal - width when printing selection lists. Automatically set if the - cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + Used by the sseelleecctt compound command to determine the terminal + width when printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon receipt of a SSIIGGWWIINNCCHH. CCOOMMPPRREEPPLLYY An array variable from which bbaasshh reads the possible completions - generated by a shell function invoked by the programmable com- - pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each ar- + generated by a shell function invoked by the programmable com- + pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). Each ar- ray element contains one possible completion. - EEMMAACCSS If bbaasshh finds this variable in the environment when the shell - starts with value "t", it assumes that the shell is running in + EEMMAACCSS If bbaasshh finds this variable in the environment when the shell + starts with value "t", it assumes that the shell is running in an Emacs shell buffer and disables line editing. - EENNVV Expanded and executed similarly to BBAASSHH__EENNVV (see IINNVVOOCCAATTIIOONN + EENNVV Expanded and executed similarly to BBAASSHH__EENNVV (see IINNVVOOCCAATTIIOONN above) when an interactive shell is invoked in posix mode. EEXXEECCIIGGNNOORREE - A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) - defining the set of filenames to be ignored by command search - using PPAATTHH. Files whose full pathnames match one of these pat- - terns are not considered executable files for the purposes of + A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) + defining the set of filenames to be ignored by command search + using PPAATTHH. Files whose full pathnames match one of these pat- + terns are not considered executable files for the purposes of completion and command execution via PPAATTHH lookup. This does not affect the behavior of the [[, tteesstt, and [[[[ commands. Full path- - names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. - Use this variable to ignore shared library files that have the - executable bit set, but are not executable files. The pattern + names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. + Use this variable to ignore shared library files that have the + executable bit set, but are not executable files. The pattern matching honors the setting of the eexxttgglloobb shell option. FFCCEEDDIITT The default editor for the ffcc builtin command. FFIIGGNNOORREE - A colon-separated list of suffixes to ignore when performing + A colon-separated list of suffixes to ignore when performing filename completion (see RREEAADDLLIINNEE below). A filename whose suf- - fix matches one of the entries in FFIIGGNNOORREE is excluded from the + fix matches one of the entries in FFIIGGNNOORREE is excluded from the list of matched filenames. A sample value is ".o:~". FFUUNNCCNNEESSTT - If set to a numeric value greater than 0, defines a maximum - function nesting level. Function invocations that exceed this + If set to a numeric value greater than 0, defines a maximum + function nesting level. Function invocations that exceed this nesting level cause the current command to abort. GGLLOOBBIIGGNNOORREE - A colon-separated list of patterns defining the set of file - names to be ignored by pathname expansion. If a file name - matched by a pathname expansion pattern also matches one of the - patterns in GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. + A colon-separated list of patterns defining the set of file + names to be ignored by pathname expansion. If a file name + matched by a pathname expansion pattern also matches one of the + patterns in GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. The pattern matching honors the setting of the eexxttgglloobb shell op- tion. GGLLOOBBSSOORRTT - Controls how the results of pathname expansion are sorted. The - value of this variable specifies the sort criteria and sort or- - der for the results of pathname expansion. If this variable is - unset or set to the null string, pathname expansion uses the - historical behavior of sorting by name, in ascending lexico- + Controls how the results of pathname expansion are sorted. The + value of this variable specifies the sort criteria and sort or- + der for the results of pathname expansion. If this variable is + unset or set to the null string, pathname expansion uses the + historical behavior of sorting by name, in ascending lexico- graphic order as determined by the LLCC__CCOOLLLLAATTEE shell variable. - If set, a valid value begins with an optional _+, which is ig- + If set, a valid value begins with an optional _+, which is ig- nored, or _-, which reverses the sort order from ascending to de- - scending, followed by a sort specifier. The valid sort speci- - fiers are _n_a_m_e, _n_u_m_e_r_i_c, _s_i_z_e, _m_t_i_m_e, _a_t_i_m_e, _c_t_i_m_e, and _b_l_o_c_k_s, + scending, followed by a sort specifier. The valid sort speci- + fiers are _n_a_m_e, _n_u_m_e_r_i_c, _s_i_z_e, _m_t_i_m_e, _a_t_i_m_e, _c_t_i_m_e, and _b_l_o_c_k_s, which sort the files on name, names in numeric rather than lexi- - cographic order, file size, modification time, access time, in- - ode change time, and number of blocks, respectively. If any of - the non-name keys compare as equal (e.g., if two files are the + cographic order, file size, modification time, access time, in- + ode change time, and number of blocks, respectively. If any of + the non-name keys compare as equal (e.g., if two files are the same size), sorting uses the name as a secondary sort key. - For example, a value of _-_m_t_i_m_e sorts the results in descending + For example, a value of _-_m_t_i_m_e sorts the results in descending order by modification time (newest first). - The _n_u_m_e_r_i_c specifier treats names consisting solely of digits - as numbers and sorts them using their numeric value (so "2" + The _n_u_m_e_r_i_c specifier treats names consisting solely of digits + as numbers and sorts them using their numeric value (so "2" sorts before "10", for example). When using _n_u_m_e_r_i_c, names con- - taining non-digits sort after all the all-digit names and are + taining non-digits sort after all the all-digit names and are sorted by name using the traditional behavior. A sort specifier of _n_o_s_o_r_t disables sorting completely; bbaasshh re- - turns the results in the order they are read from the file sys- + turns the results in the order they are read from the file sys- tem, ignoring any leading _-. - If the sort specifier is missing, it defaults to _n_a_m_e, so a - value of _+ is equivalent to the null string, and a value of _- - sorts by name in descending order. Any invalid value restores + If the sort specifier is missing, it defaults to _n_a_m_e, so a + value of _+ is equivalent to the null string, and a value of _- + sorts by name in descending order. Any invalid value restores the historical sorting behavior. HHIISSTTCCOONNTTRROOLL - A colon-separated list of values controlling how commands are - saved on the history list. If the list of values includes - _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not - saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not + saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines matching the previous history entry not to be saved. A value of _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line - to be removed from the history list before that line is saved. - Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is - unset, or does not include a valid value, bbaasshh saves all lines - read by the shell parser on the history list, subject to the + to be removed from the history list before that line is saved. + Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is + unset, or does not include a valid value, bbaasshh saves all lines + read by the shell parser on the history list, subject to the value of HHIISSTTIIGGNNOORREE. If the first line of a multi-line compound - command was saved, the second and subsequent lines are not - tested, and are added to the history regardless of the value of - HHIISSTTCCOONNTTRROOLL. If the first line was not saved, the second and + command was saved, the second and subsequent lines are not + tested, and are added to the history regardless of the value of + HHIISSTTCCOONNTTRROOLL. If the first line was not saved, the second and subsequent lines of the command are not saved either. HHIISSTTFFIILLEE The name of the file in which command history is saved (see HHIISS-- - TTOORRYY below). BBaasshh assigns a default value of _~_/_._b_a_s_h___h_i_s_t_o_r_y. - If HHIISSTTFFIILLEE is unset or null, the shell does not save the com- + TTOORRYY below). BBaasshh assigns a default value of _~_/_._b_a_s_h___h_i_s_t_o_r_y. + If HHIISSTTFFIILLEE is unset or null, the shell does not save the com- mand history when it exits. 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 + 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 + 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 - matches one of the patterns in the value of HHIISSTTIIGGNNOORREE, it is - not saved on the history list. Each pattern is anchored at the - beginning of the line and must match the complete line (bbaasshh - does not implicitly append a "**"). Each pattern is tested - against the line after the checks specified by HHIISSTTCCOONNTTRROOLL are + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. If a command line + matches one of the patterns in the value of HHIISSTTIIGGNNOORREE, it is + not saved on the history list. Each pattern is anchored at the + beginning of the line and must match the complete line (bbaasshh + does not implicitly append a "**"). Each pattern is tested + against the line after the checks specified by HHIISSTTCCOONNTTRROOLL are applied. In addition to the normal shell pattern matching char- - acters, "&&" matches the previous history line. A backslash es- - capes the "&&"; the backslash is removed before attempting a - match. If the first line of a multi-line compound command was - saved, the second and subsequent lines are not tested, and are - added to the history regardless of the value of HHIISSTTIIGGNNOORREE. If + acters, "&&" matches the previous history line. A backslash es- + capes the "&&"; the backslash is removed before attempting a + match. If the first line of a multi-line compound command was + saved, the second and subsequent lines are not tested, and are + added to the history regardless of the value of HHIISSTTIIGGNNOORREE. If the first line was not saved, the second and subsequent lines of - the command are not saved either. The pattern matching honors + the command are not saved either. The pattern matching honors the setting of the eexxttgglloobb shell option. + HHIISSTTIIGGNNOORREE subsumes some of the function of HHIISSTTCCOONNTTRROOLL. A pat- + tern of "&" is identical to "ignoredups", and a pattern of "[ + ]*" is identical to "ignorespace". Combining these two pat- + terns, separating them with a colon, provides the functionality + of "ignoreboth". HHIISSTTSSIIZZEE The number of commands to remember in the command history (see HHIISSTTOORRYY below). If the value is 0, commands are not saved in @@ -1383,127 +1398,126 @@ PPAARRAAMMEETTEERRSS the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has no value, or does not name a readable file, bbaasshh attempts to read _/_e_t_c_/_h_o_s_t_s to obtain the list of possible hostname comple- - tions. When HHOOSSTTFFIILLEE is unset, bbaasshh clears the the hostname - list. + tions. When HHOOSSTTFFIILLEE is unset, bbaasshh clears the hostname list. IIFFSS The _I_n_t_e_r_n_a_l _F_i_e_l_d _S_e_p_a_r_a_t_o_r that is used for word splitting af- - ter expansion and to split lines into words with the rreeaadd + ter expansion and to split lines into words with the rreeaadd builtin command. Word splitting is described below under EEXXPPAANN-- SSIIOONN. The default value is "". IIGGNNOORREEEEOOFF Controls the action of an interactive shell on receipt of an EEOOFF character as the sole input. If set, the value is the number of - consecutive EEOOFF characters which must be typed as the first - characters on an input line before bbaasshh exits. If the variable - is set but does not have a numeric value, or the value is null, - the default value is 10. If it is unset, EEOOFF signifies the end + consecutive EEOOFF characters which must be typed as the first + characters on an input line before bbaasshh exits. If the variable + is set but does not have a numeric value, or the value is null, + the default value is 10. If it is unset, EEOOFF signifies the end of input to the shell. IINNPPUUTTRRCC - The filename for the rreeaaddlliinnee startup file, overriding the de- + The filename for the rreeaaddlliinnee startup file, overriding the de- fault of _~_/_._i_n_p_u_t_r_c (see RREEAADDLLIINNEE below). IINNSSIIDDEE__EEMMAACCSS - If this variable appears in the environment when the shell - starts, bbaasshh assumes that it is running inside an Emacs shell - buffer and may disable line editing, depending on the value of + If this variable appears in the environment when the shell + starts, bbaasshh assumes that it is running inside an Emacs shell + buffer and may disable line editing, depending on the value of TTEERRMM. - LLAANNGG Used to determine the locale category for any category not + LLAANNGG Used to determine the locale category for any category not specifically selected with a variable starting with LLCC__. - LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ + LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ variable specifying a locale category. LLCC__CCOOLLLLAATTEE - This variable determines the collation order used when sorting - the results of pathname expansion, and determines the behavior - of range expressions, equivalence classes, and collating se- + This variable determines the collation order used when sorting + the results of pathname expansion, and determines the behavior + of range expressions, equivalence classes, and collating se- quences within pathname expansion and pattern matching. LLCC__CCTTYYPPEE - This variable determines the interpretation of characters and - the behavior of character classes within pathname expansion and + This variable determines the interpretation of characters and + the behavior of character classes within pathname expansion and pattern matching. LLCC__MMEESSSSAAGGEESS - This variable determines the locale used to translate double- + This variable determines the locale used to translate double- quoted strings preceded by a $$. LLCC__NNUUMMEERRIICC - This variable determines the locale category used for number + This variable determines the locale category used for number formatting. LLCC__TTIIMMEE - This variable determines the locale category used for data and + This variable determines the locale category used for data and time formatting. - LLIINNEESS Used by the sseelleecctt compound command to determine the column - length for printing selection lists. Automatically set if the - cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon + LLIINNEESS Used by the sseelleecctt compound command to determine the column + length for printing selection lists. Automatically set if the + cchheecckkwwiinnssiizzee option is enabled or in an interactive shell upon receipt of a SSIIGGWWIINNCCHH. MMAAIILL If the value is set to a file or directory name and the MMAAIILLPPAATTHH - variable is not set, bbaasshh informs the user of the arrival of + variable is not set, bbaasshh informs the user of the arrival of mail in the specified file or Maildir-format directory. MMAAIILLCCHHEECCKK - Specifies how often (in seconds) bbaasshh checks for mail. The de- - fault is 60 seconds. When it is time to check for mail, the - shell does so before displaying the primary prompt. If this - variable is unset, or set to a value that is not a number + Specifies how often (in seconds) bbaasshh checks for mail. The de- + fault is 60 seconds. When it is time to check for mail, the + shell does so before displaying the primary prompt. If this + variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking. MMAAIILLPPAATTHH A colon-separated list of filenames to be checked for mail. The message to be printed when mail arrives in a particular file may - be specified by separating the filename from the message with a - "?". When used in the text of the message, $$__ expands to the + be specified by separating the filename from the message with a + "?". When used in the text of the message, $$__ expands to the name of the current mailfile. For example: MMAAIILLPPAATTHH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"' - BBaasshh can be configured to supply a default value for this vari- - able (there is no value by default), but the location of the + BBaasshh can be configured to supply a default value for this vari- + able (there is no value by default), but the location of the user mail files that it uses is system dependent (e.g., /var/mail/$$UUSSEERR). OOPPTTEERRRR If set to the value 1, bbaasshh displays error messages generated by - the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a + the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a shell script is executed. - PPAATTHH The search path for commands. It is a colon-separated list of - directories in which the shell looks for commands (see CCOOMMMMAANNDD - EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the + PPAATTHH The search path for commands. It is a colon-separated list of + directories in which the shell looks for commands (see CCOOMMMMAANNDD + EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the value of PPAATTHH indicates the current directory. A null directory - name may appear as two adjacent colons, or as an initial or - trailing colon. The default path is system-dependent, and is + name may appear as two adjacent colons, or as an initial or + trailing colon. The default path is system-dependent, and is set by the administrator who installs bbaasshh. A common value is - "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin". + /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin PPOOSSIIXXLLYY__CCOORRRREECCTT - If this variable is in the environment when bbaasshh starts, the - shell enters posix mode before reading the startup files, as if - the ----ppoossiixx invocation option had been supplied. If it is set - while the shell is running, bbaasshh enables posix mode, as if the + If this variable is in the environment when bbaasshh starts, the + shell enters posix mode before reading the startup files, as if + the ----ppoossiixx invocation option had been supplied. If it is set + while the shell is running, bbaasshh enables posix mode, as if the command "set -o posix" had been executed. When the shell enters posix mode, it sets this variable if it was not already set. PPRROOMMPPTT__CCOOMMMMAANNDD - If this variable is set, and is an array, the value of each set - element is executed as a command prior to issuing each primary - prompt. If this is set but not an array variable, its value is + If this variable is set, and is an array, the value of each set + element is executed as a command prior to issuing each primary + prompt. If this is set but not an array variable, its value is used as a command to execute instead. PPRROOMMPPTT__DDIIRRTTRRIIMM - If set to a number greater than zero, the value is used as the + If set to a number greater than zero, the value is used as the number of trailing directory components to retain when expanding - the \\ww and \\WW prompt string escapes (see PPRROOMMPPTTIINNGG below). + the \\ww and \\WW prompt string escapes (see PPRROOMMPPTTIINNGG below). Characters removed are replaced with an ellipsis. - PPSS00 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) - and displayed by interactive shells after reading a command and + PPSS00 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) + and displayed by interactive shells after reading a command and before the command is executed. - PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) - and used as the primary prompt string. The default value is + PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) + and used as the primary prompt string. The default value is "\s-\v\$ ". - PPSS22 The value of this parameter is expanded as with PPSS11 and used as + PPSS22 The value of this parameter is expanded as with PPSS11 and used as the secondary prompt string. The default is "> ". PPSS33 The value of this parameter is used as the prompt for the sseelleecctt command (see SSHHEELLLL GGRRAAMMMMAARR above). - PPSS44 The value of this parameter is expanded as with PPSS11 and the + PPSS44 The value of this parameter is expanded as with PPSS11 and the value is printed before each command bbaasshh displays during an ex- ecution trace. The first character of the expanded value of PPSS44 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is "+ ". - SSHHEELLLL This variable expands to the full pathname to the shell. If it - is not set when the shell starts, bbaasshh assigns to it the full + SSHHEELLLL This variable expands to the full pathname to the shell. If it + is not set when the shell starts, bbaasshh assigns to it the full pathname of the current user's login shell. TTIIMMEEFFOORRMMAATT - The value of this parameter is used as a format string specify- - ing how the timing information for pipelines prefixed with the - ttiimmee reserved word should be displayed. The %% character intro- - duces an escape sequence that is expanded to a time value or - other information. The escape sequences and their meanings are + The value of this parameter is used as a format string specify- + ing how the timing information for pipelines prefixed with the + ttiimmee reserved word should be displayed. The %% character intro- + duces an escape sequence that is expanded to a time value or + other information. The escape sequences and their meanings are as follows; the brackets denote optional portions. %%%% A literal %%. %%[[_p]][[ll]]RR The elapsed time in seconds. @@ -1511,80 +1525,88 @@ PPAARRAAMMEETTEERRSS %%[[_p]][[ll]]SS The number of CPU seconds spent in system mode. %%PP The CPU percentage, computed as (%U + %S) / %R. - The optional _p is a digit specifying the _p_r_e_c_i_s_i_o_n, the number + The optional _p is a digit specifying the _p_r_e_c_i_s_i_o_n, the number of fractional digits after a decimal point. A value of 0 causes - no decimal point or fraction to be output. ttiimmee prints at most - six digits after the decimal point; values of _p greater than 6 + no decimal point or fraction to be output. ttiimmee prints at most + six digits after the decimal point; values of _p greater than 6 are changed to 6. If _p is not specified, ttiimmee prints three dig- its after the decimal point. - The optional ll specifies a longer format, including minutes, of - the form _M_Mm_S_S._F_Fs. The value of _p determines whether or not + The optional ll specifies a longer format, including minutes, of + the form _M_Mm_S_S._F_Fs. The value of _p determines whether or not the fraction is included. - If this variable is not set, bbaasshh acts as if it had the value - $$''\\nnrreeaall\\tt%%33llRR\\nnuusseerr\\tt%%33llUU\\nnssyyss\\tt%%33llSS''. If the value is null, - bbaasshh does not display any timing information. A trailing new- + If this variable is not set, bbaasshh acts as if it had the value + $$''\\nnrreeaall\\tt%%33llRR\\nnuusseerr\\tt%%33llUU\\nnssyyss\\tt%%33llSS''. If the value is null, + bbaasshh does not display any timing information. A trailing new- line is added when the format string is displayed. - TTMMOOUUTT If set to a value greater than zero, the rreeaadd builtin uses the - value as its default timeout. The sseelleecctt command terminates if - input does not arrive after TTMMOOUUTT seconds when input is coming - from a terminal. In an interactive shell, the value is inter- - preted as the number of seconds to wait for a line of input af- - ter issuing the primary prompt. BBaasshh terminates after waiting - for that number of seconds if a complete line of input does not + TTMMOOUUTT If set to a value greater than zero, the rreeaadd builtin uses the + value as its default timeout. The sseelleecctt command terminates if + input does not arrive after TTMMOOUUTT seconds when input is coming + from a terminal. In an interactive shell, the value is inter- + preted as the number of seconds to wait for a line of input af- + ter issuing the primary prompt. BBaasshh terminates after waiting + for that number of seconds if a complete line of input does not arrive. - TTMMPPDDIIRR If set, bbaasshh uses its value as the name of a directory in which + TTMMPPDDIIRR If set, bbaasshh uses its value as the name of a directory in which bbaasshh creates temporary files for the shell's use. aauuttoo__rreessuummee This variable controls how the shell interacts with the user and - job control. If this variable is set, simple commands consist- - ing of only a single word, without redirections, are treated as - candidates for resumption of an existing stopped job. There is - no ambiguity allowed; if there is more than one job beginning - with or containing the word, this selects the most recently ac- - cessed job. The _n_a_m_e of a stopped job, in this context, is the - command line used to start it, as displayed by jjoobbss. If set to - the value _e_x_a_c_t, the word must match the name of a stopped job - exactly; if set to _s_u_b_s_t_r_i_n_g, the word needs to match a sub- - string of the name of a stopped job. The _s_u_b_s_t_r_i_n_g value pro- + job control. If this variable is set, simple commands consist- + ing of only a single word, without redirections, are treated as + candidates for resumption of an existing stopped job. There is + no ambiguity allowed; if there is more than one job beginning + with or containing the word, this selects the most recently ac- + cessed job. The _n_a_m_e of a stopped job, in this context, is the + command line used to start it, as displayed by jjoobbss. If set to + the value _e_x_a_c_t, the word must match the name of a stopped job + exactly; if set to _s_u_b_s_t_r_i_n_g, the word needs to match a sub- + string of the name of a stopped job. The _s_u_b_s_t_r_i_n_g value pro- vides functionality analogous to the %%?? job identifier (see JJOOBB - CCOONNTTRROOLL below). If set to any other value (e.g., _p_r_e_f_i_x), the - word must be a prefix of a stopped job's name; this provides + CCOONNTTRROOLL below). If set to any other value (e.g., _p_r_e_f_i_x), the + word must be a prefix of a stopped job's name; this provides functionality analogous to the %%_s_t_r_i_n_g job identifier. hhiissttcchhaarrss - The two or three characters which control history expansion, - quick substitution, and tokenization (see HHIISSTTOORRYY EEXXPPAANNSSIIOONN be- - low). The first character is the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, - the character which begins a history expansion, normally "!!". - The second character is the _q_u_i_c_k _s_u_b_s_t_i_t_u_t_i_o_n character, nor- - mally "^^". When it appears as the first character on the line, + The two or three characters which control history expansion, + quick substitution, and tokenization (see HHIISSTTOORRYY EEXXPPAANNSSIIOONN be- + low). The first character is the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, + the character which begins a history expansion, normally "!!". + The second character is the _q_u_i_c_k _s_u_b_s_t_i_t_u_t_i_o_n character, nor- + mally "^^". When it appears as the first character on the line, history substitution repeats the previous command, replacing one - string with another. The optional third character is the char- - acter which indicates that the remainder of the line is a com- - ment when found as the first character of a word, normally "##". - The history comment character disables history substitution for - the remaining words on the line. It does not necessarily cause - the shell parser to treat the rest of the line as a comment. + string with another. The optional third character is the _h_i_s_- + _t_o_r_y _c_o_m_m_e_n_t character, normally "##", which indicates that the + remainder of the line is a comment when it appears as the first + character of a word. The history comment character disables + history substitution for the remaining words on the line. It + does not necessarily cause the shell parser to treat the rest of + the line as a comment. AArrrraayyss - BBaasshh provides one-dimensional indexed and associative array variables. - Any variable may be used as an indexed array; the ddeeccllaarree builtin ex- - plicitly declares an array. There is no maximum limit on the size of - an array, nor any requirement that members be indexed or assigned con- - tiguously. Indexed arrays are referenced using arithmetic expressions - that must expand to an integer and are zero-based; associative arrays - are referenced using arbitrary strings. Unless otherwise noted, in- - dexed array indices must be non-negative integers. + BBaasshh provides one-dimensional indexed and associative array variables. + Any variable may be used as an indexed array; the ddeeccllaarree builtin ex- + plicitly declares an array. There is no maximum limit on the size of + an array, nor any requirement that members be indexed or assigned con- + tiguously. Indexed arrays are referenced using arithmetic expressions + that must expand to an integer (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN below) and + are zero-based; associative arrays are referenced using arbitrary + strings. Unless otherwise noted, indexed array indices must be non- + negative integers. An indexed array is created automatically if any variable is assigned - to using the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as - an arithmetic expression that must evaluate to a number greater than or - equal to zero. To explicitly declare an indexed array, use ddeeccllaarree --aa - _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is - also accepted; the _s_u_b_s_c_r_i_p_t is ignored. - - Associative arrays are created using ddeeccllaarree --AA _n_a_m_e. + to using the syntax + _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e . + The _s_u_b_s_c_r_i_p_t is treated as an arithmetic expression that must evaluate + to a number greater than or equal to zero. To explicitly declare an + indexed array, use + ddeeccllaarree --aa _n_a_m_e + (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + ddeeccllaarree --aa _n_a_m_e[_s_u_b_s_c_r_i_p_t] + is also accepted; the _s_u_b_s_c_r_i_p_t is ignored. + + Associative arrays are created using + ddeeccllaarree --AA _n_a_m_e + . Attributes may be specified for an array variable using the ddeeccllaarree and rreeaaddoonnllyy builtins. Each attribute applies to all members of an array. @@ -1621,72 +1643,72 @@ PPAARRAAMMEETTEERRSS the maximum index of _n_a_m_e, so negative indices count back from the end of the array, and an index of -1 references the last element. - The += operator appends to an array variable when assigning using the + The "+=" operator appends to an array variable when assigning using the compound assignment syntax; see PPAARRAAMMEETTEERRSS above. - An array element is referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. The braces - are required to avoid conflicts with pathname expansion. If _s_u_b_s_c_r_i_p_t + An array element is referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. The braces + are required to avoid conflicts with pathname expansion. If _s_u_b_s_c_r_i_p_t is @@ or **, the word expands to all members of _n_a_m_e, unless noted in the - description of a builtin or word expansion. These subscripts differ - only when the word appears within double quotes. If the word is dou- - ble-quoted, ${_n_a_m_e[*]} expands to a single word with the value of each - array member separated by the first character of the IIFFSS special vari- - able, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a separate word. + description of a builtin or word expansion. These subscripts differ + only when the word appears within double quotes. If the word is dou- + ble-quoted, ${_n_a_m_e[*]} expands to a single word with the value of each + array member separated by the first character of the IIFFSS special vari- + able, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a separate word. When there are no array members, ${_n_a_m_e[@]} expands to nothing. If the - double-quoted expansion occurs within a word, the expansion of the - first parameter is joined with the beginning part of the expansion of - the original word, and the expansion of the last parameter is joined - with the last part of the expansion of the original word. This is - analogous to the expansion of the special parameters ** and @@ (see SSppee-- + double-quoted expansion occurs within a word, the expansion of the + first parameter is joined with the beginning part of the expansion of + the original word, and the expansion of the last parameter is joined + with the last part of the expansion of the original word. This is + analogous to the expansion of the special parameters ** and @@ (see SSppee-- cciiaall PPaarraammeetteerrss above). - ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. If + ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. If _s_u_b_s_c_r_i_p_t is ** or @@, the expansion is the number of elements in the ar- ray. If the _s_u_b_s_c_r_i_p_t used to reference an element of an indexed array eval- - uates to a number less than zero, it is interpreted as relative to one - greater than the maximum index of the array, so negative indices count - back from the end of the array, and an index of -1 references the last + uates to a number less than zero, it is interpreted as relative to one + greater than the maximum index of the array, so negative indices count + back from the end of the array, and an index of -1 references the last element. Referencing an array variable without a subscript is equivalent to ref- - erencing the array with a subscript of 0. Any reference to a variable + erencing the array with a subscript of 0. Any reference to a variable using a valid subscript is valid; bbaasshh creates an array if necessary. - An array variable is considered set if a subscript has been assigned a + An array variable is considered set if a subscript has been assigned a value. The null string is a valid value. - It is possible to obtain the keys (indices) of an array as well as the - values. ${!!_n_a_m_e[_@]} and ${!!_n_a_m_e[_*]} expand to the indices assigned in + It is possible to obtain the keys (indices) of an array as well as the + values. ${!!_n_a_m_e[_@]} and ${!!_n_a_m_e[_*]} expand to the indices assigned in array variable _n_a_m_e. The treatment when in double quotes is similar to the expansion of the special parameters _@ and _* within double quotes. The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] un- - sets the array element at index _s_u_b_s_c_r_i_p_t, for both indexed and asso- - ciative arrays. Negative subscripts to indexed arrays are interpreted - as described above. Unsetting the last element of an array variable - does not unset the variable. uunnsseett _n_a_m_e, where _n_a_m_e is an array, re- - moves the entire array. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] behaves differently de- - pending on whether _n_a_m_e is an indexed or associative array when _s_u_b_- + sets the array element at index _s_u_b_s_c_r_i_p_t, for both indexed and asso- + ciative arrays. Negative subscripts to indexed arrays are interpreted + as described above. Unsetting the last element of an array variable + does not unset the variable. uunnsseett _n_a_m_e, where _n_a_m_e is an array, re- + moves the entire array. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] behaves differently de- + pending on whether _n_a_m_e is an indexed or associative array when _s_u_b_- _s_c_r_i_p_t is ** or @@. If _n_a_m_e is an associative array, this unsets the el- - ement with subscript ** or @@. If _n_a_m_e is an indexed array, unset re- + ement with subscript ** or @@. If _n_a_m_e is an indexed array, unset re- moves all of the elements but does not remove the array itself. - When using a variable name with a subscript as an argument to a com- - mand, such as with uunnsseett, without using the word expansion syntax de- - scribed above, (e.g., unset a[4]), the argument is subject to pathname - expansion. Quote the argument if pathname expansion is not desired + When using a variable name with a subscript as an argument to a com- + mand, such as with uunnsseett, without using the word expansion syntax de- + scribed above, (e.g., unset a[4]), the argument is subject to pathname + expansion. Quote the argument if pathname expansion is not desired (e.g., unset 'a[4]'). - The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to - specify an indexed array and a --AA option to specify an associative ar- - ray. If both options are supplied, --AA takes precedence. The rreeaadd - builtin accepts a --aa option to assign a list of words read from the + The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to + specify an indexed array and a --AA option to specify an associative ar- + ray. If both options are supplied, --AA takes precedence. The rreeaadd + builtin accepts a --aa option to assign a list of words read from the standard input to an array. The sseett and ddeeccllaarree builtins display array - values in a way that allows them to be reused as assignments. Other - builtins accept array name arguments as well (e.g., mmaappffiillee); see the - descriptions of individual builtins below for details. The shell pro- + values in a way that allows them to be reused as assignments. Other + builtins accept array name arguments as well (e.g., mmaappffiillee); see the + descriptions of individual builtins below for details. The shell pro- vides a number of builtin array variables. EEXXPPAANNSSIIOONN @@ -1696,53 +1718,51 @@ EEXXPPAANNSSIIOONN _m_e_t_i_c _e_x_p_a_n_s_i_o_n, _w_o_r_d _s_p_l_i_t_t_i_n_g, _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, and _q_u_o_t_e _r_e_m_o_v_a_l. The order of expansions is: brace expansion; tilde expansion, parameter - and variable expansion, arithmetic expansion, and command substitution - (done in a left-to-right fashion); word splitting; pathname expansion; + and variable expansion, arithmetic expansion, and command substitution + (done in a left-to-right fashion); word splitting; pathname expansion; and quote removal. On systems that can support it, there is an additional expansion avail- - able: _p_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n. This is performed at the same time as - tilde, parameter, variable, and arithmetic expansion and command sub- + able: _p_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n. This is performed at the same time as + tilde, parameter, variable, and arithmetic expansion and command sub- stitution. - _Q_u_o_t_e _r_e_m_o_v_a_l is always performed last. It removes quote characters - present in the original word, not ones resulting from one of the other + _Q_u_o_t_e _r_e_m_o_v_a_l is always performed last. It removes quote characters + present in the original word, not ones resulting from one of the other expansions, unless they have been quoted themselves. - Only brace expansion, word splitting, and pathname expansion can in- - crease the number of words of the expansion; other expansions expand a - single word to a single word. The only exceptions to this are the ex- + Only brace expansion, word splitting, and pathname expansion can in- + crease the number of words of the expansion; other expansions expand a + single word to a single word. The only exceptions to this are the ex- pansions of ""$$@@"" and ""$${{_n_a_m_e[[@@]]}}"", and, in most cases, $$** and $${{_n_a_m_e[[**]]}} as explained above (see PPAARRAAMMEETTEERRSS). BBrraaccee EExxppaannssiioonn - _B_r_a_c_e _e_x_p_a_n_s_i_o_n is a mechanism to generate arbitrary strings sharing a + _B_r_a_c_e _e_x_p_a_n_s_i_o_n is a mechanism to generate arbitrary strings sharing a common prefix and suffix, either of which can be empty. This mechanism - is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the filenames generated need not - exist. Patterns to be brace expanded are formed from an optional _p_r_e_- - _a_m_b_l_e, followed by either a series of comma-separated strings or a se- - quence expression between a pair of braces, followed by an optional - _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each string contained within - the braces, and the postscript is then appended to each resulting + is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the filenames generated need not + exist. Patterns to be brace expanded are formed from an optional _p_r_e_- + _a_m_b_l_e, followed by either a series of comma-separated strings or a se- + quence expression between a pair of braces, followed by an optional + _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each string contained within + the braces, and the postscript is then appended to each resulting string, expanding left to right. - Brace expansions may be nested. The results of each expanded string + Brace expansions may be nested. The results of each expanded string are not sorted; brace expansion preserves left to right order. For ex- ample, a{{d,c,b}}e expands into "ade ace abe". - A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}, where _x and _y are - either integers or single letters, and _i_n_c_r, an optional increment, is + A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}, where _x and _y are + either integers or single letters, and _i_n_c_r, an optional increment, is an integer. When integers are supplied, the expression expands to each - number between _x and _y, inclusive. If either _x or _y begins with _0, - each generated term will contain the same number of digits, zero- - padding where necessary. When either _x or _y begins with a zero, the - shell attempts to force all generated terms to contain the same number - of digits, zero-padding where necessary. When letters are supplied, - the expression expands to each character lexicographically between _x - and _y, inclusive, using the default C locale. Note that both _x and _y - must be of the same type (integer or letter). When the increment is - supplied, it is used as the difference between each term. The default - increment is 1 or -1 as appropriate. + number between _x and _y, inclusive. If either _x or _y begins with a + zero, each generated term will contain the same number of digits, zero- + padding where necessary. When letters are supplied, the expression ex- + pands to each character lexicographically between _x and _y, inclusive, + using the default C locale. Note that both _x and _y must be of the same + type (integer or letter). When the increment is supplied, it is used + as the difference between each term. The default increment is 1 or -1 + as appropriate. Brace expansion is performed before any other expansions, and any char- acters special to other expansions are preserved in the result. It is @@ -1753,10 +1773,10 @@ EEXXPPAANNSSIIOONN closing braces, and at least one unquoted comma or a valid sequence ex- pression. Any incorrectly formed brace expansion is left unchanged. - A {{ or ,, may be quoted with a backslash to prevent its being considered - part of a brace expression. To avoid conflicts with parameter expan- - sion, the string $${{ is not considered eligible for brace expansion, and - inhibits brace expansion until the closing }}. + A "{" or Q , may be quoted with a backslash to prevent its being con- + sidered part of a brace expression. To avoid conflicts with parameter + expansion, the string "${" is not considered eligible for brace expan- + sion, and inhibits brace expansion until the closing "}". This construct is typically used as shorthand when the common prefix of the strings to be generated is longer than in the above example: @@ -1769,8 +1789,8 @@ EEXXPPAANNSSIIOONN versions of sshh. sshh does not treat opening or closing braces specially when they appear as part of a word, and preserves them in the output. BBaasshh removes braces from words as a consequence of brace expansion. - For example, a word entered to sshh as _f_i_l_e_{_1_,_2_} appears identically in - the output. BBaasshh outputs that word as _f_i_l_e_1 _f_i_l_e_2 after brace expan- + For example, a word entered to sshh as "file{1,2}" appears identically in + the output. BBaasshh outputs that word as "file1 file2" after brace expan- sion. Start bbaasshh with the ++BB option or disable brace expansion with the ++BB option to the sseett command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) for strict sshh compatibility. @@ -2203,7 +2223,7 @@ EEXXPPAANNSSIIOONN sis, otherwise the construct would be interpreted as a redirection. Process substitution is supported on systems that support named pipes - (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. + (_F_I_F_O_s) or the _/_d_e_v_/_f_d method of naming open files. When available, process substitution is performed simultaneously with parameter and variable expansion, command substitution, and arithmetic @@ -2302,8 +2322,9 @@ EEXXPPAANNSSIIOONN GGLLOOBBIIGGNNOORREE pattern matching honors the setting of the eexxttgglloobb shell op- tion. - The GGLLOOBBSSOORRTT shell variable controls how the results of pathname expan- - sion are sorted, as described above. + The value of the GGLLOOBBSSOORRTT shell variable controls how the results of + pathname expansion are sorted, as described above under SShheellll VVaarrii-- + aabblleess. PPaatttteerrnn MMaattcchhiinngg @@ -2499,14 +2520,14 @@ RREEDDIIRREECCTTIIOONN [_n]>>_w_o_r_d If the redirection operator is >>, and the nnoocclloobbbbeerr option to the sseett - builtin has been enabled, the redirection fails if the file whose name - results from the expansion of _w_o_r_d exists and is a regular file. If - the redirection operator is >>||, or the redirection operator is >> and - the nnoocclloobbbbeerr option to the sseett builtin command is not enabled, bbaasshh + builtin command has been enabled, the redirection fails if the file + whose name results from the expansion of _w_o_r_d exists and is a regular + file. If the redirection operator is >>||, or the redirection operator + is >> and the nnoocclloobbbbeerr option to the sseett builtin is not enabled, bbaasshh attempts the redirection even if the file named by _w_o_r_d exists. AAppppeennddiinngg RReeddiirreecctteedd OOuuttppuutt - Redirecting output in this fashion opens the file whose name results + Redirecting output in this fashion opens the file whose name results from the expansion of _w_o_r_d for appending on file descriptor _n, or the standard output (file descriptor 1) if _n is not specified. If the file does not exist it is created. @@ -3828,72 +3849,71 @@ RREEAADDLLIINNEE list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, the number of history entries is not limited. By default, bbaasshh - sets the the maximum number of history entries to the value of - the HHIISSTTSSIIZZEE shell variable. Setting _h_i_s_t_o_r_y_-_s_i_z_e to a non-nu- - meric value will set the maximum number of history entries to - 500. + sets the maximum number of history entries to the value of the + HHIISSTTSSIIZZEE shell variable. Setting _h_i_s_t_o_r_y_-_s_i_z_e to a non-numeric + value will set the maximum number of history entries to 500. hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) Setting this variable to OOnn makes rreeaaddlliinnee use a single line for - display, scrolling the input horizontally on a single screen - line when it becomes longer than the screen width rather than - wrapping to a new line. This setting is automatically enabled + display, scrolling the input horizontally on a single screen + line when it becomes longer than the screen width rather than + wrapping to a new line. This setting is automatically enabled for terminals of height 1. iinnppuutt--mmeettaa ((OOffff)) If set to OOnn, rreeaaddlliinnee enables eight-bit input (that is, it does not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The default is _O_f_f, - but rreeaaddlliinnee sets it to _O_n if the locale contains characters + but rreeaaddlliinnee sets it to _O_n if the locale contains characters whose encodings may include bytes with the eighth bit set. This - variable is dependent on the LLCC__CCTTYYPPEE locale category, and its + variable is dependent on the LLCC__CCTTYYPPEE locale category, and its value may change if the locale changes. The name mmeettaa--ffllaagg is a synonym for iinnppuutt--mmeettaa. iisseeaarrcchh--tteerrmmiinnaattoorrss (("CC--[[CC--jj")) - The string of characters that should terminate an incremental - search without subsequently executing the character as a com- - mand. If this variable has not been given a value, the charac- + The string of characters that should terminate an incremental + search without subsequently executing the character as a com- + mand. If this variable has not been given a value, the charac- ters _E_S_C and CC--jj terminate an incremental search. kkeeyymmaapp ((eemmaaccss)) - Set the current rreeaaddlliinnee keymap. The set of valid keymap names - is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- - _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is - equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the + Set the current rreeaaddlliinnee keymap. The set of valid keymap names + is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- + _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the value of eeddiittiinngg--mmooddee also affects the default keymap. kkeeyysseeqq--ttiimmeeoouutt ((550000)) - Specifies the duration rreeaaddlliinnee will wait for a character when - reading an ambiguous key sequence (one that can form a complete + Specifies the duration rreeaaddlliinnee will wait for a character when + reading an ambiguous key sequence (one that can form a complete key sequence using the input read so far, or can take additional - input to complete a longer key sequence). If rreeaaddlliinnee does not - receive any input within the timeout, it uses the shorter but - complete key sequence. The value is specified in milliseconds, - so a value of 1000 means that rreeaaddlliinnee will wait one second for - additional input. If this variable is set to a value less than - or equal to zero, or to a non-numeric value, rreeaaddlliinnee waits un- - til another key is pressed to decide which key sequence to com- + input to complete a longer key sequence). If rreeaaddlliinnee does not + receive any input within the timeout, it uses the shorter but + complete key sequence. The value is specified in milliseconds, + so a value of 1000 means that rreeaaddlliinnee will wait one second for + additional input. If this variable is set to a value less than + or equal to zero, or to a non-numeric value, rreeaaddlliinnee waits un- + til another key is pressed to decide which key sequence to com- plete. mmaarrkk--ddiirreeccttoorriieess ((OOnn)) If set to OOnn, completed directory names have a slash appended. mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff)) - If set to OOnn, rreeaaddlliinnee displays history lines that have been + If set to OOnn, rreeaaddlliinnee displays history lines that have been modified with a preceding asterisk (**). mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess ((OOffff)) If set to OOnn, completed names which are symbolic links to direc- - tories have a slash appended, subject to the value of mmaarrkk--ddii-- + tories have a slash appended, subject to the value of mmaarrkk--ddii-- rreeccttoorriieess. mmaattcchh--hhiiddddeenn--ffiilleess ((OOnn)) - This variable, when set to OOnn, forces rreeaaddlliinnee to match files - whose names begin with a "." (hidden files) when performing - filename completion. If set to OOffff, the user must include the + This variable, when set to OOnn, forces rreeaaddlliinnee to match files + whose names begin with a "." (hidden files) when performing + filename completion. If set to OOffff, the user must include the leading "." in the filename to be completed. mmeennuu--ccoommpplleettee--ddiissppllaayy--pprreeffiixx ((OOffff)) - If set to OOnn, menu completion displays the common prefix of the + If set to OOnn, menu completion displays the common prefix of the list of possible completions (which may be empty) before cycling through the list. oouuttppuutt--mmeettaa ((OOffff)) - If set to OOnn, rreeaaddlliinnee displays characters with the eighth bit - set directly rather than as a meta-prefixed escape sequence. - The default is _O_f_f, but rreeaaddlliinnee sets it to _O_n if the locale - contains characters whose encodings may include bytes with the - eighth bit set. This variable is dependent on the LLCC__CCTTYYPPEE lo- + If set to OOnn, rreeaaddlliinnee displays characters with the eighth bit + set directly rather than as a meta-prefixed escape sequence. + The default is _O_f_f, but rreeaaddlliinnee sets it to _O_n if the locale + contains characters whose encodings may include bytes with the + eighth bit set. This variable is dependent on the LLCC__CCTTYYPPEE lo- cale category, and its value may change if the locale changes. ppaaggee--ccoommpplleettiioonnss ((OOnn)) If set to OOnn, rreeaaddlliinnee uses an internal pager resembling _m_o_r_e(1) @@ -3901,109 +3921,109 @@ RREEAADDLLIINNEE pprreeffeerr--vviissiibbllee--bbeellll See bbeellll--ssttyyllee. pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff)) - If set to OOnn, rreeaaddlliinnee displays completions with matches sorted + If set to OOnn, rreeaaddlliinnee displays completions with matches sorted horizontally in alphabetical order, rather than down the screen. rreevveerrtt--aallll--aatt--nneewwlliinnee ((OOffff)) - If set to OOnn, rreeaaddlliinnee will undo all changes to history lines - before returning when executing aacccceepptt--lliinnee. By default, his- - tory lines may be modified and retain individual undo lists + If set to OOnn, rreeaaddlliinnee will undo all changes to history lines + before returning when executing aacccceepptt--lliinnee. By default, his- + tory lines may be modified and retain individual undo lists across calls to rreeaaddlliinnee. sseeaarrcchh--iiggnnoorree--ccaassee ((OOffff)) - If set to OOnn, rreeaaddlliinnee performs incremental and non-incremental + If set to OOnn, rreeaaddlliinnee performs incremental and non-incremental history list searches in a case-insensitive fashion. sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff)) - This alters the default behavior of the completion functions. + This alters the default behavior of the completion functions. If set to OOnn, words which have more than one possible completion - cause the matches to be listed immediately instead of ringing + cause the matches to be listed immediately instead of ringing the bell. sshhooww--aallll--iiff--uunnmmooddiiffiieedd ((OOffff)) - This alters the default behavior of the completion functions in + This alters the default behavior of the completion functions in a fashion similar to sshhooww--aallll--iiff--aammbbiigguuoouuss. If set to OOnn, words - which have more than one possible completion without any possi- - ble partial completion (the possible completions don't share a - common prefix) cause the matches to be listed immediately in- + which have more than one possible completion without any possi- + ble partial completion (the possible completions don't share a + common prefix) cause the matches to be listed immediately in- stead of ringing the bell. sshhooww--mmooddee--iinn--pprroommpptt ((OOffff)) - If set to OOnn, add a string to the beginning of the prompt indi- - cating the editing mode: emacs, vi command, or vi insertion. + If set to OOnn, add a string to the beginning of the prompt indi- + cating the editing mode: emacs, vi command, or vi insertion. The mode strings are user-settable (e.g., _e_m_a_c_s_-_m_o_d_e_-_s_t_r_i_n_g). sskkiipp--ccoommpplleetteedd--tteexxtt ((OOffff)) - If set to OOnn, this alters the default completion behavior when - inserting a single match into the line. It's only active when - performing completion in the middle of a word. If enabled, - rreeaaddlliinnee does not insert characters from the completion that - match characters after point in the word being completed, so + If set to OOnn, this alters the default completion behavior when + inserting a single match into the line. It's only active when + performing completion in the middle of a word. If enabled, + rreeaaddlliinnee does not insert characters from the completion that + match characters after point in the word being completed, so portions of the word following the cursor are not duplicated. vvii--ccmmdd--mmooddee--ssttrriinngg ((((ccmmdd)))) - If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is + If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is displayed immediately before the last line of the primary prompt - when vi editing mode is active and in command mode. The value + when vi editing mode is active and in command mode. The value is expanded like a key binding, so the standard set of meta- and - control- prefixes and backslash escape sequences is available. - The \1 and \2 escapes begin and end sequences of non-printing - characters, which can be used to embed a terminal control se- + control- prefixes and backslash escape sequences is available. + The \1 and \2 escapes begin and end sequences of non-printing + characters, which can be used to embed a terminal control se- quence into the mode string. vvii--iinnss--mmooddee--ssttrriinngg ((((iinnss)))) - If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is + If the _s_h_o_w_-_m_o_d_e_-_i_n_-_p_r_o_m_p_t variable is enabled, this string is displayed immediately before the last line of the primary prompt when vi editing mode is active and in insertion mode. The value is expanded like a key binding, so the standard set of meta- and - control- prefixes and backslash escape sequences is available. - The \1 and \2 escapes begin and end sequences of non-printing - characters, which can be used to embed a terminal control se- + control- prefixes and backslash escape sequences is available. + The \1 and \2 escapes begin and end sequences of non-printing + characters, which can be used to embed a terminal control se- quence into the mode string. vviissiibbllee--ssttaattss ((OOffff)) - If set to OOnn, a character denoting a file's type as reported by - _s_t_a_t(2) is appended to the filename when listing possible com- + If set to OOnn, a character denoting a file's type as reported by + _s_t_a_t(2) is appended to the filename when listing possible com- pletions. RReeaaddlliinnee CCoonnddiittiioonnaall CCoonnssttrruuccttss - RReeaaddlliinnee implements a facility similar in spirit to the conditional - compilation features of the C preprocessor which allows key bindings - and variable settings to be performed as the result of tests. There + RReeaaddlliinnee implements a facility similar in spirit to the conditional + compilation features of the C preprocessor which allows key bindings + and variable settings to be performed as the result of tests. There are four parser directives available. - $$iiff The $$iiff construct allows bindings to be made based on the edit- - ing mode, the terminal being used, or the application using - rreeaaddlliinnee. The text of the test, after any comparison operator, + $$iiff The $$iiff construct allows bindings to be made based on the edit- + ing mode, the terminal being used, or the application using + rreeaaddlliinnee. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no char- acters are required to isolate it. - mmooddee The mmooddee== form of the $$iiff directive is used to test - whether rreeaaddlliinnee is in emacs or vi mode. This may be - used in conjunction with the sseett kkeeyymmaapp command, for in- - stance, to set bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and - _e_m_a_c_s_-_c_t_l_x keymaps only if rreeaaddlliinnee is starting out in + mmooddee The mmooddee== form of the $$iiff directive is used to test + whether rreeaaddlliinnee is in emacs or vi mode. This may be + used in conjunction with the sseett kkeeyymmaapp command, for in- + stance, to set bindings in the _e_m_a_c_s_-_s_t_a_n_d_a_r_d and + _e_m_a_c_s_-_c_t_l_x keymaps only if rreeaaddlliinnee is starting out in emacs mode. - tteerrmm The tteerrmm== form may be used to include terminal-specific + tteerrmm The tteerrmm== form may be used to include terminal-specific key bindings, perhaps to bind the key sequences output by the terminal's function keys. The word on the right side of the == is tested against both the full name of the ter- - minal and the portion of the terminal name before the - first --. This allows _x_t_e_r_m to match both _x_t_e_r_m and + minal and the portion of the terminal name before the + first --. This allows _x_t_e_r_m to match both _x_t_e_r_m and _x_t_e_r_m_-_2_5_6_c_o_l_o_r, for instance. vveerrssiioonn - The vveerrssiioonn test may be used to perform comparisons - against specific rreeaaddlliinnee versions. The vveerrssiioonn expands - to the current rreeaaddlliinnee version. The set of comparison - operators includes ==, (and ====), !!==, <<==, >>==, <<, and >>. - The version number supplied on the right side of the op- - erator consists of a major version number, an optional + The vveerrssiioonn test may be used to perform comparisons + against specific rreeaaddlliinnee versions. The vveerrssiioonn expands + to the current rreeaaddlliinnee version. The set of comparison + operators includes ==, (and ====), !!==, <<==, >>==, <<, and >>. + The version number supplied on the right side of the op- + erator consists of a major version number, an optional decimal point, and an optional minor version (e.g., 77..11). - If the minor version is omitted, it defaults to 00. The - operator may be separated from the string vveerrssiioonn and + If the minor version is omitted, it defaults to 00. The + operator may be separated from the string vveerrssiioonn and from the version number argument by whitespace. _a_p_p_l_i_c_a_t_i_o_n The _a_p_p_l_i_c_a_t_i_o_n construct is used to include application- - specific settings. Each program using the rreeaaddlliinnee li- - brary sets the _a_p_p_l_i_c_a_t_i_o_n _n_a_m_e, and an initialization + specific settings. Each program using the rreeaaddlliinnee li- + brary sets the _a_p_p_l_i_c_a_t_i_o_n _n_a_m_e, and an initialization file can test for a particular value. This could be used - to bind key sequences to functions useful for a specific - program. For instance, the following command adds a key - sequence that quotes the current or previous word in + to bind key sequences to functions useful for a specific + program. For instance, the following command adds a key + sequence that quotes the current or previous word in bbaasshh: $$iiff Bash @@ -4013,12 +4033,12 @@ RREEAADDLLIINNEE _v_a_r_i_a_b_l_e The _v_a_r_i_a_b_l_e construct provides simple equality tests for - rreeaaddlliinnee variables and values. The permitted comparison - operators are _=, _=_=, and _!_=. The variable name must be + rreeaaddlliinnee variables and values. The permitted comparison + operators are _=, _=_=, and _!_=. The variable name must be separated from the comparison operator by whitespace; the - operator may be separated from the value on the right - hand side by whitespace. String and boolean variables - may be tested. Boolean variables must be tested against + operator may be separated from the value on the right + hand side by whitespace. String and boolean variables + may be tested. Boolean variables must be tested against the values _o_n and _o_f_f. $$eellssee Commands in this branch of the $$iiff directive are executed if the @@ -4028,71 +4048,71 @@ RREEAADDLLIINNEE command. $$iinncclluuddee - This directive takes a single filename as an argument and reads + This directive takes a single filename as an argument and reads commands and key bindings from that file. For example, the fol- lowing directive would read _/_e_t_c_/_i_n_p_u_t_r_c: $$iinncclluuddee _/_e_t_c_/_i_n_p_u_t_r_c SSeeaarrcchhiinngg - RReeaaddlliinnee provides commands for searching through the command history + RReeaaddlliinnee provides commands for searching through the command history (see HHIISSTTOORRYY below) for lines containing a specified string. There are two search modes: _i_n_c_r_e_m_e_n_t_a_l and _n_o_n_-_i_n_c_r_e_m_e_n_t_a_l. - Incremental searches begin before the user has finished typing the - search string. As each character of the search string is typed, rreeaadd-- + Incremental searches begin before the user has finished typing the + search string. As each character of the search string is typed, rreeaadd-- lliinnee displays the next entry from the history matching the string typed - so far. An incremental search requires only as many characters as - needed to find the desired history entry. When using emacs editing - mode, type CC--rr to search backward in the history for a particular - string. Typing CC--ss searches forward through the history. The charac- - ters present in the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used - to terminate an incremental search. If that variable has not been as- - signed a value, _E_S_C and CC--jj terminate an incremental search. CC--gg - aborts an incremental search and restores the original line. When the - search is terminated, the history entry containing the search string + so far. An incremental search requires only as many characters as + needed to find the desired history entry. When using emacs editing + mode, type CC--rr to search backward in the history for a particular + string. Typing CC--ss searches forward through the history. The charac- + ters present in the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used + to terminate an incremental search. If that variable has not been as- + signed a value, _E_S_C and CC--jj terminate an incremental search. CC--gg + aborts an incremental search and restores the original line. When the + search is terminated, the history entry containing the search string becomes the current line. - To find other matching entries in the history list, type CC--rr or CC--ss as - appropriate. This searches backward or forward in the history for the - next entry matching the search string typed so far. Any other key se- - quence bound to a rreeaaddlliinnee command terminates the search and executes - that command. For instance, a newline terminates the search and ac- + To find other matching entries in the history list, type CC--rr or CC--ss as + appropriate. This searches backward or forward in the history for the + next entry matching the search string typed so far. Any other key se- + quence bound to a rreeaaddlliinnee command terminates the search and executes + that command. For instance, a newline terminates the search and ac- cepts the line, thereby executing the command from the history list. A - movement command will terminate the search, make the last line found + movement command will terminate the search, make the last line found the current line, and begin editing. RReeaaddlliinnee remembers the last incremental search string. If two CC--rrs are - typed without any intervening characters defining a new search string, + typed without any intervening characters defining a new search string, rreeaaddlliinnee uses any remembered search string. - Non-incremental searches read the entire search string before starting + Non-incremental searches read the entire search string before starting to search for matching history entries. The search string may be typed by the user or be part of the contents of the current line. RReeaaddlliinnee CCoommmmaanndd NNaammeess - The following is a list of the names of the commands and the default + The following is a list of the names of the commands and the default key sequences to which they are bound. Command names without an accom- panying key sequence are unbound by default. In the following descriptions, _p_o_i_n_t refers to the current cursor posi- - tion, and _m_a_r_k refers to a cursor position saved by the sseett--mmaarrkk com- - mand. The text between the point and mark is referred to as the _r_e_- + tion, and _m_a_r_k refers to a cursor position saved by the sseett--mmaarrkk com- + mand. The text between the point and mark is referred to as the _r_e_- _g_i_o_n. RReeaaddlliinnee has the concept of an _a_c_t_i_v_e _r_e_g_i_o_n: when the region is active, rreeaaddlliinnee redisplay highlights the region using the value of the - aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr variable. The eennaabbllee--aaccttiivvee--rreeggiioonn rreeaaddlliinnee + aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr variable. The eennaabbllee--aaccttiivvee--rreeggiioonn rreeaaddlliinnee variable turns this on and off. Several commands set the region to ac- tive; those are noted below. CCoommmmaannddss ffoorr MMoovviinngg bbeeggiinnnniinngg--ooff--lliinnee ((CC--aa)) - Move to the start of the current line. This may also be bound + Move to the start of the current line. This may also be bound to the Home key on some keyboards. eenndd--ooff--lliinnee ((CC--ee)) - Move to the end of the line. This may also be bound to the End + Move to the end of the line. This may also be bound to the End key on some keyboards. ffoorrwwaarrdd--cchhaarr ((CC--ff)) - Move forward a character. This may also be bound to the right + Move forward a character. This may also be bound to the right arrow key on some keyboards. bbaacckkwwaarrdd--cchhaarr ((CC--bb)) Move back a character. This may also be bound to the left arrow @@ -4101,33 +4121,33 @@ RREEAADDLLIINNEE Move forward to the end of the next word. Words are composed of alphanumeric characters (letters and digits). bbaacckkwwaarrdd--wwoorrdd ((MM--bb)) - Move back to the start of the current or previous word. Words + Move back to the start of the current or previous word. Words are composed of alphanumeric characters (letters and digits). - sshheellll--ffoorrwwaarrdd--wwoorrdd - Move forward to the end of the next word. Words are delimited + sshheellll--ffoorrwwaarrdd--wwoorrdd ((MM--CC--ff)) + Move forward to the end of the next word. Words are delimited by non-quoted shell metacharacters. - sshheellll--bbaacckkwwaarrdd--wwoorrdd - Move back to the start of the current or previous word. Words + sshheellll--bbaacckkwwaarrdd--wwoorrdd ((MM--CC--bb)) + Move back to the start of the current or previous word. Words are delimited by non-quoted shell metacharacters. pprreevviioouuss--ssccrreeeenn--lliinnee - Attempt to move point to the same physical screen column on the - previous physical screen line. This will not have the desired - effect if the current rreeaaddlliinnee line does not take up more than - one physical line or if point is not greater than the length of + Attempt to move point to the same physical screen column on the + previous physical screen line. This will not have the desired + effect if the current rreeaaddlliinnee line does not take up more than + one physical line or if point is not greater than the length of the prompt plus the screen width. nneexxtt--ssccrreeeenn--lliinnee - Attempt to move point to the same physical screen column on the - next physical screen line. This will not have the desired ef- + Attempt to move point to the same physical screen column on the + next physical screen line. This will not have the desired ef- fect if the current rreeaaddlliinnee line does not take up more than one - physical line or if the length of the current rreeaaddlliinnee line is + physical line or if the length of the current rreeaaddlliinnee line is not greater than the length of the prompt plus the screen width. cclleeaarr--ddiissppllaayy ((MM--CC--ll)) - Clear the screen and, if possible, the terminal's scrollback - buffer, then redraw the current line, leaving the current line + Clear the screen and, if possible, the terminal's scrollback + buffer, then redraw the current line, leaving the current line at the top of the screen. cclleeaarr--ssccrreeeenn ((CC--ll)) Clear the screen, then redraw the current line, leaving the cur- - rent line at the top of the screen. With an argument, refresh + rent line at the top of the screen. With an argument, refresh the current line without clearing the screen. rreeddrraaww--ccuurrrreenntt--lliinnee Refresh the current line. @@ -4135,48 +4155,48 @@ RREEAADDLLIINNEE CCoommmmaannddss ffoorr MMaanniippuullaattiinngg tthhee HHiissttoorryy aacccceepptt--lliinnee ((NNeewwlliinnee,, RReettuurrnn)) Accept the line regardless of where the cursor is. If this line - is non-empty, add it to the history list according to the state - of the HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables. If the line is a - modified history line, restore the history line to its original + is non-empty, add it to the history list according to the state + of the HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables. If the line is a + modified history line, restore the history line to its original state. pprreevviioouuss--hhiissttoorryy ((CC--pp)) Fetch the previous command from the history list, moving back in - the list. This may also be bound to the up arrow key on some + the list. This may also be bound to the up arrow key on some keyboards. nneexxtt--hhiissttoorryy ((CC--nn)) - Fetch the next command from the history list, moving forward in - the list. This may also be bound to the down arrow key on some + Fetch the next command from the history list, moving forward in + the list. This may also be bound to the down arrow key on some keyboards. bbeeggiinnnniinngg--ooff--hhiissttoorryy ((MM--<<)) Move to the first line in the history. eenndd--ooff--hhiissttoorryy ((MM-->>)) - Move to the end of the input history, i.e., the line currently + Move to the end of the input history, i.e., the line currently being entered. ooppeerraattee--aanndd--ggeett--nneexxtt ((CC--oo)) - Accept the current line for execution as if a newline had been - entered, and fetch the next line relative to the current line - from the history for editing. A numeric argument, if supplied, + Accept the current line for execution as if a newline had been + entered, and fetch the next line relative to the current line + from the history for editing. A numeric argument, if supplied, specifies the history entry to use instead of the current line. ffeettcchh--hhiissttoorryy - With a numeric argument, fetch that entry from the history list + With a numeric argument, fetch that entry from the history list and make it the current line. Without an argument, move back to the first entry in the history list. rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((CC--rr)) - Search backward starting at the current line and moving "up" - through the history as necessary. This is an incremental - search. This command sets the region to the matched text and - activates the region. - ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) - Search forward starting at the current line and moving "down" + Search backward starting at the current line and moving "up" through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the region. + ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) + Search forward starting at the current line and moving "down" + through the history as necessary. This is an incremental + search. This command sets the region to the matched text and + activates the region. nnoonn--iinnccrreemmeennttaall--rreevveerrssee--sseeaarrcchh--hhiissttoorryy ((MM--pp)) Search backward through the history starting at the current line - using a non-incremental search for a string supplied by the + using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. nnoonn--iinnccrreemmeennttaall--ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((MM--nn)) - Search forward through the history using a non-incremental + Search forward through the history using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd @@ -4186,72 +4206,72 @@ RREEAADDLLIINNEE non-incremental search. This may be bound to the Page Up key on some keyboards. hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd - Search forward through the history for the string of characters + Search forward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a - non-incremental search. This may be bound to the Page Down key + non-incremental search. This may be bound to the Page Down key on some keyboards. hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--bbaacckkwwaarrdd Search backward through the history for the string of characters between the start of the current line and the point. The search - string may match anywhere in a history line. This is a non-in- + string may match anywhere in a history line. This is a non-in- cremental search. hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--ffoorrwwaarrdd - Search forward through the history for the string of characters + Search forward through the history for the string of characters between the start of the current line and the point. The search - string may match anywhere in a history line. This is a non-in- + string may match anywhere in a history line. This is a non-in- cremental search. yyaannkk--nntthh--aarrgg ((MM--CC--yy)) - Insert the first argument to the previous command (usually the + Insert the first argument to the previous command (usually the second word on the previous line) at point. With an argument _n, - insert the _nth word from the previous command (the words in the - previous command begin with word 0). A negative argument in- - serts the _nth word from the end of the previous command. Once - the argument _n is computed, this uses the history expansion fa- - cilities to extract the _nth word, as if the "!_n" history expan- + insert the _nth word from the previous command (the words in the + previous command begin with word 0). A negative argument in- + serts the _nth word from the end of the previous command. Once + the argument _n is computed, this uses the history expansion fa- + cilities to extract the _nth word, as if the "!_n" history expan- sion had been specified. yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) - Insert the last argument to the previous command (the last word + Insert the last argument to the previous command (the last word of the previous history entry). With a numeric argument, behave - exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg - move back through the history list, inserting the last word (or - the word specified by the argument to the first call) of each + exactly like yyaannkk--nntthh--aarrgg. Successive calls to yyaannkk--llaasstt--aarrgg + move back through the history list, inserting the last word (or + the word specified by the argument to the first call) of each line in turn. Any numeric argument supplied to these successive - calls determines the direction to move through the history. A - negative argument switches the direction through the history - (back or forward). This uses the history expansion facilities - to extract the last word, as if the "!$" history expansion had + calls determines the direction to move through the history. A + negative argument switches the direction through the history + (back or forward). This uses the history expansion facilities + to extract the last word, as if the "!$" history expansion had been specified. sshheellll--eexxppaanndd--lliinnee ((MM--CC--ee)) - Expand the line by performing shell word expansions. This per- + Expand the line by performing shell word expansions. This per- forms alias and history expansion, $$'_s_t_r_i_n_g' and $$"_s_t_r_i_n_g" quot- - ing, tilde expansion, parameter and variable expansion, arith- - metic expansion, command and process substitution, word split- - ting, and quote removal. An explicit argument suppresses com- - mand and process substitution. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for + ing, tilde expansion, parameter and variable expansion, arith- + metic expansion, command and process substitution, word split- + ting, and quote removal. An explicit argument suppresses com- + mand and process substitution. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. hhiissttoorryy--eexxppaanndd--lliinnee ((MM--^^)) - Perform history expansion on the current line. See HHIISSTTOORRYY EEXX-- + Perform history expansion on the current line. See HHIISSTTOORRYY EEXX-- PPAANNSSIIOONN below for a description of history expansion. mmaaggiicc--ssppaaccee - Perform history expansion on the current line and insert a + Perform history expansion on the current line and insert a space. See HHIISSTTOORRYY EEXXPPAANNSSIIOONN below for a description of history expansion. aalliiaass--eexxppaanndd--lliinnee - Perform alias expansion on the current line. See AALLIIAASSEESS above + Perform alias expansion on the current line. See AALLIIAASSEESS above for a description of alias expansion. hhiissttoorryy--aanndd--aalliiaass--eexxppaanndd--lliinnee Perform history and alias expansion on the current line. iinnsseerrtt--llaasstt--aarrgguummeenntt ((MM--..,, MM--__)) A synonym for yyaannkk--llaasstt--aarrgg. eeddiitt--aanndd--eexxeeccuuttee--ccoommmmaanndd ((CC--xx CC--ee)) - Invoke an editor on the current command line, and execute the + Invoke an editor on the current command line, and execute the result as shell commands. BBaasshh attempts to invoke $$VVIISSUUAALL, $$EEDD-- IITTOORR, and _e_m_a_c_s as the editor, in that order. CCoommmmaannddss ffoorr CChhaannggiinngg TTeexxtt _e_n_d_-_o_f_-_f_i_l_e ((uussuuaallllyy CC--dd)) - The character indicating end-of-file as set, for example, by + The character indicating end-of-file as set, for example, by _s_t_t_y(1). If this character is read when there are no characters on the line, and point is at the beginning of the line, rreeaaddlliinnee interprets it as the end of input and returns EEOOFF. @@ -4261,198 +4281,198 @@ RREEAADDLLIINNEE above for the effects. This may also be bound to the Delete key on some keyboards. bbaacckkwwaarrdd--ddeelleettee--cchhaarr ((RRuubboouutt)) - Delete the character behind the cursor. When given a numeric + Delete the character behind the cursor. When given a numeric argument, save the deleted text on the kill ring. ffoorrwwaarrdd--bbaacckkwwaarrdd--ddeelleettee--cchhaarr - Delete the character under the cursor, unless the cursor is at + Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cur- sor is deleted. qquuootteedd--iinnsseerrtt ((CC--qq,, CC--vv)) - Add the next character typed to the line verbatim. This is how + Add the next character typed to the line verbatim. This is how to insert characters like CC--qq, for example. ttaabb--iinnsseerrtt ((CC--vv TTAABB)) Insert a tab character. sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ...)) Insert the character typed. bbrraacckkeetteedd--ppaassttee--bbeeggiinn - This function is intended to be bound to the "bracketed paste" - escape sequence sent by some terminals, and such a binding is - assigned by default. It allows rreeaaddlliinnee to insert the pasted - text as a single unit without treating each character as if it - had been read from the keyboard. The pasted characters are in- - serted as if each one was bound to sseellff--iinnsseerrtt instead of exe- + This function is intended to be bound to the "bracketed paste" + escape sequence sent by some terminals, and such a binding is + assigned by default. It allows rreeaaddlliinnee to insert the pasted + text as a single unit without treating each character as if it + had been read from the keyboard. The pasted characters are in- + serted as if each one was bound to sseellff--iinnsseerrtt instead of exe- cuting any editing commands. - Bracketed paste sets the region to the inserted text and acti- + Bracketed paste sets the region to the inserted text and acti- vates the region. ttrraannssppoossee--cchhaarrss ((CC--tt)) - Drag the character before point forward over the character at - point, moving point forward as well. If point is at the end of - the line, then this transposes the two characters before point. + Drag the character before point forward over the character at + point, moving point forward as well. If point is at the end of + the line, then this transposes the two characters before point. Negative arguments have no effect. ttrraannssppoossee--wwoorrddss ((MM--tt)) - Drag the word before point past the word after point, moving - point over that word as well. If point is at the end of the + Drag the word before point past the word after point, moving + point past that word as well. If point is at the end of the line, this transposes the last two words on the line. sshheellll--ttrraannssppoossee--wwoorrddss ((MM--CC--tt)) - Drag the word before point past the word after point, moving - point past that word as well. If the insertion point is at the + Drag the word before point past the word after point, moving + point past that word as well. If the insertion point is at the end of the line, this transposes the last two words on the line. - Word boundaries are the same as sshheellll--ffoorrwwaarrdd--wwoorrdd and + Word boundaries are the same as sshheellll--ffoorrwwaarrdd--wwoorrdd and sshheellll--bbaacckkwwaarrdd--wwoorrdd. uuppccaassee--wwoorrdd ((MM--uu)) - Uppercase the current (or following) word. With a negative ar- + Uppercase the current (or following) word. With a negative ar- gument, uppercase the previous word, but do not move point. ddoowwnnccaassee--wwoorrdd ((MM--ll)) - Lowercase the current (or following) word. With a negative ar- + Lowercase the current (or following) word. With a negative ar- gument, lowercase the previous word, but do not move point. ccaappiittaalliizzee--wwoorrdd ((MM--cc)) Capitalize the current (or following) word. With a negative ar- gument, capitalize the previous word, but do not move point. oovveerrwwrriittee--mmooddee - Toggle overwrite mode. With an explicit positive numeric argu- + Toggle overwrite mode. With an explicit positive numeric argu- ment, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects - only eemmaaccss mode; vvii mode does overwrite differently. Each call + only eemmaaccss mode; vvii mode does overwrite differently. Each call to _r_e_a_d_l_i_n_e_(_) starts in insert mode. - In overwrite mode, characters bound to sseellff--iinnsseerrtt replace the - text at point rather than pushing the text to the right. Char- - acters bound to bbaacckkwwaarrdd--ddeelleettee--cchhaarr replace the character be- - fore point with a space. By default, this command is unbound, + In overwrite mode, characters bound to sseellff--iinnsseerrtt replace the + text at point rather than pushing the text to the right. Char- + acters bound to bbaacckkwwaarrdd--ddeelleettee--cchhaarr replace the character be- + fore point with a space. By default, this command is unbound, but may be bound to the Insert key on some keyboards. KKiilllliinngg aanndd YYaannkkiinngg kkiillll--lliinnee ((CC--kk)) Kill the text from point to the end of the current line. With a - negative numeric argument, kill backward from the cursor to the + negative numeric argument, kill backward from the cursor to the beginning of the line. bbaacckkwwaarrdd--kkiillll--lliinnee ((CC--xx RRuubboouutt)) Kill backward to the beginning of the current line. With a neg- - ative numeric argument, kill forward from the cursor to the end + ative numeric argument, kill forward from the cursor to the end of the line. uunniixx--lliinnee--ddiissccaarrdd ((CC--uu)) - Kill backward from point to the beginning of the line, saving + Kill backward from point to the beginning of the line, saving the killed text on the kill-ring. kkiillll--wwhhoollee--lliinnee - Kill all characters on the current line, no matter where point + Kill all characters on the current line, no matter where point is. kkiillll--wwoorrdd ((MM--dd)) - Kill from point to the end of the current word, or if between - words, to the end of the next word. Word boundaries are the + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the same as those used by ffoorrwwaarrdd--wwoorrdd. bbaacckkwwaarrdd--kkiillll--wwoorrdd ((MM--RRuubboouutt)) - Kill the word behind point. Word boundaries are the same as + Kill the word behind point. Word boundaries are the same as those used by bbaacckkwwaarrdd--wwoorrdd. sshheellll--kkiillll--wwoorrdd ((MM--CC--dd)) - Kill from point to the end of the current word, or if between - words, to the end of the next word. Word boundaries are the + Kill from point to the end of the current word, or if between + words, to the end of the next word. Word boundaries are the same as those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. sshheellll--bbaacckkwwaarrdd--kkiillll--wwoorrdd - Kill the word behind point. Word boundaries are the same as + Kill the word behind point. Word boundaries are the same as those used by sshheellll--bbaacckkwwaarrdd--wwoorrdd. uunniixx--wwoorrdd--rruubboouutt ((CC--ww)) - Kill the word behind point, using white space as a word bound- + Kill the word behind point, using white space as a word bound- ary, saving the killed text on the kill-ring. uunniixx--ffiilleennaammee--rruubboouutt - Kill the word behind point, using white space and the slash - character as the word boundaries, saving the killed text on the + Kill the word behind point, using white space and the slash + character as the word boundaries, saving the killed text on the kill-ring. ddeelleettee--hhoorriizzoonnttaall--ssppaaccee ((MM--\\)) Delete all spaces and tabs around point. kkiillll--rreeggiioonn Kill the text in the current region. ccooppyy--rreeggiioonn--aass--kkiillll - Copy the text in the region to the kill buffer, so it can be + Copy the text in the region to the kill buffer, so it can be yanked immediately. ccooppyy--bbaacckkwwaarrdd--wwoorrdd - Copy the word before point to the kill buffer. The word bound- + Copy the word before point to the kill buffer. The word bound- aries are the same as bbaacckkwwaarrdd--wwoorrdd. ccooppyy--ffoorrwwaarrdd--wwoorrdd - Copy the word following point to the kill buffer. The word + Copy the word following point to the kill buffer. The word boundaries are the same as ffoorrwwaarrdd--wwoorrdd. yyaannkk ((CC--yy)) Yank the top of the kill ring into the buffer at point. yyaannkk--ppoopp ((MM--yy)) - Rotate the kill ring, and yank the new top. Only works follow- + Rotate the kill ring, and yank the new top. Only works follow- ing yyaannkk or yyaannkk--ppoopp. NNuummeerriicc AArrgguummeennttss ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ...,, MM----)) - Add this digit to the argument already accumulating, or start a + Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument. uunniivveerrssaall--aarrgguummeenntt - This is another way to specify an argument. If this command is - followed by one or more digits, optionally with a leading minus - sign, those digits define the argument. If the command is fol- + This is another way to specify an argument. If this command is + followed by one or more digits, optionally with a leading minus + sign, those digits define the argument. If the command is fol- lowed by digits, executing uunniivveerrssaall--aarrgguummeenntt again ends the nu- meric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is nei- - ther a digit nor minus sign, the argument count for the next - command is multiplied by four. The argument count is initially - one, so executing this function the first time makes the argu- + ther a digit nor minus sign, the argument count for the next + command is multiplied by four. The argument count is initially + one, so executing this function the first time makes the argu- ment count four, a second time makes the argument count sixteen, and so on. CCoommpplleettiinngg ccoommpplleettee ((TTAABB)) - Attempt to perform completion on the text before point. BBaasshh - attempts completion by first checking for any programmable com- - pletions for the command word (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn be- + Attempt to perform completion on the text before point. BBaasshh + attempts completion by first checking for any programmable com- + pletions for the command word (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn be- low), otherwise treating the text as a variable (if the text be- gins with $$), username (if the text begins with ~~), hostname (if - the text begins with @@), or command (including aliases, func- - tions, and builtins) in turn. If none of these produces a + the text begins with @@), or command (including aliases, func- + tions, and builtins) in turn. If none of these produces a match, it falls back to filename completion. ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) - List the possible completions of the text before point. When + List the possible completions of the text before point. When displaying completions, rreeaaddlliinnee sets the number of columns used - for display to the value of ccoommpplleettiioonn--ddiissppllaayy--wwiiddtthh, the value - of the shell variable CCOOLLUUMMNNSS, or the screen width, in that or- + for display to the value of ccoommpplleettiioonn--ddiissppllaayy--wwiiddtthh, the value + of the shell variable CCOOLLUUMMNNSS, or the screen width, in that or- der. iinnsseerrtt--ccoommpplleettiioonnss ((MM--**)) - Insert all completions of the text before point that would have + Insert all completions of the text before point that would have been generated by ppoossssiibbllee--ccoommpplleettiioonnss, separated by a space. mmeennuu--ccoommpplleettee - Similar to ccoommpplleettee, but replaces the word to be completed with - a single match from the list of possible completions. Repeat- - edly executing mmeennuu--ccoommpplleettee steps through the list of possible - completions, inserting each match in turn. At the end of the - list of completions, mmeennuu--ccoommpplleettee rings the bell (subject to - the setting of bbeellll--ssttyyllee) and restores the original text. An - argument of _n moves _n positions forward in the list of matches; - a negative argument moves backward through the list. This com- + Similar to ccoommpplleettee, but replaces the word to be completed with + a single match from the list of possible completions. Repeat- + edly executing mmeennuu--ccoommpplleettee steps through the list of possible + completions, inserting each match in turn. At the end of the + list of completions, mmeennuu--ccoommpplleettee rings the bell (subject to + the setting of bbeellll--ssttyyllee) and restores the original text. An + argument of _n moves _n positions forward in the list of matches; + a negative argument moves backward through the list. This com- mand is intended to be bound to TTAABB, but is unbound by default. mmeennuu--ccoommpplleettee--bbaacckkwwaarrdd - Identical to mmeennuu--ccoommpplleettee, but moves backward through the list - of possible completions, as if mmeennuu--ccoommpplleettee had been given a + Identical to mmeennuu--ccoommpplleettee, but moves backward through the list + of possible completions, as if mmeennuu--ccoommpplleettee had been given a negative argument. This command is unbound by default. eexxppoorrtt--ccoommpplleettiioonnss - Perform completion on the word before point as described above - and write the list of possible completions to rreeaaddlliinnee's output - stream using the following format, writing information on sepa- + Perform completion on the word before point as described above + and write the list of possible completions to rreeaaddlliinnee's output + stream using the following format, writing information on sepa- rate lines: +o the number of matches _N; +o the word being completed; - +o _S:_E, where S and E are the start and end offsets of the + +o _S:_E, where _S and _E are the start and end offsets of the word in the rreeaaddlliinnee line buffer; then +o each match, one per line - If there are no matches, the first line will be "0", and this - command does not print any output after the _S:_E. If there is - only a single match, this prints a single line containing it. - If there is more than one match, this prints the common prefix - of the matches, which may be empty, on the first line after the + If there are no matches, the first line will be "0", and this + command does not print any output after the _S:_E. If there is + only a single match, this prints a single line containing it. + If there is more than one match, this prints the common prefix + of the matches, which may be empty, on the first line after the _S:_E, then the matches on subsequent lines. In this case, _N will include the first line with the common prefix. The user or application should be able to accommodate the possi- bility of a blank line. The intent is that the user or applica- - tion reads _N lines after the line containing _S:_E to obtain the + tion reads _N lines after the line containing _S:_E to obtain the match list. This command is unbound by default. ddeelleettee--cchhaarr--oorr--lliisstt - Deletes the character under the cursor if not at the beginning - or end of the line (like ddeelleettee--cchhaarr). At the end of the line, + Deletes the character under the cursor if not at the beginning + or end of the line (like ddeelleettee--cchhaarr). At the end of the line, it behaves identically to ppoossssiibbllee--ccoommpplleettiioonnss. This command is unbound by default. @@ -4464,7 +4484,7 @@ RREEAADDLLIINNEE it as a filename. ccoommpplleettee--uusseerrnnaammee ((MM--~~)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a username. ppoossssiibbllee--uusseerrnnaammee--ccoommpplleettiioonnss ((CC--xx ~~)) @@ -4472,7 +4492,7 @@ RREEAADDLLIINNEE it as a username. ccoommpplleettee--vvaarriiaabbllee ((MM--$$)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a shell variable. ppoossssiibbllee--vvaarriiaabbllee--ccoommpplleettiioonnss ((CC--xx $$)) @@ -4480,7 +4500,7 @@ RREEAADDLLIINNEE it as a shell variable. ccoommpplleettee--hhoossttnnaammee ((MM--@@)) - Attempt completion on the text before point, treating it as a + Attempt completion on the text before point, treating it as a hostname. ppoossssiibbllee--hhoossttnnaammee--ccoommpplleettiioonnss ((CC--xx @@)) @@ -4488,9 +4508,9 @@ RREEAADDLLIINNEE it as a hostname. ccoommpplleettee--ccoommmmaanndd ((MM--!!)) - Attempt completion on the text before point, treating it as a - command name. Command completion attempts to match the text - against aliases, reserved words, shell functions, shell + Attempt completion on the text before point, treating it as a + command name. Command completion attempts to match the text + against aliases, reserved words, shell functions, shell builtins, and finally executable filenames, in that order. ppoossssiibbllee--ccoommmmaanndd--ccoommpplleettiioonnss ((CC--xx !!)) @@ -4498,42 +4518,42 @@ RREEAADDLLIINNEE it as a command name. ddyynnaammiicc--ccoommpplleettee--hhiissttoorryy ((MM--TTAABB)) - Attempt completion on the text before point, comparing the text + Attempt completion on the text before point, comparing the text against history list entries for possible completion matches. ddaabbbbrreevv--eexxppaanndd - Attempt menu completion on the text before point, comparing the + Attempt menu completion on the text before point, comparing the text against lines from the history list for possible completion matches. ccoommpplleettee--iinnttoo--bbrraacceess ((MM--{{)) Perform filename completion and insert the list of possible com- - pletions enclosed within braces so the list is available to the + pletions enclosed within braces so the list is available to the shell (see BBrraaccee EExxppaannssiioonn above). KKeeyybbooaarrdd MMaaccrrooss ssttaarrtt--kkbbdd--mmaaccrroo ((CC--xx (()) - Begin saving the characters typed into the current keyboard + Begin saving the characters typed into the current keyboard macro. eenndd--kkbbdd--mmaaccrroo ((CC--xx )))) Stop saving the characters typed into the current keyboard macro and store the definition. ccaallll--llaasstt--kkbbdd--mmaaccrroo ((CC--xx ee)) - Re-execute the last keyboard macro defined, by making the char- + Re-execute the last keyboard macro defined, by making the char- acters in the macro appear as if typed at the keyboard. pprriinntt--llaasstt--kkbbdd--mmaaccrroo (()) - Print the last keyboard macro defined in a format suitable for + Print the last keyboard macro defined in a format suitable for the _i_n_p_u_t_r_c file. MMiisscceellllaanneeoouuss rree--rreeaadd--iinniitt--ffiillee ((CC--xx CC--rr)) - Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any + Read in the contents of the _i_n_p_u_t_r_c file, and incorporate any bindings or variable assignments found there. aabboorrtt ((CC--gg)) - Abort the current editing command and ring the terminal's bell + Abort the current editing command and ring the terminal's bell (subject to the setting of bbeellll--ssttyyllee). ddoo--lloowweerrccaassee--vveerrssiioonn ((MM--AA,, MM--BB,, MM--_x,, ...)) - If the metafied character _x is uppercase, run the command that + If the metafied character _x is uppercase, run the command that is bound to the corresponding metafied lowercase character. The behavior is undefined if _x is already lowercase. pprreeffiixx--mmeettaa ((EESSCC)) @@ -4541,223 +4561,223 @@ RREEAADDLLIINNEE uunnddoo ((CC--__,, CC--xx CC--uu)) Incremental undo, separately remembered for each line. rreevveerrtt--lliinnee ((MM--rr)) - Undo all changes made to this line. This is like executing the - uunnddoo command enough times to return the line to its initial + Undo all changes made to this line. This is like executing the + uunnddoo command enough times to return the line to its initial state. ttiillddee--eexxppaanndd ((MM--&&)) Perform tilde expansion on the current word. sseett--mmaarrkk ((CC--@@,, MM--<>)) - Set the mark to the point. If a numeric argument is supplied, + Set the mark to the point. If a numeric argument is supplied, set the mark to that position. eexxcchhaannggee--ppooiinntt--aanndd--mmaarrkk ((CC--xx CC--xx)) - Swap the point with the mark. Set the current cursor position + Swap the point with the mark. Set the current cursor position to the saved position, then set the mark to the old cursor posi- tion. cchhaarraacctteerr--sseeaarrcchh ((CC--]])) - Read a character and move point to the next occurrence of that - character. A negative argument searches for previous occur- + Read a character and move point to the next occurrence of that + character. A negative argument searches for previous occur- rences. cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]])) - Read a character and move point to the previous occurrence of + Read a character and move point to the previous occurrence of that character. A negative argument searches for subsequent oc- currences. sskkiipp--ccssii--sseeqquueennccee - Read enough characters to consume a multi-key sequence such as - those defined for keys like Home and End. CSI sequences begin + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. CSI sequences begin with a Control Sequence Indicator (CSI), usually _E_S_C _[. If this sequence is bound to "\e[", keys producing CSI sequences have no effect unless explicitly bound to a rreeaaddlliinnee command, instead of inserting stray characters into the editing buffer. This is un- bound by default, but usually bound to _E_S_C _[. iinnsseerrtt--ccoommmmeenntt ((MM--##)) - Without a numeric argument, insert the value of the rreeaaddlliinnee + Without a numeric argument, insert the value of the rreeaaddlliinnee ccoommmmeenntt--bbeeggiinn variable at the beginning of the current line. If - a numeric argument is supplied, this command acts as a toggle: - if the characters at the beginning of the line do not match the - value of ccoommmmeenntt--bbeeggiinn, insert the value; otherwise delete the - characters in ccoommmmeenntt--bbeeggiinn from the beginning of the line. In - either case, the line is accepted as if a newline had been - typed. The default value of ccoommmmeenntt--bbeeggiinn causes this command + a numeric argument is supplied, this command acts as a toggle: + if the characters at the beginning of the line do not match the + value of ccoommmmeenntt--bbeeggiinn, insert the value; otherwise delete the + characters in ccoommmmeenntt--bbeeggiinn from the beginning of the line. In + either case, the line is accepted as if a newline had been + typed. The default value of ccoommmmeenntt--bbeeggiinn causes this command to make the current line a shell comment. If a numeric argument causes the comment character to be removed, the line will be ex- ecuted by the shell. ssppeellll--ccoorrrreecctt--wwoorrdd ((CC--xx ss)) - Perform spelling correction on the current word, treating it as - a directory or filename, in the same way as the ccddssppeellll shell - option. Word boundaries are the same as those used by + Perform spelling correction on the current word, treating it as + a directory or filename, in the same way as the ccddssppeellll shell + option. Word boundaries are the same as those used by sshheellll--ffoorrwwaarrdd--wwoorrdd. gglloobb--ccoommpplleettee--wwoorrdd ((MM--gg)) Treat the word before point as a pattern for pathname expansion, - with an asterisk implicitly appended, then use the pattern to + with an asterisk implicitly appended, then use the pattern to generate a list of matching file names for possible completions. gglloobb--eexxppaanndd--wwoorrdd ((CC--xx **)) Treat the word before point as a pattern for pathname expansion, - and insert the list of matching file names, replacing the word. - If a numeric argument is supplied, append a ** before pathname + and insert the list of matching file names, replacing the word. + If a numeric argument is supplied, append a ** before pathname expansion. gglloobb--lliisstt--eexxppaannssiioonnss ((CC--xx gg)) Display the list of expansions that would have been generated by - gglloobb--eexxppaanndd--wwoorrdd and redisplay the line. If a numeric argument + gglloobb--eexxppaanndd--wwoorrdd and redisplay the line. If a numeric argument is supplied, append a ** before pathname expansion. dduummpp--ffuunnccttiioonnss - Print all of the functions and their key bindings to the rreeaadd-- + Print all of the functions and their key bindings to the rreeaadd-- lliinnee output stream. If a numeric argument is supplied, the out- - put is formatted in such a way that it can be made part of an + put is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. dduummpp--vvaarriiaabblleess Print all of the settable rreeaaddlliinnee variables and their values to - the rreeaaddlliinnee output stream. If a numeric argument is supplied, - the output is formatted in such a way that it can be made part + the rreeaaddlliinnee output stream. If a numeric argument is supplied, + the output is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. dduummpp--mmaaccrrooss - Print all of the rreeaaddlliinnee key sequences bound to macros and the + Print all of the rreeaaddlliinnee key sequences bound to macros and the strings they output to the rreeaaddlliinnee output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an _i_n_p_u_t_r_c file. eexxeeccuuttee--nnaammeedd--ccoommmmaanndd ((MM--xx)) Read a bindable rreeaaddlliinnee command name from the input and execute - the function to which it's bound, as if the key sequence to - which it was bound appeared in the input. If this function is + the function to which it's bound, as if the key sequence to + which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that argument to the function it executes. ddiissppllaayy--sshheellll--vveerrssiioonn ((CC--xx CC--vv)) Display version information about the current instance of bbaasshh. PPrrooggrraammmmaabbllee CCoommpplleettiioonn - When a user attempts word completion for a command or an argument to a - command for which a completion specification (a _c_o_m_p_s_p_e_c) has been de- - fined using the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), + When a user attempts word completion for a command or an argument to a + command for which a completion specification (a _c_o_m_p_s_p_e_c) has been de- + fined using the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), rreeaaddlliinnee invokes the programmable completion facilities. - First, bbaasshh identifies the command name. If a compspec has been de- - fined for that command, the compspec is used to generate the list of - possible completions for the word. If the command word is the empty - string (completion attempted at the beginning of an empty line), bbaasshh - uses any compspec defined with the --EE option to ccoommpplleettee. The --II op- - tion to ccoommpplleettee indicates that the command word is the first non-as- + First, bbaasshh identifies the command name. If a compspec has been de- + fined for that command, the compspec is used to generate the list of + possible completions for the word. If the command word is the empty + string (completion attempted at the beginning of an empty line), bbaasshh + uses any compspec defined with the --EE option to ccoommpplleettee. The --II op- + tion to ccoommpplleettee indicates that the command word is the first non-as- signment word on the line, or after a command delimiter such as ;; or ||. This usually indicates command name completion. - If the command word is a full pathname, bbaasshh searches for a compspec - for the full pathname first. If there is no compspec for the full - pathname, bbaasshh attempts to find a compspec for the portion following - the final slash. If those searches do not result in a compspec, or if - there is no compspec for the command word, bbaasshh uses any compspec de- - fined with the --DD option to ccoommpplleettee as the default. If there is no - default compspec, bbaasshh performs alias expansion on the command word as - a final resort, and attempts to find a compspec for the command word + If the command word is a full pathname, bbaasshh searches for a compspec + for the full pathname first. If there is no compspec for the full + pathname, bbaasshh attempts to find a compspec for the portion following + the final slash. If those searches do not result in a compspec, or if + there is no compspec for the command word, bbaasshh uses any compspec de- + fined with the --DD option to ccoommpplleettee as the default. If there is no + default compspec, bbaasshh performs alias expansion on the command word as + a final resort, and attempts to find a compspec for the command word resulting from any successful expansion. If a compspec is not found, bbaasshh performs its default completion as de- - scribed above under CCoommpplleettiinngg. Otherwise, once a compspec has been + scribed above under CCoommpplleettiinngg. Otherwise, once a compspec has been found, bbaasshh uses it to generate the list of matching words. - First, bbaasshh performs the _a_c_t_i_o_n_s specified by the compspec. This only - returns matches which are prefixes of the word being completed. When - the --ff or --dd option is used for filename or directory name completion, + First, bbaasshh performs the _a_c_t_i_o_n_s specified by the compspec. This only + returns matches which are prefixes of the word being completed. When + the --ff or --dd option is used for filename or directory name completion, bbaasshh uses the shell variable FFIIGGNNOORREE to filter the matches. Next, programmable completion generates matches specified by a pathname - expansion pattern supplied as an argument to the --GG option. The words + expansion pattern supplied as an argument to the --GG option. The words generated by the pattern need not match the word being completed. BBaasshh - uses the FFIIGGNNOORREE variable to filter the matches, but does not use the + uses the FFIIGGNNOORREE variable to filter the matches, but does not use the GGLLOOBBIIGGNNOORREE shell variable. - Next, completion considers the string specified as the argument to the - --WW option. The string is first split using the characters in the IIFFSS - special variable as delimiters. This honors shell quoting within the - string, in order to provide a mechanism for the words to contain shell - metacharacters or characters in the value of IIFFSS. Each word is then + Next, completion considers the string specified as the argument to the + --WW option. The string is first split using the characters in the IIFFSS + special variable as delimiters. This honors shell quoting within the + string, in order to provide a mechanism for the words to contain shell + metacharacters or characters in the value of IIFFSS. Each word is then expanded using brace expansion, tilde expansion, parameter and variable expansion, command substitution, and arithmetic expansion, as described above under EEXXPPAANNSSIIOONN. The results are split using the rules described - above under WWoorrdd SSpplliittttiinngg. The results of the expansion are prefix- + above under WWoorrdd SSpplliittttiinngg. The results of the expansion are prefix- matched against the word being completed, and the matching words become possible completions. - After these matches have been generated, bbaasshh executes any shell func- + After these matches have been generated, bbaasshh executes any shell func- tion or command specified with the --FF and --CC options. When the command - or function is invoked, bbaasshh assigns values to the CCOOMMPP__LLIINNEE, - CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and CCOOMMPP__TTYYPPEE variables as described above under - SShheellll VVaarriiaabblleess. If a shell function is being invoked, bbaasshh also sets - the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD variables. When the function or command - is invoked, the first argument ($$11) is the name of the command whose + or function is invoked, bbaasshh assigns values to the CCOOMMPP__LLIINNEE, + CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and CCOOMMPP__TTYYPPEE variables as described above under + SShheellll VVaarriiaabblleess. If a shell function is being invoked, bbaasshh also sets + the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD variables. When the function or command + is invoked, the first argument ($$11) is the name of the command whose arguments are being completed, the second argument ($$22) is the word be- - ing completed, and the third argument ($$33) is the word preceding the - word being completed on the current command line. There is no filter- - ing of the generated completions against the word being completed; the - function or command has complete freedom in generating the matches and + ing completed, and the third argument ($$33) is the word preceding the + word being completed on the current command line. There is no filter- + ing of the generated completions against the word being completed; the + function or command has complete freedom in generating the matches and they do not need to match a prefix of the word. - Any function specified with --FF is invoked first. The function may use + Any function specified with --FF is invoked first. The function may use any of the shell facilities, including the ccoommppggeenn and ccoommppoopptt builtins - described below, to generate the matches. It must put the possible + described below, to generate the matches. It must put the possible completions in the CCOOMMPPRREEPPLLYY array variable, one per array element. - Next, any command specified with the --CC option is invoked in an envi- - ronment equivalent to command substitution. It should print a list of - completions, one per line, to the standard output. Backslash will es- - cape a newline, if necessary. These are added to the set of possible + Next, any command specified with the --CC option is invoked in an envi- + ronment equivalent to command substitution. It should print a list of + completions, one per line, to the standard output. Backslash will es- + cape a newline, if necessary. These are added to the set of possible completions. After generating all of the possible completions, bbaasshh applies any fil- - ter specified with the --XX option to the completions in the list. The - filter is a pattern as used for pathname expansion; a && in the pattern + ter specified with the --XX option to the completions in the list. The + filter is a pattern as used for pathname expansion; a && in the pattern is replaced with the text of the word being completed. A literal && may be escaped with a backslash; the backslash is removed before attempting - a match. Any completion that matches the pattern is removed from the - list. A leading !! negates the pattern; in this case bbaasshh removes any - completion that does not match the pattern. If the nnooccaasseemmaattcchh shell - option is enabled, bbaasshh performs the match without regard to the case + a match. Any completion that matches the pattern is removed from the + list. A leading !! negates the pattern; in this case bbaasshh removes any + completion that does not match the pattern. If the nnooccaasseemmaattcchh shell + option is enabled, bbaasshh performs the match without regard to the case of alphabetic characters. - Finally, programmable completion adds any prefix and suffix specified - with the --PP and --SS options, respectively, to each completion, and re- + Finally, programmable completion adds any prefix and suffix specified + with the --PP and --SS options, respectively, to each completion, and re- turns the result to rreeaaddlliinnee as the list of possible completions. - If the previously-applied actions do not generate any matches, and the - --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was de- + If the previously-applied actions do not generate any matches, and the + --oo ddiirrnnaammeess option was supplied to ccoommpplleettee when the compspec was de- fined, bbaasshh attempts directory name completion. - If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec - was defined, bbaasshh attempts directory name completion and adds any + If the --oo pplluussddiirrss option was supplied to ccoommpplleettee when the compspec + was defined, bbaasshh attempts directory name completion and adds any matches to the set of possible completions. - By default, if a compspec is found, whatever it generates is returned - to the completion code as the full set of possible completions. The - default bbaasshh completions and the rreeaaddlliinnee default of filename comple- - tion are disabled. If the --oo bbaasshhddeeffaauulltt option was supplied to ccoomm-- - pplleettee when the compspec was defined, and the compspec generates no - matches, bbaasshh attempts its default completions. If the compspec and, + By default, if a compspec is found, whatever it generates is returned + to the completion code as the full set of possible completions. The + default bbaasshh completions and the rreeaaddlliinnee default of filename comple- + tion are disabled. If the --oo bbaasshhddeeffaauulltt option was supplied to ccoomm-- + pplleettee when the compspec was defined, and the compspec generates no + matches, bbaasshh attempts its default completions. If the compspec and, if attempted, the default bbaasshh completions generate no matches, and the - --oo ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was de- + --oo ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was de- fined, programmable completion performs rreeaaddlliinnee's default completion. - The options supplied to ccoommpplleettee and ccoommppoopptt can control how rreeaaddlliinnee - treats the completions. For instance, the _-_o _f_u_l_l_q_u_o_t_e option tells - rreeaaddlliinnee to quote the matches as if they were filenames. See the de- + The options supplied to ccoommpplleettee and ccoommppoopptt can control how rreeaaddlliinnee + treats the completions. For instance, the _-_o _f_u_l_l_q_u_o_t_e option tells + rreeaaddlliinnee to quote the matches as if they were filenames. See the de- scription of ccoommpplleettee below for details. - When a compspec indicates that it wants directory name completion, the - programmable completion functions force rreeaaddlliinnee to append a slash to + When a compspec indicates that it wants directory name completion, the + programmable completion functions force rreeaaddlliinnee to append a slash to completed names which are symbolic links to directories, subject to the value of the mmaarrkk--ddiirreeccttoorriieess rreeaaddlliinnee variable, regardless of the set- ting of the mmaarrkk--ssyymmlliinnkkeedd--ddiirreeccttoorriieess rreeaaddlliinnee variable. - There is some support for dynamically modifying completions. This is - most useful when used in combination with a default completion speci- - fied with ccoommpplleettee --DD. It's possible for shell functions executed as - completion functions to indicate that completion should be retried by - returning an exit status of 124. If a shell function returns 124, and + There is some support for dynamically modifying completions. This is + most useful when used in combination with a default completion speci- + fied with ccoommpplleettee --DD. It's possible for shell functions executed as + completion functions to indicate that completion should be retried by + returning an exit status of 124. If a shell function returns 124, and changes the compspec associated with the command on which completion is - being attempted (supplied as the first argument when the function is + being attempted (supplied as the first argument when the function is executed), programmable completion restarts from the beginning, with an - attempt to find a new compspec for that command. This can be used to - build a set of completions dynamically as completion is attempted, + attempt to find a new compspec for that command. This can be used to + build a set of completions dynamically as completion is attempted, rather than loading them all at once. - For instance, assuming that there is a library of compspecs, each kept - in a file corresponding to the name of the command, the following de- + For instance, assuming that there is a library of compspecs, each kept + in a file corresponding to the name of the command, the following de- fault completion function would load completions dynamically: _completion_loader() { @@ -4768,162 +4788,162 @@ RREEAADDLLIINNEE -o bashdefault -o default HHIISSTTOORRYY - When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell + When the --oo hhiissttoorryy option to the sseett builtin is enabled, the shell provides access to the _c_o_m_m_a_n_d _h_i_s_t_o_r_y, the list of commands previously - typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of - commands to save in a history list: the shell saves the text of the + typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of + commands to save in a history list: the shell saves the text of the last HHIISSTTSSIIZZEE commands (default 500). The shell stores each command in - the history list prior to parameter and variable expansion (see EEXXPPAANN-- - SSIIOONN above) but after history expansion is performed, subject to the + the history list prior to parameter and variable expansion (see EEXXPPAANN-- + SSIIOONN above) but after history expansion is performed, subject to the values of the shell variables HHIISSTTIIGGNNOORREE and HHIISSTTCCOONNTTRROOLL. - On startup, bbaasshh initializes the history list by reading history en- - tries from the the file named by the HHIISSTTFFIILLEE variable (default - _~_/_._b_a_s_h___h_i_s_t_o_r_y). That file is referred to as the _h_i_s_t_o_r_y _f_i_l_e. The - history file is truncated, if necessary, to contain no more than the - number of history entries specified by the value of the HHIISSTTFFIILLEESSIIZZEE - variable. If HHIISSTTFFIILLEESSIIZZEE is unset, or set to null, a non-numeric + On startup, bbaasshh initializes the history list by reading history en- + tries from the file named by the HHIISSTTFFIILLEE variable (default + _~_/_._b_a_s_h___h_i_s_t_o_r_y). That file is referred to as the _h_i_s_t_o_r_y _f_i_l_e. The + history file is truncated, if necessary, to contain no more than the + number of history entries specified by the value of the HHIISSTTFFIILLEESSIIZZEE + variable. If HHIISSTTFFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not trun- cated. 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 line. These timestamps are optionally dis- - played depending on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When - present, history timestamps delimit history entries, making multi-line + for the following history line. These timestamps are optionally dis- + played depending on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When + present, history timestamps delimit history entries, making multi-line entries possible. When a shell with history enabled exits, bbaasshh copies the last $$HHIISSTTSSIIZZEE - entries from the history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell - option is enabled (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN - CCOOMMMMAANNDDSS below), bbaasshh appends the entries to the history file, other- - wise it overwrites the history file. If HHIISSTTFFIILLEE is unset or null, or - if the history file is unwritable, the history is not saved. After - saving the history, bbaasshh truncates the history file to contain no more + entries from the history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell + option is enabled (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN + CCOOMMMMAANNDDSS below), bbaasshh appends the entries to the history file, other- + wise it overwrites the history file. If HHIISSTTFFIILLEE is unset or null, or + if the history file is unwritable, the history is not saved. After + saving the history, bbaasshh truncates the history file to contain no more than HHIISSTTFFIILLEESSIIZZEE lines as described above. - If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the shell writes the timestamp - information associated with each history entry to the history file, - marked with the history comment character, so timestamps are preserved + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the shell writes the timestamp + information associated with each history entry to the history file, + marked with the history comment character, so timestamps are preserved across shell sessions. This uses the history comment character to dis- - tinguish timestamps from other history lines. As above, when using + tinguish timestamps from other history lines. As above, when using HHIISSTTTTIIMMEEFFOORRMMAATT, the timestamps delimit multi-line history entries. - The ffcc builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) will list or + The ffcc builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) will list or edit and re-execute a portion of the history list. The hhiissttoorryy builtin can display or modify the history list and manipulate the history file. - When using command-line editing, search commands are available in each + When using command-line editing, search commands are available in each editing mode that provide access to the history list. - The shell allows control over which commands are saved on the history + The shell allows control over which commands are saved on the history list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables are used to save only a - subset of the commands entered. If the ccmmddhhiisstt shell option is en- - abled, the shell attempts to save each line of a multi-line command in - the same history entry, adding semicolons where necessary to preserve - syntactic correctness. The lliitthhiisstt shell option modifies ccmmddhhiisstt by - saving the command with embedded newlines instead of semicolons. See + subset of the commands entered. If the ccmmddhhiisstt shell option is en- + abled, the shell attempts to save each line of a multi-line command in + the same history entry, adding semicolons where necessary to preserve + syntactic correctness. The lliitthhiisstt shell option modifies ccmmddhhiisstt by + saving the command with embedded newlines instead of semicolons. See the description of the sshhoopptt builtin below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for information on setting and unsetting shell options. HHIISSTTOORRYY EEXXPPAANNSSIIOONN - The shell supports a history expansion feature that is similar to the - history expansion in ccsshh. This section describes what syntax features + The shell supports a history expansion feature that is similar to the + history expansion in ccsshh. This section describes what syntax features are available. History expansion is enabled by default for interactive shells, and can - be disabled using the ++HH option to the sseett builtin command (see SSHHEELLLL + be disabled using the ++HH option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). Non-interactive shells do not perform history expansion by default, but it can be enabled with "set -H". History expansions introduce words from the history list into the input - stream, making it easy to repeat commands, insert the arguments to a + stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly. - History expansion is performed immediately after a complete line is - read, before the shell breaks it into words, and is performed on each - line individually. The shell attempts to inform the history expansion + History expansion is performed immediately after a complete line is + read, before the shell breaks it into words, and is performed on each + line individually. The shell attempts to inform the history expansion functions about quoting still in effect from previous lines. - It takes place in two parts. The first is to determine which history - list entry to use during substitution. The second is to select por- + It takes place in two parts. The first is to determine which history + list entry to use during substitution. The second is to select por- tions of that entry to include into the current one. - The entry selected from the history is the _e_v_e_n_t, and the portions of + The entry selected from the history is the _e_v_e_n_t, and the portions of that entry that are acted upon are _w_o_r_d_s. Various _m_o_d_i_f_i_e_r_s are avail- - able to manipulate the selected words. The entry is split into words - in the same fashion as when reading input, so that several _m_e_t_a_c_h_a_r_a_c_- - _t_e_r-separated words surrounded by quotes are considered one word. The - _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r se- - lects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- + able to manipulate the selected words. The entry is split into words + in the same fashion as when reading input, so that several _m_e_t_a_c_h_a_r_a_c_- + _t_e_r-separated words surrounded by quotes are considered one word. The + _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r se- + lects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- able to manipulate the selected words. - History expansions are introduced by the appearance of the history ex- - pansion character, which is !! by default. History expansions may ap- + History expansions are introduced by the appearance of the history ex- + pansion character, which is !! by default. History expansions may ap- pear anywhere in the input, but do not nest. - Only backslash (\\) and single quotes can quote the history expansion - character, but the history expansion character is also treated as + Only backslash (\\) and single quotes can quote the history expansion + character, but the history expansion character is also treated as quoted if it immediately precedes the closing double quote in a double- quoted string. - Several characters inhibit history expansion if found immediately fol- - lowing the history expansion character, even if it is unquoted: space, - tab, newline, carriage return, ==, and the other shell metacharacters + Several characters inhibit history expansion if found immediately fol- + lowing the history expansion character, even if it is unquoted: space, + tab, newline, carriage return, ==, and the other shell metacharacters defined above. There is a special abbreviation for substitution, active when the _q_u_i_c_k - _s_u_b_s_t_i_t_u_t_i_o_n character (described above under hhiissttcchhaarrss) is the first + _s_u_b_s_t_i_t_u_t_i_o_n character (described above under hhiissttcchhaarrss) is the first character on the line. It selects the previous history list entry, us- - ing an event designator equivalent to !!!!, and substitutes one string - for another in that entry. It is described below under EEvveenntt DDeessiiggnnaa-- - ttoorrss. This is the only history expansion that does not begin with the + ing an event designator equivalent to !!!!, and substitutes one string + for another in that entry. It is described below under EEvveenntt DDeessiiggnnaa-- + ttoorrss. This is the only history expansion that does not begin with the history expansion character. - Several shell options settable with the sshhoopptt builtin will modify his- - tory expansion behavior (see the description of the sshhoopptt builtin be- + Several shell options settable with the sshhoopptt builtin will modify his- + tory expansion behavior (see the description of the sshhoopptt builtin be- low).and If the hhiissttvveerriiffyy shell option is enabled, and rreeaaddlliinnee is be- ing used, history substitutions are not immediately passed to the shell parser. Instead, the expanded line is reloaded into the rreeaaddlliinnee edit- - ing buffer for further modification. If rreeaaddlliinnee is being used, and - the hhiissttrreeeeddiitt shell option is enabled, a failed history substitution + ing buffer for further modification. If rreeaaddlliinnee is being used, and + the hhiissttrreeeeddiitt shell option is enabled, a failed history substitution is reloaded into the rreeaaddlliinnee editing buffer for correction. - The --pp option to the hhiissttoorryy builtin command shows what a history ex- - pansion will do before using it. The --ss option to the hhiissttoorryy builtin - will add commands to the end of the history list without actually exe- + The --pp option to the hhiissttoorryy builtin command shows what a history ex- + pansion will do before using it. The --ss option to the hhiissttoorryy builtin + will add commands to the end of the history list without actually exe- cuting them, so that they are available for subsequent recall. - The shell allows control of the various characters used by the history + The shell allows control of the various characters used by the history expansion mechanism (see the description of hhiissttcchhaarrss above under SShheellll - VVaarriiaabblleess). The shell uses the history comment character to mark his- + VVaarriiaabblleess). The shell uses the history comment character to mark his- tory timestamps when writing the history file. EEvveenntt DDeessiiggnnaattoorrss - An event designator is a reference to an entry in the history list. + An event designator is a reference to an entry in the history list. The event designator consists of the portion of the word beginning with - the history expansion character and ending with the word designator if - present, or the end of the word. Unless the reference is absolute, + the history expansion character and ending with the word designator if + present, or the end of the word. Unless the reference is absolute, events are relative to the current position in the history list. - !! Start a history substitution, except when followed by a bbllaannkk, - newline, carriage return, =, or, when the eexxttgglloobb shell option + !! Start a history substitution, except when followed by a bbllaannkk, + newline, carriage return, =, or, when the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, (. !!_n Refer to history list entry _n. !!--_n Refer to the current entry minus _n. !!!! Refer to the previous entry. This is a synonym for "!-1". !!_s_t_r_i_n_g - Refer to the most recent command preceding the current position + Refer to the most recent command preceding the current position in the history list starting with _s_t_r_i_n_g. !!??_s_t_r_i_n_g[[??]] - Refer to the most recent command preceding the current position - in the history list containing _s_t_r_i_n_g. The trailing ?? may be - omitted if _s_t_r_i_n_g is followed immediately by a newline. If - _s_t_r_i_n_g is missing, this uses the string from the most recent + Refer to the most recent command preceding the current position + in the history list containing _s_t_r_i_n_g. The trailing ?? may be + omitted if _s_t_r_i_n_g is followed immediately by a newline. If + _s_t_r_i_n_g is missing, this uses the string from the most recent search; it is an error if there is no previous search string. ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^ - Quick substitution. Repeat the previous command, replacing - _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" + Quick substitution. Repeat the previous command, replacing + _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" (see MMooddiiffiieerrss below). !!## The entire command line typed so far. @@ -4931,37 +4951,37 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN Word designators are used to select desired words from the event. They are optional; if the word designator isn't supplied, the history expan- sion uses the entire event. A :: separates the event specification from - the word designator. It may be omitted if the word designator begins - with a ^^, $$, **, --, or %%. Words are numbered from the beginning of the - line, with the first word being denoted by 0 (zero). Words are in- + the word designator. It may be omitted if the word designator begins + with a ^^, $$, **, --, or %%. Words are numbered from the beginning of the + line, with the first word being denoted by 0 (zero). Words are in- serted into the current line separated by single spaces. 00 ((zzeerroo)) The zeroth word. For the shell, this is the command word. _n The _nth word. ^^ The first argument: word 1. - $$ The last word. This is usually the last argument, but will ex- + $$ The last word. This is usually the last argument, but will ex- pand to the zeroth word if there is only one word in the line. %% The first word matched by the most recent "?_s_t_r_i_n_g?" search, if - the search string begins with a character that is part of a - word. By default, searches begin at the end of each line and - proceed to the beginning, so the first word matched is the one + the search string begins with a character that is part of a + word. By default, searches begin at the end of each line and + proceed to the beginning, so the first word matched is the one closest to the end of the line. _x--_y A range of words; "-_y" abbreviates "0-_y". - ** All of the words but the zeroth. This is a synonym for "_1_-_$". - It is not an error to use ** if there is just one word in the + ** All of the words but the zeroth. This is a synonym for "_1_-_$". + It is not an error to use ** if there is just one word in the event; it expands to the empty string in that case. xx** Abbreviates _x_-_$. xx-- Abbreviates _x_-_$ like xx**, but omits the last word. If xx is miss- ing, it defaults to 0. - If a word designator is supplied without an event specification, the + If a word designator is supplied without an event specification, the previous command is used as the event, equivalent to !!!!. MMooddiiffiieerrss - After the optional word designator, the expansion may include a se- - quence of one or more of the following modifiers, each preceded by a - ":". These modify, or edit, the word or words selected from the his- + After the optional word designator, the expansion may include a se- + quence of one or more of the following modifiers, each preceded by a + ":". These modify, or edit, the word or words selected from the his- tory event. hh Remove a trailing pathname component, leaving only the head. @@ -4970,24 +4990,24 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN ee Remove all but the trailing suffix. pp Print the new command but do not execute it. qq Quote the substituted words, escaping further substitutions. - xx Quote the substituted words as with qq, but break into words at - bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- + xx Quote the substituted words as with qq, but break into words at + bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- sive; expansion uses the last one supplied. ss//_o_l_d//_n_e_w// - Substitute _n_e_w for the first occurrence of _o_l_d in the event + Substitute _n_e_w for the first occurrence of _o_l_d in the event line. Any character may be used as the delimiter in place of /. - The final delimiter is optional if it is the last character of - the event line. A single backslash quotes the delimiter in _o_l_d - and _n_e_w. If & appears in _n_e_w, it is replaced with _o_l_d. A sin- - gle backslash quotes the &. If _o_l_d is null, it is set to the - last _o_l_d substituted, or, if no previous history substitutions + The final delimiter is optional if it is the last character of + the event line. A single backslash quotes the delimiter in _o_l_d + and _n_e_w. If & appears in _n_e_w, it is replaced with _o_l_d. A sin- + gle backslash quotes the &. If _o_l_d is null, it is set to the + last _o_l_d substituted, or, if no previous history substitutions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. If _n_e_w is null, each matching _o_l_d is deleted. && Repeat the previous substitution. gg Cause changes to be applied over the entire event line. This is - used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". - If used with "::ss", any delimiter can be used in place of /, and - the final delimiter is optional if it is the last character of + used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". + If used with "::ss", any delimiter can be used in place of /, and + the final delimiter is optional if it is the last character of the event line. An aa may be used as a synonym for gg. GG Apply the following "ss" or "&&" modifier once to each word in the event line. @@ -4996,64 +5016,64 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Unless otherwise noted, each builtin command documented in this section as accepting options preceded by -- accepts ---- to signify the end of the options. The ::, ttrruuee, ffaallssee, and tteesstt/[[ builtins do not accept options - and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn-- - ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning - with -- without requiring ----. Other builtins that accept arguments but - are not specified as accepting options interpret arguments beginning - with -- as invalid options and require ---- to prevent this interpreta- + and do not treat ---- specially. The eexxiitt, llooggoouutt, rreettuurrnn, bbrreeaakk, ccoonn-- + ttiinnuuee, lleett, and sshhiifftt builtins accept and process arguments beginning + with -- without requiring ----. Other builtins that accept arguments but + are not specified as accepting options interpret arguments beginning + with -- as invalid options and require ---- to prevent this interpreta- tion. :: [_a_r_g_u_m_e_n_t_s] - No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s + No effect; the command does nothing beyond expanding _a_r_g_u_m_e_n_t_s and performing any specified redirections. The return status is zero. .. [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] ssoouurrccee [--pp _p_a_t_h] _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] - The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e - in the current shell environment and returns the exit status of + The .. command (ssoouurrccee) reads and execute commands from _f_i_l_e_n_a_m_e + in the current shell environment and returns the exit status of the last command executed from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, .. searches for it. If the - --pp option is supplied, .. treats _p_a_t_h as a colon-separated list - of directories in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the - entries in PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e. - _f_i_l_e_n_a_m_e does not need to be executable. When bbaasshh is not in + --pp option is supplied, .. treats _p_a_t_h as a colon-separated list + of directories in which to find _f_i_l_e_n_a_m_e; otherwise, .. uses the + entries in PPAATTHH to find the directory containing _f_i_l_e_n_a_m_e. + _f_i_l_e_n_a_m_e does not need to be executable. When bbaasshh is not in posix mode, it searches the current directory if _f_i_l_e_n_a_m_e is not - found in PPAATTHH, but does not search the current directory if --pp + found in PPAATTHH, but does not search the current directory if --pp is supplied. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin com- mand is turned off, .. does not search PPAATTHH. - If any _a_r_g_u_m_e_n_t_s are supplied, they become the positional para- - meters when _f_i_l_e_n_a_m_e is executed. Otherwise the positional pa- + If any _a_r_g_u_m_e_n_t_s are supplied, they become the positional para- + meters when _f_i_l_e_n_a_m_e is executed. Otherwise the positional pa- rameters are unchanged. If the --TT option is enabled, .. inherits any trap on DDEEBBUUGG; if it - is not, any DDEEBBUUGG trap string is saved and restored around the + is not, any DDEEBBUUGG trap string is saved and restored around the call to .., and .. unsets the DDEEBBUUGG trap while it executes. If --TT is not set, and the sourced file changes the DDEEBBUUGG trap, the new value persists after .. completes. The return status is the sta- tus of the last command executed from _f_i_l_e_n_a_m_e (0 if no commands - are executed), and non-zero if _f_i_l_e_n_a_m_e is not found or cannot + are executed), and non-zero if _f_i_l_e_n_a_m_e is not found or cannot be read. aalliiaass [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] - With no arguments or with the --pp option, aalliiaass prints the list - of aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. + With no arguments or with the --pp option, aalliiaass prints the list + of aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When arguments are supplied, define an alias for each _n_a_m_e whose - _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word - to be checked for alias substitution when the alias is expanded - during command parsing. For each _n_a_m_e in the argument list for - which no _v_a_l_u_e is supplied, print the name and value of the - alias _n_a_m_e. aalliiaass returns true unless a _n_a_m_e is given (without + _v_a_l_u_e is given. A trailing space in _v_a_l_u_e causes the next word + to be checked for alias substitution when the alias is expanded + during command parsing. For each _n_a_m_e in the argument list for + which no _v_a_l_u_e is supplied, print the name and value of the + alias _n_a_m_e. aalliiaass returns true unless a _n_a_m_e is given (without a corresponding =_v_a_l_u_e) for which no alias has been defined. bbgg [_j_o_b_s_p_e_c ...] - Resume each suspended job _j_o_b_s_p_e_c in the background, as if it - had been started with &&. If _j_o_b_s_p_e_c is not present, the shell + Resume each suspended job _j_o_b_s_p_e_c in the background, as if it + had been started with &&. If _j_o_b_s_p_e_c is not present, the shell uses its notion of the _c_u_r_r_e_n_t _j_o_b. bbgg _j_o_b_s_p_e_c returns 0 unless - run when job control is disabled or, when run with job control - enabled, any specified _j_o_b_s_p_e_c was not found or was started + run when job control is disabled or, when run with job control + enabled, any specified _j_o_b_s_p_e_c was not found or was started without job control. bbiinndd [--mm _k_e_y_m_a_p] [--llssvvSSVVXX] @@ -5064,191 +5084,191 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS bbiinndd [--mm _k_e_y_m_a_p] --pp|--PP [_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d] bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d bbiinndd _r_e_a_d_l_i_n_e_-_c_o_m_m_a_n_d_-_l_i_n_e - Display current rreeaaddlliinnee key and function bindings, bind a key - sequence to a rreeaaddlliinnee function or macro or to a shell command, - or set a rreeaaddlliinnee variable. Each non-option argument is a key - binding or command as it would appear in a rreeaaddlliinnee initializa- - tion file such as _._i_n_p_u_t_r_c, but each binding or command must be - passed as a separate argument; e.g., '"\C-x\C-r": - re-read-init-file'. In the following descriptions, output - available to be re-read is formatted as commands that would ap- + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro or to a shell command, + or set a rreeaaddlliinnee variable. Each non-option argument is a key + binding or command as it would appear in a rreeaaddlliinnee initializa- + tion file such as _._i_n_p_u_t_r_c, but each binding or command must be + passed as a separate argument; e.g., '"\C-x\C-r": + re-read-init-file'. In the following descriptions, output + available to be re-read is formatted as commands that would ap- pear in a rreeaaddlliinnee initialization file or that would be supplied - as individual arguments to a bbiinndd command. Options, if sup- + as individual arguments to a bbiinndd command. Options, if sup- plied, have the following meanings: --mm _k_e_y_m_a_p Use _k_e_y_m_a_p as the keymap to be affected by the subsequent bindings. Acceptable _k_e_y_m_a_p names are _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_- - _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, - and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e - is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_- + _d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_m_o_v_e_, _v_i_-_c_o_m_m_a_n_d, + and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d (_v_i_-_m_o_v_e + is also a synonym); _e_m_a_c_s is equivalent to _e_m_a_c_s_-_s_t_a_n_- _d_a_r_d. --ll List the names of all rreeaaddlliinnee functions. - --pp Display rreeaaddlliinnee function names and bindings in such a - way that they can be used as an argument to a subsequent - bbiinndd command or in a rreeaaddlliinnee initialization file. If - arguments remain after option processing, bbiinndd treats - them as rreeaaddlliinnee command names and restricts output to - those names. - --PP List current rreeaaddlliinnee function names and bindings. If + --pp Display rreeaaddlliinnee function names and bindings in such a + way that they can be used as an argument to a subsequent + bbiinndd command or in a rreeaaddlliinnee initialization file. If arguments remain after option processing, bbiinndd treats them as rreeaaddlliinnee command names and restricts output to those names. - --ss Display rreeaaddlliinnee key sequences bound to macros and the - strings they output in such a way that they can be used + --PP List current rreeaaddlliinnee function names and bindings. If + arguments remain after option processing, bbiinndd treats + them as rreeaaddlliinnee command names and restricts output to + those names. + --ss Display rreeaaddlliinnee key sequences bound to macros and the + strings they output in such a way that they can be used as an argument to a subsequent bbiinndd command or in a rreeaadd-- lliinnee initialization file. - --SS Display rreeaaddlliinnee key sequences bound to macros and the + --SS Display rreeaaddlliinnee key sequences bound to macros and the strings they output. - --vv Display rreeaaddlliinnee variable names and values in such a way + --vv Display rreeaaddlliinnee variable names and values in such a way that they can be used as an argument to a subsequent bbiinndd command or in a rreeaaddlliinnee initialization file. --VV List current rreeaaddlliinnee variable names and values. --ff _f_i_l_e_n_a_m_e Read key bindings from _f_i_l_e_n_a_m_e. --qq _f_u_n_c_t_i_o_n - Display key sequences that invoke the named rreeaaddlliinnee + Display key sequences that invoke the named rreeaaddlliinnee _f_u_n_c_t_i_o_n. --uu _f_u_n_c_t_i_o_n - Unbind all key sequences bound to the named rreeaaddlliinnee + Unbind all key sequences bound to the named rreeaaddlliinnee _f_u_n_c_t_i_o_n. --rr _k_e_y_s_e_q Remove any current binding for _k_e_y_s_e_q. --xx _k_e_y_s_e_q[[:: ]]_s_h_e_l_l_-_c_o_m_m_a_n_d Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is en- tered. The separator between _k_e_y_s_e_q and _s_h_e_l_l_-_c_o_m_m_a_n_d is - either whitespace or a colon optionally followed by - whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_- - _m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex- - pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_- - _m_a_n_d before saving it. If the separator is a colon, any - enclosing double quotes are optional, and rreeaaddlliinnee does - not expand the command string before saving it. Since - the entire key binding expression must be a single argu- - ment, it should be enclosed in single quotes. When - _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets the RREEAADD-- - LLIINNEE__LLIINNEE variable to the contents of the rreeaaddlliinnee line + either whitespace or a colon optionally followed by + whitespace. If the separator is whitespace, _s_h_e_l_l_-_c_o_m_- + _m_a_n_d must be enclosed in double quotes and rreeaaddlliinnee ex- + pands any of its special backslash-escapes in _s_h_e_l_l_-_c_o_m_- + _m_a_n_d before saving it. If the separator is a colon, any + enclosing double quotes are optional, and rreeaaddlliinnee does + not expand the command string before saving it. Since + the entire key binding expression must be a single argu- + ment, it should be enclosed in single quotes. When + _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets the RREEAADD-- + LLIINNEE__LLIINNEE variable to the contents of the rreeaaddlliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT and RREEAADDLLIINNEE__MMAARRKK variables - to the current location of the insertion point and the - saved insertion point (the mark), respectively. The - shell assigns any numeric argument the user supplied to - the RREEAADDLLIINNEE__AARRGGUUMMEENNTT variable. If there was no argu- - ment, that variable is not set. If the executed command - changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADD-- - LLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be + to the current location of the insertion point and the + saved insertion point (the mark), respectively. The + shell assigns any numeric argument the user supplied to + the RREEAADDLLIINNEE__AARRGGUUMMEENNTT variable. If there was no argu- + ment, that variable is not set. If the executed command + changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADD-- + LLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be reflected in the editing state. - --XX List all key sequences bound to shell commands and the - associated commands in a format that can be reused as an + --XX List all key sequences bound to shell commands and the + associated commands in a format that can be reused as an argument to a subsequent bbiinndd command. - The return value is 0 unless an unrecognized option is supplied + The return value is 0 unless an unrecognized option is supplied or an error occurred. bbrreeaakk [_n] - Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is specified, bbrreeaakk exits _n enclosing loops. _n must be >= 1. If _n - is greater than the number of enclosing loops, all enclosing + is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless _n is not greater than or equal to 1. bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] - Execute the specified shell builtin _s_h_e_l_l_-_b_u_i_l_t_i_n, passing it - _a_r_g_u_m_e_n_t_s, and return its exit status. This is useful when - defining a function whose name is the same as a shell builtin, - retaining the functionality of the builtin within the function. - The ccdd builtin is commonly redefined this way. The return sta- + Execute the specified shell builtin _s_h_e_l_l_-_b_u_i_l_t_i_n, passing it + _a_r_g_u_m_e_n_t_s, and return its exit status. This is useful when + defining a function whose name is the same as a shell builtin, + retaining the functionality of the builtin within the function. + The ccdd builtin is commonly redefined this way. The return sta- tus is false if _s_h_e_l_l_-_b_u_i_l_t_i_n is not a shell builtin command. ccaalllleerr [_e_x_p_r] Returns the context of any active subroutine call (a shell func- tion or a script executed with the .. or ssoouurrccee builtins). - Without _e_x_p_r, ccaalllleerr displays the line number and source file- - name of the current subroutine call. If a non-negative integer + Without _e_x_p_r, ccaalllleerr displays the line number and source file- + name of the current subroutine call. If a non-negative integer is supplied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, and source file corresponding to that position in the cur- - rent execution call stack. This extra information may be used, + rent execution call stack. This extra information may be used, for example, to print a stack trace. The current frame is frame 0. - The return value is 0 unless the shell is not executing a sub- - routine call or _e_x_p_r does not correspond to a valid position in + The return value is 0 unless the shell is not executing a sub- + routine call or _e_x_p_r does not correspond to a valid position in the call stack. ccdd [--LL] [--@@] [_d_i_r] ccdd --PP [--ee] [--@@] [_d_i_r] - Change the current directory to _d_i_r. if _d_i_r is not supplied, - the value of the HHOOMMEE shell variable is used as _d_i_r. The vari- - able CCDDPPAATTHH exists, and _d_i_r does not begin with a slash (/), ccdd + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is used as _d_i_r. The vari- + able CCDDPPAATTHH exists, and _d_i_r does not begin with a slash (/), ccdd uses it as a search path: the shell searches each directory name - in CCDDPPAATTHH for _d_i_r. Alternative directory names in CCDDPPAATTHH are - separated by a colon (:). A null directory name in CCDDPPAATTHH is + in CCDDPPAATTHH for _d_i_r. Alternative directory names in CCDDPPAATTHH are + separated by a colon (:). A null directory name in CCDDPPAATTHH is the same as the current directory, i.e., ".". - The --PP option causes ccdd to use the physical directory structure + The --PP option causes ccdd to use the physical directory structure by resolving symbolic links while traversing _d_i_r and before pro- - cessing instances of _._. in _d_i_r (see also the --PP option to the + cessing instances of _._. in _d_i_r (see also the --PP option to the sseett builtin command). - The --LL option forces ccdd to follow symbolic links by resolving + The --LL option forces ccdd to follow symbolic links by resolving the link after processing instances of _._. in _d_i_r. If _._. appears - in _d_i_r, ccdd processes it by removing the immediately previous + in _d_i_r, ccdd processes it by removing the immediately previous pathname component from _d_i_r, back to a slash or the beginning of - _d_i_r, and verifying that the portion of _d_i_r it has processed to - that point is still a valid directory name after removing the + _d_i_r, and verifying that the portion of _d_i_r it has processed to + that point is still a valid directory name after removing the pathname component. If it is not a valid directory name, ccdd re- - turns a non-zero status. If neither --LL nor --PP is supplied, ccdd + turns a non-zero status. If neither --LL nor --PP is supplied, ccdd behaves as if --LL had been supplied. If the --ee option is supplied with --PP, and ccdd cannot successfully - determine the current working directory after a successful di- + determine the current working directory after a successful di- rectory change, it returns a non-zero status. - On systems that support it, the --@@ option presents the extended + On systems that support it, the --@@ option presents the extended attributes associated with a file as a directory. - An argument of -- is converted to $$OOLLDDPPWWDD before attempting the + An argument of -- is converted to $$OOLLDDPPWWDD before attempting the directory change. - If ccdd uses a non-empty directory name from CCDDPPAATTHH,, or if -- is - the first argument, and the directory change is successful, ccdd + If ccdd uses a non-empty directory name from CCDDPPAATTHH, or if -- is + the first argument, and the directory change is successful, ccdd writes the absolute pathname of the new working directory to the standard output. - If the directory change is successful, ccdd sets the value of the + If the directory change is successful, ccdd sets the value of the PPWWDD environment variable to the new directory name, and sets the - OOLLDDPPWWDD environment variable to the value of the current working + OOLLDDPPWWDD environment variable to the value of the current working directory before the change. - The return value is true if the directory was successfully + The return value is true if the directory was successfully changed; false otherwise. ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] - The ccoommmmaanndd builtin runs _c_o_m_m_a_n_d with _a_r_g_s suppressing the nor- + The ccoommmmaanndd builtin runs _c_o_m_m_a_n_d with _a_r_g_s suppressing the nor- mal shell function lookup for _c_o_m_m_a_n_d. Only builtin commands or - commands found in the PPAATTHH named _c_o_m_m_a_n_d are executed. If the + commands found in the PPAATTHH named _c_o_m_m_a_n_d are executed. If the --pp option is supplied, the search for _c_o_m_m_a_n_d is performed using - a default value for PPAATTHH that is guaranteed to find all of the + a default value for PPAATTHH that is guaranteed to find all of the standard utilities. - If either the --VV or --vv option is supplied, ccoommmmaanndd prints a de- - scription of _c_o_m_m_a_n_d. The --vv option displays a single word in- - dicating the command or filename used to invoke _c_o_m_m_a_n_d; the --VV + If either the --VV or --vv option is supplied, ccoommmmaanndd prints a de- + scription of _c_o_m_m_a_n_d. The --vv option displays a single word in- + dicating the command or filename used to invoke _c_o_m_m_a_n_d; the --VV option produces a more verbose description. - If the --VV or --vv option is supplied, the exit status is zero if - _c_o_m_m_a_n_d was found, and non-zero if not. If neither option is - supplied and an error occurred or _c_o_m_m_a_n_d cannot be found, the - exit status is 127. Otherwise, the exit status of the ccoommmmaanndd + If the --VV or --vv option is supplied, the exit status is zero if + _c_o_m_m_a_n_d was found, and non-zero if not. If neither option is + supplied and an error occurred or _c_o_m_m_a_n_d cannot be found, the + exit status is 127. Otherwise, the exit status of the ccoommmmaanndd builtin is the exit status of _c_o_m_m_a_n_d. ccoommppggeenn [--VV _v_a_r_n_a_m_e] [_o_p_t_i_o_n] [_w_o_r_d] - Generate possible completion matches for _w_o_r_d according to the - _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee + Generate possible completion matches for _w_o_r_d according to the + _o_p_t_i_o_ns, which may be any option accepted by the ccoommpplleettee builtin with the exceptions of --pp, --rr, --DD, --EE, and --II, and write the matches to the standard output. - If the --VV option is supplied, ccoommppggeenn stores the generated com- - pletions into the indexed array variable _v_a_r_n_a_m_e instead of + If the --VV option is supplied, ccoommppggeenn stores the generated com- + pletions into the indexed array variable _v_a_r_n_a_m_e instead of writing them to the standard output. When using the --FF or --CC options, the various shell variables set @@ -5257,11 +5277,11 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS The matches will be generated in the same way as if the program- mable completion code had generated them directly from a comple- - tion specification with the same flags. If _w_o_r_d is specified, - only those completions matching _w_o_r_d will be displayed or + tion specification with the same flags. If _w_o_r_d is specified, + only those completions matching _w_o_r_d will be displayed or stored. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, or no matches were generated. ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--DDEEII] [--AA _a_c_t_i_o_n] @@ -5271,78 +5291,78 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Specify how arguments to each _n_a_m_e should be completed. If the --pp option is supplied, or if no options or _n_a_m_es are sup- - plied, print existing completion specifications in a way that + plied, print existing completion specifications in a way that allows them to be reused as input. The --rr option removes a com- - pletion specification for each _n_a_m_e, or, if no _n_a_m_es are sup- + pletion specification for each _n_a_m_e, or, if no _n_a_m_es are sup- plied, all completion specifications. - The --DD option indicates that other supplied options and actions - should apply to the "default" command completion; that is, com- - pletion attempted on a command for which no completion has pre- - viously been defined. The --EE option indicates that other sup- - plied options and actions should apply to "empty" command com- - pletion; that is, completion attempted on a blank line. The --II - option indicates that other supplied options and actions should - apply to completion on the initial non-assignment word on the + The --DD option indicates that other supplied options and actions + should apply to the "default" command completion; that is, com- + pletion attempted on a command for which no completion has pre- + viously been defined. The --EE option indicates that other sup- + plied options and actions should apply to "empty" command com- + pletion; that is, completion attempted on a blank line. The --II + option indicates that other supplied options and actions should + apply to completion on the initial non-assignment word on the line, or after a command delimiter such as ;; or ||, which is usu- ally command name completion. If multiple options are supplied, the --DD option takes precedence over --EE, and both take precedence - over --II. If any of --DD, --EE, or --II are supplied, any other _n_a_m_e - arguments are ignored; these completions only apply to the case + over --II. If any of --DD, --EE, or --II are supplied, any other _n_a_m_e + arguments are ignored; these completions only apply to the case specified by the option. The process of applying these completion specifications when at- - tempting word completion is described above under PPrrooggrraammmmaabbllee + tempting word completion is described above under PPrrooggrraammmmaabbllee CCoommpplleettiioonn. - Other options, if specified, have the following meanings. The - arguments to the --GG, --WW, and --XX options (and, if necessary, the - --PP and --SS options) should be quoted to protect them from expan- + Other options, if specified, have the following meanings. The + arguments to the --GG, --WW, and --XX options (and, if necessary, the + --PP and --SS options) should be quoted to protect them from expan- sion before the ccoommpplleettee builtin is invoked. --oo _c_o_m_p_-_o_p_t_i_o_n - The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- - spec's behavior beyond the simple generation of comple- + The _c_o_m_p_-_o_p_t_i_o_n controls several aspects of the comp- + spec's behavior beyond the simple generation of comple- tions. _c_o_m_p_-_o_p_t_i_o_n may be one of: bbaasshhddeeffaauulltt Perform the rest of the default bbaasshh completions if the compspec generates no matches. - ddeeffaauulltt Use rreeaaddlliinnee's default filename completion if + ddeeffaauulltt Use rreeaaddlliinnee's default filename completion if the compspec generates no matches. ddiirrnnaammeess - Perform directory name completion if the comp- + Perform directory name completion if the comp- spec generates no matches. ffiilleennaammeess - Tell rreeaaddlliinnee that the compspec generates file- - names, so it can perform any filename-specific - processing (such as adding a slash to directory - names, quoting special characters, or suppress- - ing trailing spaces). This is intended to be + Tell rreeaaddlliinnee that the compspec generates file- + names, so it can perform any filename-specific + processing (such as adding a slash to directory + names, quoting special characters, or suppress- + ing trailing spaces). This is intended to be used with shell functions. ffuullllqquuoottee - Tell rreeaaddlliinnee to quote all the completed words + Tell rreeaaddlliinnee to quote all the completed words even if they are not filenames. - nnooqquuoottee Tell rreeaaddlliinnee not to quote the completed words - if they are filenames (quoting filenames is the + nnooqquuoottee Tell rreeaaddlliinnee not to quote the completed words + if they are filenames (quoting filenames is the default). - nnoossoorrtt Tell rreeaaddlliinnee not to sort the list of possible + nnoossoorrtt Tell rreeaaddlliinnee not to sort the list of possible completions alphabetically. - nnoossppaaccee Tell rreeaaddlliinnee not to append a space (the de- - fault) to words completed at the end of the + nnoossppaaccee Tell rreeaaddlliinnee not to append a space (the de- + fault) to words completed at the end of the line. pplluussddiirrss - After generating any matches defined by the - compspec, attempt directory name completion and - add any matches to the results of the other ac- + After generating any matches defined by the + compspec, attempt directory name completion and + add any matches to the results of the other ac- tions. --AA _a_c_t_i_o_n - The _a_c_t_i_o_n may be one of the following to generate a + The _a_c_t_i_o_n may be one of the following to generate a list of possible completions: aalliiaass Alias names. May also be specified as --aa. aarrrraayyvvaarr Array variable names. bbiinnddiinngg RReeaaddlliinnee key binding names. - bbuuiillttiinn Names of shell builtin commands. May also be + bbuuiillttiinn Names of shell builtin commands. May also be specified as --bb. ccoommmmaanndd Command names. May also be specified as --cc. ddiirreeccttoorryy @@ -5350,10 +5370,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ddiissaabblleedd Names of disabled shell builtins. eennaabblleedd Names of enabled shell builtins. - eexxppoorrtt Names of exported shell variables. May also be + eexxppoorrtt Names of exported shell variables. May also be specified as --ee. - ffiillee File and directory names, similar to rreeaaddlliinnee's - filename completion. May also be specified as + ffiillee File and directory names, similar to rreeaaddlliinnee's + filename completion. May also be specified as --ff. ffuunnccttiioonn Names of shell functions. @@ -5361,17 +5381,17 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS hheellppttooppiicc Help topics as accepted by the hheellpp builtin. hhoossttnnaammee - Hostnames, as taken from the file specified by + Hostnames, as taken from the file specified by the HHOOSSTTFFIILLEE shell variable. - jjoobb Job names, if job control is active. May also + jjoobb Job names, if job control is active. May also be specified as --jj. - kkeeyywwoorrdd Shell reserved words. May also be specified as + kkeeyywwoorrdd Shell reserved words. May also be specified as --kk. rruunnnniinngg Names of running jobs, if job control is active. sseerrvviiccee Service names. May also be specified as --ss. - sseettoopptt Valid arguments for the --oo option to the sseett + sseettoopptt Valid arguments for the --oo option to the sseett builtin. - sshhoopptt Shell option names as accepted by the sshhoopptt + sshhoopptt Shell option names as accepted by the sshhoopptt builtin. ssiiggnnaall Signal names. ssttooppppeedd Names of stopped jobs, if job control is active. @@ -5380,219 +5400,219 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Names of all shell variables. May also be spec- ified as --vv. --CC _c_o_m_m_a_n_d - _c_o_m_m_a_n_d is executed in a subshell environment, and its - output is used as the possible completions. Arguments + _c_o_m_m_a_n_d is executed in a subshell environment, and its + output is used as the possible completions. Arguments are passed as with the --FF option. --FF _f_u_n_c_t_i_o_n - The shell function _f_u_n_c_t_i_o_n is executed in the current - shell environment. When the function is executed, the + The shell function _f_u_n_c_t_i_o_n is executed in the current + shell environment. When the function is executed, the first argument ($$11) is the name of the command whose ar- guments are being completed, the second argument ($$22) is the word being completed, and the third argument ($$33) is - the word preceding the word being completed on the cur- + the word preceding the word being completed on the cur- rent command line. When _f_u_n_c_t_i_o_n finishes, programmable - completion retrieves the possible completions from the + completion retrieves the possible completions from the value of the CCOOMMPPRREEPPLLYY array variable. --GG _g_l_o_b_p_a_t - Expand the pathname expansion pattern _g_l_o_b_p_a_t to gener- + Expand the pathname expansion pattern _g_l_o_b_p_a_t to gener- ate the possible completions. --PP _p_r_e_f_i_x - Add _p_r_e_f_i_x to the beginning of each possible completion + Add _p_r_e_f_i_x to the beginning of each possible completion after all other options have been applied. --SS _s_u_f_f_i_x - Append _s_u_f_f_i_x to each possible completion after all + Append _s_u_f_f_i_x to each possible completion after all other options have been applied. --WW _w_o_r_d_l_i_s_t - Split the _w_o_r_d_l_i_s_t using the characters in the IIFFSS spe- - cial variable as delimiters, and expand each resulting - word. Shell quoting is honored within _w_o_r_d_l_i_s_t, in or- - der to provide a mechanism for the words to contain - shell metacharacters or characters in the value of IIFFSS. - The possible completions are the members of the resul- - tant list which match a prefix of the word being com- + Split the _w_o_r_d_l_i_s_t using the characters in the IIFFSS spe- + cial variable as delimiters, and expand each resulting + word. Shell quoting is honored within _w_o_r_d_l_i_s_t, in or- + der to provide a mechanism for the words to contain + shell metacharacters or characters in the value of IIFFSS. + The possible completions are the members of the resul- + tant list which match a prefix of the word being com- pleted. --XX _f_i_l_t_e_r_p_a_t - _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. + _f_i_l_t_e_r_p_a_t is a pattern as used for pathname expansion. It is applied to the list of possible completions gener- - ated by the preceding options and arguments, and each - completion matching _f_i_l_t_e_r_p_a_t is removed from the list. - A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this + ated by the preceding options and arguments, and each + completion matching _f_i_l_t_e_r_p_a_t is removed from the list. + A leading !! in _f_i_l_t_e_r_p_a_t negates the pattern; in this case, any completion not matching _f_i_l_t_e_r_p_a_t is removed. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, an option other than --pp, --rr, --DD, --EE, or --II is supplied without a - _n_a_m_e argument, an attempt is made to remove a completion speci- + _n_a_m_e argument, an attempt is made to remove a completion speci- fication for a _n_a_m_e for which no specification exists, or an er- ror occurs adding a completion specification. ccoommppoopptt [--oo _o_p_t_i_o_n] [--DDEEII] [++oo _o_p_t_i_o_n] [_n_a_m_e] - Modify completion options for each _n_a_m_e according to the _o_p_- + Modify completion options for each _n_a_m_e according to the _o_p_- _t_i_o_ns, or for the currently-executing completion if no _n_a_m_es are - supplied. If no _o_p_t_i_o_ns are supplied, display the completion - options for each _n_a_m_e or the current completion. The possible - values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de- + supplied. If no _o_p_t_i_o_ns are supplied, display the completion + options for each _n_a_m_e or the current completion. The possible + values of _o_p_t_i_o_n are those valid for the ccoommpplleettee builtin de- scribed above. The --DD option indicates that other supplied options should apply - to the "default" command completion; the --EE option indicates + to the "default" command completion; the --EE option indicates that other supplied options should apply to "empty" command com- pletion; and the --II option indicates that other supplied options - should apply to completion on the initial word on the line. + should apply to completion on the initial word on the line. These are determined in the same way as the ccoommpplleettee builtin. If multiple options are supplied, the --DD option takes precedence over --EE, and both take precedence over --II. - The return value is true unless an invalid option is supplied, + The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a _n_a_m_e for which no completion specification exists, or an output error occurs. ccoonnttiinnuuee [_n] ccoonnttiinnuuee resumes the next iteration of the enclosing ffoorr, wwhhiillee, - uunnttiill, or sseelleecctt loop. If _n is specified, bbaasshh resumes the _nth - enclosing loop. _n must be >= 1. If _n is greater than the num- - ber of enclosing loops, the shell resumes the last enclosing - loop (the "top-level" loop). The return value is 0 unless _n is + uunnttiill, or sseelleecctt loop. If _n is specified, bbaasshh resumes the _nth + enclosing loop. _n must be >= 1. If _n is greater than the num- + ber of enclosing loops, the shell resumes the last enclosing + loop (the "top-level" loop). The return value is 0 unless _n is not greater than or equal to 1. ddeeccllaarree [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] ttyyppeesseett [--aaAAffFFggiiIIllnnrrttuuxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] - Declare variables and/or give them attributes. If no _n_a_m_es are + Declare variables and/or give them attributes. If no _n_a_m_es are given then display the values of variables or functions. The --pp - option will display the attributes and values of each _n_a_m_e. - When --pp is used with _n_a_m_e arguments, additional options, other + option will display the attributes and values of each _n_a_m_e. + When --pp is used with _n_a_m_e arguments, additional options, other than --ff and --FF, are ignored. When --pp is supplied without _n_a_m_e arguments, ddeeccllaarree will display the attributes and values of all variables having the attributes - specified by the additional options. If no other options are + specified by the additional options. If no other options are supplied with --pp, ddeeccllaarree will display the attributes and values - of all shell variables. The --ff option restricts the display to + of all shell variables. The --ff option restricts the display to shell functions. The --FF option inhibits the display of function definitions; only - the function name and attributes are printed. If the eexxttddeebbuugg - shell option is enabled using sshhoopptt, the source file name and - line number where each _n_a_m_e is defined are displayed as well. + the function name and attributes are printed. If the eexxttddeebbuugg + shell option is enabled using sshhoopptt, the source file name and + line number where each _n_a_m_e is defined are displayed as well. The --FF option implies --ff. - The --gg option forces variables to be created or modified at the + The --gg option forces variables to be created or modified at the global scope, even when ddeeccllaarree is executed in a shell function. It is ignored when ddeeccllaarree is not executed in a shell function. - The --II option causes local variables to inherit the attributes - (except the _n_a_m_e_r_e_f attribute) and value of any existing vari- - able with the same _n_a_m_e at a surrounding scope. If there is no + The --II option causes local variables to inherit the attributes + (except the _n_a_m_e_r_e_f attribute) and value of any existing vari- + able with the same _n_a_m_e at a surrounding scope. If there is no existing variable, the local variable is initially unset. - The following options can be used to restrict output to vari- - ables with the specified attribute or to give variables attrib- + The following options can be used to restrict output to vari- + ables with the specified attribute or to give variables attrib- utes: - --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss above). - --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss + --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss above). --ff Each _n_a_m_e refers to a shell function. --ii The variable is treated as an integer; arithmetic evalua- - tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN above) is performed when the variable is assigned a value. - --ll When the variable is assigned a value, all upper-case - characters are converted to lower-case. The upper-case + --ll When the variable is assigned a value, all upper-case + characters are converted to lower-case. The upper-case attribute is disabled. - --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name - reference to another variable. That other variable is - defined by the value of _n_a_m_e. All references, assign- - ments, and attribute modifications to _n_a_m_e, except those - using or changing the --nn attribute itself, are performed - on the variable referenced by _n_a_m_e's value. The nameref + --nn Give each _n_a_m_e the _n_a_m_e_r_e_f attribute, making it a name + reference to another variable. That other variable is + defined by the value of _n_a_m_e. All references, assign- + ments, and attribute modifications to _n_a_m_e, except those + using or changing the --nn attribute itself, are performed + on the variable referenced by _n_a_m_e's value. The nameref attribute cannot be applied to array variables. --rr Make _n_a_m_es readonly. These names cannot then be assigned values by subsequent assignment statements or unset. --tt Give each _n_a_m_e the _t_r_a_c_e attribute. Traced functions in- - herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell. + herit the DDEEBBUUGG and RREETTUURRNN traps from the calling shell. The trace attribute has no special meaning for variables. - --uu When the variable is assigned a value, all lower-case - characters are converted to upper-case. The lower-case + --uu When the variable is assigned a value, all lower-case + characters are converted to upper-case. The lower-case attribute is disabled. - --xx Mark each _n_a_m_e for export to subsequent commands via the + --xx Mark each _n_a_m_e for export to subsequent commands via the environment. - Using "+" instead of "-" turns off the specified attribute in- + Using "+" instead of "-" turns off the specified attribute in- stead, with the exceptions that ++aa and ++AA may not be used to de- - stroy array variables and ++rr will not remove the readonly at- + stroy array variables and ++rr will not remove the readonly at- tribute. - When used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e lo- - cal, as with the llooccaall command, unless the --gg option is sup- - plied. If a variable name is followed by =_v_a_l_u_e, the value of - the variable is set to _v_a_l_u_e. When using --aa or --AA and the com- - pound assignment syntax to create array variables, additional + When used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e lo- + cal, as with the llooccaall command, unless the --gg option is sup- + plied. If a variable name is followed by =_v_a_l_u_e, the value of + the variable is set to _v_a_l_u_e. When using --aa or --AA and the com- + pound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments. - The return value is 0 unless an invalid option is encountered, - an attempt is made to define a function using "-f foo=bar". an + The return value is 0 unless an invalid option is encountered, + an attempt is made to define a function using "-f foo=bar", an attempt is made to assign a value to a readonly variable, an at- tempt is made to assign a value to an array variable without us- - ing the compound assignment syntax (see AArrrraayyss above), one of + ing the compound assignment syntax (see AArrrraayyss above), one of the _n_a_m_e_s is not a valid shell variable name, an attempt is made - to turn off readonly status for a readonly variable, an attempt - is made to turn off array status for an array variable, or an + to turn off readonly status for a readonly variable, an attempt + is made to turn off array status for an array variable, or an attempt is made to display a non-existent function with --ff. ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]] Without options, display the list of currently remembered direc- - tories. The default display is on a single line with directory - names separated by spaces. Directories are added to the list - with the ppuusshhdd command; the ppooppdd command removes entries from - the list. The current directory is always the first directory + tories. The default display is on a single line with directory + names separated by spaces. Directories are added to the list + with the ppuusshhdd command; the ppooppdd command removes entries from + the list. The current directory is always the first directory in the stack. Options, if supplied, have the following meanings: - --cc Clears the directory stack by deleting all of the en- + --cc Clears the directory stack by deleting all of the en- tries. - --ll Produces a listing using full pathnames; the default + --ll Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. --pp Print the directory stack with one entry per line. - --vv Print the directory stack with one entry per line, pre- + --vv Print the directory stack with one entry per line, pre- fixing each entry with its index in the stack. ++_n Displays the _nth entry counting from the left of the list shown by ddiirrss when invoked without options, starting with zero. - --_n Displays the _nth entry counting from the right of the + --_n Displays the _nth entry counting from the right of the list shown by ddiirrss when invoked without options, starting with zero. - The return value is 0 unless an invalid option is supplied or _n + The return value is 0 unless an invalid option is supplied or _n indexes beyond the end of the directory stack. ddiissoowwnn [--aarr] [--hh] [_i_d ...] - Without options, remove each _i_d from the table of active jobs. - Each _i_d may be a job specification _j_o_b_s_p_e_c or a process ID _p_i_d; + Without options, remove each _i_d from the table of active jobs. + Each _i_d may be a job specification _j_o_b_s_p_e_c or a process ID _p_i_d; if _i_d is a _p_i_d, ddiissoowwnn uses the job containing _p_i_d as _j_o_b_s_p_e_c. - If the --hh option is supplied, ddiissoowwnn does not remove the jobs - corresponding to each _i_d from the jobs table, but rather marks - them so the shell does not send SSIIGGHHUUPP to the job if the shell + If the --hh option is supplied, ddiissoowwnn does not remove the jobs + corresponding to each _i_d from the jobs table, but rather marks + them so the shell does not send SSIIGGHHUUPP to the job if the shell receives a SSIIGGHHUUPP. - If no _i_d is supplied, the --aa option means to remove or mark all + If no _i_d is supplied, the --aa option means to remove or mark all jobs; the --rr option without an _i_d argument removes or marks run- - ning jobs. If no _i_d is supplied, and neither the --aa nor the --rr + ning jobs. If no _i_d is supplied, and neither the --aa nor the --rr option is supplied, ddiissoowwnn removes or marks the current job. The return value is 0 unless an _i_d does not specify a valid job. eecchhoo [--nneeEE] [_a_r_g ...] - Output the _a_r_gs, separated by spaces, followed by a newline. - The return status is 0 unless a write error occurs. If --nn is + Output the _a_r_gs, separated by spaces, followed by a newline. + The return status is 0 unless a write error occurs. If --nn is specified, the trailing newline is not printed. - If the --ee option is given, eecchhoo interprets the following back- + If the --ee option is given, eecchhoo interprets the following back- slash-escaped characters. The --EE option disables interpretation - of these escape characters, even on systems where they are in- - terpreted by default. The xxppgg__eecchhoo shell option determines + of these escape characters, even on systems where they are in- + terpreted by default. The xxppgg__eecchhoo shell option determines whether or not eecchhoo interprets any options and expands these es- - cape characters. eecchhoo does not interpret ---- to mean the end of + cape characters. eecchhoo does not interpret ---- to mean the end of options. eecchhoo interprets the following escape sequences: @@ -5607,101 +5627,101 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS \\tt horizontal tab \\vv vertical tab \\\\ backslash - \\00_n_n_n The eight-bit character whose value is the octal value + \\00_n_n_n The eight-bit character whose value is the octal value _n_n_n (zero to three octal digits). - \\xx_H_H The eight-bit character whose value is the hexadecimal + \\xx_H_H The eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits). - \\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the + \\uu_H_H_H_H The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits). \\UU_H_H_H_H_H_H_H_H - The Unicode (ISO/IEC 10646) character whose value is the + The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits). - eecchhoo writes any unrecognized backslash-escaped characters un- + eecchhoo writes any unrecognized backslash-escaped characters un- changed. eennaabbllee [--aa] [--ddnnppss] [--ff _f_i_l_e_n_a_m_e] [_n_a_m_e ...] - Enable and disable builtin shell commands. Disabling a builtin - allows an executable file which has the same name as a shell - builtin to be executed without specifying a full pathname, even + Enable and disable builtin shell commands. Disabling a builtin + allows an executable file which has the same name as a shell + builtin to be executed without specifying a full pathname, even though the shell normally searches for builtins before files. - If --nn is supplied, each _n_a_m_e is disabled; otherwise, _n_a_m_es are - enabled. For example, to use the tteesstt binary found usin g PPAATTHH + If --nn is supplied, each _n_a_m_e is disabled; otherwise, _n_a_m_es are + enabled. For example, to use the tteesstt binary found using PPAATTHH instead of the shell builtin version, run "enable -n test". - If no _n_a_m_e arguments are supplied, or if the --pp option is sup- + If no _n_a_m_e arguments are supplied, or if the --pp option is sup- plied, print a list of shell builtins. With no other option ar- guments, the list consists of all enabled shell builtins. If --nn - is supplied, print only disabled builtins. If --aa is supplied, - the list printed includes all builtins, with an indication of + is supplied, print only disabled builtins. If --aa is supplied, + the list printed includes all builtins, with an indication of whether or not each is enabled. The --ss option means to restrict the output to the POSIX _s_p_e_c_i_a_l builtins. - The --ff option means to load the new builtin command _n_a_m_e from + The --ff option means to load the new builtin command _n_a_m_e from shared object _f_i_l_e_n_a_m_e, on systems that support dynamic loading. If _f_i_l_e_n_a_m_e does not contain a slash, BBaasshh will use the value of - the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a colon-separated list of - directories in which to search for _f_i_l_e_n_a_m_e. The default for - BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH is system-dependent, and may include "." to - force a search of the current directory. The --dd option will - delete a builtin previously loaded with --ff. If _-_s is used with + the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a colon-separated list of + directories in which to search for _f_i_l_e_n_a_m_e. The default for + BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH is system-dependent, and may include "." to + force a search of the current directory. The --dd option will + delete a builtin previously loaded with --ff. If _-_s is used with _-_f, the new builtin becomes a POSIX special builtin. - If no options are supplied and a _n_a_m_e is not a shell builtin, - eennaabbllee will attempt to load _n_a_m_e from a shared object named + If no options are supplied and a _n_a_m_e is not a shell builtin, + eennaabbllee will attempt to load _n_a_m_e from a shared object named _n_a_m_e, as if the command were "enable -f _n_a_m_e _n_a_m_e". - The return value is 0 unless a _n_a_m_e is not a shell builtin or + The return value is 0 unless a _n_a_m_e is not a shell builtin or there is an error loading a new builtin from a shared object. eevvaall [_a_r_g ...] - Concatenate the _a_r_gs together into a single command, separating + Concatenate the _a_r_gs together into a single command, separating them with spaces. BBaasshh then reads and execute this command, and - returns its exit status as the return status of eevvaall. If there + returns its exit status as the return status of eevvaall. If there are no _a_r_g_s, or only null arguments, eevvaall returns 0. eexxeecc [--ccll] [--aa _n_a_m_e] [_c_o_m_m_a_n_d [_a_r_g_u_m_e_n_t_s]] - If _c_o_m_m_a_n_d is specified, it replaces the shell without creating - a new process. _c_o_m_m_a_n_d cannot be a shell builtin or function. + If _c_o_m_m_a_n_d is specified, it replaces the shell without creating + a new process. _c_o_m_m_a_n_d cannot be a shell builtin or function. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If the --ll option is supplied, the shell places a dash at the beginning of the ze- - roth argument passed to _c_o_m_m_a_n_d. This is what _l_o_g_i_n(1) does. - The --cc option causes _c_o_m_m_a_n_d to be executed with an empty envi- + roth argument passed to _c_o_m_m_a_n_d. This is what _l_o_g_i_n(1) does. + The --cc option causes _c_o_m_m_a_n_d to be executed with an empty envi- ronment. If --aa is supplied, the shell passes _n_a_m_e as the zeroth argument to the executed command. If _c_o_m_m_a_n_d cannot be executed for some reason, a non-interactive - shell exits, unless the eexxeeccffaaiill shell option is enabled. In - that case, it returns a non-zero status. An interactive shell - returns a non-zero status if the file cannot be executed. A + shell exits, unless the eexxeeccffaaiill shell option is enabled. In + that case, it returns a non-zero status. An interactive shell + returns a non-zero status if the file cannot be executed. A subshell exits unconditionally if eexxeecc fails. If _c_o_m_m_a_n_d is not specified, any redirections take effect in the - current shell, and the return status is 0. If there is a redi- + current shell, and the return status is 0. If there is a redi- rection error, the return status is 1. eexxiitt [_n] - Cause the shell to exit with a status of _n. If _n is omitted, - the exit status is that of the last command executed. Any trap + Cause the shell to exit with a status of _n. If _n is omitted, + the exit status is that of the last command executed. Any trap on EEXXIITT is executed before the shell terminates. eexxppoorrtt [--ffnn] [_n_a_m_e[=_v_a_l_u_e]] ... eexxppoorrtt --pp - 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 + 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 + 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. - 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. @@ -5709,147 +5729,159 @@ 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; otherwise it displays a list of all the builtins and - shell compound commands. + 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: + --dd Display a short description of each _p_a_t_t_e_r_n --mm Display the description of each _p_a_t_t_e_r_n in a manpage-like 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 + 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 + of all matching help topics. + The return status is 0 unless no command matches _p_a_t_t_e_r_n. hhiissttoorryy [[_n]] @@ -6414,179 +6446,179 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS with a non-zero status, or zero if all commands in the pipeline exit successfully. This option is disabled by default. - ppoossiixx Change the behavior of bbaasshh where the default - operation differs from the POSIX standard to - match the standard (_p_o_s_i_x _m_o_d_e). See SSEEEE AALLSSOO - below for a reference to a document that details - how posix mode affects bash's behavior. + 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 @@ -6596,143 +6628,143 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ccoommppaatt4433 ccoommppaatt4444 ccoommppaatt5500 - 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 @@ -6741,37 +6773,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 @@ -6779,73 +6811,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. @@ -6862,110 +6894,110 @@ 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 keyword, part of the test in an _i_f statement, + a wwhhiillee or uunnttiill keyword, part of the test in an _i_f statement, 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 option), or if + following the final &&&& 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 using !!. These are the same conditions obeyed by the eerrrreexxiitt (--ee) option. 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. @@ -6974,61 +7006,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). @@ -7037,146 +7069,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 @@ -7184,173 +7216,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 _p_o_s_i_x 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 value of SSHHEELLLLOOPPTTSS from the shell environment at + +o Parsing the value of SSHHEELLLLOOPPTTSS from the shell environment 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 @@ -7375,10 +7407,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 @@ -7392,15 +7424,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: @@ -7408,10 +7440,10 @@ BBUUGG RREEPPOORRTTSS The version number of bbaasshh The hardware and operating system The compiler used to compile - A description of the bug behaviour + 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 @@ -7421,20 +7453,20 @@ BBUUGGSS It's too big and too slow. There are some subtle differences between bbaasshh and traditional versions - of sshh, mostly because of the PPOOSSIIXX specification. + of sshh, mostly because of the POSIX specification. Aliases are confusing in some uses. 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 2024 December 12 _B_A_S_H(1) +GNU Bash 5.3 2025 January 8 _B_A_S_H(1) diff --git a/doc/bash.1 b/doc/bash.1 index 171d8e30..9de7f96b 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,9 +5,13 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Thu Dec 12 13:37:07 EST 2024 +.\" Last Change: Wed Jan 8 09:27:11 EST 2025 .\" -.\" bash_builtins, strip all but Builtins section +.\" For bash_builtins, strip all but "SHELL BUILTIN COMMANDS" section +.\" For rbash, strip all but "RESTRICTED SHELL" section +.\" +.\" Both conditionalize text based on the base page being formatted +.\" using the zZ and zY registers, respectively .\" .\" Ensure the registers are initialized to avoid groff warnings. .nr zZ +0 @@ -17,7 +21,7 @@ .ds zY \" empty .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2024 December 12" "GNU Bash 5.3" +.TH BASH 1 "2025 January 8" "GNU Bash 5.3" .\" .ie \n(.g \{\ .ds ' \(aq @@ -66,24 +70,40 @@ bash \- GNU Bourne-Again SHell [options] [command_string | file] .SH COPYRIGHT -.if n Bash is Copyright (C) 1989-2024 by the Free Software Foundation, Inc. -.if t Bash is Copyright \(co 1989-2024 by the Free Software Foundation, Inc. +.if n Bash is Copyright (C) 1989-2025 by the Free Software Foundation, Inc. +.if t Bash is Copyright \(co 1989-2025 by the Free Software Foundation, Inc. .SH DESCRIPTION .B Bash -is an \fBsh\fP-compatible command language interpreter that +is a command language interpreter that executes commands read from the standard input, from a string, or from a file. +It is a reimplementation and extension of the Bourne shell, +the historical Unix command language interpreter. .B Bash also incorporates useful features from the \fIKorn\fP and \fIC\fP shells (\fBksh\fP and \fBcsh\fP). .PP -POSIX is the name for a family of computing standards based on Unix. +.SM POSIX +is the name for a family of computing standards based on Unix. .B Bash is intended to be a conformant implementation of the -Shell and Utilities portion of the IEEE POSIX specification -(IEEE Standard 1003.1). +Shell and Utilities portion of the IEEE +.SM POSIX +specification (IEEE Standard 1003.1). +.B Bash +.SM POSIX +mode (hereafter referred to as \fIposix mode\fP) +changes the shell's behavior where its default operation differs +from the standard to strictly conform to the standard. +See +.SM +.B "SEE ALSO" +below for a reference to a document that details how posix mode affects +\fBbash\fP's behavior. .B Bash -can be configured to be POSIX-conformant by default. +can be configured to be +.SM POSIX\c +-conformant by default. .SH OPTIONS All of the single-character shell options documented in the description of the \fBset\fP builtin command, including \fB\-o\fP, @@ -244,13 +264,11 @@ This option is on by default if the shell is invoked as .BR sh . .TP .B \-\-posix -Change the behavior of \fBbash\fP where the default operation differs -from the POSIX standard to match the standard (\fIposix mode\fP). -See -.SM -.B "SEE ALSO" -below for a reference to a document that details how posix mode affects -\fBBash\fP's behavior. +Enable posix mode; +change the behavior of \fBbash\fP +where the default operation differs from the +.SM POSIX +standard to match the standard. .TP .B \-\-restricted The shell becomes restricted (see @@ -270,9 +288,9 @@ If arguments remain after option processing, and neither the .B \-c nor the .B \-s -option has been supplied, the first argument is assumed to -be the name of a file containing shell commands (a \fIshell script\fP). -If +option has been supplied, the first argument is treated as +the name of a file containing shell commands (a \fIshell script\fP). +When .B bash is invoked in this fashion, .B $0 @@ -283,8 +301,9 @@ reads and executes commands from this file, then exits. \fBBash\fP's exit status is the exit status of the last command executed in the script. If no commands are executed, the exit status is 0. -Bash first attempts to open the file in the current directory, and, -if no file is found, then searches the directories in +.B Bash +first attempts to open the file in the current directory, +and, if no file is found, searches the directories in .SM .B PATH for the script. @@ -295,12 +314,12 @@ or one started with the .B \-\-login option. .PP -An \fIinteractive\fP shell is one started without non-option arguments +An \fIinteractive shell\fP is one started without non-option arguments (unless \fB\-s\fP is specified) and without the .B \-c option, -whose standard input and standard error are +and whose standard input and standard error are both connected to terminals (as determined by .IR isatty (3)), or one started with the @@ -397,10 +416,12 @@ is invoked with the name it tries to mimic the startup behavior of historical versions of .B sh as closely as possible, -while conforming to the POSIX standard as well. +while conforming to the +.SM POSIX +standard as well. When invoked as an interactive login shell, or a non-interactive -shell with the \fB\-\-login\fP option, it first attempts to -read and execute commands from +shell with the \fB\-\-login\fP option, it first attempts to read +and execute commands from .FN /etc/profile and .FN \*~/.profile , @@ -425,6 +446,7 @@ option has no effect. A non-interactive shell invoked with the name .B sh does not attempt to read any other startup files. +.PP When invoked as .BR sh , .B bash @@ -434,7 +456,9 @@ When .B bash is started in posix mode, as with the .B \-\-posix -command line option, it follows the POSIX standard for startup files. +command line option, it follows the +.SM POSIX +standard for startup files. In this mode, interactive shells expand the .SM .B ENV @@ -605,7 +629,9 @@ If the reserved word precedes a pipeline, the shell reports the elapsed as well as user and system time consumed by its execution when the pipeline terminates. -The \fB\-p\fP option changes the output format to that specified by POSIX. +The \fB\-p\fP option changes the output format to that specified by +.SM POSIX\c +\&. When the shell is in posix mode, it does not recognize \fBtime\fP as a reserved word if the next token begins with a .Q \- . @@ -784,8 +810,12 @@ instead of having any special pattern matching meaning. An additional binary operator, \fB=\*~\fP, is available, with the same precedence as \fB==\fP and \fB!=\fP. When it is used, the string to the right of the operator is considered -a POSIX extended regular expression and matched accordingly -(using the POSIX \fIregcomp\fP and \fIregexec\fP interfaces +a +.SM POSIX +extended regular expression and matched accordingly +(using the +.SM POSIX +\fIregcomp\fP and \fIregexec\fP interfaces usually described in .IR regex (3)). The return value is 0 if the string matches @@ -973,7 +1003,7 @@ Using \fB;&\fP in place of \fB;;\fP causes execution to continue with the \fIlist\fP associated with the next pattern list. Using \fB;;&\fP in place of \fB;;\fP causes the shell to test the next pattern list in the statement, if any, and execute any associated \fIlist\fP -if the match succeeds. +if the match succeeds, continuing the case statement execution as if the pattern list had not matched. The exit status is zero if no pattern matches. .IP @@ -1103,7 +1133,9 @@ parentheses are not supplied, the braces are recommended. \fIcompound\-command\fP is executed whenever \fIfname\fP is specified as the name of a simple command. When in posix mode, \fIfname\fP must be a valid shell \fIname\fP -and may not be the name of one of the POSIX \fIspecial builtins\fP. +and may not be the name of one of the +.SM POSIX +\fIspecial builtins\fP. In default mode, a function name can be any unquoted shell word that does not contain \fB$\fP. .PP @@ -1221,8 +1253,8 @@ The special parameters .B * and .B @ -have special meaning when in double -quotes (see +have special meaning when in double quotes +(see .SM .B PARAMETERS below). @@ -1390,25 +1422,34 @@ one or more instances of the \fBcommand\fP builtin and retain these assignment statement properties. .PP In the context where an assignment statement is assigning a value -to a shell variable or array index, -the += operator appends to or adds to +to a shell variable or array index, the +.Q += +operator appends to or adds to the variable's previous value. This includes arguments to \fIdeclaration\fP commands such as -\fBdeclare\fP that accept assignment statements. -When += is applied to a variable -for which the \fBinteger\fP attribute has been set, +.B \%declare +that accept assignment statements. +When +.Q += +is applied to a variable for which the +.B \%integer +attribute has been set, the variable's current value and \fIvalue\fP are each evaluated as arithmetic expressions, and the sum of the results is assigned as the variable's value. The current value is usually an integer constant, but may be an expression. -When += is applied to an array variable using compound assignment +When +.Q += +is applied to an array variable using compound assignment (see .B Arrays -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. +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, \fIvalue\fP is expanded and appended to the variable's value. .PP @@ -1775,7 +1816,7 @@ have no effect, and it may not be unset. .B BASH_LOADABLES_PATH A colon-separated list of directories in which the .B enable -command. +command looks for dynamically loadable builtins. .TP @@ -2170,7 +2211,9 @@ is unset, it loses its special properties, even if it is subsequently reset. .TP .B READLINE_ARGUMENT -Any numeric argument given to a \fBreadline\fP command that was defined using +Any numeric argument given to a +.B \%readline +command that was defined using .Q "bind \-x" (see .SM @@ -2252,6 +2295,8 @@ If this variable is in the environment when .B bash starts up, the shell enables each option in the list before reading any startup files. +If this variable is exported, child shells will enable each option +in the list. This variable is read-only. .TP .B SHLVL @@ -2367,9 +2412,10 @@ A sample value is .TP .B CHILD_MAX Set the number of exited child status values for the shell to remember. -\fBBash\fP will not allow this value to be decreased below a POSIX-mandated -minimum, and there is a maximum value (currently 8192) that this may -not exceed. +\fBBash\fP will not allow this value to be decreased below a +.SM POSIX\c +-mandated minimum, +and there is a maximum value (currently 8192) that this may not exceed. The minimum value is system-dependent. .TP .B COLUMNS @@ -2569,7 +2615,9 @@ 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 \fBhistory\fP builtin. +writing it when a shell exits or by the +.B \%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 @@ -2606,8 +2654,26 @@ and are added to the history regardless of the value of .BR HISTIGNORE . If the first line was not saved, the second and subsequent lines of the command are not saved either. -The pattern matching honors the setting of the \fBextglob\fP shell -option. +The pattern matching honors the setting of the +.B \%extglob +shell option. +.IP +.SM +.B HISTIGNORE +subsumes some of the function of +.SM +.BR HISTCONTROL . +A pattern of +.Q & +is identical to +.Q \%ignoredups , +and a pattern of +.Q "[ ]*" +is identical to +.Q \%ignorespace . +Combining these two patterns, separating them with a colon, +provides the functionality of +.Q \%ignoreboth . .TP .B HISTSIZE The number of commands to remember in the command history (see @@ -2656,7 +2722,7 @@ to obtain the list of possible hostname completions. When .SM .B HOSTFILE -is unset, \fBbash\fP clears the the hostname list. +is unset, \fBbash\fP clears the hostname list. .TP .B IFS The @@ -2824,15 +2890,22 @@ The default path is system-dependent, and is set by the administrator who installs .BR bash . A common value is -.na -.Q /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin . -.ad +.RS +.RS 5n +.EX +/usr/local/bin:/usr/local/sbin:\c +.if \n(LL<78n .br +/usr/bin:/usr/sbin:/bin:/sbin +.EE +.RE +.RE .TP .B POSIXLY_CORRECT If this variable is in the environment when \fBbash\fP starts, the shell enters posix mode before reading the startup files, as if the .B \-\-posix -invocation option had been supplied. If it is set while the shell is +invocation option had been supplied. +If it is set while the shell is running, \fBbash\fP enables posix mode, as if the command .Q "set \-o posix" had been executed. @@ -3024,10 +3097,13 @@ The second character is the \fIquick substitution\fP character, normally When it appears as the first character on the line, history substitution repeats the previous command, replacing one string with another. -The optional third character is the character which indicates that -the remainder of the line is a comment when found as the first character -of a word, normally -.Q \fB#\fP . +The optional third character is the +\fIhistory comment\fP +character, normally +.Q \fB#\fP , +which indicates +that the remainder of the line is a comment +when it appears as the first character of a word. The history comment character disables history substitution for the remaining words on the line. It does not necessarily cause the shell parser to treat the rest of the @@ -3043,34 +3119,49 @@ There is no maximum limit on the size of an array, nor any requirement that members be indexed or assigned contiguously. Indexed arrays are referenced using arithmetic expressions -that must expand to an integer and are zero-based; +that must expand to an integer +(see +.SM +.B +ARITHMETIC EVALUATION +below) +and are zero-based; associative arrays are referenced using arbitrary strings. Unless otherwise noted, indexed array indices must be non-negative integers. .PP An indexed array is created automatically if any variable is assigned to using the syntax -\fIname\fP[\fIsubscript\fP]=\fIvalue\fP. +.RS +\fIname\fP[\fIsubscript\fP]=\fIvalue\fP +\&. +.RE The .I subscript is treated as an arithmetic expression that must evaluate to a number greater than or equal to zero. To explicitly declare an indexed array, use -.B declare \-a \fIname\fP +.RS +.BI "declare \-a\ " name +.RE (see .SM .B "SHELL BUILTIN COMMANDS" below). -.B declare \-a \fIname\fP[\fIsubscript\fP] +.RS +\fBdeclare \-a\fP \fIname\fP[\fIsubscript\fP] +.RE is also accepted; the \fIsubscript\fP is ignored. .PP Associative arrays are created using -.BR "declare \-A \fIname\fP" . +.RS +.BI "declare \-A\ " name +.RE +\&. .PP -Attributes may be -specified for an array variable using the -.B declare +Attributes may be specified for an array variable using the +.B \%declare and -.B readonly +.B \%readonly builtins. Each attribute applies to all members of an array. .PP @@ -3119,7 +3210,9 @@ interpreted as relative to one greater than the maximum index of \fIname\fP, so negative indices count back from the end of the array, and an index of \-1 references the last element. .PP -The += operator appends to an array variable when assigning +The +.Q += +operator appends to an array variable when assigning using the compound assignment syntax; see .SM .B PARAMETERS @@ -3291,12 +3384,12 @@ need not exist. Patterns to be brace expanded are formed from an optional .IR preamble , followed by either a series of comma-separated strings or -a sequence expression between a pair of braces, followed by -an optional +a sequence expression between a pair of braces, +followed by an optional .IR postscript . -The preamble is prefixed to each string contained -within the braces, and the postscript is then appended -to each resulting string, expanding left to right. +The preamble is prefixed to each string contained within the braces, +and the postscript is then appended to each resulting string, +expanding left to right. .PP Brace expansions may be nested. The results of each expanded string are not sorted; @@ -3310,12 +3403,9 @@ where \fIx\fP and \fIy\fP are either integers or single letters, and \fIincr\fP, an optional increment, is an integer. When integers are supplied, the expression expands to each number between \fIx\fP and \fIy\fP, inclusive. -If either \fIx\fP or \fIy\fP begins with \fI0\fP, +If either \fIx\fP or \fIy\fP begins with a zero, each generated term will contain the same number of digits, zero-padding where necessary. -When either \fIx\fP or \fPy\fP begins with a zero, the shell -attempts to force all generated terms to contain the same number of digits, -zero-padding where necessary. When letters are supplied, the expression expands to each character lexicographically between \fIx\fP and \fIy\fP, inclusive, using the default C locale. @@ -3338,22 +3428,32 @@ and closing braces, and at least one unquoted comma or a valid sequence expression. Any incorrectly formed brace expansion is left unchanged. .PP -A \fB{\fP or \fB,\fP may be quoted with a backslash to prevent its +A +.Q { +or +Q , +may be quoted with a backslash to prevent its being considered part of a brace expression. -To avoid conflicts with parameter expansion, the string \fB${\fP -is not considered eligible for brace expansion, and inhibits brace -expansion until the closing \fB}\fP. +To avoid conflicts with parameter expansion, the string +.Q ${ +is not considered eligible for brace expansion, +and inhibits brace expansion until the closing +.Q } . .PP This construct is typically used as shorthand when the common prefix of the strings to be generated is longer than in the above example: -.RS .PP +.RS +.EX mkdir /usr/local/src/bash/{old,new,dist,bugs} +.EE .RE or .RS +.EX chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +.EE .RE .PP Brace expansion introduces a slight incompatibility with @@ -3363,14 +3463,15 @@ historical versions of does not treat opening or closing braces specially when they appear as part of a word, and preserves them in the output. .B Bash -removes braces from words as a consequence of brace -expansion. +removes braces from words as a consequence of brace expansion. For example, a word entered to .B sh -as \fIfile{1,2}\fP +as +.Q file{1,2} appears identically in the output. -\fBBash\fP outputs that word as -.I file1 file2 +.B Bash +outputs that word as +.Q "file1 file2" after brace expansion. Start .B bash @@ -3464,8 +3565,9 @@ of variable assignments (as described above under .SM .BR PARAMETERS ) when they appear as arguments to simple commands. -\fBBash\fP does not do this, except for the \fIdeclaration\fP commands listed -above, when in posix mode. +\fBBash\fP does not do this, +except for the \fIdeclaration\fP commands listed above, +when in posix mode. .SS Parameter Expansion The .Q \fB$\fP @@ -4080,7 +4182,8 @@ This filename is passed as an argument to the current command as the result of the expansion. .PP -If the \fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to +If the +\fB>(\fP\fIlist\^\fP\fB)\fP form is used, writing to the file provides input for \fIlist\fP. If the \fB<(\fP\fIlist\^\fP\fB)\fP form is used, reading the file @@ -4090,7 +4193,7 @@ and the left parenthesis, otherwise the construct would be interpreted as a redirection. .PP Process substitution is supported on systems that support named -pipes (\fIFIFOs\fP) or the \fB/dev/fd\fP method of naming open files. +pipes (\fIFIFOs\fP) or the \fI/dev/fd\fP method of naming open files. .PP When available, process substitution is performed simultaneously with parameter and variable expansion, @@ -4301,7 +4404,8 @@ make .Q .* one of the patterns in .SM -.BR GLOBIGNORE . +.B GLOBIGNORE\c +\&. The .B dotglob option is disabled when @@ -4313,11 +4417,12 @@ The pattern matching honors the setting of the \fBextglob\fP shell option. .PP -The +The value of the .SM .B GLOBSORT shell variable controls how the results of pathname expansion are sorted, -as described above. +as described above under +.BR "Shell Variables" . .PP \fBPattern Matching\fP .PP @@ -4395,7 +4500,9 @@ shell option. Within a bracket expression, \fIcharacter classes\fP can be specified using the syntax \fB[:\fP\fIclass\fP\fB:]\fP, where \fIclass\fP is one of the -following classes defined in the POSIX standard: +following classes defined in the +.SM POSIX +standard: .IP .RS .B @@ -4648,7 +4755,7 @@ and the .B noclobber option to the .B set -builtin has been enabled, the redirection fails if the file +builtin command has been enabled, the redirection fails if the file whose name results from the expansion of \fIword\fP exists and is a regular file. If the redirection operator is @@ -4659,11 +4766,11 @@ and the .B noclobber option to the .B set -builtin command is not enabled, +builtin is not enabled, \fBbash\fP attempts the redirection even if the file named by \fIword\fP exists. .SS Appending Redirected Output -Redirecting output in this fashion opens +Redirecting output in this fashion opens the file whose name results from the expansion of .I word for appending on file descriptor @@ -5418,7 +5525,9 @@ is non-zero. .TP \fIstring1\fP \fB=\fP \fIstring2\fP True if the strings are equal. -\fB=\fP should be used with the \fBtest\fP command for POSIX conformance. +\fB=\fP should be used with the \fBtest\fP command for +.SM POSIX +conformance. When used with the \fB[[\fP command, this performs pattern matching as described above (\fBCompound Commands\fP). .TP @@ -6948,7 +7057,7 @@ If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, the number of history entries is not limited. -By default, \fBbash\fP sets the the maximum number of history entries to +By default, \fBbash\fP sets the maximum number of history entries to the value of the \fBHISTSIZE\fP shell variable. Setting \fIhistory\-size\fP to a non-numeric value will set the maximum number of history entries to 500. @@ -7329,11 +7438,11 @@ Words are composed of alphanumeric characters (letters and digits). Move back to the start of the current or previous word. Words are composed of alphanumeric characters (letters and digits). .TP -.B shell\-forward\-word +.B shell\-forward\-word (M\-C\-f) Move forward to the end of the next word. Words are delimited by non-quoted shell metacharacters. .TP -.B shell\-backward\-word +.B shell\-backward\-word (M\-C\-b) Move back to the start of the current or previous word. Words are delimited by non-quoted shell metacharacters. .TP @@ -7607,7 +7716,7 @@ Negative arguments have no effect. .TP .B transpose\-words (M\-t) Drag the word before point past the word after point, -moving point over that word as well. +moving point past that word as well. If point is at the end of the line, this transposes the last two words on the line. .TP @@ -7810,7 +7919,7 @@ the number of matches \fIN\fP; the word being completed; .IP \(bu \fIS\fP:\fIE\fP, -where S and E are the start and end offsets of the word +where \fIS\fP and \fIE\fP are the start and end offsets of the word in the \fBreadline\fP line buffer; then .IP \(bu each match, one per line @@ -8327,7 +8436,7 @@ and .PP On startup, \fBbash\fP initializes the history list by reading history entries from the -the file named by the +file named by the .SM .B HISTFILE variable (default @@ -9163,7 +9272,7 @@ before attempting the directory change. .IP If \fBcd\fP uses a non-empty directory name from .SM -.BR CDPATH, +.BR CDPATH , or if \fB\-\fP is the first argument, and the directory change is successful, \fBcd\fP writes the absolute pathname of the new working directory to the standard output. @@ -9712,7 +9821,7 @@ subsequent assignments. .PP The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using -.Q "\-f foo=bar" . +.Q "\-f foo=bar" , an attempt is made to assign a value to a readonly variable, an attempt is made to assign a value to an array variable without using the compound assignment syntax (see @@ -9895,7 +10004,7 @@ If \fB\-n\fP is supplied, each \fIname\fP is disabled; otherwise, \fIname\fPs are enabled. For example, to use the .B test -binary found usin g +binary found using .SM .B PATH instead of the shell builtin version, run @@ -9909,7 +10018,8 @@ shell builtins. If \fB\-n\fP is supplied, print only disabled builtins. If \fB\-a\fP is supplied, the list printed includes all builtins, with an indication of whether or not each is enabled. -The \fB\-s\fP option means to restrict the output to the POSIX +The \fB\-s\fP option means to restrict the output to the +.SM POSIX \fIspecial\fP builtins. .IP The @@ -9929,7 +10039,8 @@ to force a search of the current directory. The .B \-d option will delete a builtin previously loaded with \fB\-f\fP. -If \fI\-s\fP is used with \fI\-f\fP, the new builtin becomes a POSIX +If \fI\-s\fP is used with \fI\-f\fP, the new builtin becomes a +.SM POSIX special builtin. .IP If no options are supplied and a \fIname\fP is not a shell builtin, @@ -10321,12 +10432,15 @@ If is specified, .B help gives detailed help on all commands matching -.IR pattern ; +.I pattern +as described below; otherwise it displays a list of all the builtins and shell compound commands. +.IP +Options, if supplied, have the follow meanings: .RS -.PD 0 .TP +.PD 0 .B \-d Display a short description of each \fIpattern\fP .TP @@ -10338,6 +10452,21 @@ Display only a short usage synopsis for each \fIpattern\fP .PD .RE .IP +If \fIpattern\fP contains pattern matching characters +(see +.SM +.B "Pattern Matching" +above) +it's treated as a shell pattern and +\fBhelp\fP prints the description of each +help topic matching \fIpattern\fP. +.IP +If not, and \fIpattern\fP exactly matches the name of a help topic, +\fBhelp\fP prints the description +associated with that topic. +Otherwise, \fBhelp\fP performs prefix matching and +prints the descriptions of all matching help topics. +.IP The return status is 0 unless no command matches .IR pattern . .TP @@ -11380,10 +11509,13 @@ commands in the pipeline exit successfully. This option is disabled by default. .TP 8 .B posix -Change the behavior of +Enable posix mode; +change the behavior of .B bash where the default operation differs -from the POSIX standard to match the standard (\fIposix mode\fP). +from the +.SM POSIX +standard to match the standard. See .SM .B "SEE ALSO" @@ -12271,7 +12403,8 @@ commands sort lexicographically using ASCII ordering. .PP The historical operator-precedence parsing with 4 or more arguments can lead to ambiguities when it encounters strings that look like primaries. -The POSIX +The +.SM POSIX standard has deprecated the \fB\-a\fP and \fB\-o\fP primaries and enclosing expressions within parentheses. Scripts should no longer use them. @@ -12588,7 +12721,9 @@ allow this value to be set). The pipe size in 512-byte blocks (this may not be set). .TP .B \-q -The maximum number of bytes in POSIX message queues. +The maximum number of bytes in +.SM POSIX +message queues. .TP .B \-r The maximum real-time scheduling priority. @@ -12906,14 +13041,18 @@ bash-4.1 and later use the current locale's collation sequence and .PD 0 .RS .IP \(bu -In \fIposix\fP mode, \fBtime\fP may be followed by options and still be -recognized as a reserved word (this is POSIX interpretation 267). +In posix mode, \fBtime\fP may be followed by options and still be +recognized as a reserved word (this is +.SM POSIX +interpretation 267). .IP \(bu In \fIposix\fP mode, the parser requires that an even number of single quotes occur in the \fIword\fP 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). +(this is +.SM POSIX +interpretation 221). .RE .PD .TP @@ -12927,7 +13066,9 @@ undergo quote removal, as it does in versions after bash-4.2. In posix mode, single quotes are considered special when expanding the \fIword\fP 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 interpretation 221); +(this is part of +.SM POSIX +interpretation 221); in later versions, single quotes are not special within double-quoted word expansions. .RE @@ -13246,7 +13387,7 @@ The hardware and operating system .TP The compiler used to compile .TP -A description of the bug behaviour +A description of the bug behavior .TP A short script or \c .Q recipe " \c" @@ -13268,8 +13409,7 @@ There are some subtle differences between and traditional versions of .BR sh , mostly because of the -.SM -.B POSIX +.SM POSIX specification. .PP Aliases are confusing in some uses. diff --git a/doc/bash.html b/doc/bash.html index 11f90e3b..04b3b5ba 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2024 December 12BASH(1) +BASH(1)2025 January 8BASH(1)

Index @@ -48,30 +48,48 @@ bash - GNU Bourne-Again SHell

COPYRIGHT

-Bash is Copyright © 1989-2024 by the Free Software Foundation, Inc. +Bash is Copyright © 1989-2025 by the Free Software Foundation, Inc.  

DESCRIPTION

Bash -is an sh-compatible command language interpreter that +is a command language interpreter that executes commands read from the standard input, from a string, or from a file. +It is a reimplementation and extension of the Bourne shell, +the historical Unix command language interpreter. Bash also incorporates useful features from the Korn and C shells (ksh and csh).

-POSIX is the name for a family of computing standards based on Unix. +POSIX +is the name for a family of computing standards based on Unix. Bash is intended to be a conformant implementation of the -Shell and Utilities portion of the IEEE POSIX specification -(IEEE Standard 1003.1). +Shell and Utilities portion of the IEEE +POSIX +specification (IEEE Standard 1003.1). Bash -can be configured to be POSIX-conformant by default. +POSIX +mode (hereafter referred to as posix mode) +changes the shell's behavior where its default operation differs +from the standard to strictly conform to the standard. +See +SEE ALSO + + +below for a reference to a document that details how posix mode affects +bash's behavior. +Bash + +can be configured to be +POSIX +-conformant by default.  

OPTIONS

@@ -294,14 +312,11 @@ This option is on by default if the shell is invoked as
--posix
-Change the behavior of bash where the default operation differs -from the POSIX standard to match the standard (posix mode). -See -SEE ALSO - - -below for a reference to a document that details how posix mode affects -Bash's behavior. +Enable posix mode; +change the behavior of bash +where the default operation differs from the +POSIX +standard to match the standard.
--restricted
@@ -331,9 +346,9 @@ If arguments remain after option processing, and neither the nor the -s -option has been supplied, the first argument is assumed to -be the name of a file containing shell commands (a shell script). -If +option has been supplied, the first argument is treated as +the name of a file containing shell commands (a shell script). +When bash is invoked in this fashion, @@ -347,8 +362,10 @@ reads and executes commands from this file, then exits. Bash's exit status is the exit status of the last command executed in the script. If no commands are executed, the exit status is 0. -Bash first attempts to open the file in the current directory, and, -if no file is found, then searches the directories in +Bash + +first attempts to open the file in the current directory, +and, if no file is found, searches the directories in PATH @@ -365,13 +382,13 @@ or one started with the option.

-An interactive shell is one started without non-option arguments +An interactive shell is one started without non-option arguments (unless -s is specified) and without the -c option, -whose standard input and standard error are +and whose standard input and standard error are both connected to terminals (as determined by isatty(3)), @@ -518,10 +535,12 @@ it tries to mimic the startup behavior of historical versions of sh as closely as possible, -while conforming to the POSIX standard as well. +while conforming to the +POSIX +standard as well. When invoked as an interactive login shell, or a non-interactive -shell with the --login option, it first attempts to -read and execute commands from +shell with the --login option, it first attempts to read +and execute commands from /etc/profile @@ -557,6 +576,8 @@ A non-interactive shell invoked with the name sh does not attempt to read any other startup files. +

+ When invoked as sh, @@ -571,7 +592,9 @@ When is started in posix mode, as with the --posix -command line option, it follows the POSIX standard for startup files. +command line option, it follows the +POSIX +standard for startup files. In this mode, interactive shells expand the ENV @@ -806,7 +829,9 @@ If the reserved word precedes a pipeline, the shell reports the elapsed as well as user and system time consumed by its execution when the pipeline terminates. -The -p option changes the output format to that specified by POSIX. +The -p option changes the output format to that specified by +POSIX +. When the shell is in posix mode, it does not recognize time as a reserved word if the next token begins with a @@ -1025,8 +1050,12 @@ instead of having any special pattern matching meaning. An additional binary operator, =~, is available, with the same precedence as == and !=. When it is used, the string to the right of the operator is considered -a POSIX extended regular expression and matched accordingly -(using the POSIX regcomp and regexec interfaces +a +POSIX +extended regular expression and matched accordingly +(using the +POSIX +regcomp and regexec interfaces usually described in regex(3)). @@ -1240,7 +1269,7 @@ Using ;& in place of ;; causes execution to continue with the list associated with the next pattern list. Using ;;& in place of ;; causes the shell to test the next pattern list in the statement, if any, and execute any associated list -if the match succeeds. +if the match succeeds, continuing the case statement execution as if the pattern list had not matched. The exit status is zero if no pattern matches.

@@ -1390,7 +1419,9 @@ parentheses are not supplied, the braces are recommended. compound-command is executed whenever fname is specified as the name of a simple command. When in posix mode, fname must be a valid shell name -and may not be the name of one of the POSIX special builtins. +and may not be the name of one of the +POSIX +special builtins. In default mode, a function name can be any unquoted shell word that does not contain $. @@ -1550,8 +1581,8 @@ The special parameters and @ -have special meaning when in double -quotes (see +have special meaning when in double quotes +(see PARAMETERS @@ -1780,26 +1811,37 @@ assignment statement properties.

In the context where an assignment statement is assigning a value -to a shell variable or array index, -the += operator appends to or adds to +to a shell variable or array index, the + +operator appends to or adds to the variable's previous value. This includes arguments to declaration commands such as -declare that accept assignment statements. -When += is applied to a variable -for which the integer attribute has been set, +declare + +that accept assignment statements. +When + +is applied to a variable for which the +integer + +attribute has been set, the variable's current value and value are each evaluated as arithmetic expressions, and the sum of the results is assigned as the variable's value. The current value is usually an integer constant, but may be an expression. -When += is applied to an array variable using compound assignment +When + +is applied to an array variable using compound assignment (see Arrays -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. +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, value is expanded and appended to the variable's value.

@@ -1843,6 +1885,15 @@ array variables. Namerefs can be unset using the -n option to the unset builtin. Otherwise, if unset is executed with the name of a nameref variable as an argument, the variable referenced by the nameref variable is unset. +

+ +When the shell starts, it reads its environment and creates a shell +variable from each environment variable that has a valid name, +as described below +(see +ENVIRONMENT). + +  

Positional Parameters

@@ -2246,7 +2297,7 @@ have no effect, and it may not be unset. A colon-separated list of directories in which the enable -command. +command looks for dynamically loadable builtins.
BASH_MONOSECONDS @@ -2737,7 +2788,10 @@ subsequently reset.
READLINE_ARGUMENT
-Any numeric argument given to a readline command that was defined using +Any numeric argument given to a +readline + +command that was defined using (see SHELL BUILTIN COMMANDS @@ -2841,6 +2895,8 @@ If this variable is in the environment when starts up, the shell enables each option in the list before reading any startup files. +If this variable is exported, child shells will enable each option +in the list. This variable is read-only.
SHLVL @@ -2985,9 +3041,10 @@ A sample value is
Set the number of exited child status values for the shell to remember. -Bash will not allow this value to be decreased below a POSIX-mandated -minimum, and there is a maximum value (currently 8192) that this may -not exceed. +Bash will not allow this value to be decreased below a +POSIX +-mandated minimum, +and there is a maximum value (currently 8192) that this may not exceed. The minimum value is system-dependent.
COLUMNS @@ -3232,7 +3289,10 @@ 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. +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 @@ -3274,8 +3334,29 @@ and are added to the history regardless of the value of If the first line was not saved, the second and subsequent lines of the command are not saved either. -The pattern matching honors the setting of the extglob shell -option. +The pattern matching honors the setting of the +extglob + +shell option. +
+HISTIGNORE + + +subsumes some of the function of +HISTCONTROL. + + +A pattern of + +is identical to + +and a pattern of + +is identical to + +Combining these two patterns, separating them with a colon, +provides the functionality of +
HISTSIZE
@@ -3337,7 +3418,7 @@ When HOSTFILE -is unset, bash clears the the hostname list. +is unset, bash clears the hostname list.
IFS
@@ -3555,8 +3636,18 @@ and is set by the administrator who installs bash. A common value is +
+
+ +/usr/local/bin:/usr/local/sbin: +
+/usr/bin:/usr/sbin:/bin:/sbin + +
+ +
POSIXLY_CORRECT @@ -3565,7 +3656,8 @@ If this variable is in the environment when bash starts, the shell enters posix mode before reading the startup files, as if the --posix -invocation option had been supplied. If it is set while the shell is +invocation option had been supplied. +If it is set while the shell is running, bash enables posix mode, as if the command had been executed. @@ -3801,10 +3893,13 @@ The second character is the quick substitution character, normally When it appears as the first character on the line, history substitution repeats the previous command, replacing one string with another. -The optional third character is the character which indicates that -the remainder of the line is a comment when found as the first character -of a word, normally +The optional third character is the +history comment +character, normally +which indicates +that the remainder of the line is a comment +when it appears as the first character of a word. The history comment character disables history substitution for the remaining words on the line. It does not necessarily cause the shell parser to treat the rest of the @@ -3825,39 +3920,57 @@ There is no maximum limit on the size of an array, nor any requirement that members be indexed or assigned contiguously. Indexed arrays are referenced using arithmetic expressions -that must expand to an integer and are zero-based; +that must expand to an integer +(see +ARITHMETIC EVALUATION + + +below) +and are zero-based; associative arrays are referenced using arbitrary strings. Unless otherwise noted, indexed array indices must be non-negative integers.

An indexed array is created automatically if any variable is assigned to using the syntax -name[subscript]=value. +

+name[subscript]=value +. +
+ The subscript is treated as an arithmetic expression that must evaluate to a number greater than or equal to zero. To explicitly declare an indexed array, use -declare -a name +
+declare -a name + +
(see SHELL BUILTIN COMMANDS below). -declare -a name[subscript] +
+declare -a name[subscript] +
is also accepted; the subscript is ignored.

Associative arrays are created using -declare -A name. +

+declare -A name +
+ +.

-Attributes may be -specified for an array variable using the +Attributes may be specified for an array variable using the declare and @@ -3920,7 +4033,9 @@ interpreted as relative to one greater than the maximum index of array, and an index of -1 references the last element.

-The += operator appends to an array variable when assigning +The + +operator appends to an array variable when assigning using the compound assignment syntax; see PARAMETERS @@ -4139,13 +4254,13 @@ Patterns to be brace expanded are formed from an optional preamble, followed by either a series of comma-separated strings or -a sequence expression between a pair of braces, followed by -an optional +a sequence expression between a pair of braces, +followed by an optional postscript. -The preamble is prefixed to each string contained -within the braces, and the postscript is then appended -to each resulting string, expanding left to right. +The preamble is prefixed to each string contained within the braces, +and the postscript is then appended to each resulting string, +expanding left to right.

Brace expansions may be nested. @@ -4161,12 +4276,9 @@ where x and y are either integers or single letters, and incr, an optional increment, is an integer. When integers are supplied, the expression expands to each number between x and y, inclusive. -If either x or y begins with 0, +If either x or y begins with a zero, each generated term will contain the same number of digits, zero-padding where necessary. -When either x or y begins with a zero, the shell -attempts to force all generated terms to contain the same number of digits, -zero-padding where necessary. When letters are supplied, the expression expands to each character lexicographically between x and y, inclusive, using the default C locale. @@ -4193,25 +4305,35 @@ sequence expression. Any incorrectly formed brace expansion is left unchanged.

-A { or , may be quoted with a backslash to prevent its +A + +or +Q , +may be quoted with a backslash to prevent its being considered part of a brace expression. -To avoid conflicts with parameter expansion, the string ${ -is not considered eligible for brace expansion, and inhibits brace -expansion until the closing }. +To avoid conflicts with parameter expansion, the string + +is not considered eligible for brace expansion, +and inhibits brace expansion until the closing +

This construct is typically used as shorthand when the common prefix of the strings to be generated is longer than in the above example: -

+

+ mkdir /usr/local/src/bash/{old,new,dist,bugs} +
or
+ chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} +

@@ -4226,15 +4348,16 @@ does not treat opening or closing braces specially when they appear as part of a word, and preserves them in the output. Bash -removes braces from words as a consequence of brace -expansion. +removes braces from words as a consequence of brace expansion. For example, a word entered to sh -as file{1,2} +as + appears identically in the output. -Bash outputs that word as -file1 file2 +Bash + +outputs that word as after brace expansion. Start @@ -4352,8 +4475,9 @@ of variable assignments (as described above under when they appear as arguments to simple commands. -Bash does not do this, except for the declaration commands listed -above, when in posix mode. +Bash does not do this, +except for the declaration commands listed above, +when in posix mode.  

Parameter Expansion

@@ -5077,7 +5201,8 @@ passed as an argument to the current command as the result of the expansion.

-If the >(list) form is used, writing to +If the +>(list) form is used, writing to the file provides input for list. If the <(list) form is used, reading the file @@ -5088,7 +5213,7 @@ as a redirection.

Process substitution is supported on systems that support named -pipes (FIFOs) or the /dev/fd method of naming open files. +pipes (FIFOs) or the /dev/fd method of naming open files.

When available, process substitution is performed @@ -5369,9 +5494,10 @@ To get the old behavior of ignoring filenames beginning with a make one of the patterns in -GLOBIGNORE. +GLOBIGNORE +. The dotglob @@ -5387,12 +5513,14 @@ pattern matching honors the setting of the extglob shell option.

-The +The value of the GLOBSORT shell variable controls how the results of pathname expansion are sorted, -as described above. +as described above under +Shell Variables. +

Pattern Matching @@ -5491,7 +5619,9 @@ shell option. Within a bracket expression, character classes can be specified using the syntax [:class:], where class is one of the -following classes defined in the POSIX standard: +following classes defined in the +POSIX +standard:

@@ -5816,7 +5946,7 @@ and the option to the set -builtin has been enabled, the redirection fails if the file +builtin command has been enabled, the redirection fails if the file whose name results from the expansion of word exists and is a regular file. If the redirection operator is @@ -5831,13 +5961,13 @@ and the option to the set -builtin command is not enabled, +builtin is not enabled, bash attempts the redirection even if the file named by word exists.  

Appending Redirected Output

-Redirecting output in this fashion opens +Redirecting output in this fashion opens the file whose name results from the expansion of word @@ -6823,7 +6953,9 @@ is non-zero.
string1 = string2
True if the strings are equal. -= should be used with the test command for POSIX conformance. += should be used with the test command for +POSIX +conformance. When used with the [[ command, this performs pattern matching as described above (Compound Commands).
string1 != string2
@@ -8786,7 +8918,7 @@ If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, the number of history entries is not limited. -By default, bash sets the the maximum number of history entries to +By default, bash sets the maximum number of history entries to the value of the HISTSIZE shell variable. Setting history-size to a non-numeric value will set the maximum number of history entries to 500. @@ -9264,12 +9396,12 @@ Words are composed of alphanumeric characters (letters and digits).
Move back to the start of the current or previous word. Words are composed of alphanumeric characters (letters and digits). -
shell-forward-word +
shell-forward-word (M-C-f)
Move forward to the end of the next word. Words are delimited by non-quoted shell metacharacters. -
shell-backward-word +
shell-backward-word (M-C-b)
Move back to the start of the current or previous word. @@ -9603,7 +9735,7 @@ Negative arguments have no effect.
Drag the word before point past the word after point, -moving point over that word as well. +moving point past that word as well. If point is at the end of the line, this transposes the last two words on the line.
shell-transpose-words (M-C-t) @@ -9854,7 +9986,7 @@ the number of matches N; the word being completed;
*
S:E, -where S and E are the start and end offsets of the word +where S and E are the start and end offsets of the word in the readline line buffer; then
*
each match, one per line @@ -10483,7 +10615,7 @@ and On startup, bash initializes the history list by reading history entries from the -the file named by the +file named by the HISTFILE @@ -11526,7 +11658,7 @@ is converted to before attempting the directory change.
If cd uses a non-empty directory name from -CDPATH, +CDPATH, or if - is the first argument, and the directory change is @@ -12396,7 +12528,7 @@ If -n is supplied, each name is disabled; otherwise, For example, to use the test -binary found usin g +binary found using PATH @@ -12420,7 +12552,8 @@ shell builtins. If -n is supplied, print only disabled builtins. If -a is supplied, the list printed includes all builtins, with an indication of whether or not each is enabled. -The -s option means to restrict the output to the POSIX +The -s option means to restrict the output to the +POSIX special builtins.
The @@ -12444,7 +12577,8 @@ The -d option will delete a builtin previously loaded with -f. -If -s is used with -f, the new builtin becomes a POSIX +If -s is used with -f, the new builtin becomes a +POSIX special builtin.
If no options are supplied and a name is not a shell builtin, @@ -12935,16 +13069,19 @@ is specified, help gives detailed help on all commands matching -pattern; +pattern +as described below; otherwise it displays a list of all the builtins and shell compound commands. +
+Options, if supplied, have the follow meanings:
-
-
-d - +
+-d + Display a short description of each pattern
-m @@ -12957,6 +13094,22 @@ Display only a short usage synopsis for each pattern
+
+If pattern contains pattern matching characters +(see +Pattern Matching + + +above) +it's treated as a shell pattern and +help prints the description of each +help topic matching pattern. +
+If not, and pattern exactly matches the name of a help topic, +help prints the description +associated with that topic. +Otherwise, help performs prefix matching and +prints the descriptions of all matching help topics.
The return status is 0 unless no command matches pattern. @@ -14201,11 +14354,14 @@ This option is disabled by default.
posix
-Change the behavior of +Enable posix mode; +change the behavior of bash where the default operation differs -from the POSIX standard to match the standard (posix mode). +from the +POSIX +standard to match the standard. See SEE ALSO @@ -15313,7 +15469,8 @@ commands sort lexicographically using ASCII ordering. The historical operator-precedence parsing with 4 or more arguments can lead to ambiguities when it encounters strings that look like primaries. -The POSIX +The +POSIX standard has deprecated the -a and -o primaries and enclosing expressions within parentheses. Scripts should no longer use them. @@ -15713,7 +15870,9 @@ The pipe size in 512-byte blocks (this may not be set).
-q
-The maximum number of bytes in POSIX message queues. +The maximum number of bytes in +POSIX +message queues.
-r
@@ -16111,14 +16270,18 @@ bash-4.1 and later use the current locale's collation sequence and
*
-In posix mode, time may be followed by options and still be -recognized as a reserved word (this is POSIX interpretation 267). +In posix mode, time may be followed by options and still be +recognized as a reserved word (this is +POSIX +interpretation 267).
*
In posix mode, the parser requires that an even number of single quotes occur in the word 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). +(this is +POSIX +interpretation 221).
@@ -16133,7 +16296,9 @@ undergo quote removal, as it does in versions after bash-4.2. In posix mode, single quotes are considered special when expanding the word 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 interpretation 221); +(this is part of +POSIX +interpretation 221); in later versions, single quotes are not special within double-quoted word expansions.
@@ -16525,7 +16690,7 @@ ALL bug reports should include:
The version number of bash
The hardware and operating system
The compiler used to compile
-
A description of the bug behaviour
+
A description of the bug behavior
A short script or
which exercises the bug @@ -16556,9 +16721,7 @@ and traditional versions of sh, mostly because of the -POSIX - - +POSIX specification.

@@ -16586,7 +16749,7 @@ Array variables may not (yet) be exported.


-
GNU Bash 5.32024 December 12BASH(1) +GNU Bash 5.32025 January 8BASH(1)

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

-This document was created by man2html from /usr/local/src/bash/bash-20241207/doc/bash.1.
-Time: 12 December 2024 13:38:21 EST +This document was created by man2html from /usr/local/src/bash/bash-20241227/doc/bash.1.
+Time: 08 January 2025 09:33:16 EST diff --git a/doc/bash.info b/doc/bash.info index 1eafd9df..11bcc903 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -1,12 +1,12 @@ 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, 12 December 2024). +Bash shell (version 5.3, 8 January 2025). - This is Edition 5.3, last updated 12 December 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 8 January 2025, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. - Copyright © 1988-2024 Free Software Foundation, Inc. + Copyright © 1988-2025 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -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, 12 December 2024). The Bash home page is +Bash shell (version 5.3, 8 January 2025). The Bash home page is . - This is Edition 5.3, last updated 12 December 2024, of ‘The GNU Bash + This is Edition 5.3, last updated 8 January 2025, of ‘The GNU Bash Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some @@ -1448,7 +1448,7 @@ above. If a variable at the current local scope is unset, it remains so function returns. Once the function returns, any instance of the variable at a previous scope becomes visible. If the unset acts on a variable at a previous scope, any instance of a variable with that name -that had been shadowed will become visible (see below how the +that had been shadowed becomes visible (see below how the ‘localvar_unset’ shell option changes this behavior). The ‘-f’ option to the ‘declare’ (‘typeset’) builtin command (*note @@ -1550,6 +1550,10 @@ array variables. Namerefs can be unset using the ‘-n’ option to the is executed with the name of a nameref variable as an argument, the variable referenced by the nameref variable is unset. + When the shell starts, it reads its environment and creates a shell +variable from each environment variable that has a valid name, as +described below (*note Environment::). +  File: bash.info, Node: Positional Parameters, Next: Special Parameters, Up: Shell Parameters @@ -1739,7 +1743,7 @@ to the context of the expansion or the text between the braces. closing braces, and at least one unquoted comma or a valid sequence expression. Any incorrectly formed brace expansion is left unchanged. - A { or ‘,’ may be quoted with a backslash to prevent its being + A ‘{’ or ‘,’ may be quoted with a backslash to prevent its being considered part of a brace expression. To avoid conflicts with parameter expansion, the string ‘${’ is not considered eligible for brace expansion, and inhibits brace expansion until the closing ‘}’. @@ -1750,6 +1754,16 @@ of the strings to be generated is longer than in the above example: or chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} + Brace expansion introduces a slight incompatibility with historical +versions of ‘sh’. ‘sh’ does not treat opening or closing braces +specially when they appear as part of a word, and preserves them in the +output. Bash removes braces from words as a consequence of brace +expansion. For example, a word entered to ‘sh’ as ‘file{1,2}’ appears +identically in the output. Bash outputs that word as ‘file1 file2’ +after brace expansion. Start Bash with the ‘+B’ option or disable brace +expansion with the ‘+B’ option to the ‘set’ command (*note Shell Builtin +Commands::) for strict ‘sh’ compatibility. +  File: bash.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, Prev: Brace Expansion, Up: Shell Expansions @@ -2377,7 +2391,7 @@ File: bash.info, Node: Arithmetic Expansion, Next: Process Substitution, Prev 3.5.5 Arithmetic Expansion -------------------------- -Arithmetic expansion evalutes an arithmetic expression and substitutes +Arithmetic expansion evaluates an arithmetic expression and substitutes the result. The format for arithmetic expansion is: $(( EXPRESSION )) @@ -2530,9 +2544,9 @@ patterns in ‘GLOBIGNORE’. The ‘dotglob’ option is disabled when ‘GLOBIGNORE’ is unset. The ‘GLOBIGNORE’ pattern matching honors the setting of the ‘extglob’ shell option. - After the pattern is expanded and matched against filenames, the -value of the ‘GLOBSORT’ shell variable controls how the results are -sorted, as described below (*note Bash Variables::). + The value of the ‘GLOBSORT’ shell variable controls how the results +of pathname expansion are sorted, as described below (*note Bash +Variables::).  File: bash.info, Node: Pattern Matching, Up: Filename Expansion @@ -2764,11 +2778,12 @@ created; if it does exist it is truncated to zero size. [N]>[|]WORD If the redirection operator is ‘>’, and the ‘noclobber’ option to the -‘set’ builtin has been enabled, the redirection fails if the file whose -name results from the expansion of WORD exists and is a regular file. -If the redirection operator is ‘>|’, or the redirection operator is ‘>’ -and the ‘noclobber’ option is not enabled, Bash attemps the redirection -even if the file named by WORD exists. +‘set’ builtin command has been enabled, the redirection fails if the +file whose name results from the expansion of WORD exists and is a +regular file. If the redirection operator is ‘>|’, or the redirection +operator is ‘>’ and the ‘noclobber’ option to the ‘set’ builtin is not +enabled, Bash attempts the redirection even if the file named by WORD +exists. 3.6.3 Appending Redirected Output --------------------------------- @@ -3838,7 +3853,7 @@ standard. The ACTION is a command that is read and executed when the shell receives any of the signals SIGSPEC. If ACTION is absent (and there is a single SIGSPEC) or equal to ‘-’, each specified - SIGSPEC'ss disposition is reset to the value it had when the shell + SIGSPEC's disposition is reset to the value it had when the shell was started. If ACTION is the null string, then the signal specified by each SIGSPEC is ignored by the shell and commands it invokes. @@ -4053,7 +4068,7 @@ standard. optional, and Readline does not expand the command string before saving it. Since the entire key binding expression must be a single argument, it should be enclosed in single - quotes. When SHELL-COMMAND is executed, the shell sets thex + quotes. When SHELL-COMMAND is executed, the shell sets the ‘READLINE_LINE’ variable to the contents of the Readline line buffer and the ‘READLINE_POINT’ and ‘READLINE_MARK’ variables to the current location of the insertion point and the saved @@ -4305,7 +4320,8 @@ standard. ‘BASH_LOADABLES_PATH’ is system-dependent, and may include "." to force a search of the current directory. The ‘-d’ option will delete a builtin loaded with ‘-f’. If ‘-s’ is used with ‘-f’, the - new builtin becomes a special builtin (*note Special Builtins::). + new builtin becomes a POSIX special builtin (*note Special + Builtins::). If no options are supplied and a NAME is not a shell builtin, ‘enable’ will attempt to load NAME from a shared object named NAME, @@ -4319,8 +4335,8 @@ standard. Display helpful information about builtin commands. If PATTERN is specified, ‘help’ gives detailed help on all commands matching - PATTERN, otherwise it displays a list of all builtins and shell - compound commands. + PATTERN as described below; otherwise it displays a list of all + builtins and shell compound commands. Options, if supplied, have the following meanings: @@ -4332,6 +4348,15 @@ standard. ‘-s’ Display only a short usage synopsis for each PATTERN + If PATTERN contains pattern matching characters (*note Pattern + Matching::) it's treated as a shell pattern and ‘help’ prints the + description of each help topic matching PATTERN. + + If not, and PATTERN exactly matches the name of a help topic, + ‘help’ prints the description associated with that topic. + Otherwise, ‘help’ performs prefix matching and prints the + descriptions of all matching help topics. + The return status is zero unless no command matches PATTERN. ‘let’ @@ -4758,7 +4783,7 @@ standard. Values are in 1024-byte increments, except for ‘-t’, which is in seconds; ‘-R’, which is in microseconds; ‘-p’, which is in units of 512-byte blocks; ‘-P’, ‘-T’, ‘-b’, ‘-k’, ‘-n’ and ‘-u’, which are - unscaled values; and, when in POSIX Mode (*note Bash POSIX Mode::), + unscaled values; and, when in POSIX mode (*note Bash POSIX Mode::), ‘-c’ and ‘-f’, which are in 512-byte increments. The return status is zero unless an invalid option or argument is @@ -4957,10 +4982,11 @@ parameters, or to display the names and values of shell variables. successfully. This option is disabled by default. ‘posix’ - Change the behavior of Bash where the default operation - differs from the POSIX standard to match the standard - (*note Bash POSIX Mode::). This is intended to make Bash - behave as a strict superset of that standard. + Enable POSIX mode; change the behavior of Bash where the + default operation differs from the POSIX standard to + match the standard (*note Bash POSIX Mode::). This is + intended to make Bash behave as a strict superset of that + standard. ‘privileged’ Same as ‘-p’. @@ -5878,7 +5904,7 @@ Variables::). ‘ENV’ Expanded and executed similarly to ‘BASH_ENV’ (*note Bash Startup - Files::) when an interactive shell is invoked in POSIX Mode (*note + Files::) when an interactive shell is invoked in POSIX mode (*note Bash POSIX Mode::). ‘EPOCHREALTIME’ @@ -5999,15 +6025,16 @@ Variables::). substitution, and tokenization (*note History Interaction::). The first character is the “history expansion” character, the character which begins a history expansion, normally ‘!’. The second - character is the "quick substitution" character, normally ‘^’. + character is the “quick substitution” character, normally ‘^’. When it appears as the first character on the line, history substitution repeats the previous command, replacing one string - with another. The optional third character is the character which - indicates that the remainder of the line is a comment when found as - the first character of a word, usually ‘#’. The history comment - character disables history substitution for the remaining words on - the line. It does not necessarily cause the shell parser to treat - the rest of the line as a comment. + with another. The optional third character is the “history + comment” character, normally ‘#’, which indicates that the + remainder of the line is a comment when it appears as the first + character of a word. The history comment character disables + history substitution for the remaining words on the line. It does + not necessarily cause the shell parser to treat the rest of the + line as a comment. ‘HISTCMD’ The history number, or index in the history list, of the current @@ -6307,7 +6334,8 @@ Variables::). ‘SHELLOPTS’ are those reported as ‘on’ by ‘set -o’. If this variable is in the environment when Bash starts up, the shell enables each option in the list before reading any startup files. - This variable is readonly. + If this variable is exported, child shells will enable each option + in the list. This variable is readonly. ‘SHLVL’ Incremented by one each time a new instance of Bash is started. @@ -6468,10 +6496,11 @@ single-character options to be recognized. shell. This is on by default if the shell is invoked as ‘sh’. ‘--posix’ - Change the behavior of Bash where the default operation differs - from the POSIX standard to match the standard. This is intended to - make Bash behave as a strict superset of that standard. *Note Bash - POSIX Mode::, for a description of the Bash POSIX mode. + Enable POSIX mode; change the behavior of Bash where the default + operation differs from the POSIX standard to match the standard. + This is intended to make Bash behave as a strict superset of that + standard. *Note Bash POSIX Mode::, for a description of the Bash + POSIX mode. ‘--restricted’ Equivalent to ‘-r’. Make the shell a restricted shell (*note The @@ -6542,23 +6571,25 @@ invocation which are not available with the ‘set’ builtin. ‘-’ Equivalent to ‘--’. - A _login_ shell is one whose first character of argument zero is ‘-’, + A “login shell” is one whose first character of argument zero is ‘-’, or one invoked with the ‘--login’ option. - An _interactive_ shell is one started without non-option arguments, + An “interactive shell” is one started without non-option arguments, unless ‘-s’ is specified, without specifying the ‘-c’ option, and whose -input and output (using the standard error) are both connected to -terminals (as determined by ‘isatty(3)’), or one started with the ‘-i’ -option. *Note Interactive Shells::, for more information. +standard input and standard error are both connected to terminals (as +determined by isatty(3)), or one started with the ‘-i’ option. *Note +Interactive Shells::, for more information. If arguments remain after option processing, and neither the ‘-c’ nor -the ‘-s’ option has been supplied, the first argument is assumed to be -the name of a file containing shell commands (*note Shell Scripts::). -When Bash is invoked in this fashion, ‘$0’ is set to the name of the -file, and the positional parameters are set to the remaining arguments. -Bash reads and executes commands from this file, then exits. Bash's -exit status is the exit status of the last command executed in the -script. If no commands are executed, the exit status is 0. +the ‘-s’ option has been supplied, the first argument is treated as the +name of a file containing shell commands (*note Shell Scripts::). When +Bash is invoked in this fashion, ‘$0’ is set to the name of the file, +and the positional parameters are set to the remaining arguments. Bash +reads and executes commands from this file, then exits. Bash's exit +status is the exit status of the last command executed in the script. +If no commands are executed, the exit status is 0. Bash first attempts +to open the file in the current directory, and, if no file is found, +searches the directories in ‘PATH’ for the script.  File: bash.info, Node: Bash Startup Files, Next: Interactive Shells, Prev: Invoking Bash, Up: Bash Features @@ -7155,7 +7186,7 @@ to using the syntax The SUBSCRIPT is treated as an arithmetic expression that must evaluate to a number greater than or equal to zero. To explicitly declare an -array, use +indexed array, use declare -a NAME (*note Bash Builtins::). The syntax declare -a NAME[SUBSCRIPT] @@ -7590,7 +7621,7 @@ editing commands were left out due to objections. Although Bash is an implementation of the POSIX shell specification, there are areas where the Bash default behavior differs from the specification. The Bash “posix mode” changes the Bash behavior in these -areas so that it conforms more closely to the standard. +areas so that it conforms more strictly to the standard. Starting Bash with the ‘--posix’ command-line option or executing ‘set -o posix’ while Bash is running will cause Bash to conform more @@ -7600,7 +7631,7 @@ specified by POSIX in areas where the Bash default differs. When invoked as ‘sh’, Bash enters POSIX mode after reading the startup files. - The following list is what's changed when 'POSIX mode' is in effect: + The following list is what's changed when POSIX mode is in effect: 1. Bash ensures that the ‘POSIXLY_CORRECT’ variable is set. @@ -7983,10 +8014,10 @@ required for bash-5.1 and later versions. collation sequence and strcoll(3). ‘compat41’ - • In posix mode, ‘time’ may be followed by options and still be + • In POSIX mode, ‘time’ may be followed by options and still be recognized as a reserved word (this is POSIX interpretation 267). - • In posix mode, the parser requires that an even number of + • In POSIX mode, the parser requires that an even number of single quotes occur in the WORD portion of a double-quoted ${...} parameter expansion and treats them specially, so that characters within the single quotes are considered quoted @@ -7996,7 +8027,7 @@ required for bash-5.1 and later versions. • The replacement string in double-quoted pattern substitution does not undergo quote removal, as it does in versions after bash-4.2. - • In posix mode, single quotes are considered special when + • In POSIX mode, single quotes are considered special when expanding the WORD 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 interpretation 221); @@ -8005,7 +8036,7 @@ required for bash-5.1 and later versions. ‘compat43’ • Word expansion errors are considered non-fatal errors that - cause the current command to fail, even in posix mode (the + 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). • When executing a shell function, the loop state @@ -8024,7 +8055,7 @@ required for bash-5.1 and later versions. • Variable assignments preceding builtins like ‘export’ and ‘readonly’ that set attributes continue to affect variables with the same name in the calling environment even if the - shell is not in posix mode. + shell is not in POSIX mode. ‘compat50 (set using BASH_COMPAT)’ • Bash-5.1 changed the way ‘$RANDOM’ is generated to introduce @@ -8947,9 +8978,9 @@ Variable Settings list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, the number of history entries is not limited. By - default, Bash sets the the maximum number of history entries - to the value of the ‘HISTSIZE’ shell variable. If you try to - set HISTORY-SIZE to a non-numeric value, the maximum number of + default, Bash sets the maximum number of history entries to + the value of the ‘HISTSIZE’ shell variable. If you try to set + HISTORY-SIZE to a non-numeric value, the maximum number of history entries will be set to 500. ‘horizontal-scroll-mode’ @@ -9229,7 +9260,7 @@ Key Bindings When entering the text of a macro, single or double quotes must be used to indicate a macro definition. Unquoted text is assumed to - be a function name. Tthe backslash escapes described above are + be a function name. The backslash escapes described above are expanded in the macro body. Backslash will quote any other character in the macro text, including ‘"’ and ‘'’. For example, the following binding will make ‘‘C-x’ \’ insert a single ‘\’ into @@ -9336,7 +9367,7 @@ File: bash.info, Node: Sample Init File, Prev: Conditional Init Constructs, U Here is an example of an INPUTRC file. This illustrates key binding, variable assignment, and conditional syntax. - # This file controls the behaviour of line input editing for + # This file controls the behavior of line input editing for # programs that use the GNU Readline library. Existing # programs include FTP, Bash, and GDB. # @@ -10112,8 +10143,9 @@ File: bash.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bin Expand the line by performing shell word expansions. This performs alias and history expansion, $'STRING' and $"STRING" quoting, tilde expansion, parameter and variable expansion, arithmetic expansion, - command and proces substitution, word splitting, and quote removal. - An explicit argument suppresses command and process substitution. + command and process substitution, word splitting, and quote + removal. An explicit argument suppresses command and process + substitution. ‘history-expand-line (M-^)’ Perform history expansion on the current line. @@ -11781,7 +11813,7 @@ fix, you are encouraged to submit that as well! Suggestions and • The version number of Bash. • The hardware and operating system. • The compiler used to compile Bash. - • A description of the bug behaviour. + • A description of the bug behavior. • A short script or 'recipe' which exercises the bug and may be used to reproduce it. @@ -12780,26 +12812,26 @@ D.1 Index of Shell Builtin Commands (line 179) * hash: Bourne Shell Builtins. (line 231) -* help: Bash Builtins. (line 374) +* help: Bash Builtins. (line 375) * history: Bash History Builtins. (line 59) * jobs: Job Control Builtins. (line 28) * kill: Job Control Builtins. (line 61) -* let: Bash Builtins. (line 394) -* local: Bash Builtins. (line 403) -* logout: Bash Builtins. (line 428) -* mapfile: Bash Builtins. (line 433) +* let: Bash Builtins. (line 404) +* local: Bash Builtins. (line 413) +* logout: Bash Builtins. (line 438) +* mapfile: Bash Builtins. (line 443) * popd: Directory Stack Builtins. (line 37) -* printf: Bash Builtins. (line 478) +* printf: Bash Builtins. (line 488) * pushd: Directory Stack Builtins. (line 70) * pwd: Bourne Shell Builtins. (line 263) -* read: Bash Builtins. (line 548) -* readarray: Bash Builtins. (line 659) +* read: Bash Builtins. (line 558) +* readarray: Bash Builtins. (line 669) * readonly: Bourne Shell Builtins. (line 275) * return: Bourne Shell Builtins. @@ -12808,7 +12840,7 @@ D.1 Index of Shell Builtin Commands * shift: Bourne Shell Builtins. (line 325) * shopt: The Shopt Builtin. (line 9) -* source: Bash Builtins. (line 668) +* source: Bash Builtins. (line 678) * suspend: Job Control Builtins. (line 139) * test: Bourne Shell Builtins. @@ -12819,12 +12851,12 @@ D.1 Index of Shell Builtin Commands (line 444) * true: Bourne Shell Builtins. (line 510) -* type: Bash Builtins. (line 673) -* typeset: Bash Builtins. (line 710) -* ulimit: Bash Builtins. (line 716) +* type: Bash Builtins. (line 683) +* typeset: Bash Builtins. (line 720) +* ulimit: Bash Builtins. (line 726) * umask: Bourne Shell Builtins. (line 515) -* unalias: Bash Builtins. (line 824) +* unalias: Bash Builtins. (line 834) * unset: Bourne Shell Builtins. (line 533) * wait: Job Control Builtins. @@ -12999,55 +13031,55 @@ D.3 Parameter and Variable Index * GLOBSORT: Bash Variables. (line 376) * GROUPS: Bash Variables. (line 414) * histchars: Bash Variables. (line 420) -* HISTCMD: Bash Variables. (line 435) -* HISTCONTROL: Bash Variables. (line 441) -* HISTFILE: Bash Variables. (line 459) -* HISTFILESIZE: Bash Variables. (line 465) -* HISTIGNORE: Bash Variables. (line 476) +* HISTCMD: Bash Variables. (line 436) +* HISTCONTROL: Bash Variables. (line 442) +* HISTFILE: Bash Variables. (line 460) +* HISTFILESIZE: Bash Variables. (line 466) +* HISTIGNORE: Bash Variables. (line 477) * history-preserve-point: Readline Init File Syntax. (line 234) * history-size: Readline Init File Syntax. (line 240) -* HISTSIZE: Bash Variables. (line 500) -* HISTTIMEFORMAT: Bash Variables. (line 507) +* HISTSIZE: Bash Variables. (line 501) +* HISTTIMEFORMAT: Bash Variables. (line 508) * HOME: Bourne Shell Variables. (line 13) * horizontal-scroll-mode: Readline Init File Syntax. (line 250) -* HOSTFILE: Bash Variables. (line 516) -* HOSTNAME: Bash Variables. (line 527) -* HOSTTYPE: Bash Variables. (line 530) +* HOSTFILE: Bash Variables. (line 517) +* HOSTNAME: Bash Variables. (line 528) +* HOSTTYPE: Bash Variables. (line 531) * IFS: Bourne Shell Variables. (line 18) -* IGNOREEOF: Bash Variables. (line 533) +* IGNOREEOF: Bash Variables. (line 534) * input-meta: Readline Init File Syntax. (line 258) -* INPUTRC: Bash Variables. (line 542) -* INSIDE_EMACS: Bash Variables. (line 546) +* INPUTRC: Bash Variables. (line 543) +* INSIDE_EMACS: Bash Variables. (line 547) * 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 552) -* LC_ALL: Bash Variables. (line 556) -* LC_COLLATE: Bash Variables. (line 560) -* LC_CTYPE: Bash Variables. (line 567) +* LANG <1>: Bash Variables. (line 553) +* LC_ALL: Bash Variables. (line 557) +* LC_COLLATE: Bash Variables. (line 561) +* LC_CTYPE: Bash Variables. (line 568) * LC_MESSAGES: Creating Internationalized Scripts. (line 51) -* LC_MESSAGES <1>: Bash Variables. (line 572) -* LC_NUMERIC: Bash Variables. (line 576) -* LC_TIME: Bash Variables. (line 580) -* LINENO: Bash Variables. (line 584) -* LINES: Bash Variables. (line 591) -* MACHTYPE: Bash Variables. (line 597) +* LC_MESSAGES <1>: Bash Variables. (line 573) +* LC_NUMERIC: Bash Variables. (line 577) +* LC_TIME: Bash Variables. (line 581) +* LINENO: Bash Variables. (line 585) +* LINES: Bash Variables. (line 592) +* MACHTYPE: Bash Variables. (line 598) * MAIL: Bourne Shell Variables. (line 24) -* MAILCHECK: Bash Variables. (line 601) +* MAILCHECK: Bash Variables. (line 602) * MAILPATH: Bourne Shell Variables. (line 29) -* MAPFILE: Bash Variables. (line 609) +* MAPFILE: Bash Variables. (line 610) * mark-modified-lines: Readline Init File Syntax. (line 306) * mark-symlinked-directories: Readline Init File Syntax. @@ -13058,46 +13090,46 @@ D.3 Parameter and Variable Index (line 323) * meta-flag: Readline Init File Syntax. (line 258) -* OLDPWD: Bash Variables. (line 613) +* OLDPWD: Bash Variables. (line 614) * OPTARG: Bourne Shell Variables. (line 36) -* OPTERR: Bash Variables. (line 616) +* OPTERR: Bash Variables. (line 617) * OPTIND: Bourne Shell Variables. (line 40) -* OSTYPE: Bash Variables. (line 621) +* OSTYPE: Bash Variables. (line 622) * 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 624) -* POSIXLY_CORRECT: Bash Variables. (line 634) -* PPID: Bash Variables. (line 644) -* PROMPT_COMMAND: Bash Variables. (line 648) -* PROMPT_DIRTRIM: Bash Variables. (line 654) -* PS0: Bash Variables. (line 660) +* PIPESTATUS: Bash Variables. (line 625) +* POSIXLY_CORRECT: Bash Variables. (line 635) +* PPID: Bash Variables. (line 645) +* PROMPT_COMMAND: Bash Variables. (line 649) +* PROMPT_DIRTRIM: Bash Variables. (line 655) +* PS0: Bash Variables. (line 661) * PS1: Bourne Shell Variables. (line 53) * PS2: Bourne Shell Variables. (line 58) -* PS3: Bash Variables. (line 665) -* PS4: Bash Variables. (line 670) -* PWD: Bash Variables. (line 678) -* RANDOM: Bash Variables. (line 681) -* READLINE_ARGUMENT: Bash Variables. (line 689) -* READLINE_LINE: Bash Variables. (line 693) -* READLINE_MARK: Bash Variables. (line 697) -* READLINE_POINT: Bash Variables. (line 703) -* REPLY: Bash Variables. (line 707) +* PS3: Bash Variables. (line 666) +* PS4: Bash Variables. (line 671) +* PWD: Bash Variables. (line 679) +* RANDOM: Bash Variables. (line 682) +* READLINE_ARGUMENT: Bash Variables. (line 690) +* READLINE_LINE: Bash Variables. (line 694) +* READLINE_MARK: Bash Variables. (line 698) +* READLINE_POINT: Bash Variables. (line 704) +* REPLY: Bash Variables. (line 708) * revert-all-at-newline: Readline Init File Syntax. (line 350) * search-ignore-case: Readline Init File Syntax. (line 357) -* SECONDS: Bash Variables. (line 711) -* SHELL: Bash Variables. (line 721) -* SHELLOPTS: Bash Variables. (line 726) -* SHLVL: Bash Variables. (line 735) +* SECONDS: Bash Variables. (line 712) +* SHELL: Bash Variables. (line 722) +* SHELLOPTS: Bash Variables. (line 727) +* SHLVL: Bash Variables. (line 737) * show-all-if-ambiguous: Readline Init File Syntax. (line 362) * show-all-if-unmodified: Readline Init File Syntax. @@ -13106,15 +13138,15 @@ D.3 Parameter and Variable Index (line 377) * skip-completed-text: Readline Init File Syntax. (line 383) -* SRANDOM: Bash Variables. (line 740) +* SRANDOM: Bash Variables. (line 742) * TEXTDOMAIN: Creating Internationalized Scripts. (line 51) * TEXTDOMAINDIR: Creating Internationalized Scripts. (line 51) -* TIMEFORMAT: Bash Variables. (line 749) -* TMOUT: Bash Variables. (line 788) -* TMPDIR: Bash Variables. (line 800) -* UID: Bash Variables. (line 804) +* TIMEFORMAT: Bash Variables. (line 751) +* TMOUT: Bash Variables. (line 790) +* TMPDIR: Bash Variables. (line 802) +* UID: Bash Variables. (line 806) * vi-cmd-mode-string: Readline Init File Syntax. (line 396) * vi-ins-mode-string: Readline Init File Syntax. @@ -13136,7 +13168,7 @@ D.4 Function Index * accept-line (Newline or Return): Commands For History. (line 6) * alias-expand-line (): Miscellaneous Commands. - (line 133) + (line 134) * backward-char (C-b): Commands For Moving. (line 18) * backward-delete-char (Rubout): Commands For Text. (line 18) * backward-kill-line (C-x Rubout): Commands For Killing. @@ -13185,7 +13217,7 @@ D.4 Function Index (line 50) * digit-argument (M-0, M-1, ... M--): Numeric Arguments. (line 6) * display-shell-version (C-x C-v): Miscellaneous Commands. - (line 147) + (line 148) * do-lowercase-version (M-A, M-B, M-X, ...): Miscellaneous Commands. (line 14) * downcase-word (M-l): Commands For Text. (line 69) @@ -13198,7 +13230,7 @@ D.4 Function Index * dynamic-complete-history (M-): Commands For Completion. (line 115) * edit-and-execute-command (C-x C-e): Miscellaneous Commands. - (line 142) + (line 143) * end-kbd-macro (C-x )): Keyboard Macros. (line 9) * end-of-file (usually C-d): Commands For Text. (line 6) * end-of-history (M->): Commands For History. @@ -13224,9 +13256,9 @@ D.4 Function Index * glob-list-expansions (C-x g): Miscellaneous Commands. (line 114) * history-and-alias-expand-line (): Miscellaneous Commands. - (line 136) + (line 137) * history-expand-line (M-^): Miscellaneous Commands. - (line 126) + (line 127) * history-search-backward (): Commands For History. (line 53) * history-search-forward (): Commands For History. @@ -13240,7 +13272,7 @@ D.4 Function Index * insert-completions (M-*): Commands For Completion. (line 24) * insert-last-argument (M-. or M-_): Miscellaneous Commands. - (line 139) + (line 140) * kill-line (C-k): Commands For Killing. (line 6) * kill-region (): Commands For Killing. @@ -13250,7 +13282,7 @@ D.4 Function Index * kill-word (M-d): Commands For Killing. (line 23) * magic-space (): Miscellaneous Commands. - (line 129) + (line 130) * menu-complete (): Commands For Completion. (line 28) * menu-complete-backward (): Commands For Completion. @@ -13430,7 +13462,7 @@ D.5 Concept Index * installation: Basic Installation. (line 6) * interaction, readline: Readline Interaction. (line 6) -* interactive shell: Invoking Bash. (line 136) +* interactive shell: Invoking Bash. (line 137) * interactive shell <1>: Interactive Shells. (line 6) * internationalization: Locale Translation. (line 6) * internationalized scripts: Creating Internationalized Scripts. @@ -13443,7 +13475,7 @@ D.5 Concept Index * killing text: Readline Killing Commands. (line 6) * localization: Locale Translation. (line 6) -* login shell: Invoking Bash. (line 133) +* login shell: Invoking Bash. (line 134) * matching, pattern: Pattern Matching. (line 6) * metacharacter: Definitions. (line 50) * name: Definitions. (line 55) @@ -13509,138 +13541,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 Constructs36118 -Node: Command Grouping51054 -Node: Coprocesses52546 -Node: GNU Parallel55232 -Node: Shell Functions56150 -Node: Shell Parameters64602 -Node: Positional Parameters69327 -Node: Special Parameters70417 -Node: Shell Expansions73878 -Node: Brace Expansion76067 -Node: Tilde Expansion78768 -Node: Shell Parameter Expansion81723 -Node: Command Substitution101483 -Node: Arithmetic Expansion105012 -Node: Process Substitution106025 -Node: Word Splitting107133 -Node: Filename Expansion109577 -Node: Pattern Matching112840 -Node: Quote Removal118563 -Node: Redirections118867 -Node: Executing Commands129095 -Node: Simple Command Expansion129762 -Node: Command Search and Execution131870 -Node: Command Execution Environment134314 -Node: Environment137762 -Node: Exit Status139665 -Node: Signals141723 -Node: Shell Scripts146652 -Node: Shell Builtin Commands149950 -Node: Bourne Shell Builtins152061 -Node: Bash Builtins178626 -Node: Modifying Shell Behavior215074 -Node: The Set Builtin215416 -Node: The Shopt Builtin227370 -Node: Special Builtins244422 -Node: Shell Variables245411 -Node: Bourne Shell Variables245845 -Node: Bash Variables248353 -Node: Bash Features287048 -Node: Invoking Bash288062 -Node: Bash Startup Files294488 -Node: Interactive Shells299730 -Node: What is an Interactive Shell?300138 -Node: Is this Shell Interactive?300800 -Node: Interactive Shell Behavior301624 -Node: Bash Conditional Expressions305385 -Node: Shell Arithmetic310596 -Node: Aliases313925 -Node: Arrays317059 -Node: The Directory Stack324143 -Node: Directory Stack Builtins324940 -Node: Controlling the Prompt329385 -Node: The Restricted Shell332270 -Node: Bash POSIX Mode335152 -Node: Shell Compatibility Mode353214 -Node: Job Control362221 -Node: Job Control Basics362678 -Node: Job Control Builtins368956 -Node: Job Control Variables375638 -Node: Command Line Editing376869 -Node: Introduction and Notation378572 -Node: Readline Interaction380924 -Node: Readline Bare Essentials382112 -Node: Readline Movement Commands383920 -Node: Readline Killing Commands384916 -Node: Readline Arguments386939 -Node: Searching387996 -Node: Readline Init File390239 -Node: Readline Init File Syntax391542 -Node: Conditional Init Constructs418372 -Node: Sample Init File422757 -Node: Bindable Readline Commands425878 -Node: Commands For Moving427416 -Node: Commands For History429784 -Node: Commands For Text435174 -Node: Commands For Killing439299 -Node: Numeric Arguments442087 -Node: Commands For Completion443239 -Node: Keyboard Macros448935 -Node: Miscellaneous Commands449636 -Node: Readline vi Mode456196 -Node: Programmable Completion457173 -Node: Programmable Completion Builtins465910 -Node: A Programmable Completion Example477647 -Node: Using History Interactively482992 -Node: Bash History Facilities483673 -Node: Bash History Builtins487408 -Node: History Interaction493879 -Node: Event Designators498829 -Node: Word Designators500407 -Node: Modifiers502711 -Node: Installing Bash504648 -Node: Basic Installation505764 -Node: Compilers and Options509640 -Node: Compiling For Multiple Architectures510390 -Node: Installation Names512143 -Node: Specifying the System Type514377 -Node: Sharing Defaults515123 -Node: Operation Controls515837 -Node: Optional Features516856 -Node: Reporting Bugs529236 -Node: Major Differences From The Bourne Shell530594 -Node: GNU Free Documentation License552014 -Node: Indexes577191 -Node: Builtin Index577642 -Node: Reserved Word Index584740 -Node: Variable Index587185 -Node: Function Index604598 -Node: Concept Index618593 +Node: Top897 +Node: Introduction2834 +Node: What is Bash?3047 +Node: What is a shell?4180 +Node: Definitions6790 +Node: Basic Shell Features10117 +Node: Shell Syntax11341 +Node: Shell Operation12368 +Node: Quoting13659 +Node: Escape Character14997 +Node: Single Quotes15532 +Node: Double Quotes15881 +Node: ANSI-C Quoting17226 +Node: Locale Translation18620 +Node: Creating Internationalized Scripts20023 +Node: Comments24221 +Node: Shell Commands24988 +Node: Reserved Words25927 +Node: Simple Commands26792 +Node: Pipelines27454 +Node: Lists30710 +Node: Compound Commands32582 +Node: Looping Constructs33591 +Node: Conditional Constructs36110 +Node: Command Grouping51046 +Node: Coprocesses52538 +Node: GNU Parallel55224 +Node: Shell Functions56142 +Node: Shell Parameters64590 +Node: Positional Parameters69492 +Node: Special Parameters70582 +Node: Shell Expansions74043 +Node: Brace Expansion76232 +Node: Tilde Expansion79578 +Node: Shell Parameter Expansion82533 +Node: Command Substitution102293 +Node: Arithmetic Expansion105822 +Node: Process Substitution106836 +Node: Word Splitting107944 +Node: Filename Expansion110388 +Node: Pattern Matching113612 +Node: Quote Removal119335 +Node: Redirections119639 +Node: Executing Commands129902 +Node: Simple Command Expansion130569 +Node: Command Search and Execution132677 +Node: Command Execution Environment135121 +Node: Environment138569 +Node: Exit Status140472 +Node: Signals142530 +Node: Shell Scripts147459 +Node: Shell Builtin Commands150757 +Node: Bourne Shell Builtins152868 +Node: Bash Builtins179432 +Node: Modifying Shell Behavior216356 +Node: The Set Builtin216698 +Node: The Shopt Builtin228686 +Node: Special Builtins245738 +Node: Shell Variables246727 +Node: Bourne Shell Variables247161 +Node: Bash Variables249669 +Node: Bash Features288488 +Node: Invoking Bash289502 +Node: Bash Startup Files296086 +Node: Interactive Shells301328 +Node: What is an Interactive Shell?301736 +Node: Is this Shell Interactive?302398 +Node: Interactive Shell Behavior303222 +Node: Bash Conditional Expressions306983 +Node: Shell Arithmetic312194 +Node: Aliases315523 +Node: Arrays318657 +Node: The Directory Stack325749 +Node: Directory Stack Builtins326546 +Node: Controlling the Prompt330991 +Node: The Restricted Shell333876 +Node: Bash POSIX Mode336758 +Node: Shell Compatibility Mode354819 +Node: Job Control363826 +Node: Job Control Basics364283 +Node: Job Control Builtins370561 +Node: Job Control Variables377243 +Node: Command Line Editing378474 +Node: Introduction and Notation380177 +Node: Readline Interaction382529 +Node: Readline Bare Essentials383717 +Node: Readline Movement Commands385525 +Node: Readline Killing Commands386521 +Node: Readline Arguments388544 +Node: Searching389601 +Node: Readline Init File391844 +Node: Readline Init File Syntax393147 +Node: Conditional Init Constructs419972 +Node: Sample Init File424357 +Node: Bindable Readline Commands427477 +Node: Commands For Moving429015 +Node: Commands For History431383 +Node: Commands For Text436773 +Node: Commands For Killing440898 +Node: Numeric Arguments443686 +Node: Commands For Completion444838 +Node: Keyboard Macros450534 +Node: Miscellaneous Commands451235 +Node: Readline vi Mode457802 +Node: Programmable Completion458779 +Node: Programmable Completion Builtins467516 +Node: A Programmable Completion Example479253 +Node: Using History Interactively484598 +Node: Bash History Facilities485279 +Node: Bash History Builtins489014 +Node: History Interaction495485 +Node: Event Designators500435 +Node: Word Designators502013 +Node: Modifiers504317 +Node: Installing Bash506254 +Node: Basic Installation507370 +Node: Compilers and Options511246 +Node: Compiling For Multiple Architectures511996 +Node: Installation Names513749 +Node: Specifying the System Type515983 +Node: Sharing Defaults516729 +Node: Operation Controls517443 +Node: Optional Features518462 +Node: Reporting Bugs530842 +Node: Major Differences From The Bourne Shell532199 +Node: GNU Free Documentation License553619 +Node: Indexes578796 +Node: Builtin Index579247 +Node: Reserved Word Index586345 +Node: Variable Index588790 +Node: Function Index606203 +Node: Concept Index620198  End Tag Table diff --git a/doc/bash.pdf b/doc/bash.pdf index 281e433f..565f728d 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bashref.aux b/doc/bashref.aux index 5857a2f5..46edb33b 100644 --- a/doc/bashref.aux +++ b/doc/bashref.aux @@ -105,15 +105,15 @@ @xrdef{Process Substitution-title}{Process Substitution} @xrdef{Process Substitution-snt}{Section@tie 3.5.6} @xrdef{Arithmetic Expansion-pg}{36} -@xrdef{Process Substitution-pg}{36} @xrdef{Word Splitting-title}{Word Splitting} @xrdef{Word Splitting-snt}{Section@tie 3.5.7} +@xrdef{Process Substitution-pg}{37} +@xrdef{Word Splitting-pg}{37} @xrdef{Filename Expansion-title}{Filename Expansion} @xrdef{Filename Expansion-snt}{Section@tie 3.5.8} -@xrdef{Word Splitting-pg}{37} -@xrdef{Filename Expansion-pg}{37} @xrdef{Pattern Matching-title}{Pattern Matching} @xrdef{Pattern Matching-snt}{Section@tie 3.5.8.1} +@xrdef{Filename Expansion-pg}{38} @xrdef{Pattern Matching-pg}{38} @xrdef{Quote Removal-title}{Quote Removal} @xrdef{Quote Removal-snt}{Section@tie 3.5.9} @@ -135,9 +135,9 @@ @xrdef{Command Execution Environment-pg}{45} @xrdef{Environment-title}{Environment} @xrdef{Environment-snt}{Section@tie 3.7.4} -@xrdef{Environment-pg}{46} @xrdef{Exit Status-title}{Exit Status} @xrdef{Exit Status-snt}{Section@tie 3.7.5} +@xrdef{Environment-pg}{47} @xrdef{Exit Status-pg}{47} @xrdef{Signals-title}{Signals} @xrdef{Signals-snt}{Section@tie 3.7.6} @@ -159,13 +159,13 @@ @xrdef{The Set Builtin-title}{The Set Builtin} @xrdef{The Set Builtin-snt}{Section@tie 4.3.1} @xrdef{Modifying Shell Behavior-pg}{72} -@xrdef{The Set Builtin-pg}{72} +@xrdef{The Set Builtin-pg}{73} @xrdef{The Shopt Builtin-title}{The Shopt Builtin} @xrdef{The Shopt Builtin-snt}{Section@tie 4.3.2} @xrdef{The Shopt Builtin-pg}{77} @xrdef{Special Builtins-title}{Special Builtins} @xrdef{Special Builtins-snt}{Section@tie 4.4} -@xrdef{Special Builtins-pg}{83} +@xrdef{Special Builtins-pg}{84} @xrdef{Shell Variables-title}{Shell Variables} @xrdef{Shell Variables-snt}{Chapter@tie 5} @xrdef{Bourne Shell Variables-title}{Bourne Shell Variables} diff --git a/doc/bashref.bt b/doc/bashref.bt index 2914698d..14cc5184 100644 --- a/doc/bashref.bt +++ b/doc/bashref.bt @@ -32,7 +32,7 @@ \entry{help}{66}{\code {help}} \entry{let}{66}{\code {let}} \entry{local}{66}{\code {local}} -\entry{logout}{66}{\code {logout}} +\entry{logout}{67}{\code {logout}} \entry{mapfile}{67}{\code {mapfile}} \entry{printf}{67}{\code {printf}} \entry{read}{68}{\code {read}} @@ -42,7 +42,7 @@ \entry{typeset}{71}{\code {typeset}} \entry{ulimit}{71}{\code {ulimit}} \entry{unalias}{72}{\code {unalias}} -\entry{set}{72}{\code {set}} +\entry{set}{73}{\code {set}} \entry{shopt}{77}{\code {shopt}} \entry{dirs}{111}{\code {dirs}} \entry{popd}{111}{\code {popd}} diff --git a/doc/bashref.bts b/doc/bashref.bts index 1a0c60a3..614e4a89 100644 --- a/doc/bashref.bts +++ b/doc/bashref.bts @@ -47,7 +47,7 @@ \initial {L} \entry{\code {let}}{66} \entry{\code {local}}{66} -\entry{\code {logout}}{66} +\entry{\code {logout}}{67} \initial {M} \entry{\code {mapfile}}{67} \initial {P} @@ -61,7 +61,7 @@ \entry{\code {readonly}}{55} \entry{\code {return}}{56} \initial {S} -\entry{\code {set}}{72} +\entry{\code {set}}{73} \entry{\code {shift}}{56} \entry{\code {shopt}}{77} \entry{\code {source}}{70} diff --git a/doc/bashref.cp b/doc/bashref.cp index c3e418a9..3810ef0a 100644 --- a/doc/bashref.cp +++ b/doc/bashref.cp @@ -58,12 +58,12 @@ \entry{command substitution}{35}{command substitution} \entry{expansion, arithmetic}{36}{expansion, arithmetic} \entry{arithmetic expansion}{36}{arithmetic expansion} -\entry{process substitution}{36}{process substitution} +\entry{process substitution}{37}{process substitution} \entry{word splitting}{37}{word splitting} -\entry{expansion, filename}{37}{expansion, filename} -\entry{expansion, pathname}{37}{expansion, pathname} -\entry{filename expansion}{37}{filename expansion} -\entry{pathname expansion}{37}{pathname expansion} +\entry{expansion, filename}{38}{expansion, filename} +\entry{expansion, pathname}{38}{expansion, pathname} +\entry{filename expansion}{38}{filename expansion} +\entry{pathname expansion}{38}{pathname expansion} \entry{pattern matching}{38}{pattern matching} \entry{matching, pattern}{38}{matching, pattern} \entry{redirection}{40}{redirection} @@ -71,11 +71,11 @@ \entry{command execution}{45}{command execution} \entry{command search}{45}{command search} \entry{execution environment}{45}{execution environment} -\entry{environment}{46}{environment} +\entry{environment}{47}{environment} \entry{exit status}{47}{exit status} \entry{signal handling}{48}{signal handling} \entry{shell script}{49}{shell script} -\entry{special builtin}{83}{special builtin} +\entry{special builtin}{84}{special builtin} \entry{login shell}{101}{login shell} \entry{interactive shell}{101}{interactive shell} \entry{startup files}{101}{startup files} diff --git a/doc/bashref.cps b/doc/bashref.cps index 3c8f46eb..1739914e 100644 --- a/doc/bashref.cps +++ b/doc/bashref.cps @@ -43,7 +43,7 @@ \entry{dollar-single quote quoting}{6} \initial {E} \entry{editing command lines}{129} -\entry{environment}{46} +\entry{environment}{47} \entry{evaluation, arithmetic}{106} \entry{event designators}{170} \entry{execution environment}{45} @@ -51,16 +51,16 @@ \entry{expansion}{24} \entry{expansion, arithmetic}{36} \entry{expansion, brace}{25} -\entry{expansion, filename}{37} +\entry{expansion, filename}{38} \entry{expansion, parameter}{27} -\entry{expansion, pathname}{37} +\entry{expansion, pathname}{38} \entry{expansion, tilde}{26} \entry{expressions, arithmetic}{106} \entry{expressions, conditional}{104} \initial {F} \entry{field}{3} \entry{filename}{3} -\entry{filename expansion}{37} +\entry{filename expansion}{38} \entry{foreground}{123} \entry{functions, shell}{19} \initial {H} @@ -100,7 +100,7 @@ \entry{parameters}{22} \entry{parameters, positional}{23} \entry{parameters, special}{23} -\entry{pathname expansion}{37} +\entry{pathname expansion}{38} \entry{pattern matching}{38} \entry{pipeline}{10} \entry{POSIX}{3} @@ -108,7 +108,7 @@ \entry{POSIX Mode}{115} \entry{process group}{3} \entry{process group ID}{3} -\entry{process substitution}{36} +\entry{process substitution}{37} \entry{programmable completion}{156} \entry{prompting}{112} \initial {Q} @@ -129,7 +129,7 @@ \entry{shell, interactive}{103} \entry{signal}{4} \entry{signal handling}{48} -\entry{special builtin}{4, 83} +\entry{special builtin}{4, 84} \entry{startup files}{101} \entry{string translations}{8} \entry{suspending jobs}{123} diff --git a/doc/bashref.html b/doc/bashref.html index f846ef0b..3a627571 100644 --- a/doc/bashref.html +++ b/doc/bashref.html @@ -4,13 +4,13 @@