From: Chet Ramey Date: Fri, 9 Feb 2024 15:41:58 +0000 (-0500) Subject: updates to man pages to deal with groff warnings and old troff versions X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=092aa45bcc22641e949027f2435115b0e2904155;p=thirdparty%2Fbash.git updates to man pages to deal with groff warnings and old troff versions --- diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 058e667d..41ab1e44 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -8555,3 +8555,9 @@ bashline.c in the presence of multibyte characters - bash_vi_complete: call vi_advance_point instead of just incrementing rl_point + + 2/5 + --- +doc/bash.1,lib/readline/doc/readline.3 + - minor updates to handle old versions of troff and groff warnings + Fixes from G. Branden Robinson diff --git a/doc/bash.0 b/doc/bash.0 index 3bf169ce..4bc30d2d 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -1,6 +1,4 @@ -BASH(1) General Commands Manual BASH(1) - - +_B_A_S_H(1) General Commands Manual _B_A_S_H(1) NNAAMMEE bash - GNU Bourne-Again SHell @@ -16,8 +14,8 @@ DDEESSCCRRIIPPTTIIOONN commands read from the standard input or from a file. BBaasshh also incor- porates useful features from the _K_o_r_n and _C shells (kksshh and ccsshh). - BBaasshh is intended to be a conformant implementation of the Shell and - Utilities portion of the IEEE POSIX specification (IEEE Standard + 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. OOPPTTIIOONNSS @@ -28,22 +26,22 @@ OOPPTTIIOONNSS --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. --ii If the --ii option is present, the shell is _i_n_t_e_r_a_c_t_i_v_e. --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 - option processing, then commands are read from the standard - input. This option allows the positional parameters to be - set when invoking an interactive shell or when reading input + --ss If the --ss option is present, or if no arguments remain after + option processing, then commands are read from the standard + input. This option allows the positional parameters to be + set when invoking an interactive shell or when reading input through a pipe. - --DD A list of all double-quoted strings preceded by $$ is printed - on the standard output. These are the strings that are sub- + --DD A list of all double-quoted strings preceded by $$ is printed + on the standard output. These are the strings that are sub- ject to language translation when the current locale is not CC or PPOOSSIIXX. This implies the --nn option; no commands will be executed. @@ -51,17 +49,17 @@ OOPPTTIIOONNSS _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, the names and - values of the shell options accepted by sshhoopptt are printed 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, the names and + values of the shell options accepted by sshhoopptt are printed 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 @@ -69,8 +67,8 @@ OOPPTTIIOONNSS 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 ppoo (por- - table object) file format. + Equivalent to --DD, but the output is in the GNU _g_e_t_t_e_x_t ppoo + (portable object) file format. ----dduummpp--ssttrriinnggss Equivalent to --DD. ----hheellpp Display a usage message on standard output and exit success- @@ -78,21 +76,21 @@ OOPPTTIIOONNSS ----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 @@ -102,7 +100,7 @@ OOPPTTIIOONNSS ----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 + SSEEEE AALLSSOO below for a reference to a document that details how posix mode affects bash's behavior. ----rreessttrriicctteedd @@ -112,7 +110,7 @@ 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 @@ -123,16 +121,16 @@ AARRGGUUMMEENNTTSS sitional 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. An attempt is first made to - open the file in the current directory, and, if no file is found, then + mands are executed, the exit status is 0. An attempt is first made to + open the file in the current directory, and, if no file is found, then the shell 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 + 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 error are both connected to terminals (as determined by _i_s_a_t_t_y(3)), or one started with the --ii option. PPSS11 is set and $$-- includes ii if bbaasshh is interactive, allowing a shell script or a startup file to test @@ -147,8 +145,8 @@ IINNVVOOCCAATTIIOONN 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 @@ -166,7 +164,9 @@ IINNVVOOCCAATTIIOONN 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 + but the value of the PPAATTHH variable is not used to search for the file- name. @@ -180,22 +180,22 @@ IINNVVOOCCAATTIIOONN 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 exe- - cute commands from any other startup files, the ----rrccffiillee option has no - effect. A non-interactive shell invoked with the name sshh does not at- + cute commands from any other startup files, the ----rrccffiillee option has no + effect. A non-interactive shell invoked with the name sshh does not at- tempt to read any other startup files. When invoked as sshh, bbaasshh enters _p_o_s_i_x mode after the startup files are read. When bbaasshh is started in _p_o_s_i_x 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 commands are read and - executed from the file whose name is the expanded value. No other + interactive shells expand the EENNVV variable and commands are read and + executed 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 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 + 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. It will not do this if invoked as sshh. The ----nnoorrcc option may be used to inhibit this behavior, and the ----rrccffiillee option may be used to force another file to be read, but neither _r_s_h_d nor _s_s_h_d generally @@ -204,22 +204,22 @@ IINNVVOOCCAATTIIOONN 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. - 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 @@ -245,14 +245,14 @@ SSHHEELLLL GGRRAAMMMMAARR 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 ... ] @@ -260,10 +260,10 @@ SSHHEELLLL GGRRAAMMMMAARR 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 used, - _c_o_m_m_a_n_d_1's standard error, in addition to its standard output, is con- - nected 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 redirections specified by _c_o_m_- + _c_o_m_m_a_n_d_1's standard error, in addition to its standard output, is con- + nected 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 redirections specified by _c_o_m_- _m_a_n_d_1. The return status of a pipeline is the exit status of the last command, @@ -271,17 +271,17 @@ SSHHEELLLL GGRRAAMMMMAARR 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. The shell waits for all commands in the pipeline to terminate + that pipeline is the logical negation of the exit status as described + above. The shell waits for all commands in the pipeline to terminate before returning a value. - If the ttiimmee reserved word precedes a pipeline, the elapsed as well as - user and system time consumed by its execution are reported when the - pipeline terminates. The --pp option changes the output format to that - specified by POSIX. When the shell is in _p_o_s_i_x _m_o_d_e, it does not rec- - ognize ttiimmee as a reserved word if the next token begins with a `-'. - The TTIIMMEEFFOORRMMAATT variable may be set to 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 elapsed as well as + user and system time consumed by its execution are reported when the + pipeline terminates. The --pp option changes the output format to that + specified by POSIX. When the shell is in _p_o_s_i_x _m_o_d_e, it does not rec- + ognize ttiimmee as a reserved word if the next token begins with a "-". + The TTIIMMEEFFOORRMMAATT variable may be set to a format string that specifies + how the timing information should be displayed; see the description of TTIIMMEEFFOORRMMAATT under SShheellll VVaarriiaabblleess below. When the shell is in _p_o_s_i_x _m_o_d_e, ttiimmee may be followed by a newline. In @@ -312,35 +312,35 @@ SSHHEELLLL GGRRAAMMMMAARR 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. @@ -350,8 +350,8 @@ SSHHEELLLL GGRRAAMMMMAARR as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are _r_e_s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted - to be recognized. Since they do not cause a word break, they - must be separated from _l_i_s_t by whitespace or another shell + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell metacharacter. ((_e_x_p_r_e_s_s_i_o_n)) @@ -368,9 +368,9 @@ SSHHEELLLL GGRRAAMMMMAARR the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. The words between the [[[[ and ]]]] do not undergo word splitting and pathname expansion. The shell performs tilde expansion, pa- - rameter and variable expansion, arithmetic expansion, command - substitution, process substitution, and quote removal on those - words (the expansions that would occur if the words were en- + rameter and variable expansion, arithmetic expansion, command + substitution, process substitution, and quote removal on those + words (the expansions that would occur if the words were en- closed in double quotes). Conditional operators such as --ff must be unquoted to be recognized as primaries. @@ -381,15 +381,15 @@ SSHHEELLLL GGRRAAMMMMAARR of the operator is considered a pattern and matched according to the rules described below under PPaatttteerrnn MMaattcchhiinngg, as if the eexxtt-- gglloobb shell option were enabled. The == operator is equivalent to - ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is - performed without regard to the case of alphabetic characters. - The return value is 0 if the string matches (====) or does not - match (!!==) the pattern, and 1 otherwise. Any part of the pat- - tern may be quoted to force the quoted portion to be matched as + ====. If the nnooccaasseemmaattcchh shell option is enabled, the match is + performed without regard to the case of alphabetic characters. + The return value is 0 if the string matches (====) or does not + match (!!==) the pattern, and 1 otherwise. Any part of the pat- + tern may be quoted to force the quoted portion to be matched as a string. - An additional binary operator, ==~~, is available, with the same - precedence as ==== and !!==. When it is used, the string to the + 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 @@ -398,11 +398,11 @@ SSHHEELLLL GGRRAAMMMMAARR tional expression's return value is 2. If the nnooccaasseemmaattcchh shell option is enabled, the match is performed without regard to the case of alphabetic characters. If any part of the pattern is - quoted, the quoted portion is matched literally. This means ev- - ery character in the quoted portion matches itself, instead of - having any special pattern matching meaning. If the pattern is - stored in a shell variable, quoting the variable expansion - forces the entire pattern to be matched literally. Treat + quoted, the quoted portion is matched literally. This means + every character in the quoted portion matches itself, instead of + having any special pattern matching meaning. 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 nor- mal quoting and pattern characters lose their meanings between brackets. @@ -410,21 +410,21 @@ SSHHEELLLL GGRRAAMMMMAARR The pattern will match if it matches any part of the string. Anchor the pattern using the ^^ and $$ regular expression opera- tors to force it to match the entire string. The array variable - BBAASSHH__RREEMMAATTCCHH records which parts of the string matched the pat- - tern. The element of BBAASSHH__RREEMMAATTCCHH with index 0 contains the - portion of the string matching the entire regular expression. - Substrings matched by parenthesized subexpressions within the - regular expression are saved in the remaining BBAASSHH__RREEMMAATTCCHH in- - dices. The element of BBAASSHH__RREEMMAATTCCHH with index _n is the portion - of the string matching the _nth parenthesized subexpression. - BBaasshh sets BBAASSHH__RREEMMAATTCCHH in the global scope; declaring it as a + BBAASSHH__RREEMMAATTCCHH records which parts of the string matched the pat- + tern. The element of BBAASSHH__RREEMMAATTCCHH with index 0 contains the + portion of the string matching the entire regular expression. + Substrings matched by parenthesized subexpressions within the + regular expression are saved in the remaining BBAASSHH__RREEMMAATTCCHH in- + dices. The element of BBAASSHH__RREEMMAATTCCHH with index _n is the portion + of the string matching the _nth parenthesized 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. @@ -460,37 +460,37 @@ SSHHEELLLL GGRRAAMMMMAARR sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee The list of words following iinn is expanded, generating a list of - items, and the set of expanded words is printed on the standard - error, each preceded by a number. If the iinn _w_o_r_d is omitted, - the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). - 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 the value of _n_a_m_e is set to - that word. If the line is empty, the words and prompt are dis- - played again. If EOF is read, the sseelleecctt command completes and - returns 1. Any other value read causes _n_a_m_e to be set to null. - The line read is saved in the variable RREEPPLLYY. The _l_i_s_t is exe- - cuted after each selection until a bbrreeaakk command is executed. + items, and the set of expanded words is printed on the standard + error, each preceded by a number. If the iinn _w_o_r_d is omitted, + the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). + 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 the value of _n_a_m_e is set to + that word. If the line is empty, the words and prompt are dis- + played again. If EOF is read, the sseelleecctt command completes and + returns 1. Any other value read causes _n_a_m_e to be set to null. + The line read is saved in the variable RREEPPLLYY. The _l_i_s_t is exe- + cuted 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, using the matching rules described under + each _p_a_t_t_e_r_n in turn, using the matching rules described under PPaatttteerrnn MMaattcchhiinngg below. The _w_o_r_d is expanded using tilde expan- sion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution and quote removal. Each _p_a_t_t_e_r_n examined is expanded using tilde expansion, parame- - ter and variable expansion, arithmetic expansion, command sub- - stitution, process substitution, and quote removal. If the nnoo-- - ccaasseemmaattcchh shell option is enabled, the match is performed with- - out regard to the case of alphabetic characters. When a match - is found, the corresponding _l_i_s_t is executed. If the ;;;; opera- + ter and variable expansion, arithmetic expansion, command sub- + stitution, process substitution, and quote removal. If the nnoo-- + ccaasseemmaattcchh shell option is enabled, the match is performed with- + out regard to the case of alphabetic characters. When a match + is found, the corresponding _l_i_s_t is executed. If the ;;;; opera- tor is used, no subsequent matches are attempted after the first pattern match. Using ;;&& in place of ;;;; causes execution to con- - tinue with the _l_i_s_t associated with the next set of patterns. - Using ;;;;&& in place of ;;;; causes the shell to test the next pat- - tern list in the statement, if any, and execute any associated + tinue with the _l_i_s_t associated with the next set of patterns. + Using ;;;;&& in place of ;;;; causes the shell to test the next pat- + tern list in the statement, if any, and execute any associated _l_i_s_t on a successful match, continuing the case statement execu- tion as if the pattern list had not matched. The exit status is zero if no pattern matches. Otherwise, it is the exit status of @@ -501,7 +501,7 @@ SSHHEELLLL GGRRAAMMMMAARR _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. @@ -509,7 +509,7 @@ SSHHEELLLL GGRRAAMMMMAARR 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 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 @@ -517,40 +517,40 @@ 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 recommended because simple commands result in the copro- - cess always being named CCOOPPRROOCC, and it is simpler to use and more com- - plete than the other compound commands. + This form is recommended because simple commands result in the co- + process 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 @@ -573,23 +573,23 @@ SSHHEELLLL GGRRAAMMMMAARR _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. When in _p_o_s_i_x _m_o_d_e, _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 - not contain $$. Any redirections (see RREEDDIIRREECCTTIIOONN below) speci- - fied 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 command executed in the + 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) speci- + fied 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 command executed in the body. (See FFUUNNCCTTIIOONNSS below.) CCOOMMMMEENNTTSS @@ -602,8 +602,8 @@ CCOOMMMMEENNTTSS tive shells. QQUUOOTTIINNGG - _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or - words to the shell. Quoting can be used to disable special treatment + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or + words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. @@ -614,38 +614,38 @@ QQUUOOTTIINNGG TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must be quoted to prevent history expansion. - There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single + There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single quotes, and double quotes. - A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the literal value of the next character that follows, with the exception of . If a \\ pair appears, and the backslash is not it- self 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, when history expansion is enabled, !!. When the shell is in _p_o_s_i_x _m_o_d_e, - the !! has no special meaning within double quotes, even when history - expansion is enabled. The characters $$ and `` retain their special - meaning within double quotes. The backslash retains its special mean- - ing only when followed by one of the following characters: $$, ``, "", \\, - or <>. A double quote may be quoted within double quotes by - preceding it with a backslash. If enabled, history expansion will be - performed unless an !! appearing in double quotes is escaped using a + the !! has no special meaning within double quotes, even when history + expansion is enabled. The characters $$ and `` retain their special + meaning within double quotes. The backslash retains its special mean- + ing only when followed by one of the following characters: $$, ``, "", \\, + or <>. A double quote may be quoted within double quotes by + preceding it with a backslash. If enabled, history expansion will be + performed unless an !! appearing in double quotes is escaped using a backslash. The backslash preceding the !! is not removed. - The special parameters ** and @@ have special meaning when in double + The special parameters ** and @@ have special meaning when in double quotes (see PPAARRAAMMEETTEERRSS below). - 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 @@ -660,18 +660,18 @@ QQUUOOTTIINNGG \\'' single quote \\"" double quote \\?? question mark - \\_n_n_n the eight-bit character whose value is the octal value + \\_n_n_n the eight-bit character whose value is the octal value _n_n_n (one to three octal digits) - \\xx_H_H the eight-bit character whose value is the hexadecimal + \\xx_H_H the eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits) - \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the + \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits) \\UU_H_H_H_H_H_H_H_H - the Unicode (ISO/IEC 10646) character whose value is the + the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) \\cc_x a control-_x character - The expanded result is single-quoted, as if the dollar sign had not + The expanded result is single-quoted, as if the dollar sign had not been present. A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") will cause @@ -681,51 +681,51 @@ QQUUOOTTIINNGG current locale is CC or PPOOSSIIXX, if there are no translations available, or if the string is not translated, the dollar sign is ignored. This is a form of double quoting, so the string remains double-quoted by de- - fault, whether or not it is translated and replaced. If the nnooeexx-- - ppaanndd__ttrraannssllaattiioonn option is enabled using the sshhoopptt builtin, translated - strings are single-quoted instead of double-quoted. See the descrip- + fault, whether or not it is translated and replaced. If the nnooeexx-- + ppaanndd__ttrraannssllaattiioonn option is enabled using the sshhoopptt builtin, translated + strings are single-quoted instead of double-quoted. See the descrip- tion 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 PPaarraamm-- - eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a + 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). 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 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- 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 _p_o_s_i_x _m_o_d_e, - 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 _p_o_s_i_x _m_o_d_e, + these builtins may appear in a command after one or more instances of the ccoommmmaanndd builtin and retain these assignment statement properties. - In the context where an assignment statement is assigning a value to a + In the context where an assignment statement is assigning a value to a shell variable or array index, the += operator can be used to append to or add to the variable's previous value. This includes arguments to - builtin commands such as ddeeccllaarree that accept assignment statements - (_d_e_c_l_a_r_a_t_i_o_n commands). When += is applied to a variable for which the + builtin commands such as ddeeccllaarree that accept assignment statements (_d_e_- + _c_l_a_r_a_t_i_o_n commands). When += is applied to a variable for which the iinntteeggeerr attribute has been set, _v_a_l_u_e is evaluated as an arithmetic ex- pression and added to the variable's current value, which is also eval- - uated. When += is applied to an array variable using compound assign- - ment (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 + uated. When += is applied to an array variable using compound assign- + ment (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. A variable can be assigned the _n_a_m_e_r_e_f attribute using the --nn option to @@ -737,10 +737,12 @@ PPAARRAAMMEETTEERRSS itself), the operation is actually performed on the variable specified by the nameref variable's value. A nameref is commonly used within shell functions to refer to a variable whose name is passed as an argu- - ment to the function. For instance, if a variable name is passed to a + ment to the function. For instance, if a variable name is passed to a shell function as its first argument, running + declare -n ref=$1 - inside the function creates a nameref variable rreeff whose value is the + + inside the function creates a nameref variable rreeff whose value is the variable name passed as the first argument. References and assignments to rreeff, and changes to its attributes, are treated as references, as- signments, and attribute modifications to the variable whose name was @@ -748,14 +750,14 @@ PPAARRAAMMEETTEERRSS attribute, the list of words can be a list of shell variables, and a name reference will be established for each word in the list, in turn, when the loop is executed. Array variables cannot be given the nnaammeerreeff - attribute. However, nameref variables can reference array variables - and subscripted array variables. Namerefs can be unset using the --nn - option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the - name of a nameref variable as an argument, the variable referenced by + attribute. However, nameref variables can reference array variables + and subscripted array variables. Namerefs can be unset using the --nn + option to the uunnsseett builtin. Otherwise, if uunnsseett is executed with the + name of a nameref variable as an argument, the variable referenced by the nameref variable will be unset. PPoossiittiioonnaall PPaarraammeetteerrss - A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, other than the single digit 0. Positional parameters are assigned from the shell's arguments when it is invoked, and may be reassigned using the sseett builtin command. Positional parameters may not be assigned to @@ -769,42 +771,42 @@ PPAARRAAMMEETTEERRSS The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. ** Expands to the positional parameters, starting from one. When - the expansion is not within double quotes, each positional pa- - rameter expands to a separate word. In contexts where it is - performed, those words are subject to further word splitting and - pathname expansion. When the expansion occurs within double - quotes, it expands to a single word with the value of each pa- - rameter separated by the first character of the IIFFSS special - variable. That is, "$$**" is equivalent to "$$11_c$$22_c......", where _c - is the first character of the value of the IIFFSS variable. If IIFFSS - is unset, the parameters are separated by spaces. If IIFFSS is - null, the parameters are joined without intervening separators. - @@ Expands to the positional parameters, starting from one. In - contexts where word splitting is performed, this expands each - positional parameter to a separate word; if not within double - quotes, these words are subject to word splitting. In contexts - where word splitting is not performed, this expands to a single - word with each positional parameter separated by a space. When - the expansion occurs within double quotes, each parameter ex- - pands to a separate word. That is, "$$@@" is equivalent to "$$11" - "$$22" ... If the double-quoted expansion occurs within a word, - the expansion of the first parameter is joined with the begin- - ning part of the original word, and the expansion of the last - parameter is joined with the last part of the original word. - When there are no positional parameters, "$$@@" and $$@@ expand to - nothing (i.e., they are removed). + the expansion is not within double quotes, each positional para- + meter expands to a separate word. In contexts where it is per- + formed, those words are subject to further word splitting and + pathname expansion. When the expansion occurs within double + quotes, it expands to a single word with the value of each para- + meter separated by the first character of the IIFFSS special vari- + able. That is, ""$$**"" is equivalent to ""$$11_c$$22_c......"", where _c is + the first character of the value of the IIFFSS variable. If IIFFSS is + unset, the parameters are separated by spaces. If IIFFSS is null, + the parameters are joined without intervening separators. + @@ Expands to the positional parameters, starting from one. In + contexts where word splitting is performed, this expands each + positional parameter to a separate word; if not within double + quotes, these words are subject to word splitting. In contexts + where word splitting is not performed, this expands to a single + word with each positional parameter separated by a space. When + the expansion occurs within double quotes, each parameter ex- + pands to a separate word. That is, ""$$@@"" is equivalent to + ""$$11"" ""$$22"" ...... If the double-quoted expansion occurs within a + word, the expansion of the first parameter is joined with the + beginning part of the original word, and the expansion of the + last parameter is joined with the last part of the original + word. When there are no positional parameters, ""$$@@"" and $$@@ ex- + pand to nothing (i.e., they are removed). ## Expands to the number of positional parameters in decimal. - ?? Expands to the exit status of the most recently executed fore- + ?? Expands to the exit status of the most recently executed fore- ground pipeline. - -- Expands to the current option flags as specified upon invoca- - tion, by the sseett builtin command, or those set by the shell it- + -- Expands to the current option flags as specified upon invoca- + tion, by the sseett builtin command, or those set by the shell it- self (such as the --ii option). - $$ Expands to the process ID of the shell. In a subshell, it ex- + $$ Expands to the process ID of the shell. In a subshell, it ex- pands to the process ID of the current shell, not the subshell. - !! Expands to the process ID of the job most recently placed into - the background, whether executed as an asynchronous command or + !! Expands to the process ID of the job most recently placed into + the background, whether executed as an asynchronous command or using the bbgg builtin (see JJOOBB CCOONNTTRROOLL below). - 00 Expands to the name of the shell or shell script. This is set + 00 Expands to the name of the shell or shell script. This is set at shell initialization. If bbaasshh is invoked with a file of com- mands, $$00 is set to the name of that file. If bbaasshh is started with the --cc option, then $$00 is set to the first argument after @@ -829,44 +831,44 @@ PPAARRAAMMEETTEERRSS A colon-separated list of enabled shell options. Each word in the list is a valid argument for the --ss option to the sshhoopptt builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If - this variable is in the environment when bbaasshh starts up, each - shell option in the list will be enabled before reading any + appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any startup files. This variable is read-only. BBAASSHHPPIIDD - Expands to the process ID of the current bbaasshh process. This - differs from $$$$ under certain circumstances, such as subshells - that do not require bbaasshh to be re-initialized. Assignments to - BBAASSHHPPIIDD have no effect. If BBAASSHHPPIIDD is unset, it loses its spe- + Expands to the process ID of the current bbaasshh process. This + differs from $$$$ under certain circumstances, such as subshells + that do not require bbaasshh to be re-initialized. Assignments to + BBAASSHHPPIIDD have no effect. If BBAASSHHPPIIDD is unset, it loses its spe- cial properties, even if it is subsequently reset. BBAASSHH__AALLIIAASSEESS - An associative array variable whose members correspond to the - internal list of aliases as maintained by the aalliiaass builtin. - Elements added to this array appear in the alias list; however, - unsetting array elements currently does not cause aliases to be + An associative array variable whose members correspond to the + internal list of aliases as maintained by the aalliiaass builtin. + Elements added to this array appear in the alias list; however, + unsetting array elements currently does not cause aliases to be removed from the alias list. If BBAASSHH__AALLIIAASSEESS is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__AARRGGCC An array variable whose values are the number of parameters in each frame of the current bbaasshh execution call stack. The number - of parameters to the current subroutine (shell function or - script executed with .. or ssoouurrccee) is at the top of the stack. - When a subroutine is executed, the number of parameters passed + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in extended debugging mode (see the description of the eexxttddeebbuugg op- - tion to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the + tion to the sshhoopptt builtin below). Setting eexxttddeebbuugg after the shell has started to execute a script, or referencing this vari- able when eexxttddeebbuugg is not set, may result in inconsistent val- ues. Assignments to BBAASSHH__AARRGGCC have no effect, and it may not be unset. BBAASSHH__AARRGGVV - An array variable containing all of the parameters in the cur- + An array variable containing all of the parameters in the cur- rent bbaasshh execution call stack. The final parameter of the last subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is exe- - cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The - shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see - the description of the eexxttddeebbuugg option to the sshhoopptt builtin be- + cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The + shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see + the description of the eexxttddeebbuugg option to the sshhoopptt builtin be- low). Setting eexxttddeebbuugg after the shell has started to execute a script, or referencing this variable when eexxttddeebbuugg is not set, may result in inconsistent values. Assignments to BBAASSHH__AARRGGVV @@ -874,12 +876,12 @@ PPAARRAAMMEETTEERRSS BBAASSHH__AARRGGVV00 When referenced, this variable expands to the name of the shell or shell script (identical to $$00; see the description of special - parameter 0 above). Assignment to BBAASSHH__AARRGGVV00 causes the value - assigned to also be assigned to $$00. If BBAASSHH__AARRGGVV00 is unset, it + parameter 0 above). Assignment to BBAASSHH__AARRGGVV00 causes the value + assigned to also be assigned to $$00. If BBAASSHH__AARRGGVV00 is unset, it loses its special properties, even if it is subsequently reset. BBAASSHH__CCMMDDSS - An associative array variable whose members correspond to the - internal hash table of commands as maintained by the hhaasshh + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the hhaasshh builtin. Elements added to this array appear in the hash table; however, unsetting array elements currently does not cause com- mand names to be removed from the hash table. If BBAASSHH__CCMMDDSS is @@ -888,27 +890,27 @@ PPAARRAAMMEETTEERRSS BBAASSHH__CCOOMMMMAANNDD The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, - in which case it is the command executing at the time of the - trap. If BBAASSHH__CCOOMMMMAANNDD is unset, it loses its special proper- + in which case it is the command executing at the time of the + trap. If BBAASSHH__CCOOMMMMAANNDD is unset, it loses its special proper- ties, even if it is subsequently reset. BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG The command argument to the --cc invocation option. BBAASSHH__LLIINNEENNOO - An array variable whose members are the line numbers in source - files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. + An array variable whose members are the line numbers in source + files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file ($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or - $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- - tion). Use LLIINNEENNOO to obtain the current line number. Assign- + $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- + tion). Use LLIINNEENNOO to obtain the current line number. Assign- 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 shell looks - for dynamically loadable builtins specified by the eennaabbllee com- + A colon-separated list of directories in which the shell looks + for dynamically loadable builtins specified by the eennaabbllee com- mand. BBAASSHH__RREEMMAATTCCHH - An array variable whose members are assigned by the ==~~ binary - operator to the [[[[ conditional command. The element with index - 0 is the portion of the string matching the entire regular ex- + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular ex- pression. The element with index _n is the portion of the string matching the _nth parenthesized subexpression. BBAASSHH__MMOONNOOSSEECCOONNDDSS @@ -921,18 +923,18 @@ PPAARRAAMMEETTEERRSS An array variable whose members are the source filenames where the corresponding shell function names in the FFUUNNCCNNAAMMEE array variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is de- - fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from - $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. Assignments to BBAASSHH__SSOOUURRCCEE have no ef- + fined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from + $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. Assignments to BBAASSHH__SSOOUURRCCEE have no ef- fect, and it may not be unset. BBAASSHH__SSUUBBSSHHEELLLL - Incremented by one within each subshell or subshell environment - when the shell begins executing in that environment. The ini- - tial value is 0. If BBAASSHH__SSUUBBSSHHEELLLL is unset, it loses its spe- + Incremented by one within each subshell or subshell environment + when the shell begins executing in that environment. The ini- + tial value is 0. If BBAASSHH__SSUUBBSSHHEELLLL is unset, it loses its spe- cial properties, even if it is subsequently reset. BBAASSHH__TTRRAAPPSSIIGG - Set to the signal number corresponding to the trap action being - executed during its execution. See the description of ttrraapp un- - der SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below for information about signal + Set to the signal number corresponding to the trap action being + executed during its execution. See the description of ttrraapp un- + der SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below for information about signal numbers and trap execution. BBAASSHH__VVEERRSSIINNFFOO A readonly array variable whose members hold version information @@ -942,7 +944,7 @@ PPAARRAAMMEETTEERRSS BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). BBAASSHH__VVEERRSSIINNFFOO[[2]] The patch level. BBAASSHH__VVEERRSSIINNFFOO[[3]] The build version. - BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a_1). + BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a). BBAASSHH__VVEERRSSIINNFFOO[[5]] The value of MMAACCHHTTYYPPEE. BBAASSHH__VVEERRSSIIOONN Expands to a string describing the version of this instance of @@ -950,52 +952,52 @@ PPAARRAAMMEETTEERRSS CCOOMMPP__CCWWOORRDD An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current cursor position. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__KKEEYY The key (or final key of a key sequence) used to invoke the cur- rent completion function. CCOOMMPP__LLIINNEE The current command line. This variable is available only in - shell functions and external commands invoked by the program- - mable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + shell functions and external commands invoked by the programma- + ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__PPOOIINNTT The index of the current cursor position relative to the begin- ning of the current command. If the current cursor position is at the end of the current command, the value of this variable is - equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in - shell functions and external commands invoked by the program- - mable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the programma- + ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__TTYYPPEE - Set to an integer value corresponding to the type of completion - attempted that caused a completion function to be called: _T_A_B, - for normal completion, _?, for listing completions after succes- - sive tabs, _!, for listing alternatives on partial word comple- - tion, _@, to list completions if the word is not unmodified, or - _%, for menu completion. This variable is available only in - shell functions and external commands invoked by the program- - mable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). + Set to an integer value corresponding to the type of completion + attempted that caused a completion function to be called: _T_A_B, + for normal completion, _?, for listing completions after succes- + sive tabs, _!, for listing alternatives on partial word comple- + tion, _@, to list completions if the word is not unmodified, or + _%, for menu completion. This variable is available only in + shell functions and external commands invoked by the programma- + ble completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__WWOORRDDBBRREEAAKKSS - The set of characters that the rreeaaddlliinnee library treats as word - separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS - is unset, it loses its special properties, even if it is subse- + The set of characters that the rreeaaddlliinnee library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- quently reset. CCOOMMPP__WWOORRDDSS - An array variable (see AArrrraayyss below) consisting of the individ- - ual words in the current command line. The line is split into - words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as de- - scribed above. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The line is split into + words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as de- + scribed above. This variable is available only in shell func- + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). - CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file - descriptors for output from and input to an unnamed coprocess + CCOOPPRROOCC An array variable (see AArrrraayyss below) created to hold the file + descriptors for output from and input to an unnamed coprocess (see CCoopprroocceesssseess above). DDIIRRSSTTAACCKK An array variable (see AArrrraayyss below) containing the current con- tents of the directory stack. Directories appear in the stack in the order they are displayed by the ddiirrss builtin. Assigning to members of this array variable may be used to modify directo- - ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must be used to add and remove directories. Assignment to this vari- able will not change the current directory. If DDIIRRSSTTAACCKK is un- set, it loses its special properties, even if it is subsequently @@ -1008,29 +1010,29 @@ PPAARRAAMMEETTEERRSS its special properties, even if it is subsequently reset. EEPPOOCCHHSSEECCOONNDDSS Each time this parameter is referenced, it expands to the number - of seconds since the Unix Epoch (see _t_i_m_e(3)). Assignments to - EEPPOOCCHHSSEECCOONNDDSS are ignored. If EEPPOOCCHHSSEECCOONNDDSS is unset, it loses + of seconds since the Unix Epoch (see _t_i_m_e(3)). Assignments to + EEPPOOCCHHSSEECCOONNDDSS are ignored. If EEPPOOCCHHSSEECCOONNDDSS is unset, it loses its special properties, even if it is subsequently reset. - EEUUIIDD Expands to the effective user ID of the current user, initial- + EEUUIIDD Expands to the effective user ID of the current user, initial- ized at shell startup. This variable is readonly. FFUUNNCCNNAAMMEE - An array variable containing the names of all shell functions + An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bot- - tom-most element (the one with the highest index) is "main". - This variable exists only when a shell function is executing. - Assignments to FFUUNNCCNNAAMMEE have no effect. If FFUUNNCCNNAAMMEE is unset, - it loses its special properties, even if it is subsequently re- + tom-most element (the one with the highest index) is "main". + This variable exists only when a shell function is executing. + Assignments to FFUUNNCCNNAAMMEE have no effect. If FFUUNNCCNNAAMMEE is unset, + it loses its special properties, even if it is subsequently re- set. - This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. - Each element of FFUUNNCCNNAAMMEE has corresponding elements in + This variable can be used with BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE. + Each element of FFUUNNCCNNAAMMEE has corresponding elements in BBAASSHH__LLIINNEENNOO and BBAASSHH__SSOOUURRCCEE to describe the call stack. For in- stance, $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called from the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}} at line number $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}}. The ccaalllleerr builtin displays the current call stack using this infor- mation. - GGRROOUUPPSS An array variable containing the list of groups of which the + GGRROOUUPPSS An array variable containing the list of groups of which the current user is a member. Assignments to GGRROOUUPPSS have no effect. If GGRROOUUPPSS is unset, it loses its special properties, even if it is subsequently reset. @@ -1042,13 +1044,13 @@ PPAARRAAMMEETTEERRSS HHOOSSTTNNAAMMEE Automatically set to the name of the current host. HHOOSSTTTTYYPPEE - Automatically set to a string that uniquely describes the type - of machine on which bbaasshh is executing. The default is system- + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- dependent. - LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a - decimal number representing the current sequential line number - (starting with 1) within a script or function. When not in a - script or function, the value substituted is not guaranteed to + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to be meaningful. If LLIINNEENNOO is unset, it loses its special proper- ties, even if it is subsequently reset. MMAACCHHTTYYPPEE @@ -1087,13 +1089,13 @@ PPAARRAAMMEETTEERRSS (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). RREEAADDLLIINNEE__MMAARRKK The position of the mark (saved insertion point) in the rreeaaddlliinnee - line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The characters between the insertion point and the mark are often called the _r_e_g_i_o_n. RREEAADDLLIINNEE__PPOOIINNTT The position of the insertion point in the rreeaaddlliinnee line buffer, for use with "bind -x" (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when no arguments are supplied. SSEECCOONNDDSS Each time this parameter is referenced, it expands to the number @@ -1108,15 +1110,15 @@ PPAARRAAMMEETTEERRSS A colon-separated list of enabled shell options. Each word in the list is a valid argument for the --oo option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If - this variable is in the environment when bbaasshh starts up, each - shell option in the list will be enabled before reading any + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any startup files. This variable is read-only. SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. SSRRAANNDDOOMM This variable expands to a 32-bit pseudo-random number each time it is referenced. The random number generator is not linear on - systems that support /dev/urandom or _a_r_c_4_r_a_n_d_o_m, so each re- + 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 re- turned number has no relationship to the numbers preceding it. The random number generator cannot be seeded, so assignments to this variable have no effect. If SSRRAANNDDOOMM is unset, it loses its @@ -1128,8 +1130,8 @@ PPAARRAAMMEETTEERRSS signs 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 @@ -1137,28 +1139,29 @@ PPAARRAAMMEETTEERRSS default for the current version. If BBAASSHH__CCOOMMPPAATT is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level - to the default for the current version. The valid values corre- - spond 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 compat- - ibility level to 42. The current version is also a valid value. + 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 value is interpreted as a filename containing commands to + If this parameter is set when bbaasshh is executing a shell script, + its value is interpreted as a filename containing commands to initialize the shell, as in _~_/_._b_a_s_h_r_c. The value of BBAASSHH__EENNVV is subjected to parameter expansion, command substitution, and arithmetic expansion before being interpreted as a filename. PPAATTHH is not used to search for the resultant filename. BBAASSHH__XXTTRRAACCEEFFDD If set to an integer corresponding to a valid file descriptor, - bbaasshh will write the trace output generated when _s_e_t _-_x is en- + bbaasshh will write the trace output generated when "set -x" is en- abled to that file descriptor. The file descriptor is closed when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace output to be sent to the standard error. Note that setting BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed. - CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated list of directories in which the shell looks for destination di- rectories specified by the ccdd command. A sample value is ".:~:/usr". @@ -1175,28 +1178,28 @@ PPAARRAAMMEETTEERRSS 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 _p_o_s_i_x _m_o_d_e. EEXXEECCIIGGNNOORREE - A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) - defining the list of filenames to be ignored by command search - using PPAATTHH. Files whose full pathnames match one of these pat- - terns are not considered executable files for the purposes of + A colon-separated list of shell patterns (see PPaatttteerrnn MMaattcchhiinngg) + defining the list of filenames to be ignored by command search + using PPAATTHH. Files whose full pathnames match one of these pat- + terns are not considered executable files for the purposes of completion and command execution via PPAATTHH lookup. This does not affect the behavior of the [[, tteesstt, and [[[[ commands. Full path- - names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. - Use this variable to ignore shared library files that have the - executable bit set, but are not executable files. The pattern + names in the command hash table are not subject to EEXXEECCIIGGNNOORREE. + Use this variable to ignore shared library files that have the + executable bit set, but are not executable files. The pattern matching honors the setting of the eexxttgglloobb shell option. FFCCEEDDIITT The default editor for the ffcc builtin command. FFIIGGNNOORREE - A colon-separated list of suffixes to ignore when performing + A colon-separated list of suffixes to ignore when performing filename completion (see RREEAADDLLIINNEE below). A filename whose suf- fix matches one of the entries in FFIIGGNNOORREE is excluded from the list of matched filenames. A sample value is ".o:~". @@ -1229,10 +1232,10 @@ PPAARRAAMMEETTEERRSS 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 to not be saved. A value of _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line @@ -1240,8 +1243,8 @@ PPAARRAAMMEETTEERRSS Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value - of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line - compound command are not tested, and are added to the history + of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line + compound command are not tested, and are added to the history regardless of the value of HHIISSTTCCOONNTTRROOLL. HHIISSTTFFIILLEE The name of the file in which command history is saved (see HHIISS-- @@ -1250,24 +1253,24 @@ PPAARRAAMMEETTEERRSS when a shell 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 - truncated to this size after writing it when a shell exits. 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 + 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. 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. Each pattern is an- - chored at the beginning of the line and must match the complete - line (no implicit `**' is appended). 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. `&&' may be es- - caped using a backslash; the backslash is removed before at- - tempting a match. The second and subsequent lines of a multi- + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. Each pattern is an- + chored at the beginning of the line and must match the complete + line (bbaasshh will not implicitly append a "**"). Each pattern is + tested against the line after the checks specified by HHIISSTTCCOONN-- + TTRROOLL are applied. In addition to the normal shell pattern + matching characters, "&&" matches the previous history line. A + backslash will escape the "&&"; the backslash is removed before + attempting a match. The second and subsequent lines of a multi- line compound command are not tested, and are added to the his- tory regardless of the value of HHIISSTTIIGGNNOORREE. The pattern match- ing honors the setting of the eexxttgglloobb shell option. @@ -1275,11 +1278,11 @@ PPAARRAAMMEETTEERRSS The number of commands to remember in the command history (see HHIISSTTOORRYY below). If the value is 0, commands are not saved in the history list. Numeric values less than zero result in every - command being saved on the history list (there is no limit). - The shell sets the default value to 500 after reading any + command being saved on the history list (there is no limit). + The shell sets the default value to 500 after reading any startup files. HHIISSTTTTIIMMEEFFOORRMMAATT - If this variable is set and not null, its value is used as a + If this variable is set and not null, its value is used as a format string for _s_t_r_f_t_i_m_e(3) to print the time stamp associated with each history entry displayed by the hhiissttoorryy builtin. If this variable is set, time stamps are written to the history @@ -1292,107 +1295,104 @@ PPAARRAAMMEETTEERRSS HHOOSSTTFFIILLEE Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s that should be read when the shell needs to complete a hostname. - The list of possible hostname completions may be changed while - the shell is running; the next time hostname completion is at- - tempted after the value is changed, bbaasshh adds the contents of - 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- + The list of possible hostname completions may be changed while + the shell is running; the next time hostname completion is at- + tempted after the value is changed, bbaasshh adds the contents of + 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, the hostname list is cleared. 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 - builtin command. The default value is ``''. + builtin command. 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 - exists but does not have a numeric value, or has no value, the - default value is 10. If it does not exist, EEOOFF signifies the + consecutive EEOOFF characters which must be typed as the first + characters on an input line before bbaasshh exits. If the variable + exists but does not have a numeric value, or has no value, the + default value is 10. If it does not exist, 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 this parameter is set to a file or directory name and the - MMAAIILLPPAATTHH variable is not set, bbaasshh informs the user of the ar- + MMAAIILL If this parameter is set to a file or directory name and the + MMAAIILLPPAATTHH variable is not set, bbaasshh informs the user of the ar- rival 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. Example: - MMAAIILLPPAATTHH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has - mail!"' + 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 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 set by the administrator who installs bbaasshh. A common value is - ``/usr/local/bin:/usr/lo- - cal/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 _p_o_s_i_x _m_o_d_e 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 _p_o_s_i_x _m_o_d_e, as if the - command _s_e_t _-_o _p_o_s_i_x had been executed. When the shell enters + command "set -o posix" had been executed. When the shell enters _p_o_s_i_x _m_o_d_e, 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). Characters removed are replaced with an ellipsis. @@ -1401,16 +1401,16 @@ PPAARRAAMMEETTEERRSS 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 - ``\\ss--\\vv\\$$ ''. + "\s-\v\$ ". PPSS22 The value of this parameter is expanded as with PPSS11 and used as - the secondary prompt string. The default is ``>> ''. + 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 ``++ ''. + 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 pathname of the current user's login shell. @@ -1420,7 +1420,7 @@ PPAARRAAMMEETTEERRSS 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 braces denote optional portions. + as follows; the brackets denote optional portions. %%%% A literal %%. %%[[_p]][[ll]]RR The elapsed time in seconds. %%[[_p]][[ll]]UU The number of CPU seconds spent in user mode. @@ -1429,28 +1429,28 @@ PPAARRAAMMEETTEERRSS 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. At most six places - after the decimal point may be specified; values of _p greater - than 6 are changed to 6. If _p is not specified, the value 3 is + no decimal point or fraction to be output. At most six places + after the decimal point may be specified; values of _p greater + than 6 are changed to 6. If _p is not specified, the value 3 is used. - 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, TTMMOOUUTT is treated as the de- fault timeout for the rreeaadd builtin. The sseelleecctt command termi- nates if input does not arrive after TTMMOOUUTT seconds when input is - coming from a terminal. In an interactive shell, the value is + coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for a line of input after issuing the primary prompt. BBaasshh terminates after waiting - for that number of seconds if a complete line of input does not + 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 @@ -1469,36 +1469,36 @@ PPAARRAAMMEETTEERRSS 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 and + The two or three characters which control history expansion and tokenization (see HHIISSTTOORRYY EEXXPPAANNSSIIOONN below). 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 signals - the start of a history expansion, normally `!!'. The second + the start of 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, which is used as shorthand for re-running the previous command entered, substi- tuting one string for another in the command, when it appears as - the first character on the line. The default is `^^'. The op- + the first character on the line. The default is "^^". The op- tional third character is the character which indicates that the remainder of the line is a comment when found as the first char- - acter of a word, normally `##'. The history comment character - causes history substitution to be skipped for the remaining - words on the line. It does not necessarily cause the shell + acter of a word, normally "##". The history comment character + causes history substitution to be skipped 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 will - explicitly declare 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 integers (including + BBaasshh provides one-dimensional indexed and associative array variables. + Any variable may be used as an indexed array; the ddeeccllaarree builtin will + explicitly declare 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 integers (including arithmetic expressions) and are zero-based; associative arrays are ref- erenced 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 + 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. To explicitly - declare an indexed array, use ddeeccllaarree --aa _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMM-- - MMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is also accepted; the _s_u_b_- + declare an indexed array, use ddeeccllaarree --aa _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMM-- + MMAANNDDSS 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. @@ -1519,20 +1519,20 @@ PPAARRAAMMEETTEERRSS plus one. Indexing starts at zero. When assigning to an associative array, the words in a compound assign- - ment may be either assignment statements, for which the subscript is - required, or a list of words that is interpreted as a sequence of al- - ternating keys and values: _n_a_m_e=(( _k_e_y_1 _v_a_l_u_e_1 _k_e_y_2 _v_a_l_u_e_2 ...)). These - are treated identically to _n_a_m_e=(( [_k_e_y_1]=_v_a_l_u_e_1 [_k_e_y_2]=_v_a_l_u_e_2 ...)). - The first word in the list determines how the remaining words are in- - terpreted; all assignments in a list must be of the same type. When - using key/value pairs, the keys may not be missing or empty; a final + ment may be either assignment statements, for which the subscript is + required, or a list of words that is interpreted as a sequence of al- + ternating keys and values: _n_a_m_e=(( _k_e_y_1 _v_a_l_u_e_1 _k_e_y_2 _v_a_l_u_e_2 ...)). These + are treated identically to _n_a_m_e=(( [_k_e_y_1]=_v_a_l_u_e_1 [_k_e_y_2]=_v_a_l_u_e_2 ...)). + The first word in the list determines how the remaining words are in- + terpreted; all assignments in a list must be of the same type. When + using key/value pairs, the keys may not be missing or empty; a final missing value is treated like the empty string. - This syntax is also accepted by the ddeeccllaarree builtin. Individual array - elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax in- - troduced above. When assigning to an indexed array, if _n_a_m_e is sub- - scripted by a negative number, that number is interpreted as relative - to one greater than the maximum index of _n_a_m_e, so negative indices + This syntax is also accepted by the ddeeccllaarree builtin. Individual array + elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax in- + troduced above. When assigning to an indexed array, if _n_a_m_e is sub- + scripted by a negative number, that number is interpreted as relative + to one greater than 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. @@ -1541,28 +1541,28 @@ PPAARRAAMMEETTEERRSS Any element of an array may be 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 sub- + _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 sub- scripts differ only when the word appears within double quotes. If the word is double-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 variable, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a sep- - arate word. When there are no array members, ${_n_a_m_e[@]} expands to - nothing. If the double-quoted expansion occurs within a word, the ex- + arate word. When there are no array members, ${_n_a_m_e[@]} expands to + nothing. If the double-quoted expansion occurs within a word, the ex- pansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. This is analogous to the expansion - of the special parameters ** and @@ (see SSppeecciiaall 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 + of the special parameters ** and @@ (see SSppeecciiaall 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 _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 - evaluates to a number less than zero, it is interpreted as relative to - one greater than the maximum index of the array, so negative indices + evaluates 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, and bbaasshh will create an array if nec- essary. @@ -1576,12 +1576,12 @@ PPAARRAAMMEETTEERRSS The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] de- stroys 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- + 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], where _s_u_b_s_c_r_i_p_t is ** or @@, behaves differently depending on whether _n_a_m_e is an indexed or asso- - ciative array. If _n_a_m_e is an associative array, this unsets the ele- + ciative array. If _n_a_m_e is an associative array, this unsets the ele- ment with subscript ** or @@. If _n_a_m_e is an indexed array, unset removes all of the elements but does not remove the array itself. @@ -1590,76 +1590,78 @@ PPAARRAAMMEETTEERRSS scribed above, the argument is subject to pathname expansion. If path- name expansion is not desired, the argument should be quoted. - 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. EEXXPPAANNSSIIOONN Expansion is performed on the command line after it has been split into - words. There are seven kinds of expansion performed: _b_r_a_c_e _e_x_p_a_n_s_i_o_n, - _t_i_l_d_e _e_x_p_a_n_s_i_o_n, _p_a_r_a_m_e_t_e_r _a_n_d _v_a_r_i_a_b_l_e _e_x_p_a_n_s_i_o_n, _c_o_m_m_a_n_d _s_u_b_s_t_i_t_u_- - _t_i_o_n, _a_r_i_t_h_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, and _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n. + words. The shell performs these expansions: _b_r_a_c_e _e_x_p_a_n_s_i_o_n, _t_i_l_d_e _e_x_- + _p_a_n_s_i_o_n, _p_a_r_a_m_e_t_e_r _a_n_d _v_a_r_i_a_b_l_e _e_x_p_a_n_s_i_o_n, _c_o_m_m_a_n_d _s_u_b_s_t_i_t_u_t_i_o_n, _a_r_i_t_h_- + _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; and pathname expan- - sion. + 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- stitution. - After these expansions are performed, quote characters present in the - original word are removed unless they have been quoted themselves - (_q_u_o_t_e _r_e_m_o_v_a_l). + _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- - pansions of "$$@@" and "$${{_n_a_m_e[[@@]]}}", and, in most cases, $$** and + 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 by which arbitrary strings may be gener- - ated. This mechanism is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the file- + ated. This mechanism is similar to _p_a_t_h_n_a_m_e _e_x_p_a_n_s_i_o_n, but the file- names generated need not exist. Patterns to be brace expanded take the form of an optional _p_r_e_a_m_b_l_e, followed by either a series of comma-sep- - arated strings or a sequence expression between a pair of braces, fol- - lowed by an optional _p_o_s_t_s_c_r_i_p_t. The preamble is prefixed to each + arated strings or a sequence expression between a pair of braces, fol- + lowed 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 are not sorted; left to right order is preserved. For example, - a{{d,c,b}}e expands into `ade ace abe'. + 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 an integer. When integers are supplied, the expression expands to each - number between _x and _y, inclusive. Supplied integers may be prefixed - with _0 to force each term to have the same width. 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 lexico- - graphically 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 the supplied integers are pre- + fixed with _0, each term will have the same width, zero-padding if nec- + essary. 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 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 - strictly textual. BBaasshh does not apply any syntactic interpretation to + acters special to other expansions are preserved in the result. It is + strictly textual. BBaasshh does not apply any syntactic interpretation to the context of the expansion or the text between the braces. - A correctly-formed brace expansion must contain unquoted opening and + A correctly-formed brace expansion must contain unquoted opening and 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- + {{ 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 }}. @@ -1670,18 +1672,18 @@ EEXXPPAANNSSIIOONN or chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}} - Brace expansion introduces a slight incompatibility with historical - 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. The same word is output as _f_i_l_e_1 _f_i_l_e_2 after expansion by - bbaasshh. If strict compatibility with sshh is desired, start bbaasshh with the + Brace expansion introduces a slight incompatibility with historical + 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. The same word is output as _f_i_l_e_1 _f_i_l_e_2 after expansion by + bbaasshh. If strict compatibility with sshh is desired, start bbaasshh with the ++BB option or disable brace expansion with the ++BB option to the sseett com- mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). TTiillddee EExxppaannssiioonn - If a word begins with an unquoted tilde character (`~~'), all of the + If a word begins with an unquoted tilde character ("~~"), all of the characters preceding the first unquoted slash (or all characters, if there is no unquoted slash) are considered a _t_i_l_d_e_-_p_r_e_f_i_x. If none of the characters in the tilde-prefix are quoted, the characters in the @@ -1692,15 +1694,15 @@ EEXXPPAANNSSIIOONN wise, the tilde-prefix is replaced with the home directory associated with the specified login name. - If the tilde-prefix is a `~+', the value of the shell variable PPWWDD re- - places the tilde-prefix. If the tilde-prefix is a `~-', the value of + If the tilde-prefix is a "~+", the value of the shell variable PPWWDD re- + places the tilde-prefix. If the tilde-prefix is a "~-", the value of the shell variable OOLLDDPPWWDD, if it is set, is substituted. If the char- acters following the tilde in the tilde-prefix consist of a number _N, - optionally prefixed by a `+' or a `-', the tilde-prefix is replaced + optionally prefixed by a "+" or a "-", the tilde-prefix is replaced with the corresponding element from the directory stack, as it would be displayed by the ddiirrss builtin invoked with the tilde-prefix as an argu- ment. If the characters following the tilde in the tilde-prefix con- - sist of a number without a leading `+' or `-', `+' is assumed. + sist of a number without a leading "+" or "-", "+" is assumed. If the login name is invalid, or the tilde expansion fails, the word is unchanged. @@ -1713,34 +1715,34 @@ EEXXPPAANNSSIIOONN BBaasshh also performs tilde expansion on words satisfying the conditions of variable assignments (as described above under PPAARRAAMMEETTEERRSS) when they - appear as arguments to simple commands. BBaasshh does not do this, except + appear as arguments to simple commands. BBaasshh does not do this, except for the _d_e_c_l_a_r_a_t_i_o_n commands listed above, when in _p_o_s_i_x _m_o_d_e. PPaarraammeetteerr EExxppaannssiioonn - The `$$' character introduces parameter expansion, command substitution, + The "$$" character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. - When braces are used, the matching ending brace is the first `}}' not + When braces are used, the matching ending brace is the first "}}" not escaped by a backslash or within a quoted string, and not within an em- - bedded arithmetic expansion, command substitution, or parameter expan- + bedded arithmetic expansion, command substitution, or parameter expan- sion. ${_p_a_r_a_m_e_t_e_r} - The value of _p_a_r_a_m_e_t_e_r is substituted. The braces are required - when _p_a_r_a_m_e_t_e_r is a positional parameter with more than one + The value of _p_a_r_a_m_e_t_e_r is substituted. The braces are required + when _p_a_r_a_m_e_t_e_r is a positional parameter with more than one digit, or when _p_a_r_a_m_e_t_e_r is followed by a character which is not to be interpreted as part of its name. The _p_a_r_a_m_e_t_e_r is a shell - parameter as described above PPAARRAAMMEETTEERRSS) or an array reference + parameter as described above PPAARRAAMMEETTEERRSS) or an array reference (AArrrraayyss). - If the first character of _p_a_r_a_m_e_t_e_r is an exclamation point (!!), and + If the first character of _p_a_r_a_m_e_t_e_r is an exclamation point (!!), and _p_a_r_a_m_e_t_e_r is not a _n_a_m_e_r_e_f, it introduces a level of indirection. BBaasshh uses the value formed by expanding the rest of _p_a_r_a_m_e_t_e_r as the new _p_a_- - _r_a_m_e_t_e_r; this is then expanded and that value is used in the rest of - the expansion, rather than the expansion of the original _p_a_r_a_m_e_t_e_r. + _r_a_m_e_t_e_r; this is then expanded and that value is used in the rest of + the expansion, rather than the expansion of the original _p_a_r_a_m_e_t_e_r. This is known as _i_n_d_i_r_e_c_t _e_x_p_a_n_s_i_o_n. The value is subject to tilde ex- pansion, parameter expansion, command substitution, and arithmetic ex- pansion. If _p_a_r_a_m_e_t_e_r is a nameref, this expands to the name of the @@ -1774,38 +1776,38 @@ EEXXPPAANNSSIIOONN it is not interactive, exits. Otherwise, the value of _p_a_r_a_m_e_t_e_r is substituted. ${_p_a_r_a_m_e_t_e_r::++_w_o_r_d} - UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is + UUssee AAlltteerrnnaattee VVaalluuee. If _p_a_r_a_m_e_t_e_r is null or unset, nothing is substituted, otherwise the expansion of _w_o_r_d is substituted. ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t} ${_p_a_r_a_m_e_t_e_r::_o_f_f_s_e_t::_l_e_n_g_t_h} - SSuubbssttrriinngg EExxppaannssiioonn. Expands to up to _l_e_n_g_t_h characters of the - value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_- - _s_e_t. If _p_a_r_a_m_e_t_e_r is @@ or **, an indexed array subscripted by @@ - or **, or an associative array name, the results differ as de- - scribed below. If _l_e_n_g_t_h is omitted, expands to the substring + SSuubbssttrriinngg EExxppaannssiioonn. Expands to up to _l_e_n_g_t_h characters of the + value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_- + _s_e_t. If _p_a_r_a_m_e_t_e_r is @@ or **, an indexed array subscripted by @@ + or **, or an associative array name, the results differ as de- + scribed below. If _l_e_n_g_t_h is omitted, expands to the substring of the value of _p_a_r_a_m_e_t_e_r starting at the character specified by _o_f_f_s_e_t and extending to the end of the value. _l_e_n_g_t_h and _o_f_f_s_e_t are arithmetic expressions (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN below). - If _o_f_f_s_e_t evaluates to a number less than zero, the value is + If _o_f_f_s_e_t evaluates to a number less than zero, the value is used as an offset in characters from the end of the value of _p_a_- _r_a_m_e_t_e_r. If _l_e_n_g_t_h evaluates to a number less than zero, it is interpreted as an offset in characters from the end of the value - of _p_a_r_a_m_e_t_e_r rather than a number of characters, and the expan- - sion is the characters between _o_f_f_s_e_t and that result. Note - that a negative offset must be separated from the colon by at + of _p_a_r_a_m_e_t_e_r rather than a number of characters, and the expan- + sion is the characters between _o_f_f_s_e_t and that result. Note + that a negative offset must be separated from the colon by at least one space to avoid being confused with the ::-- expansion. - If _p_a_r_a_m_e_t_e_r is @@ or **, the result is _l_e_n_g_t_h positional parame- - ters beginning at _o_f_f_s_e_t. A negative _o_f_f_s_e_t is taken relative - to one greater than the greatest positional parameter, so an + If _p_a_r_a_m_e_t_e_r is @@ or **, the result is _l_e_n_g_t_h positional parame- + ters beginning at _o_f_f_s_e_t. A negative _o_f_f_s_e_t is taken relative + to one greater than the greatest positional parameter, so an offset of -1 evaluates to the last positional parameter (or 0 if there are no positional parameters). It is an expansion error if _l_e_n_g_t_h evaluates to a number less than zero. If _p_a_r_a_m_e_t_e_r is an indexed array name subscripted by @ or *, the - result is the _l_e_n_g_t_h members of the array beginning with ${_p_a_- - _r_a_m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is taken relative to one + result is the _l_e_n_g_t_h members of the array beginning with ${_p_a_r_a_- + _m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is taken relative to one greater than the maximum index of the specified array. It is an expansion error if _l_e_n_g_t_h evaluates to a number less than zero. @@ -1821,27 +1823,27 @@ EEXXPPAANNSSIIOONN ${!!_p_r_e_f_i_x@@} NNaammeess mmaattcchhiinngg pprreeffiixx. Expands to the names of variables whose names begin with _p_r_e_f_i_x, separated by the first character of the - IIFFSS special variable. When _@ is used and the expansion appears - within double quotes, each variable name expands to a separate + IIFFSS special variable. When _@ is used and the expansion appears + within double quotes, each variable name expands to a separate word. ${!!_n_a_m_e[_@]} ${!!_n_a_m_e[_*]} - LLiisstt ooff aarrrraayy kkeeyyss. If _n_a_m_e is an array variable, expands to - the list of array indices (keys) assigned in _n_a_m_e. If _n_a_m_e is - not an array, expands to 0 if _n_a_m_e is set and null otherwise. - When _@ is used and the expansion appears within double quotes, + LLiisstt ooff aarrrraayy kkeeyyss. If _n_a_m_e is an array variable, expands to + the list of array indices (keys) assigned in _n_a_m_e. If _n_a_m_e is + not an array, expands to 0 if _n_a_m_e is set and null otherwise. + When _@ is used and the expansion appears within double quotes, each key expands to a separate word. ${##_p_a_r_a_m_e_t_e_r} - PPaarraammeetteerr lleennggtthh. The length in characters of the value of _p_a_- - _r_a_m_e_t_e_r is substituted. If _p_a_r_a_m_e_t_e_r is ** or @@, the value sub- - stituted is the number of positional parameters. If _p_a_r_a_m_e_t_e_r + PPaarraammeetteerr lleennggtthh. The length in characters of the value of _p_a_- + _r_a_m_e_t_e_r is substituted. If _p_a_r_a_m_e_t_e_r is ** or @@, the value sub- + stituted is the number of positional parameters. If _p_a_r_a_m_e_t_e_r is an array name subscripted by ** or @@, the value substituted is the number of elements in the array. If _p_a_r_a_m_e_t_e_r is an indexed - array name subscripted by a negative number, that number is in- - terpreted as relative to one greater than the maximum index of - _p_a_r_a_m_e_t_e_r, so negative indices count back from the end of the + array name subscripted by a negative number, that number is in- + terpreted as relative to one greater than the maximum index of + _p_a_r_a_m_e_t_e_r, so negative indices count back from the end of the array, and an index of -1 references the last element. ${_p_a_r_a_m_e_t_e_r##_w_o_r_d} @@ -1852,29 +1854,29 @@ EEXXPPAANNSSIIOONN tteerrnn MMaattcchhiinngg below. If the pattern matches the beginning of the value of _p_a_r_a_m_e_t_e_r, then the result of the expansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest matching pattern - (the ``##'' case) or the longest matching pattern (the ``####'' - case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern removal op- - eration is applied to each positional parameter in turn, and the - expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is an array vari- - able subscripted with @@ or **, the pattern removal operation is - applied to each member of the array in turn, and the expansion - is the resultant list. + (the "#" case) or the longest matching pattern (the "##" case) + deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern removal operation + is applied to each positional parameter in turn, and the expan- + sion is the resultant list. If _p_a_r_a_m_e_t_e_r is an array variable + subscripted with @@ or **, the pattern removal operation is ap- + plied to each member of the array in turn, and the expansion is + the resultant list. ${_p_a_r_a_m_e_t_e_r%%_w_o_r_d} ${_p_a_r_a_m_e_t_e_r%%%%_w_o_r_d} RReemmoovvee mmaattcchhiinngg ssuuffffiixx ppaatttteerrnn. The _w_o_r_d is expanded to produce a pattern just as in pathname expansion, and matched against the expanded value of _p_a_r_a_m_e_t_e_r using the rules described under PPaatt-- - tteerrnn MMaattcchhiinngg below. If the pattern matches a trailing portion - of the expanded value of _p_a_r_a_m_e_t_e_r, then the result of the ex- - pansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest - matching pattern (the ``%%'' case) or the longest matching pat- - tern (the ``%%%%'' case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the - pattern removal operation is applied to each positional parame- - ter in turn, and the expansion is the resultant list. If _p_a_r_a_m_- - _e_t_e_r is an array variable subscripted with @@ or **, the pattern - removal operation is applied to each member of the array in - turn, and the expansion is the resultant list. + tteerrnn MMaattcchhiinngg below. If the pattern matches a trailing portion + of the expanded value of _p_a_r_a_m_e_t_e_r, then the result of the ex- + pansion is the expanded value of _p_a_r_a_m_e_t_e_r with the shortest + matching pattern (the "%" case) or the longest matching pattern + (the "%%" case) deleted. If _p_a_r_a_m_e_t_e_r is @@ or **, the pattern + removal operation is applied to each positional parameter in + turn, and the expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is + an array variable subscripted with @@ or **, the pattern removal + operation is applied to each member of the array in turn, and + the expansion is the resultant list. ${_p_a_r_a_m_e_t_e_r//_p_a_t_t_e_r_n//_s_t_r_i_n_g} ${_p_a_r_a_m_e_t_e_r////_p_a_t_t_e_r_n//_s_t_r_i_n_g} @@ -1887,10 +1889,10 @@ EEXXPPAANNSSIIOONN able expansion, arithmetic expansion, command and process sub- stitution, and quote removal. The match is performed using the rules described under PPaatttteerrnn MMaattcchhiinngg below. In the first form - above, only the first match is replaced. If there are two + above, only the first match is replaced. If there are two slashes separating _p_a_r_a_m_e_t_e_r and _p_a_t_t_e_r_n (the second form - above), all matches of _p_a_t_t_e_r_n are replaced with _s_t_r_i_n_g. If - _p_a_t_t_e_r_n is preceded by ## (the third form above), it must match + above), all matches of _p_a_t_t_e_r_n are replaced with _s_t_r_i_n_g. If + _p_a_t_t_e_r_n is preceded by ## (the third form above), it must match at the beginning of the expanded value of _p_a_r_a_m_e_t_e_r. If _p_a_t_t_e_r_n is preceded by %% (the fourth form above), it must match at the end of the expanded value of _p_a_r_a_m_e_t_e_r. If the expansion of @@ -1898,8 +1900,8 @@ EEXXPPAANNSSIIOONN null, matches of _p_a_t_t_e_r_n are deleted and the // following _p_a_t_t_e_r_n may be omitted. - If the ppaattssuubb__rreeppllaacceemmeenntt shell option is enabled using sshhoopptt, - any unquoted instances of && in _s_t_r_i_n_g are replaced with the + If the ppaattssuubb__rreeppllaacceemmeenntt shell option is enabled using sshhoopptt, + any unquoted instances of && in _s_t_r_i_n_g are replaced with the matching portion of _p_a_t_t_e_r_n. Quoting any part of _s_t_r_i_n_g inhibits replacement in the expansion @@ -1932,20 +1934,20 @@ EEXXPPAANNSSIIOONN CCaassee mmooddiiffiiccaattiioonn. This expansion modifies the case of alpha- betic characters in _p_a_r_a_m_e_t_e_r. The _p_a_t_t_e_r_n is expanded to pro- duce a pattern just as in pathname expansion. Each character in - the expanded value of _p_a_r_a_m_e_t_e_r is tested against _p_a_t_t_e_r_n, and, - if it matches the pattern, its case is converted. The pattern - should not attempt to match more than one character. The ^^ op- + the expanded value of _p_a_r_a_m_e_t_e_r is tested against _p_a_t_t_e_r_n, and, + if it matches the pattern, its case is converted. The pattern + should not attempt to match more than one character. The ^^ op- erator converts lowercase letters matching _p_a_t_t_e_r_n to uppercase; the ,, operator converts matching uppercase letters to lowercase. - The ^^^^ and ,,,, expansions convert each matched character in the - expanded value; the ^^ and ,, expansions match and convert only - the first character in the expanded value. If _p_a_t_t_e_r_n is omit- - ted, it is treated like a ??, which matches every character. If - _p_a_r_a_m_e_t_e_r is @@ or **, the case modification operation is applied - to each positional parameter in turn, and the expansion is the - resultant list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted - with @@ or **, the case modification operation is applied to each - member of the array in turn, and the expansion is the resultant + The ^^^^ and ,,,, expansions convert each matched character in the + expanded value; the ^^ and ,, expansions match and convert only + the first character in the expanded value. If _p_a_t_t_e_r_n is omit- + ted, it is treated like a ??, which matches every character. If + _p_a_r_a_m_e_t_e_r is @@ or **, the case modification operation is applied + to each positional parameter in turn, and the expansion is the + resultant list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted + with @@ or **, the case modification operation is applied to each + member of the array in turn, and the expansion is the resultant list. ${_p_a_r_a_m_e_t_e_r@@_o_p_e_r_a_t_o_r} @@ -1960,33 +1962,33 @@ EEXXPPAANNSSIIOONN uu The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r with the first character converted to uppercase, if it is alphabetic. - LL The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r - with uppercase alphabetic characters converted to lower- + LL The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + with uppercase alphabetic characters converted to lower- case. - QQ The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + QQ The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r quoted in a format that can be reused as input. - EE The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r - with backslash escape sequences expanded as with the - $$''......'' quoting mechanism. + EE The expansion is a string that is the value of _p_a_r_a_m_e_t_e_r + with backslash escape sequences expanded as with the + $$''...'' quoting mechanism. PP The expansion is a string that is the result of expanding the value of _p_a_r_a_m_e_t_e_r as if it were a prompt string (see PPRROOMMPPTTIINNGG below). - AA The expansion is a string in the form of an assignment - statement or ddeeccllaarree command that, if evaluated, will + AA The expansion is a string in the form of an assignment + statement or ddeeccllaarree command that, if evaluated, will recreate _p_a_r_a_m_e_t_e_r with its attributes and value. - KK Produces a possibly-quoted version of the value of _p_a_r_a_m_- - _e_t_e_r, except that it prints the values of indexed and as- - sociative arrays as a sequence of quoted key-value pairs - (see AArrrraayyss above). - aa The expansion is a string consisting of flag values rep- + KK Produces a possibly-quoted version of the value of _p_a_r_a_- + _m_e_t_e_r, except that it prints the values of indexed and + associative arrays as a sequence of quoted key-value + pairs (see AArrrraayyss above). + aa The expansion is a string consisting of flag values rep- resenting _p_a_r_a_m_e_t_e_r's attributes. - kk Like the K transformation, but expands the keys and val- - ues of indexed and associative arrays to separate words + kk Like the K transformation, but expands the keys and val- + ues of indexed and associative arrays to separate words after word splitting. - If _p_a_r_a_m_e_t_e_r is @@ or **, the operation is applied to each posi- - tional parameter in turn, and the expansion is the resultant - list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted with @@ or + If _p_a_r_a_m_e_t_e_r is @@ or **, the operation is applied to each posi- + tional parameter in turn, and the expansion is the resultant + list. If _p_a_r_a_m_e_t_e_r is an array variable subscripted with @@ or **, the operation is applied to each member of the array in turn, and the expansion is the resultant list. @@ -2022,26 +2024,26 @@ EEXXPPAANNSSIIOONN tures its output, again with trailing newlines removed. The character _c following the open brace must be a space, tab, newline, - or ||, and the close brace must be in a position where a reserved word - may appear (i.e., preceded by a command terminator such as semicolon). + or ||, and the close brace must be in a position where a reserved word + may appear (i.e., preceded by a command terminator such as semicolon). BBaasshh allows the close brace to be joined to the remaining characters in the word without being followed by a shell metacharacter as a reserved word would usually require. Any side effects of _c_o_m_m_a_n_d take effect immediately in the current exe- - cution environment and persist in the current environment after the + cution environment and persist in the current environment after the command completes (e.g., the eexxiitt builtin will exit the shell). - This type of command substitution superficially resembles executing an - unnamed shell function: local variables are created as when a shell - function is executing, and the rreettuurrnn builtin forces _c_o_m_m_a_n_d to com- - plete; however, the rest of the execution environment, including the + This type of command substitution superficially resembles executing an + unnamed shell function: local variables are created as when a shell + function is executing, and the rreettuurrnn builtin forces _c_o_m_m_a_n_d to com- + plete; however, the rest of the execution environment, including the positional parameters, is shared with the caller. - If the first character following the open brace is a ||, the construct - expands to the value of the RREEPPLLYY shell variable after _c_o_m_m_a_n_d exe- - cutes, without removing any trailing newlines, and the standard output - of _c_o_m_m_a_n_d remains the same as in the calling shell. BBaasshh creates RREE-- + If the first character following the open brace is a ||, the construct + expands to the value of the RREEPPLLYY shell variable after _c_o_m_m_a_n_d exe- + cutes, without removing any trailing newlines, and the standard output + of _c_o_m_m_a_n_d remains the same as in the calling shell. BBaasshh creates RREE-- PPLLYY as an initially-unset local variable when _c_o_m_m_a_n_d executes, and re- stores RREEPPLLYY to the value it had before the command substitution after _c_o_m_m_a_n_d completes, as with any local variable. @@ -2061,8 +2063,8 @@ EEXXPPAANNSSIIOONN The _e_x_p_r_e_s_s_i_o_n undergoes the same expansions as if it were within dou- ble quotes, but double quote characters in _e_x_p_r_e_s_s_i_o_n are not treated - specially and are removed. All tokens in the expression undergo param- - eter and variable expansion, command substitution, and quote removal. + specially and are removed. All tokens in the expression undergo para- + meter and variable expansion, command substitution, and quote removal. The result is treated as the arithmetic expression to be evaluated. Arithmetic expansions may be nested. @@ -2071,9 +2073,9 @@ EEXXPPAANNSSIIOONN indicating failure and no substitution occurs. PPrroocceessss SSuubbssttiittuuttiioonn - _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n allows a process's input or output to be referred - to using a filename. It takes the form of <<((_l_i_s_t)) or >>((_l_i_s_t)). The - process _l_i_s_t is run asynchronously, and its input or output appears as + _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n allows a process's input or output to be referred + to using a filename. It takes the form of <<((_l_i_s_t)) or >>((_l_i_s_t)). The + process _l_i_s_t is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current com- mand as the result of the expansion. If the >>((_l_i_s_t)) form is used, writing to the file will provide input for _l_i_s_t. If the <<((_l_i_s_t)) form @@ -2081,17 +2083,17 @@ EEXXPPAANNSSIIOONN output of _l_i_s_t. Process substitution is supported on systems that sup- port named pipes (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. - When available, process substitution is performed simultaneously with - parameter and variable expansion, command substitution, and arithmetic + When available, process substitution is performed simultaneously with + parameter and variable expansion, command substitution, and arithmetic expansion. WWoorrdd SSpplliittttiinngg - The shell scans the results of parameter expansion, command substitu- - tion, and arithmetic expansion that did not occur within double quotes + The shell scans the results of parameter expansion, command substitu- + tion, and arithmetic expansion that did not occur within double quotes for _w_o_r_d _s_p_l_i_t_t_i_n_g. - The shell treats each character of IIFFSS as a delimiter, and splits the - results of the other expansions into words using these characters as + The shell treats each character of IIFFSS as a delimiter, and splits the + results of the other expansions into words using these characters as field terminators. If IIFFSS is unset, or its value is exactly <><><>, the de- @@ -2116,8 +2118,8 @@ EEXXPPAANNSSIIOONN ter with no value is expanded within double quotes, a null argument re- sults and is retained and passed to a command as an empty string. When a quoted null argument appears as part of a word whose expansion is - non-null, the null argument is removed. That is, the word -d'' becomes - -d after word splitting and null argument removal. + non-null, the null argument is removed. That is, the word "-d''" be- + comes "-d" after word splitting and null argument removal. Note that if no expansion occurs, no splitting is performed. @@ -2125,44 +2127,42 @@ EEXXPPAANNSSIIOONN After word splitting, unless the --ff option has been set, bbaasshh scans each word for the characters **, ??, and [[. If one of these characters appears, and is not quoted, then the word is regarded as a _p_a_t_t_e_r_n, and - replaced with an alphabetically sorted list of filenames matching the - pattern (see PPaatttteerrnn MMaattcchhiinngg below). If no matching filenames are - found, and the shell option nnuullllgglloobb is not enabled, the word is left - unchanged. If the nnuullllgglloobb option is set, and no matches are found, - the word is removed. If the ffaaiillgglloobb shell option is set, and no - matches are found, an error message is printed and the command is not + replaced with an alphabetically sorted list of filenames matching the + pattern (see PPaatttteerrnn MMaattcchhiinngg below). If no matching filenames are + found, and the shell option nnuullllgglloobb is not enabled, the word is left + unchanged. If the nnuullllgglloobb option is set, and no matches are found, + the word is removed. If the ffaaiillgglloobb shell option is set, and no + matches are found, an error message is printed and the command is not executed. If the shell option nnooccaasseegglloobb is enabled, the match is per- formed without regard to the case of alphabetic characters. When a - pattern is used for pathname expansion, the character ````..'''' at the - start of a name or immediately following a slash must be matched ex- - plicitly, unless the shell option ddoottgglloobb is set. In order to match - the filenames ````..'''' and ````....'''', the pattern must begin with ``.'' (for - example, ``.?''), even if ddoottgglloobb is set. If the gglloobbsskkiippddoottss shell - option is enabled, the filenames ````..'''' and ````....'''' are never matched, - even if the pattern begins with a ````..''''. When not matching pathnames, - the ````..'''' character is not treated specially. When matching a path- - name, the slash character must always be matched explicitly by a slash - in the pattern, but in other matching contexts it can be matched by a - special pattern character as described below under PPaatttteerrnn MMaattcchhiinngg. - See the description of sshhoopptt below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for a - description of the nnooccaasseegglloobb, nnuullllgglloobb, gglloobbsskkiippddoottss, ffaaiillgglloobb, and - ddoottgglloobb shell options. - - The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file - names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file - name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed - from the list of matches. If the nnooccaasseegglloobb option is set, the match- - ing against the patterns in GGLLOOBBIIGGNNOORREE is performed without regard to - case. The filenames ````..'''' and ````....'''' are always ignored when GGLLOOBBIIGG-- - NNOORREE is set and not null. However, setting GGLLOOBBIIGGNNOORREE to a non-null - value has the effect of enabling the ddoottgglloobb shell option, so all other - filenames beginning with a ````..'''' will match. To get the old behavior - of ignoring filenames beginning with a ````..'''', make ````..**'''' one of the - patterns in GGLLOOBBIIGGNNOORREE. The ddoottgglloobb option is disabled when GGLLOOBBIIGGNNOORREE - is unset. The pattern matching honors the setting of the eexxttgglloobb shell - option. - - The GGLLOOBBSSOORRTT variable controls how the results of pathname expansion + pattern is used for pathname expansion, the character "." at the start + of a name or immediately following a slash must be matched explicitly, + unless the shell option ddoottgglloobb is set. In order to match the file- + names "." and "..", the pattern must begin with "." (for example, + ".?"), even if ddoottgglloobb is set. If the gglloobbsskkiippddoottss shell option is en- + abled, the filenames "." and ".." never match, even if the pattern be- + gins with a "." When not matching pathnames, the "." character is not + treated specially. When matching a pathname, the slash character must + always be matched explicitly by a slash in the pattern, but in other + matching contexts it can be matched by a special pattern character as + described below under PPaatttteerrnn MMaattcchhiinngg. See the description of sshhoopptt + below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS for a description of the nnooccaasseegglloobb, + nnuullllgglloobb, gglloobbsskkiippddoottss, ffaaiillgglloobb, and ddoottgglloobb shell options. + + The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file + names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file + name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed + from the list of matches. If the nnooccaasseegglloobb option is set, the match- + ing against the patterns in GGLLOOBBIIGGNNOORREE is performed without regard to + case. The filenames "." and ".." are always ignored when GGLLOOBBIIGGNNOORREE is + set and not null. However, setting GGLLOOBBIIGGNNOORREE to a non-null value has + the effect of enabling the ddoottgglloobb shell option, so all other filenames + beginning with a Q . will match. To get the old behavior of ignoring + filenames beginning with a ".", make ".*" one of the patterns in GGLLOO-- + BBIIGGNNOORREE. The ddoottgglloobb option is disabled when GGLLOOBBIIGGNNOORREE is unset. The + pattern matching honors the setting of the eexxttgglloobb shell option. + + The GGLLOOBBSSOORRTT variable controls how the results of pathname expansion are sorted, as described above. PPaatttteerrnn MMaattcchhiinngg @@ -2183,36 +2183,38 @@ EEXXPPAANNSSIIOONN adjacent **s will match only directories and subdirecto- ries. ?? Matches any single character. - [[......]] Matches any one of the enclosed characters. A pair of + [[...]] Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a _r_a_n_g_e _e_x_p_r_e_s_- _s_i_o_n; any character that falls between those two charac- ters, inclusive, using the current locale's collating se- quence and character set, is matched. If the first char- acter following the [[ is a !! or a ^^ then any character not enclosed is matched. The sorting order of characters - in range expressions, and the characters included in the - range, are determined by the current locale and the val- - ues of the LLCC__CCOOLLLLAATTEE or LLCC__AALLLL shell variables, if set. + in range expressions, and the characters included in the + range, are determined by the current locale and the val- + ues of the LLCC__CCOOLLLLAATTEE or LLCC__AALLLL shell variables, if set. To obtain the traditional interpretation of range expres- sions, where [[aa--dd]] is equivalent to [[aabbccdd]], set value of the LLCC__AALLLL shell variable to CC, or enable the gglloobbaassccii-- iirraannggeess shell option. A -- may be matched by including it - as the first or last character in the set. A ]] may be - matched by including it as the first character in the + as the first or last character in the set. A ]] may be + matched by including it as the first character in the set. - Within [[ and ]], _c_h_a_r_a_c_t_e_r _c_l_a_s_s_e_s can be specified using + Within [[ and ]], _c_h_a_r_a_c_t_e_r _c_l_a_s_s_e_s can be specified using the syntax [[::_c_l_a_s_s::]], where _c_l_a_s_s is one of the following classes defined in the POSIX standard: + aallnnuumm aallpphhaa aasscciiii bbllaannkk ccnnttrrll ddiiggiitt ggrraapphh lloowweerr pprriinntt ppuunncctt ssppaaccee uuppppeerr wwoorrdd xxddiiggiitt + A character class matches any character belonging to that class. The wwoorrdd character class matches letters, digits, and the character _. Within [[ and ]], an _e_q_u_i_v_a_l_e_n_c_e _c_l_a_s_s can be specified us- - ing the syntax [[==_c==]], which matches all characters with - the same collation weight (as defined by the current lo- + ing the syntax [[==_c==]], which matches all characters with + the same collation weight (as defined by the current lo- cale) as the character _c. Within [[ and ]], the syntax [[.._s_y_m_b_o_l..]] matches the collat- @@ -2221,7 +2223,7 @@ EEXXPPAANNSSIIOONN If the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, the shell recognizes several extended pattern matching operators. In the following description, a _p_a_t_t_e_r_n_-_l_i_s_t is a list of one or more patterns - separated by a ||. Composite patterns may be formed using one or more + separated by a ||. Composite patterns may be formed using one or more of the following sub-patterns: ??((_p_a_t_t_e_r_n_-_l_i_s_t)) @@ -2242,12 +2244,12 @@ EEXXPPAANNSSIIOONN terns, including shell functions and command substitutions. When matching filenames, the ddoottgglloobb shell option determines the set of - filenames that are tested: when ddoottgglloobb is enabled, the set of file- - names includes all files beginning with ``.'', but ``.'' and ``..'' - must be matched by a pattern or sub-pattern that begins with a dot; - when it is disabled, the set does not include any filenames beginning - with ``.'' unless the pattern or sub-pattern begins with a ``.''. As - above, ``.'' only has a special meaning when matching filenames. + filenames that are tested: when ddoottgglloobb is enabled, the set of file- + names includes all files beginning with ".", but "." and ".." must be + matched by a pattern or sub-pattern that begins with a dot; when it is + disabled, the set does not include any filenames beginning with "." un- + less the pattern or sub-pattern begins with a ".". As above, "." only + has a special meaning when matching filenames. Complicated extended pattern matching against long strings is slow, es- pecially when the patterns contain alternations and the strings contain @@ -2256,54 +2258,54 @@ EEXXPPAANNSSIIOONN QQuuoottee RReemmoovvaall After the preceding expansions, all unquoted occurrences of the charac- - ters \\, '', and "" that did not result from one of the above expansions + ters \\, '', and "" that did not result from one of the above expansions are removed. RREEDDIIRREECCTTIIOONN - Before a command is executed, its input and output may be _r_e_d_i_r_e_c_t_e_d - using a special notation interpreted by the shell. _R_e_d_i_r_e_c_t_i_o_n allows - commands' file handles to be duplicated, opened, closed, made to refer + Before a command is executed, its input and output may be _r_e_d_i_r_e_c_t_e_d + using a special notation interpreted by the shell. _R_e_d_i_r_e_c_t_i_o_n allows + commands' file handles to be duplicated, opened, closed, made to refer to different files, and can change the files the command reads from and writes to. Redirection may also be used to modify file handles in the current shell execution environment. The following redirection opera- tors may precede or appear anywhere within a _s_i_m_p_l_e _c_o_m_m_a_n_d or may fol- - low a _c_o_m_m_a_n_d. Redirections are processed in the order they appear, + low a _c_o_m_m_a_n_d. Redirections are processed in the order they appear, from left to right. - Each redirection that may be preceded by a file descriptor number may + Each redirection that may be preceded by a file descriptor number may instead be preceded by a word of the form {_v_a_r_n_a_m_e}. In this case, for each redirection operator except >&- and <&-, the shell will allocate a - file descriptor greater than or equal to 10 and assign it to _v_a_r_n_a_m_e. - If >&- or <&- is preceded by {_v_a_r_n_a_m_e}, the value of _v_a_r_n_a_m_e defines - the file descriptor to close. If {_v_a_r_n_a_m_e} is supplied, the redirect- - ion persists beyond the scope of the command, allowing the shell pro- + file descriptor greater than or equal to 10 and assign it to _v_a_r_n_a_m_e. + If >&- or <&- is preceded by {_v_a_r_n_a_m_e}, the value of _v_a_r_n_a_m_e defines + the file descriptor to close. If {_v_a_r_n_a_m_e} is supplied, the redirec- + tion persists beyond the scope of the command, allowing the shell pro- grammer to manage the file descriptor's lifetime manually. The vvaarrrreeddiirr__cclloossee shell option manages this behavior. - In the following descriptions, if the file descriptor number is omit- - ted, and the first character of the redirection operator is <<, the re- - direction refers to the standard input (file descriptor 0). If the - first character of the redirection operator is >>, the redirection + In the following descriptions, if the file descriptor number is omit- + ted, and the first character of the redirection operator is <<, the + redirection refers to the standard input (file descriptor 0). If the + first character of the redirection operator is >>, the redirection refers to the standard output (file descriptor 1). - The word following the redirection operator in the following descrip- - tions, unless otherwise noted, is subjected to brace expansion, tilde - expansion, parameter and variable expansion, command substitution, - arithmetic expansion, quote removal, pathname expansion, and word + The word following the redirection operator in the following descrip- + tions, unless otherwise noted, is subjected to brace expansion, tilde + expansion, parameter and variable expansion, command substitution, + arithmetic expansion, quote removal, pathname expansion, and word splitting. If it expands to more than one word, bbaasshh reports an error. - Note that the order of redirections is significant. For example, the + Note that the order of redirections is significant. For example, the command ls >> dirlist 2>>&&1 - directs both standard output and standard error to the file _d_i_r_l_i_s_t, + directs both standard output and standard error to the file _d_i_r_l_i_s_t, while the command ls 2>>&&1 >> dirlist - directs only the standard output to file _d_i_r_l_i_s_t, because the standard - error was duplicated from the standard output before the standard out- + directs only the standard output to file _d_i_r_l_i_s_t, because the standard + error was duplicated from the standard output before the standard out- put was redirected to _d_i_r_l_i_s_t. BBaasshh handles several filenames specially when they are used in redirec- @@ -2323,7 +2325,7 @@ RREEDDIIRREECCTTIIOONN File descriptor 2 is duplicated. //ddeevv//ttccpp//_h_o_s_t//_p_o_r_t If _h_o_s_t is a valid hostname or Internet address, and _p_o_r_t - is an integer port number or service name, bbaasshh attempts + is an integer port number or service name, bbaasshh attempts to open the corresponding TCP socket. //ddeevv//uuddpp//_h_o_s_t//_p_o_r_t If _h_o_s_t is a valid hostname or Internet address, and _p_o_r_t @@ -2338,7 +2340,7 @@ RREEDDIIRREECCTTIIOONN RReeddiirreeccttiinngg IInnppuutt Redirection of input causes the file whose name results from the expan- - sion of _w_o_r_d to be opened for reading on file descriptor _n, or the + sion of _w_o_r_d to be opened for reading on file descriptor _n, or the standard input (file descriptor 0) if _n is not specified. The general format for redirecting input is: @@ -2346,8 +2348,8 @@ RREEDDIIRREECCTTIIOONN [_n]<<_w_o_r_d RReeddiirreeccttiinngg OOuuttppuutt - Redirection of output causes the file whose name results from the ex- - pansion of _w_o_r_d to be opened for writing on file descriptor _n, or the + Redirection of output causes the file whose name results from the ex- + pansion of _w_o_r_d to be opened for writing 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; if it does exist it is truncated to zero size. @@ -2360,11 +2362,11 @@ RREEDDIIRREECCTTIIOONN builtin has been enabled, the redirection will fail 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, the re- - direction is attempted even if the file named by _w_o_r_d exists. + the nnoocclloobbbbeerr option to the sseett builtin command is not enabled, the + redirection is attempted even if the file named by _w_o_r_d exists. AAppppeennddiinngg RReeddiirreecctteedd OOuuttppuutt - Redirection of output in this fashion causes the file whose name re- + Redirection of output in this fashion causes the file whose name re- sults from the expansion of _w_o_r_d to be opened for appending on file de- scriptor _n, or the standard output (file descriptor 1) if _n is not specified. If the file does not exist it is created. @@ -2390,13 +2392,13 @@ RREEDDIIRREECCTTIIOONN >>_w_o_r_d 2>>&&1 - When using the second form, _w_o_r_d may not expand to a number or --. If - it does, other redirection operators apply (see DDuupplliiccaattiinngg FFiillee DDee-- + When using the second form, _w_o_r_d may not expand to a number or --. If + it does, other redirection operators apply (see DDuupplliiccaattiinngg FFiillee DDee-- ssccrriippttoorrss below) for compatibility reasons. AAppppeennddiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr - This construct allows both the standard output (file descriptor 1) and - the standard error output (file descriptor 2) to be appended to the + This construct allows both the standard output (file descriptor 1) and + the standard error output (file descriptor 2) to be appended to the file whose name is the expansion of _w_o_r_d. The format for appending standard output and standard error is: @@ -2410,10 +2412,10 @@ RREEDDIIRREECCTTIIOONN (see DDuupplliiccaattiinngg FFiillee DDeessccrriippttoorrss below). HHeerree DDooccuummeennttss - This type of redirection instructs the shell to read input from the + This type of redirection instructs the shell to read input from the current source until it reads a line containing only _d_e_l_i_m_i_t_e_r (with no trailing blanks). All of the lines read up to that point are then used - as the standard input (or file descriptor _n if _n is specified) for a + as the standard input (or file descriptor _n if _n is specified) for a command. The format of here-documents is: @@ -2422,19 +2424,19 @@ RREEDDIIRREECCTTIIOONN _h_e_r_e_-_d_o_c_u_m_e_n_t _d_e_l_i_m_i_t_e_r - No parameter and variable expansion, command substitution, arithmetic + No parameter and variable expansion, command substitution, arithmetic expansion, or pathname expansion is performed on _w_o_r_d. If any part of _w_o_r_d is quoted, the _d_e_l_i_m_i_t_e_r is the result of quote re- moval on _w_o_r_d, and the lines in the here-document are not expanded. If - _w_o_r_d is unquoted, the _d_e_l_i_m_i_t_e_r is _w_o_r_d itself, all lines of the here- - document are subjected to parameter expansion, command substitution, + _w_o_r_d is unquoted, the _d_e_l_i_m_i_t_e_r is _w_o_r_d itself, all lines of the here- + document are subjected to parameter expansion, command substitution, and arithmetic expansion, the character sequence \\<> is ignored, and \\ must be used to quote the characters \\, $$, and ``. If the redirection operator is <<<<--, then all leading tab characters are - stripped from input lines and the line containing _d_e_l_i_m_i_t_e_r. This al- - lows here-documents within shell scripts to be indented in a natural + stripped from input lines and the line containing _d_e_l_i_m_i_t_e_r. This al- + lows here-documents within shell scripts to be indented in a natural fashion. HHeerree SSttrriinnggss @@ -2442,9 +2444,9 @@ RREEDDIIRREECCTTIIOONN [_n]<<<<<<_w_o_r_d - The _w_o_r_d undergoes tilde expansion, parameter and variable expansion, - command substitution, arithmetic expansion, and quote removal. Path- - name expansion and word splitting are not performed. The result is + The _w_o_r_d undergoes tilde expansion, parameter and variable expansion, + command substitution, arithmetic expansion, and quote removal. Path- + name expansion and word splitting are not performed. The result is supplied as a single string, with a newline appended, to the command on its standard input (or file descriptor _n if _n is specified). @@ -2454,8 +2456,8 @@ RREEDDIIRREECCTTIIOONN [_n]<<&&_w_o_r_d is used to duplicate input file descriptors. If _w_o_r_d expands to one or - more digits, the file descriptor denoted by _n is made to be a copy of - that file descriptor. If the digits in _w_o_r_d do not specify a file de- + more digits, the file descriptor denoted by _n is made to be a copy of + that file descriptor. If the digits in _w_o_r_d do not specify a file de- scriptor open for input, a redirection error occurs. If _w_o_r_d evaluates to --, file descriptor _n is closed. If _n is not specified, the standard input (file descriptor 0) is used. @@ -2464,10 +2466,10 @@ RREEDDIIRREECCTTIIOONN [_n]>>&&_w_o_r_d - is used similarly to duplicate output file descriptors. If _n is not - specified, the standard output (file descriptor 1) is used. If the - digits in _w_o_r_d do not specify a file descriptor open for output, a re- - direction error occurs. If _w_o_r_d evaluates to --, file descriptor _n is + is used similarly to duplicate output file descriptors. If _n is not + specified, the standard output (file descriptor 1) is used. If the + digits in _w_o_r_d do not specify a file descriptor open for output, a + redirection error occurs. If _w_o_r_d evaluates to --, file descriptor _n is closed. As a special case, if _n is omitted, and _w_o_r_d does not expand to one or more digits or --, the standard output and standard error are redirected as described previously. @@ -2485,7 +2487,7 @@ RREEDDIIRREECCTTIIOONN [_n]>>&&_d_i_g_i_t-- - moves the file descriptor _d_i_g_i_t to file descriptor _n, or the standard + moves the file descriptor _d_i_g_i_t to file descriptor _n, or the standard output (file descriptor 1) if _n is not specified. OOppeenniinngg FFiillee DDeessccrriippttoorrss ffoorr RReeaaddiinngg aanndd WWrriittiinngg @@ -2493,20 +2495,20 @@ RREEDDIIRREECCTTIIOONN [_n]<<>>_w_o_r_d - causes the file whose name is the expansion of _w_o_r_d to be opened for - both reading and writing on file descriptor _n, or on file descriptor 0 + causes the file whose name is the expansion of _w_o_r_d to be opened for + both reading and writing on file descriptor _n, or on file descriptor 0 if _n is not specified. If the file does not exist, it is created. AALLIIAASSEESS - _A_l_i_a_s_e_s allow a string to be substituted for a word that is in a posi- - tion in the input where it can be the first word of a simple command. - Aliases have names and corresponding values that are set and unset us- - ing the aalliiaass and uunnaalliiaass builtin commands (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS + _A_l_i_a_s_e_s allow a string to be substituted for a word that is in a posi- + tion in the input where it can be the first word of a simple command. + Aliases have names and corresponding values that are set and unset us- + ing the aalliiaass and uunnaalliiaass builtin commands (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - If the shell reads an unquoted word in the right position, it checks - the word to see if it matches an alias name. If it matches, the shell - replaces the word with the alias value, and reads that value as if it + If the shell reads an unquoted word in the right position, it checks + the word to see if it matches an alias name. If it matches, the shell + replaces the word with the alias value, and reads that value as if it had been read instead of the word. The shell doesn't look at any char- acters following the word before attempting alias substitution. @@ -2554,9 +2556,9 @@ FFUUNNCCTTIIOONNSS stores a series of commands for later execution. When the name of a shell function is used as a simple command name, the list of commands associated with that function name is executed. Functions are executed - in the context of the current shell; no new process is created to in- - terpret them (contrast this with the execution of a shell script). - When a function is executed, the arguments to the function become the + in the context of the current shell; no new process is created to in- + terpret them (contrast this with the execution of a shell script). + When a function is executed, the arguments to the function become the positional parameters during its execution. The special parameter ## is updated to reflect the change. Special parameter 00 is unchanged. The first element of the FFUUNNCCNNAAMMEE variable is set to the name of the func- @@ -2596,12 +2598,12 @@ FFUUNNCCTTIIOONNSS values are a result of the sequence of function calls that caused exe- cution to reach the current function. The value of a variable that a function sees depends on its value within its caller, if any, whether - that caller is the "global" scope or another shell function. This is - also the value that a local variable declaration "shadows", and the - value that is restored when the function returns. + that caller is the global scope or another shell function. This is + also the value that a local variable declaration shadows, and the value + that is restored when the function returns. - For example, if a variable _v_a_r is declared as local in function _f_u_n_c_1, - and _f_u_n_c_1 calls another function _f_u_n_c_2, references to _v_a_r made from + For example, if a variable _v_a_r is declared as local in function _f_u_n_c_1, + and _f_u_n_c_1 calls another function _f_u_n_c_2, references to _v_a_r made from within _f_u_n_c_2 will resolve to the local variable _v_a_r from _f_u_n_c_1, shadow- ing any global variable named _v_a_r. @@ -2612,16 +2614,16 @@ FFUUNNCCTTIIOONNSS main so (appearing as unset) until it is reset in that scope or until the function returns. Once the function returns, any instance of the variable at a previous scope will become 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 lloo-- + 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 lloo-- ccaallvvaarr__uunnsseett shell option changes this behavior). - The FFUUNNCCNNEESSTT variable, if set to a numeric value greater than 0, de- - fines a maximum function nesting level. Function invocations that ex- + The FFUUNNCCNNEESSTT variable, if set to a numeric value greater than 0, de- + fines a maximum function nesting level. Function invocations that ex- ceed the limit cause the entire command to abort. - If the builtin command rreettuurrnn is executed in a function, the function - completes and execution resumes with the next command after the func- + If the builtin command rreettuurrnn is executed in a function, the function + completes and execution resumes with the next command after the func- tion call. Any command associated with the RREETTUURRNN trap is executed be- fore execution resumes. When a function completes, the values of the positional parameters and the special parameter ## are restored to the @@ -2629,15 +2631,15 @@ FFUUNNCCTTIIOONNSS Function names and definitions may be listed with the --ff option to the ddeeccllaarree or ttyyppeesseett builtin commands. The --FF option to ddeeccllaarree or ttyyppee-- - sseett will list the function names only (and optionally the source file - and line number, if the eexxttddeebbuugg shell option is enabled). Functions - may be exported so that child shell processes (those created when exe- - cuting a separate shell invocation) automatically have them defined + sseett will list the function names only (and optionally the source file + and line number, if the eexxttddeebbuugg shell option is enabled). Functions + may be exported so that child shell processes (those created when exe- + cuting a separate shell invocation) automatically have them defined with the --ff option to the eexxppoorrtt builtin. A function definition may be deleted using the --ff option to the uunnsseett builtin. Functions may be recursive. The FFUUNNCCNNEESSTT variable may be used to limit - the depth of the function call stack and restrict the number of func- + the depth of the function call stack and restrict the number of func- tion invocations. By default, no limit is imposed on the number of re- cursive calls. @@ -2645,9 +2647,9 @@ AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN The shell allows arithmetic expressions to be evaluated, under certain circumstances (see the lleett and ddeeccllaarree builtin commands, the (((( com- pound command, and AArriitthhmmeettiicc EExxppaannssiioonn). Evaluation is done in fixed- - width integers with no check for overflow, though division by 0 is - trapped and flagged as an error. The operators and their precedence, - associativity, and values are the same as in the C language. The fol- + width integers with no check for overflow, though division by 0 is + trapped and flagged as an error. The operators and their precedence, + associativity, and values are the same as in the C language. The fol- lowing list of operators is grouped into levels of equal-precedence op- erators. The levels are listed in order of decreasing precedence. @@ -2678,21 +2680,21 @@ AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN Shell variables are allowed as operands; parameter expansion is per- formed before the expression is evaluated. Within an expression, shell - variables may also be referenced by name without using the parameter - expansion syntax. A shell variable that is null or unset evaluates to + variables may also be referenced by name without using the parameter + expansion syntax. A shell variable that is null or unset evaluates to 0 when referenced by name without using the parameter expansion syntax. The value of a variable is evaluated as an arithmetic expression when it is referenced, or when a variable which has been given the _i_n_t_e_g_e_r attribute using ddeeccllaarree --ii is assigned a value. A null value evaluates - to 0. A shell variable need not have its _i_n_t_e_g_e_r attribute turned on + to 0. A shell variable need not have its _i_n_t_e_g_e_r attribute turned on to be used in an expression. Integer constants follow the C language definition, without suffixes or character constants. Constants with a leading 0 are interpreted as oc- - tal numbers. A leading 0x or 0X denotes hexadecimal. Otherwise, num- - bers take the form [_b_a_s_e_#]n, where the optional _b_a_s_e is a decimal num- - ber between 2 and 64 representing the arithmetic base, and _n is a num- - ber in that base. If _b_a_s_e_# is omitted, then base 10 is used. When + tal numbers. A leading 0x or 0X denotes hexadecimal. Otherwise, num- + bers take the form [_b_a_s_e_#]n, where the optional _b_a_s_e is a decimal num- + ber between 2 and 64 representing the arithmetic base, and _n is a num- + ber in that base. If _b_a_s_e_# is omitted, then base 10 is used. When specifying _n, if a non-digit is required, the digits greater than 9 are represented by the lowercase letters, the uppercase letters, @, and _, in that order. If _b_a_s_e is less than or equal to 36, lowercase and up- @@ -2713,8 +2715,8 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS Expressions are formed from the following unary or binary primaries. BBaasshh handles several filenames specially when they are used in expres- sions. If the operating system on which bbaasshh is running provides these - special files, bash will use them; otherwise it will emulate them in- - ternally with this behavior: If any _f_i_l_e argument to one of the pri- + special files, bash will use them; otherwise it will emulate them in- + ternally with this behavior: If any _f_i_l_e argument to one of the pri- maries is of the form _/_d_e_v_/_f_d_/_n, then file descriptor _n is checked. If the _f_i_l_e argument to one of the primaries is one of _/_d_e_v_/_s_t_d_i_n, _/_d_e_v_/_s_t_d_o_u_t, or _/_d_e_v_/_s_t_d_e_r_r, file descriptor 0, 1, or 2, respectively, @@ -2746,7 +2748,7 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS --hh _f_i_l_e True if _f_i_l_e exists and is a symbolic link. --kk _f_i_l_e - True if _f_i_l_e exists and its ``sticky'' bit is set. + True if _f_i_l_e exists and its "sticky" bit is set. --pp _f_i_l_e True if _f_i_l_e exists and is a named pipe (FIFO). --rr _f_i_l_e @@ -2789,10 +2791,10 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS value). If _v_a_r_n_a_m_e is an indexed array variable name sub- scripted by _@ or _*, this returns true if the array has any set elements. If _v_a_r_n_a_m_e is an associative array variable name sub- - scripted by _@ or _*, this returns true if an element with that + scripted by _@ or _*, this returns true if an element with that key is set. --RR _v_a_r_n_a_m_e - True if the shell variable _v_a_r_n_a_m_e is set and is a name refer- + True if the shell variable _v_a_r_n_a_m_e is set and is a name refer- ence. --zz _s_t_r_i_n_g True if the length of _s_t_r_i_n_g is zero. @@ -2802,8 +2804,8 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS _s_t_r_i_n_g_1 ==== _s_t_r_i_n_g_2 _s_t_r_i_n_g_1 == _s_t_r_i_n_g_2 - True if the strings are equal. == should be used with the tteesstt - command for POSIX conformance. When used with the [[[[ command, + True if the strings are equal. == should be used with the tteesstt + command for POSIX conformance. When used with the [[[[ command, this performs pattern matching as described above (CCoommppoouunndd CCoomm-- mmaannddss). @@ -2827,23 +2829,23 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS SSIIMMPPLLEE CCOOMMMMAANNDD EEXXPPAANNSSIIOONN When a simple command is executed, the shell performs the following ex- - pansions, assignments, and redirections, from left to right, in the + pansions, assignments, and redirections, from left to right, in the following order. - 1. The words that the parser has marked as variable assignments - (those preceding the command name) and redirections are saved + 1. The words that the parser has marked as variable assignments + (those preceding the command name) and redirections are saved for later processing. - 2. The words that are not variable assignments or redirections are - expanded. If any words remain after expansion, the first word - is taken to be the name of the command and the remaining words + 2. The words that are not variable assignments or redirections are + expanded. If any words remain after expansion, the first word + is taken to be the name of the command and the remaining words are the arguments. 3. Redirections are performed as described above under RREEDDIIRREECCTTIIOONN. 4. The text after the == in each variable assignment undergoes tilde expansion, parameter expansion, command substitution, arithmetic - expansion, and quote removal before being assigned to the vari- + expansion, and quote removal before being assigned to the vari- able. If no command name results, the variable assignments affect the current @@ -2852,17 +2854,17 @@ SSIIMMPPLLEE CCOOMMMMAANNDD EEXXPPAANNSSIIOONN are performed before redirections. Otherwise, the variables are added to the environment of the executed command and do not affect the cur- rent shell environment. If any of the assignments attempts to assign a - value to a readonly variable, an error occurs, and the command exits + value to a readonly variable, an error occurs, and the command exits with a non-zero status. - If no command name results, redirections are performed, but do not af- - fect the current shell environment. A redirection error causes the + If no command name results, redirections are performed, but do not af- + fect the current shell environment. A redirection error causes the command to exit with a non-zero status. - If there is a command name left after expansion, execution proceeds as - described below. Otherwise, the command exits. If one of the expan- - sions contained a command substitution, the exit status of the command - is the exit status of the last command substitution performed. If + If there is a command name left after expansion, execution proceeds as + described below. Otherwise, the command exits. If one of the expan- + sions contained a command substitution, the exit status of the command + is the exit status of the last command substitution performed. If there were no command substitutions, the command exits with a status of zero. @@ -2880,14 +2882,14 @@ CCOOMMMMAANNDD EEXXEECCUUTTIIOONN If the name is neither a shell function nor a builtin, and contains no slashes, bbaasshh searches each element of the PPAATTHH for a directory con- taining an executable file by that name. BBaasshh uses a hash table to re- - member the full pathnames of executable files (see hhaasshh under SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A full search of the directories in PPAATTHH is - performed only if the command is not found in the hash table. If the + member the full pathnames of executable files (see hhaasshh under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A full search of the directories in PPAATTHH is + performed only if the command is not found in the hash table. If the search is unsuccessful, the shell searches for a defined shell function named ccoommmmaanndd__nnoott__ffoouunndd__hhaannddllee. If that function exists, it is invoked - in a separate execution environment with the original command and the - original command's arguments as its arguments, and the function's exit - status becomes the exit status of that subshell. If that function is + in a separate execution environment with the original command and the + original command's arguments as its arguments, and the function's exit + status becomes the exit status of that subshell. If that function is not defined, the shell prints an error message and returns an exit sta- tus of 127. @@ -2899,7 +2901,7 @@ CCOOMMMMAANNDD EEXXEECCUUTTIIOONN If this execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a _s_h_e_l_l _s_c_r_i_p_t, a file containing shell commands, and the shell creates a new instance of - itself to execute it. This subshell reinitializes itself, so that the + itself to execute it. This subshell reinitializes itself, so that the effect is as if a new shell had been invoked to handle the script, with the exception that the locations of commands remembered by the parent (see hhaasshh below under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS) are retained by the @@ -2931,33 +2933,32 @@ CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENN +o shell parameters that are set by variable assignment or with sseett or inherited from the shell's parent in the environment - +o shell functions defined during execution or inherited from the + +o shell functions defined during execution or inherited from the shell's parent in the environment - +o options enabled at invocation (either by default or with com- + +o options enabled at invocation (either by default or with com- mand-line arguments) or by sseett +o options enabled by sshhoopptt +o shell aliases defined with aalliiaass - +o various process IDs, including those of background jobs, the + +o various process IDs, including those of background jobs, the value of $$$$, and the value of PPPPIIDD - When a simple command other than a builtin or shell function is to be - executed, it is invoked in a separate execution environment that con- - sists of the following. Unless otherwise noted, the values are inher- + When a simple command other than a builtin or shell function is to be + executed, it is invoked in a separate execution environment that con- + sists of the following. Unless otherwise noted, the values are inher- ited from the shell. - - +o the shell's open files, plus any modifications and additions + +o the shell's open files, plus any modifications and additions specified by redirections to the command +o the current working directory +o the file creation mode mask - +o shell variables and functions marked for export, along with + +o shell variables and functions marked for export, along with variables exported for the command, passed in the environment +o traps caught by the shell are reset to the values inherited from @@ -2976,34 +2977,36 @@ CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENN executed in a subshell environment. Changes made to the subshell envi- ronment cannot affect the shell's execution environment. - Subshells spawned to execute command substitutions inherit the value of - the --ee option from the parent shell. When not in _p_o_s_i_x _m_o_d_e, bbaasshh - clears the --ee option in such subshells. + When the shell is in _p_o_s_i_x _m_o_d_e, subshells spawned to execute command + substitutions inherit the value of the --ee option from their parent + shell. When not in _p_o_s_i_x _m_o_d_e, bbaasshh clears the --ee option in such sub- + shells. See the description of the iinnhheerriitt__eerrrreexxiitt shell option below + for how to control this behavior when not in posix mode. If a command is followed by a && and job control is not active, the de- fault standard input for the command is the empty file _/_d_e_v_/_n_u_l_l. Oth- - erwise, the invoked command inherits the file descriptors of the call- + erwise, the invoked command inherits the file descriptors of the call- ing shell as modified by redirections. EENNVVIIRROONNMMEENNTT - When a program is invoked it is given an array of strings called the + When a program is invoked it is given an array of strings called the _e_n_v_i_r_o_n_m_e_n_t. This is a list of _n_a_m_e-_v_a_l_u_e pairs, of the form _n_a_m_e=_v_a_l_u_e. - The shell provides several ways to manipulate the environment. On in- - vocation, the shell scans its own environment and creates a parameter - for each name found, automatically marking it for _e_x_p_o_r_t to child pro- - cesses. Executed commands inherit the environment. The eexxppoorrtt and ddee-- - ccllaarree --xx commands allow parameters and functions to be added to and + The shell provides several ways to manipulate the environment. On in- + vocation, the shell scans its own environment and creates a parameter + for each name found, automatically marking it for _e_x_p_o_r_t to child + processes. Executed commands inherit the environment. The eexxppoorrtt and + ddeeccllaarree --xx commands allow parameters and functions to be added to and deleted from the environment. If the value of a parameter in the envi- ronment is modified, the new value becomes part of the environment, re- - placing the old. The environment inherited by any executed command - consists of the shell's initial environment, whose values may be modi- - fied in the shell, less any pairs removed by the uunnsseett command, plus + placing the old. The environment inherited by any executed command + consists of the shell's initial environment, whose values may be modi- + fied in the shell, less any pairs removed by the uunnsseett command, plus any additions via the eexxppoorrtt and ddeeccllaarree --xx commands. - The environment for any _s_i_m_p_l_e _c_o_m_m_a_n_d or function may be augmented - temporarily by prefixing it with parameter assignments, as described + The environment for any _s_i_m_p_l_e _c_o_m_m_a_n_d or function may be augmented + temporarily by prefixing it with parameter assignments, as described above in PPAARRAAMMEETTEERRSS. These assignment statements affect only the envi- ronment seen by that command. @@ -3016,7 +3019,7 @@ EENNVVIIRROONNMMEENNTT ment. EEXXIITT SSTTAATTUUSS - The exit status of an executed command is the value returned by the + The exit status of an executed command is the value returned by the _w_a_i_t_p_i_d system call or equivalent function. Exit statuses fall between 0 and 255, though, as explained below, the shell may use values above 125 specially. Exit statuses from shell builtins and compound commands @@ -3024,12 +3027,12 @@ EEXXIITT SSTTAATTUUSS will use special values to indicate specific failure modes. For the shell's purposes, a command which exits with a zero exit status - has succeeded. An exit status of zero indicates success. A non-zero - exit status indicates failure. When a command terminates on a fatal + has succeeded. An exit status of zero indicates success. A non-zero + exit status indicates failure. When a command terminates on a fatal signal _N, bbaasshh uses the value of 128+_N as the exit status. - If a command is not found, the child process created to execute it re- - turns a status of 127. If a command is found but is not executable, + If a command is not found, the child process created to execute it re- + turns a status of 127. If a command is found but is not executable, the return status is 126. If a command fails because of an error during expansion or redirection, @@ -3043,12 +3046,12 @@ EEXXIITT SSTTAATTUUSS The exit status of the last command is available in the special parame- ter $?. - BBaasshh itself returns the exit status of the last command executed, un- - less a syntax error occurs, in which case it exits with a non-zero + BBaasshh itself returns the exit status of the last command executed, un- + less a syntax error occurs, in which case it exits with a non-zero value. See also the eexxiitt builtin command below. SSIIGGNNAALLSS - When bbaasshh is interactive, in the absence of any traps, it ignores + When bbaasshh is interactive, in the absence of any traps, it ignores SSIIGGTTEERRMM (so that kkiillll 00 does not kill an interactive shell), and SSIIGGIINNTT is caught and handled (so that the wwaaiitt builtin is interruptible). In all cases, bbaasshh ignores SSIIGGQQUUIITT. If job control is in effect, bbaasshh ig- @@ -3056,38 +3059,38 @@ SSIIGGNNAALLSS Non-builtin commands run by bbaasshh have signal handlers set to the values inherited by the shell from its parent. When job control is not in ef- - fect, asynchronous commands ignore SSIIGGIINNTT and SSIIGGQQUUIITT in addition to - these inherited handlers. Commands run as a result of command substi- + fect, asynchronous commands ignore SSIIGGIINNTT and SSIIGGQQUUIITT in addition to + these inherited handlers. Commands run as a result of command substi- tution ignore the keyboard-generated job control signals SSIIGGTTTTIINN, SSIIGGTT-- TTOOUU, and SSIIGGTTSSTTPP. The shell exits by default upon receipt of a SSIIGGHHUUPP. Before exiting, an interactive shell resends the SSIIGGHHUUPP to all jobs, running or stopped. Stopped jobs are sent SSIIGGCCOONNTT to ensure that they receive the - SSIIGGHHUUPP. To prevent the shell from sending the signal to a particular - job, it should be removed from the jobs table with the ddiissoowwnn builtin - (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) or marked to not receive SSIIGGHHUUPP us- + SSIIGGHHUUPP. To prevent the shell from sending the signal to a particular + job, it should be removed from the jobs table with the ddiissoowwnn builtin + (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) or marked to not receive SSIIGGHHUUPP us- ing ddiissoowwnn --hh. - If the hhuuppoonneexxiitt shell option has been set with sshhoopptt, bbaasshh sends a + If the hhuuppoonneexxiitt shell option has been set with sshhoopptt, bbaasshh sends a SSIIGGHHUUPP to all jobs when an interactive login shell exits. - If bbaasshh is waiting for a command to complete and receives a signal for + If bbaasshh is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the com- mand completes. When bbaasshh is waiting for an asynchronous command via the wwaaiitt builtin, the reception of a signal for which a trap has been set will cause the wwaaiitt builtin to return immediately with an exit sta- tus greater than 128, immediately after which the trap is executed. - When job control is not enabled, and bbaasshh is waiting for a foreground + When job control is not enabled, and bbaasshh is waiting for a foreground command to complete, the shell receives keyboard-generated signals such as SSIIGGIINNTT (usually generated by ^^CC) that users commonly intend to send to that command. This happens because the shell and the command are in - the same process group as the terminal, and ^^CC sends SSIIGGIINNTT to all pro- - cesses in that process group. + the same process group as the terminal, and ^^CC sends SSIIGGIINNTT to all + processes in that process group. - When bbaasshh is running without job control enabled and receives SSIIGGIINNTT - while waiting for a foreground command, it waits until that foreground + When bbaasshh is running without job control enabled and receives SSIIGGIINNTT + while waiting for a foreground command, it waits until that foreground command terminates and then decides what to do about the SSIIGGIINNTT: 1. If the command terminates due to the SSIIGGIINNTT, bbaasshh concludes that @@ -3100,30 +3103,30 @@ SSIIGGNNAALLSS nal, either, instead assuming that the SSIIGGIINNTT was used as part of the program's normal operation (e.g., emacs uses it to abort editing commands) or deliberately discarded. However, bbaasshh will - run any trap set on SSIIGGIINNTT, as it does with any other trapped - signal it receives while it is waiting for the foreground com- + run any trap set on SSIIGGIINNTT, as it does with any other trapped + signal it receives while it is waiting for the foreground com- mand to complete, for compatibility. JJOOBB CCOONNTTRROOLL _J_o_b _c_o_n_t_r_o_l refers to the ability to selectively stop (_s_u_s_p_e_n_d) the ex- ecution of processes and continue (_r_e_s_u_m_e) their execution at a later point. A user typically employs this facility via an interactive in- - terface supplied jointly by the operating system kernel's terminal - driver and bbaasshh. + terface supplied jointly by the operating system kernel's terminal dri- + ver and bbaasshh. - The shell associates a _j_o_b with each pipeline. It keeps a table of - currently executing jobs, which may be listed with the jjoobbss command. - When bbaasshh starts a job asynchronously (in the _b_a_c_k_g_r_o_u_n_d), it prints a + The shell associates a _j_o_b with each pipeline. It keeps a table of + currently executing jobs, which may be listed with the jjoobbss command. + When bbaasshh starts a job asynchronously (in the _b_a_c_k_g_r_o_u_n_d), it prints a line that looks like: [1] 25647 indicating that this job is job number 1 and that the process ID of the last process in the pipeline associated with this job is 25647. All of - the processes in a single pipeline are members of the same job. BBaasshh + the processes in a single pipeline are members of the same job. BBaasshh uses the _j_o_b abstraction as the basis for job control. - To facilitate the implementation of the user interface to job control, + To facilitate the implementation of the user interface to job control, the operating system maintains the notion of a _c_u_r_r_e_n_t _t_e_r_m_i_n_a_l _p_r_o_c_e_s_s _g_r_o_u_p _I_D. Members of this process group (processes whose process group ID is equal to the current terminal process group ID) receive keyboard- @@ -3131,11 +3134,10 @@ JJOOBB CCOONNTTRROOLL the _f_o_r_e_g_r_o_u_n_d. _B_a_c_k_g_r_o_u_n_d processes are those whose process group ID differs from the terminal's; such processes are immune to keyboard-gen- erated signals. Only foreground processes are allowed to read from or, - if the user so specifies with stty tostop, write to the terminal. - Background processes which attempt to read from (write to when stty - tostop is in effect) the terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal - by the kernel's terminal driver, which, unless caught, suspends the - process. + if the user so specifies with "stty tostop", write to the terminal. + Background processes which attempt to read from (write to when "tostop" + is in effect) the terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal by the + kernel's terminal driver, which, unless caught, suspends the process. If the operating system on which bbaasshh is running supports job control, bbaasshh contains facilities to use it. Typing the _s_u_s_p_e_n_d character (typ- @@ -3143,8 +3145,8 @@ JJOOBB CCOONNTTRROOLL be stopped and returns control to bbaasshh. Typing the _d_e_l_a_y_e_d _s_u_s_p_e_n_d character (typically ^^YY, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to be re- - turned to bbaasshh. The user may then manipulate the state of this job, - using the bbgg command to continue it in the background, the ffgg command + turned to bbaasshh. The user may then manipulate the state of this job, + using the bbgg command to continue it in the background, the ffgg command to continue it in the foreground, or the kkiillll command to kill it. A ^^ZZ takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded. @@ -3156,7 +3158,7 @@ JJOOBB CCOONNTTRROOLL line. For example, %%ccee refers to a stopped job whose command name be- gins with ccee. If a prefix matches more than one job, bbaasshh reports an error. Using %%??ccee, on the other hand, refers to any job containing the - string ccee in its command line. If the substring matches more than one + string ccee in its command line. If the substring matches more than one job, bbaasshh reports an error. The symbols %%%% and %%++ refer to the shell's notion of the _c_u_r_r_e_n_t _j_o_b, which is the last job stopped while it was in the foreground or started in the background. The _p_r_e_v_i_o_u_s _j_o_b may @@ -3167,19 +3169,19 @@ JJOOBB CCOONNTTRROOLL job specification) also refers to the current job. Simply naming a job can be used to bring it into the foreground: %%11 is - a synonym for ````ffgg %%11'''', bringing job 1 from the background into the - foreground. Similarly, ````%%11 &&'''' resumes job 1 in the background, - equivalent to ````bbgg %%11''''. + a synonym for "fg %1", bringing job 1 from the background into the + foreground. Similarly, "%1 &" resumes job 1 in the background, equiva- + lent to "bg %1". - The shell learns immediately whenever a job changes state. Normally, + The shell learns immediately whenever a job changes state. Normally, bbaasshh waits until it is about to print a prompt before reporting changes in a job's status so as to not interrupt any other output. If the --bb option to the sseett builtin command is enabled, bbaasshh reports such changes - immediately. Any trap on SSIIGGCCHHLLDD is executed for each child that ex- + immediately. Any trap on SSIIGGCCHHLLDD is executed for each child that ex- its. - If an attempt to exit bbaasshh is made while jobs are stopped (or, if the - cchheecckkjjoobbss shell option has been enabled using the sshhoopptt builtin, run- + If an attempt to exit bbaasshh is made while jobs are stopped (or, if the + cchheecckkjjoobbss shell option has been enabled using the sshhoopptt builtin, run- ning), the shell prints a warning message, and, if the cchheecckkjjoobbss option is enabled, lists the jobs and their statuses. The jjoobbss command may then be used to inspect their status. If a second attempt to exit is @@ -3193,29 +3195,29 @@ JJOOBB CCOONNTTRROOLL PPRROOMMPPTTIINNGG When executing interactively, bbaasshh displays the primary prompt PPSS11 when - it is ready to read a command, and the secondary prompt PPSS22 when it - needs more input to complete a command. BBaasshh displays PPSS00 after it - reads a command but before executing it. BBaasshh displays PPSS44 as de- - scribed above before tracing each command when the --xx option is en- - abled. BBaasshh allows these prompt strings to be customized by inserting - a number of backslash-escaped special characters that are decoded as + it is ready to read a command, and the secondary prompt PPSS22 when it + needs more input to complete a command. BBaasshh displays PPSS00 after it + reads a command but before executing it. BBaasshh displays PPSS44 as de- + scribed above before tracing each command when the --xx option is en- + abled. BBaasshh allows these prompt strings to be customized by inserting + a number of backslash-escaped special characters that are decoded as follows: \\aa an ASCII bell character (07) - \\dd the date in "Weekday Month Date" format (e.g., "Tue May + \\dd the date in "Weekday Month Date" format (e.g., "Tue May 26") \\DD{{_f_o_r_m_a_t}} the _f_o_r_m_a_t is passed to _s_t_r_f_t_i_m_e(3) and the result is in- serted into the prompt string; an empty _f_o_r_m_a_t results in - a locale-specific time representation. The braces are + a locale-specific time representation. The braces are required \\ee an ASCII escape character (033) - \\hh the hostname up to the first `.' + \\hh the hostname up to the first "." \\HH the hostname \\jj the number of jobs currently managed by the shell \\ll the basename of the shell's terminal device name \\nn newline \\rr carriage return - \\ss the name of the shell, the basename of $$00 (the portion + \\ss the name of the shell, the basename of $$00 (the portion following the final slash) \\tt the current time in 24-hour HH:MM:SS format \\TT the current time in 12-hour HH:MM:SS format @@ -3224,8 +3226,8 @@ PPRROOMMPPTTIINNGG \\uu the username of the current user \\vv the version of bbaasshh (e.g., 2.00) \\VV the release of bbaasshh, version + patch level (e.g., 2.00.0) - \\ww the value of the PPWWDD shell variable ($$PPWWDD), with $$HHOOMMEE - abbreviated with a tilde (uses the value of the + \\ww the value of the PPWWDD shell variable ($$PPWWDD), with $$HHOOMMEE + abbreviated with a tilde (uses the value of the PPRROOMMPPTT__DDIIRRTTRRIIMM variable) \\WW the basename of $$PPWWDD, with $$HHOOMMEE abbreviated with a tilde \\!! the history number of this command @@ -3233,18 +3235,18 @@ PPRROOMMPPTTIINNGG \\$$ if the effective UID is 0, a ##, otherwise a $$ \\_n_n_n the character corresponding to the octal number _n_n_n \\\\ a backslash - \\[[ begin a sequence of non-printing characters, which could - be used to embed a terminal control sequence into the + \\[[ begin a sequence of non-printing characters, which could + be used to embed a terminal control sequence into the prompt \\]] end a sequence of non-printing characters - The command number and the history number are usually different: the - history number of a command is its position in the history list, which - may include commands restored from the history file (see HHIISSTTOORRYY be- - low), while the command number is the position in the sequence of com- - mands executed during the current shell session. After the string is - decoded, it is expanded via parameter expansion, command substitution, - arithmetic expansion, and quote removal, subject to the value of the + The command number and the history number are usually different: the + history number of a command is its position in the history list, which + may include commands restored from the history file (see HHIISSTTOORRYY be- + low), while the command number is the position in the sequence of com- + mands executed during the current shell session. After the string is + decoded, it is expanded via parameter expansion, command substitution, + arithmetic expansion, and quote removal, subject to the value of the pprroommppttvvaarrss shell option (see the description of the sshhoopptt command under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). This can have unwanted side effects if escaped portions of the string appear within command substitution or @@ -3263,21 +3265,21 @@ RREEAADDLLIINNEE RReeaaddlliinnee NNoottaattiioonn In this section, the Emacs-style notation is used to denote keystrokes. - Control keys are denoted by C-_k_e_y, e.g., C-n means Control-N. Simi- - larly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x means Meta-X. (On key- - boards without a _m_e_t_a key, M-_x means ESC _x, i.e., press the Escape key + Control keys are denoted by C-_k_e_y, e.g., C-n means Control-N. Simi- + larly, _m_e_t_a keys are denoted by M-_k_e_y, so M-x means Meta-X. (On key- + boards without a _m_e_t_a key, M-_x means ESC _x, i.e., press the Escape key then the _x key. This makes ESC the _m_e_t_a _p_r_e_f_i_x. The combination M-C-_x means ESC-Control-_x, or press the Escape key then hold the Control key while pressing the _x key.) Readline commands may be given numeric _a_r_g_u_m_e_n_t_s, which normally act as - a repeat count. Sometimes, however, it is the sign of the argument - that is significant. Passing a negative argument to a command that - acts in the forward direction (e.g., kkiillll--lliinnee) causes that command to - act in a backward direction. Commands whose behavior with arguments + a repeat count. Sometimes, however, it is the sign of the argument + that is significant. Passing a negative argument to a command that + acts in the forward direction (e.g., kkiillll--lliinnee) causes that command to + act in a backward direction. Commands whose behavior with arguments deviates from this are noted below. - When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved + When a command is described as _k_i_l_l_i_n_g text, the text deleted is saved for possible future retrieval (_y_a_n_k_i_n_g). The killed text is saved in a _k_i_l_l _r_i_n_g. Consecutive kills cause the text to be accumulated into one unit, which can be yanked all at once. Commands which do not kill text @@ -3287,16 +3289,16 @@ RREEAADDLLIINNEE Readline is customized by putting commands in an initialization file (the _i_n_p_u_t_r_c file). The name of this file is taken from the value of the IINNPPUUTTRRCC variable. If that variable is unset, the default is _~_/_._i_n_- - _p_u_t_r_c. If that file does not exist or cannot be read, the ultimate - default is _/_e_t_c_/_i_n_p_u_t_r_c. When a program which uses the readline li- - brary starts up, the initialization file is read, and the key bindings - and variables are set. There are only a few basic constructs allowed - in the readline initialization file. Blank lines are ignored. Lines - beginning with a ## are comments. Lines beginning with a $$ indicate - conditional constructs. Other lines denote key bindings and variable + _p_u_t_r_c. If that file does not exist or cannot be read, the ultimate + default is _/_e_t_c_/_i_n_p_u_t_r_c. When a program which uses the readline li- + brary starts up, the initialization file is read, and the key bindings + and variables are set. There are only a few basic constructs allowed + in the readline initialization file. Blank lines are ignored. Lines + beginning with a ## are comments. Lines beginning with a $$ indicate + conditional constructs. Other lines denote key bindings and variable settings. - The default key-bindings may be changed with an _i_n_p_u_t_r_c file. Other + The default key-bindings may be changed with an _i_n_p_u_t_r_c file. Other programs that use this library may add their own commands and bindings. For example, placing @@ -3304,18 +3306,19 @@ RREEAADDLLIINNEE M-Control-u: universal-argument or C-Meta-u: universal-argument - into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_- + + into the _i_n_p_u_t_r_c would make M-C-u execute the readline command _u_n_i_v_e_r_- _s_a_l_-_a_r_g_u_m_e_n_t. - The following symbolic character names are recognized: _R_U_B_O_U_T, _D_E_L, + The following symbolic character names are recognized: _R_U_B_O_U_T, _D_E_L, _E_S_C, _L_F_D, _N_E_W_L_I_N_E, _R_E_T, _R_E_T_U_R_N, _S_P_C, _S_P_A_C_E, and _T_A_B. - In addition to command names, readline allows keys to be bound to a + In addition to command names, readline allows keys to be bound to a string that is inserted when the key is pressed (a _m_a_c_r_o). RReeaaddlliinnee KKeeyy BBiinnddiinnggss - The syntax for controlling key bindings in the _i_n_p_u_t_r_c file is simple. - All that is required is the name of the command or the text of a macro + The syntax for controlling key bindings in the _i_n_p_u_t_r_c file is simple. + All that is required is the name of the command or the text of a macro and a key sequence to which it should be bound. The name may be speci- fied in one of two ways: as a symbolic key name, possibly with _M_e_t_a_- or _C_o_n_t_r_o_l_- prefixes, or as a key sequence. @@ -3330,7 +3333,7 @@ RREEAADDLLIINNEE In the above example, _C_-_u is bound to the function uunniivveerrssaall--aarrgguummeenntt, _M_-_D_E_L is bound to the function bbaacckkwwaarrdd--kkiillll--wwoorrdd, and _C_-_o is bound to run the macro expressed on the right hand side (that is, to insert the - text ``> output'' into the line). + text "> output" into the line). In the second form, ""kkeeyysseeqq"":_f_u_n_c_t_i_o_n_-_n_a_m_e or _m_a_c_r_o, kkeeyysseeqq differs from kkeeyynnaammee above in that strings denoting an entire key sequence may @@ -3343,8 +3346,8 @@ RREEAADDLLIINNEE "\e[11~": "Function Key 1" In this example, _C_-_u is again bound to the function uunniivveerrssaall--aarrgguummeenntt. - _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is - bound to insert the text ``Function Key 1''. + _C_-_x _C_-_r is bound to the function rree--rreeaadd--iinniitt--ffiillee, and _E_S_C _[ _1 _1 _~ is + bound to insert the text "Function Key 1". The full set of GNU Emacs style escape sequences is \\CC-- control prefix @@ -3354,7 +3357,7 @@ RREEAADDLLIINNEE \\"" literal " \\'' literal ' - In addition to the GNU Emacs style escape sequences, a second set of + In addition to the GNU Emacs style escape sequences, a second set of backslash escapes is available: \\aa alert (bell) \\bb backspace @@ -3364,20 +3367,20 @@ RREEAADDLLIINNEE \\rr carriage return \\tt horizontal tab \\vv vertical tab - \\_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 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) 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 func- - tion name. In the macro body, the backslash escapes described above - are expanded. Backslash will quote any other character in the macro + tion name. In the macro body, the backslash escapes described above + are expanded. Backslash will quote any other character in the macro text, including " and '. - BBaasshh allows the current readline key bindings to be displayed or modi- - fied with the bbiinndd builtin command. The editing mode may be switched - during interactive use by using the --oo option to the sseett builtin com- + BBaasshh allows the current readline key bindings to be displayed or modi- + fied with the bbiinndd builtin command. The editing mode may be switched + during interactive use by using the --oo option to the sseett builtin com- mand (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). RReeaaddlliinnee VVaarriiaabblleess @@ -3388,46 +3391,46 @@ RREEAADDLLIINNEE sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e or using the bbiinndd builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - Except where noted, readline variables can take the values OOnn or OOffff - (without regard to case). Unrecognized variable names are ignored. - When a variable value is read, empty or null values, "on" (case-insen- - sitive), and "1" are equivalent to OOnn. All other values are equivalent - to OOffff. The variables and their default values are: + Except where noted, readline variables can take the values OOnn or OOffff + (without regard to case). Unrecognized variable names are ignored. + When readline reads a variable value, empty or null values, "on" (case- + insensitive), and "1" are equivalent to OOnn. All other values are + equivalent to OOffff. The variables and their default values are: aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr A string variable that controls the text color and background when displaying the text in the active region (see the descrip- tion of eennaabbllee--aaccttiivvee--rreeggiioonn below). This string must not take up any physical character positions on the display, so it should - consist only of terminal escape sequences. It is output to the - terminal before displaying the text in the active region. This - variable is reset to the default value whenever the terminal - type changes. The default value is the string that puts the - terminal in standout mode, as obtained from the terminal's ter- + consist only of terminal escape sequences. It is output to the + terminal before displaying the text in the active region. This + variable is reset to the default value whenever the terminal + type changes. The default value is the string that puts the + terminal in standout mode, as obtained from the terminal's ter- minfo description. A sample value might be "\e[01;33m". aaccttiivvee--rreeggiioonn--eenndd--ccoolloorr - A string variable that "undoes" the effects of aaccttiivvee--rree-- - ggiioonn--ssttaarrtt--ccoolloorr and restores "normal" terminal display appear- - ance after displaying text in the active region. This string - must not take up any physical character positions on the dis- - play, so it should consist only of terminal escape sequences. - It is output to the terminal after displaying the text in the - active region. This variable is reset to the default value - whenever the terminal type changes. The default value is the - string that restores the terminal from standout mode, as ob- + A string variable that "undoes" the effects of aaccttiivvee--rree-- + ggiioonn--ssttaarrtt--ccoolloorr and restores "normal" terminal display appear- + ance after displaying text in the active region. This string + must not take up any physical character positions on the dis- + play, so it should consist only of terminal escape sequences. + It is output to the terminal after displaying the text in the + active region. This variable is reset to the default value + whenever the terminal type changes. The default value is the + string that restores the terminal from standout mode, as ob- tained from the terminal's terminfo description. A sample value might be "\e[0m". bbeellll--ssttyyllee ((aauuddiibbllee)) Controls what happens when readline wants to ring the terminal bell. If set to nnoonnee, readline never rings the bell. If set to - vviissiibbllee, readline uses a visible bell if one is available. If + vviissiibbllee, readline uses a visible bell if one is available. If set to aauuddiibbllee, readline attempts to ring the terminal's bell. bbiinndd--ttttyy--ssppeecciiaall--cchhaarrss ((OOnn)) - If set to OOnn (the default), readline attempts to bind the con- - trol characters that are treated specially by the kernel's ter- + If set to OOnn (the default), readline attempts to bind the con- + trol characters that are treated specially by the kernel's ter- minal driver to their readline equivalents. These override the - default readline bindings described here. Type stty -a at a - bash prompt to see your current terminal settings, including the + default readline bindings described here. Type "stty -a" at a + bbaasshh prompt to see your current terminal settings, including the special control characters (usually cccchhaarrss). bblliinnkk--mmaattcchhiinngg--ppaarreenn ((OOffff)) If set to OOnn, readline attempts to briefly move the cursor to an @@ -3435,7 +3438,7 @@ RREEAADDLLIINNEE ccoolloorreedd--ccoommpplleettiioonn--pprreeffiixx ((OOffff)) If set to OOnn, when listing completions, readline displays the common prefix of the set of possible completions using a differ- - ent color. The color definitions are taken from the value of + ent color. The color definitions are taken from the value of the LLSS__CCOOLLOORRSS environment variable. If there is a color defini- tion in $$LLSS__CCOOLLOORRSS for the custom suffix "readline-colored-com- pletion-prefix", readline uses this color for the common prefix @@ -3445,15 +3448,15 @@ RREEAADDLLIINNEE ferent colors to indicate their file type. The color defini- tions are taken from the value of the LLSS__CCOOLLOORRSS environment variable. - ccoommmmeenntt--bbeeggiinn ((````##'''')) + ccoommmmeenntt--bbeeggiinn (("##")) The string that is inserted when the readline iinnsseerrtt--ccoommmmeenntt command is executed. This command is bound to MM--## in emacs mode and to ## in vi command mode. ccoommpplleettiioonn--ddiissppllaayy--wwiiddtthh ((--11)) - The number of screen columns used to display possible matches - when performing completion. The value is ignored if it is less - than 0 or greater than the terminal screen width. A value of 0 - will cause matches to be displayed one per line. The default + The number of screen columns used to display possible matches + when performing completion. The value is ignored if it is less + than 0 or greater than the terminal screen width. A value of 0 + will cause matches to be displayed one per line. The default value is -1. ccoommpplleettiioonn--iiggnnoorree--ccaassee ((OOffff)) If set to OOnn, readline performs filename matching and completion @@ -3480,10 +3483,10 @@ RREEAADDLLIINNEE ccoonnvveerrtt--mmeettaa ((OOnn)) If set to OOnn, readline will convert characters with the eighth bit set to an ASCII key sequence by stripping the eighth bit and - prefixing an escape character (in effect, using escape as the - _m_e_t_a _p_r_e_f_i_x). The default is _O_n, but readline will set it to - _O_f_f if the locale contains eight-bit characters. This variable - is dependent on the LLCC__CCTTYYPPEE locale category, and may change if + prefixing an escape character (in effect, using escape as the + _m_e_t_a _p_r_e_f_i_x). The default is _O_n, but readline will set it to + _O_f_f if the locale contains eight-bit characters. This variable + is dependent on the LLCC__CCTTYYPPEE locale category, and may change if the locale is changed. ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) If set to OOnn, readline will inhibit word completion. Completion @@ -3498,29 +3501,29 @@ RREEAADDLLIINNEE ilar to _E_m_a_c_s or _v_i. eeddiittiinngg--mmooddee can be set to either eemmaaccss or vvii. eemmaaccss--mmooddee--ssttrriinngg ((@@)) - 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 emacs editing mode is active. The value is expanded like a - key binding, so the standard set of meta- and control prefixes - and backslash escape sequences is available. Use the \1 and \2 - escapes to begin and end sequences of non-printing characters, - which can be used to embed a terminal control sequence into the + key binding, so the standard set of meta- and control prefixes + and backslash escape sequences is available. Use the \1 and \2 + escapes to begin and end sequences of non-printing characters, + which can be used to embed a terminal control sequence into the mode string. eennaabbllee--aaccttiivvee--rreeggiioonn ((OOnn)) - The _p_o_i_n_t is the current cursor position, and _m_a_r_k refers to a - saved cursor position. The text between the point and mark is - referred to as the _r_e_g_i_o_n. When this variable is set to _O_n, - readline allows certain commands to designate the region as _a_c_- - _t_i_v_e. When the region is active, readline highlights the text - in the region using the value of the aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr, - which defaults to the string that enables the terminal's stand- - out mode. The active region shows the text inserted by brack- - eted-paste and any matching text found by incremental and non- + The _p_o_i_n_t is the current cursor position, and _m_a_r_k refers to a + saved cursor position. The text between the point and mark is + referred to as the _r_e_g_i_o_n. When this variable is set to _O_n, + readline allows certain commands to designate the region as _a_c_- + _t_i_v_e. When the region is active, readline highlights the text + in the region using the value of the aaccttiivvee--rreeggiioonn--ssttaarrtt--ccoolloorr, + which defaults to the string that enables the terminal's stand- + out mode. The active region shows the text inserted by brack- + eted-paste and any matching text found by incremental and non- incremental history searches. eennaabbllee--bbrraacckkeetteedd--ppaassttee ((OOnn)) - When set to OOnn, readline configures the terminal to insert each - paste into the editing buffer as a single string of characters, - instead of treating each character as if it had been read from + When set to OOnn, readline configures the terminal to insert each + paste into the editing buffer as a single string of characters, + instead of treating each character as if it had been read from the keyboard. This prevents readline from executing any editing commands bound to key sequences appearing in the pasted text. eennaabbllee--kkeeyyppaadd ((OOffff)) @@ -3542,26 +3545,26 @@ RREEAADDLLIINNEE Set the maximum number of history entries saved in the history list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, - the number of history entries is not limited. By default, the - number of history entries is set to the value of the HHIISSTTSSIIZZEE - shell variable. If an attempt is made to set _h_i_s_t_o_r_y_-_s_i_z_e to a + the number of history entries is not limited. By default, the + number of history entries is set to the value of the HHIISSTTSSIIZZEE + shell variable. If an attempt is made to set _h_i_s_t_o_r_y_-_s_i_z_e to a non-numeric value, the maximum number of history entries will be set to 500. hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) When set to OOnn, makes readline 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 for terminals + 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, readline will enable eight-bit input (that is, it + If set to OOnn, readline will enable eight-bit input (that is, it will not strip the eighth bit from the characters it reads), re- gardless of what the terminal claims it can support. The name mmeettaa--ffllaagg is a synonym for this variable. The default is _O_f_f, but readline will set it to _O_n if the locale contains eight-bit characters. This variable is dependent on the LLCC__CCTTYYPPEE locale category, and may change if the locale is changed. - iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ'''')) + 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- @@ -3576,48 +3579,48 @@ RREEAADDLLIINNEE Specifies the duration _r_e_a_d_l_i_n_e 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 no input is re- - ceived within the timeout, _r_e_a_d_l_i_n_e will use the shorter but - complete key sequence. The value is specified in milliseconds, - so a value of 1000 means that _r_e_a_d_l_i_n_e 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, _r_e_a_d_l_i_n_e will wait - until another key is pressed to decide which key sequence to + input to complete a longer key sequence). If no input is re- + ceived within the timeout, _r_e_a_d_l_i_n_e will use the shorter but + complete key sequence. The value is specified in milliseconds, + so a value of 1000 means that _r_e_a_d_l_i_n_e 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, _r_e_a_d_l_i_n_e will wait + until another key is pressed to decide which key sequence to complete. mmaarrkk--ddiirreeccttoorriieess ((OOnn)) If set to OOnn, completed directory names have a slash appended. mmaarrkk--mmooddiiffiieedd--lliinneess ((OOffff)) - If set to OOnn, history lines that have been modified are dis- + If set to OOnn, history lines that have been modified are dis- played 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-- rreeccttoorriieess). mmaattcchh--hhiiddddeenn--ffiilleess ((OOnn)) - This variable, when set to OOnn, causes readline to match files - whose names begin with a `.' (hidden files) when performing - filename completion. If set to OOffff, the leading `.' must be - supplied by the user in the filename to be completed. + This variable, when set to OOnn, forces readline 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 list of possible completions (which may be empty) before cycling through the list. oouuttppuutt--mmeettaa ((OOffff)) - If set to OOnn, readline will display characters with the eighth + If set to OOnn, readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. The default is _O_f_f, but readline will set it to _O_n if the locale - contains eight-bit characters. This variable is dependent on - the LLCC__CCTTYYPPEE locale category, and may change if the locale is + contains eight-bit characters. This variable is dependent on + the LLCC__CCTTYYPPEE locale category, and may change if the locale is changed. ppaaggee--ccoommpplleettiioonnss ((OOnn)) - If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis- + If set to OOnn, readline uses an internal _m_o_r_e-like pager to dis- play a screenful of possible completions at a time. pprriinntt--ccoommpplleettiioonnss--hhoorriizzoonnttaallllyy ((OOffff)) - If set to OOnn, readline will display completions with matches - sorted horizontally in alphabetical order, rather than down the + If set to OOnn, readline will display completions with matches + sorted horizontally in alphabetical order, rather than down the screen. rreevveerrtt--aallll--aatt--nneewwlliinnee ((OOffff)) - If set to OOnn, readline will undo all changes to history lines + If set to OOnn, readline will undo all changes to history lines before returning when aacccceepptt--lliinnee is executed. By default, his- tory lines may be modified and retain individual undo lists across calls to rreeaaddlliinnee. @@ -3627,10 +3630,10 @@ RREEAADDLLIINNEE sshhooww--aallll--iiff--aammbbiigguuoouuss ((OOffff)) 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 @@ -3650,7 +3653,7 @@ RREEAADDLLIINNEE 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 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. Use the \1 and \2 escapes to begin and end sequences of non- @@ -3661,24 +3664,24 @@ RREEAADDLLIINNEE 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. - Use the \1 and \2 escapes to begin and end sequences of non- - printing characters, which can be used to embed a terminal con- + control prefixes and backslash escape sequences is available. + Use the \1 and \2 escapes to begin and end sequences of non- + printing characters, which can be used to embed a terminal con- trol sequence 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 - Readline 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 + Readline 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 used. - $$iiff The $$iiff construct allows bindings to be made based on the edit- - ing mode, the terminal being used, or the application using - readline. 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 + readline. 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. @@ -3693,30 +3696,30 @@ RREEAADDLLIINNEE 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 _s_u_n to match both _s_u_n and _s_u_n_-_c_m_d, + minal and the portion of the terminal name before the + first --. This allows _s_u_n to match both _s_u_n and _s_u_n_-_c_m_d, for instance. vveerrssiioonn - The vveerrssiioonn test may be used to perform comparisons - against specific readline versions. The vveerrssiioonn expands - to the current readline 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 readline versions. The vveerrssiioonn expands + to the current readline 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 is assumed to be 00. The operator may be separated from the string vveerrssiioonn and from the version number argument by whitespace. - aapppplliiccaattiioonn - The aapppplliiccaattiioonn construct is used to include application- + _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 readline 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 @@ -3729,9 +3732,9 @@ RREEAADDLLIINNEE readline 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. Both string and boolean vari- - ables may be tested. Boolean variables must be tested + operator may be separated from the value on the right + hand side by whitespace. Both string and boolean vari- + ables may be tested. Boolean variables must be tested against the values _o_n and _o_f_f. $$eennddiiff This command, as seen in the previous example, terminates an $$iiff @@ -3741,23 +3744,23 @@ RREEAADDLLIINNEE test fails. $$iinncclluuddee - This directive takes a single filename as an argument and reads - commands and bindings from that file. For example, the follow- + This directive takes a single filename as an argument and reads + commands and bindings from that file. For example, the follow- ing 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 - Readline provides commands for searching through the command history + Readline 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, read- line 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. The characters present in - the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used to terminate an + so far. An incremental search requires only as many characters as + needed to find the desired history entry. The characters present in + the value of the iisseeaarrcchh--tteerrmmiinnaattoorrss variable are used to terminate an incremental search. If that variable has not been assigned a value the Escape and Control-J characters will terminate an incremental search. Control-G will abort an incremental search and restore the original @@ -3774,7 +3777,7 @@ RREEAADDLLIINNEE Readline remembers the last incremental search string. If two Control- Rs are typed without any intervening characters defining a new search - string, any remembered search string is used. + string, readline uses any remembered search string. Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be typed @@ -3801,22 +3804,22 @@ 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 + 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 + 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 readline 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 readline 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 + Attempt to move point to the same physical screen column on the next physical screen line. This will not have the desired effect if the current readline line does not take up more than one physical line or if the length of the current readline line is @@ -3827,7 +3830,7 @@ RREEAADDLLIINNEE 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. @@ -3842,40 +3845,40 @@ RREEAADDLLIINNEE Fetch the previous command from the history list, moving back in the list. nneexxtt--hhiissttoorryy ((CC--nn)) - Fetch the next command from the history list, moving forward in + Fetch the next command from the history list, moving forward in the list. 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 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 + Accept the current line for execution 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' + Search backward starting at the current line and moving "up" through the history as necessary. This is an incremental search. ffoorrwwaarrdd--sseeaarrcchh--hhiissttoorryy ((CC--ss)) - Search forward starting at the current line and moving `down' + Search forward starting at the current line and moving "down" through the history as necessary. This is an incremental search. 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. 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. hhiissttoorryy--sseeaarrcchh--ffoorrwwaarrdd - Search forward through the history for the string of characters - between the start of the current line and the point. This is a + Search forward through the history for the string of characters + between the start of the current line and the point. This is a non-incremental search. hhiissttoorryy--sseeaarrcchh--bbaacckkwwaarrdd Search backward through the history for the string of characters @@ -3889,10 +3892,10 @@ RREEAADDLLIINNEE hhiissttoorryy--ssuubbssttrriinngg--sseeaarrcchh--ffoorrwwaarrdd 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- @@ -3902,9 +3905,9 @@ RREEAADDLLIINNEE yyaannkk--llaasstt--aarrgg ((MM--..,, MM--__)) 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 @@ -3914,14 +3917,16 @@ RREEAADDLLIINNEE sshheellll--eexxppaanndd--lliinnee ((MM--CC--ee)) 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, word splitting, and quote removal. See HHIISSTTOORRYY - EEXXPPAANNSSIIOONN below for a description of history expansion. + 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 @@ -3938,19 +3943,19 @@ RREEAADDLLIINNEE 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 - ``stty''. If this character is read when there are no charac- - ters on the line, and point is at the beginning of the line, - readline interprets it as the end of input and returns EEOOFF. + 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, readline + interprets it as the end of input and returns EEOOFF. ddeelleettee--cchhaarr ((CC--dd)) Delete the character at point. If this function is bound to the same character as the tty EEOOFF character, as CC--dd commonly is, see above for the effects. 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)) @@ -3958,7 +3963,7 @@ RREEAADDLLIINNEE to insert characters like CC--qq, for example. ttaabb--iinnsseerrtt ((CC--vv TTAABB)) Insert a tab character. - sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ......)) + sseellff--iinnsseerrtt ((aa,, bb,, AA,, 11,, !!,, ...)) Insert the character typed. ttrraannssppoossee--cchhaarrss ((CC--tt)) Drag the character before point forward over the character at @@ -3979,10 +3984,10 @@ RREEAADDLLIINNEE 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, charac- ters bound to sseellff--iinnsseerrtt replace the text at point rather than pushing the text to the right. Characters bound to bbaacckk-- @@ -4040,7 +4045,7 @@ RREEAADDLLIINNEE ing yyaannkk or yyaannkk--ppoopp. NNuummeerriicc AArrgguummeennttss - ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ......,, MM----)) + ddiiggiitt--aarrgguummeenntt ((MM--00,, MM--11,, ...,, MM----)) Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument. uunniivveerrssaall--aarrgguummeenntt @@ -4050,9 +4055,9 @@ RREEAADDLLIINNEE 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. @@ -4060,8 +4065,8 @@ RREEAADDLLIINNEE ccoommpplleettee ((TTAABB)) Attempt to perform completion on the text before point. BBaasshh attempts completion treating the text as a variable (if the text - begins with $$), username (if the text begins with ~~), hostname - (if the text begins with @@), or command (including aliases and + begins with $$), username (if the text begins with ~~), hostname + (if the text begins with @@), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted. ppoossssiibbllee--ccoommpplleettiioonnss ((MM--??)) @@ -4100,7 +4105,7 @@ RREEAADDLLIINNEE List the possible completions of the text before point, treating 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 $$)) List the possible completions of the text before point, treating @@ -4112,9 +4117,9 @@ RREEAADDLLIINNEE List the possible completions of the text before point, treating 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 !!)) List the possible completions of the text before point, treating @@ -4140,21 +4145,21 @@ RREEAADDLLIINNEE 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 + ddoo--lloowweerrccaassee--vveerrssiioonn ((MM--AA,, MM--BB,, MM--_x,, ...)) + 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)) @@ -4176,15 +4181,15 @@ RREEAADDLLIINNEE as the mark. cchhaarraacctteerr--sseeaarrcchh ((CC--]])) A character is read and point is moved to the next occurrence of - that character. A negative argument searches for previous oc- + that character. A negative argument searches for previous oc- currences. cchhaarraacctteerr--sseeaarrcchh--bbaacckkwwaarrdd ((MM--CC--]])) - A character is read and point is moved to the previous occur- - rence of that character. A negative argument searches for sub- + A character is read and point is moved to the previous occur- + rence of that character. A negative argument searches for sub- sequent occurrences. sskkiipp--ccssii--sseeqquueennccee - Read enough characters to consume a multi-key sequence such as - those defined for keys like Home and End. Such sequences begin + Read enough characters to consume a multi-key sequence such as + those defined for keys like Home and End. Such sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this sequence is bound to "\[", keys producing such sequences will have no effect unless explicitly bound to a readline command, @@ -4194,8 +4199,8 @@ RREEAADDLLIINNEE Without a numeric argument, the value of the readline ccoomm-- mmeenntt--bbeeggiinn variable is inserted 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, the value is inserted, other- + toggle: if the characters at the beginning of the line do not + match the value of ccoommmmeenntt--bbeeggiinn, the value is inserted, other- wise the characters in ccoommmmeenntt--bbeeggiinn are deleted from the begin- ning of the line. In either case, the line is accepted as if a newline had been typed. The default value of ccoommmmeenntt--bbeeggiinn @@ -4225,7 +4230,7 @@ RREEAADDLLIINNEE dduummpp--ffuunnccttiioonnss Print all of the functions and their key bindings to the read- line 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 readline variables and their values to @@ -4241,32 +4246,32 @@ RREEAADDLLIINNEE Display version information about the current instance of bbaasshh. PPrrooggrraammmmaabbllee CCoommpplleettiioonn - When word completion is attempted for an argument to a command for - which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using - the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the program- - mable completion facilities are invoked. + When word completion is attempted for an argument to a command for + which a completion specification (a _c_o_m_p_s_p_e_c) has been defined using + the ccoommpplleettee builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the programma- + ble completion facilities are invoked. First, the command name is identified. If the command word is the empty string (completion attempted at the beginning of an empty line), any compspec defined with the --EE option to ccoommpplleettee is used. If a compspec has been defined for that command, the compspec is used to generate the list of possible completions for the word. If the command - word is a full pathname, a compspec for the full pathname is searched - for first. If no compspec is found for the full pathname, an attempt - is made to find a compspec for the portion following the final slash. - If those searches do not result in a compspec, any compspec defined - with the --DD option to ccoommpplleettee is used as the default. If there is no - default compspec, bbaasshh attempts alias expansion on the command word as - a final resort, and attempts to find a compspec for the command word + word is a full pathname, a compspec for the full pathname is searched + for first. If no compspec is found for the full pathname, an attempt + is made to find a compspec for the portion following the final slash. + If those searches do not result in a compspec, any compspec defined + with the --DD option to ccoommpplleettee is used as the default. If there is no + default compspec, bbaasshh attempts alias expansion on the command word as + a final resort, and attempts to find a compspec for the command word from any successful expansion. - Once a compspec has been found, it is used to generate the list of - matching words. If a compspec is not found, the default bbaasshh comple- + Once a compspec has been found, it is used to generate the list of + matching words. If a compspec is not found, the default bbaasshh comple- tion as described above under CCoommpplleettiinngg is performed. - First, the actions specified by the compspec are used. Only matches - which are prefixed by the word being completed are returned. When the - --ff or --dd option is used for filename or directory name completion, the + First, the actions specified by the compspec are used. Only matches + which are prefixed by the word being completed are returned. When the + --ff or --dd option is used for filename or directory name completion, the shell variable FFIIGGNNOORREE is used to filter the matches. Any completions specified by a pathname expansion pattern to the --GG op- @@ -4284,35 +4289,35 @@ RREEAADDLLIINNEE prefix-matched against the word being completed, and the matching words become the possible completions. - After these matches have been generated, any shell function or command - specified with the --FF and --CC options is invoked. When the command or + After these matches have been generated, any shell function or command + specified with the --FF and --CC options is invoked. When the command or function is invoked, the CCOOMMPP__LLIINNEE, CCOOMMPP__PPOOIINNTT, CCOOMMPP__KKEEYY, and CCOOMMPP__TTYYPPEE variables are assigned values as described above under SShheellll VVaarriiaabblleess. - If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD - variables are also set. When the function or command is invoked, the - first argument ($$11) is the name of the command whose arguments are be- - ing completed, the second argument ($$22) is the word being completed, - and the third argument ($$33) is the word preceding the word being com- + If a shell function is being invoked, the CCOOMMPP__WWOORRDDSS and CCOOMMPP__CCWWOORRDD + variables are also set. When the function or command is invoked, the + first argument ($$11) is the name of the command whose arguments are be- + ing completed, the second argument ($$22) is the word being completed, + and the third argument ($$33) is the word preceding the word being com- pleted on the current command line. No filtering of the generated com- pletions against the word being completed is performed; the function or command has complete freedom in generating the matches. - Any function specified with --FF is invoked first. The function may use - any of the shell facilities, including the ccoommppggeenn builtin described - below, to generate the matches. It must put the possible completions + Any function specified with --FF is invoked first. The function may use + any of the shell facilities, including the ccoommppggeenn builtin 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 may be + 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 may be used to escape a newline, if necessary. - After all of the possible completions are generated, any filter speci- - fied with the --XX option is applied to the list. The filter is a pat- - tern 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 will be removed from the list. + After all of the possible completions are generated, any filter speci- + fied with the --XX option is applied to the list. The filter is a pat- + tern 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 will be removed from the list. A leading !! negates the pattern; in this case any completion not match- ing the pattern will be removed. If the nnooccaasseemmaattcchh shell option is enabled, the match is performed without regard to the case of alpha- @@ -4330,11 +4335,11 @@ RREEAADDLLIINNEE was defined, directory name completion is attempted and any matches are added to the results of the other actions. - By default, if a compspec is found, whatever it generates is returned - to the completion code as the full set of possible completions. The + 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 are not attempted, and the readline default of filename completion is disabled. If the --oo bbaasshhddeeffaauulltt option was sup- - plied to ccoommpplleettee when the compspec was defined, the bbaasshh default com- + plied to ccoommpplleettee when the compspec was defined, the bbaasshh default com- pletions are attempted if the compspec generates no matches. If the --oo ddeeffaauulltt option was supplied to ccoommpplleettee when the compspec was defined, readline's default completion will be performed if the compspec (and, @@ -4352,7 +4357,7 @@ RREEAADDLLIINNEE completion handlers 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 allows a set of completions to be built dynamically as completion is attempted, rather @@ -4361,18 +4366,18 @@ RREEAADDLLIINNEE 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() - { - . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124 - } - complete -D -F _completion_loader -o bashdefault -o default - + _completion_loader() + { + . "/etc/bash_completion.d/$1.sh" \ + >/dev/null 2>&1 && return 124 + } + complete -D -F _completion_loader \ + -o bashdefault -o default HHIISSTTOORRYY 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 + typed. The value of the HHIISSTTSSIIZZEE variable is used as the number of commands to save in a history list. The text of the last HHIISSTTSSIIZZEE com- mands (default 500) is saved. The shell stores each command in the history list prior to parameter and variable expansion (see EEXXPPAANNSSIIOONN @@ -4380,30 +4385,30 @@ HHIISSTTOORRYY of the shell variables HHIISSTTIIGGNNOORREE and HHIISSTTCCOONNTTRROOLL. On startup, the history is initialized from the file named by the vari- - able HHIISSTTFFIILLEE (default _~_/_._b_a_s_h___h_i_s_t_o_r_y). The file named by the value - of HHIISSTTFFIILLEE is truncated, if necessary, to contain no more than the - number of lines specified by the value of HHIISSTTFFIILLEESSIIZZEE. If HHIISSTTFFIILLEE-- - SSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value - less than zero, the history file is not truncated. When the history - file is read, lines beginning with the history comment character fol- + able HHIISSTTFFIILLEE (default _~_/_._b_a_s_h___h_i_s_t_o_r_y). The file named by the value + of HHIISSTTFFIILLEE is truncated, if necessary, to contain no more than the + number of lines specified by the value of HHIISSTTFFIILLEESSIIZZEE. If HHIISSTTFFIILLEE-- + SSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value + less than zero, the history file is not truncated. When the history + file is read, lines beginning with the history comment character fol- lowed immediately by a digit are interpreted as timestamps for the fol- lowing history line. These timestamps are optionally displayed depend- - ing on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When a shell with - history enabled exits, the last $$HHIISSTTSSIIZZEE lines are copied from the - history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell option is enabled - (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the - lines are appended to the history file, otherwise the history file is - overwritten. If HHIISSTTFFIILLEE is unset or null, or if the history file is - unwritable, the history is not saved. If the HHIISSTTTTIIMMEEFFOORRMMAATT variable - is set, time stamps are written to the history file, marked with the - history comment character, so they may be preserved across shell ses- - sions. This uses the history comment character to distinguish time- + ing on the value of the HHIISSTTTTIIMMEEFFOORRMMAATT variable. When a shell with + history enabled exits, the last $$HHIISSTTSSIIZZEE lines are copied from the + history list to $$HHIISSTTFFIILLEE. If the hhiissttaappppeenndd shell option is enabled + (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below), the + lines are appended to the history file, otherwise the history file is + overwritten. If HHIISSTTFFIILLEE is unset or null, or if the history file is + unwritable, the history is not saved. If the HHIISSTTTTIIMMEEFFOORRMMAATT variable + is set, time stamps are written to the history file, marked with the + history comment character, so they may be preserved across shell ses- + sions. This uses the history comment character to distinguish time- stamps from other history lines. After saving the history, the history file is truncated to contain no more than HHIISSTTFFIILLEESSIIZZEE lines. If HHIISSTT-- - FFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric + FFIILLEESSIIZZEE is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated. - The builtin command ffcc (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) may be used + The builtin command ffcc (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) may be used to list or edit and re-execute a portion of the history list. The hhiiss-- ttoorryy builtin may be used to display or modify the history list and ma- nipulate the history file. When using command-line editing, search @@ -4413,10 +4418,10 @@ HHIISSTTOORRYY The shell allows control over which commands are saved on the history list. The HHIISSTTCCOONNTTRROOLL and HHIISSTTIIGGNNOORREE variables are used to cause the shell to save only a subset of the commands entered. The ccmmddhhiisstt shell - option, if enabled, causes the shell to attempt 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 - causes the shell to save the command with embedded newlines instead of + option, if enabled, causes the shell to attempt 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 + causes the shell to save 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 op- tions. @@ -4430,7 +4435,7 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN perform history expansion by default. 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. @@ -4442,18 +4447,18 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN to select portions of that line for inclusion into the current one. The line selected from the history is the _e_v_e_n_t, and the portions of that line that are acted upon are _w_o_r_d_s. The line is broken 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- + 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. @@ -4463,28 +4468,28 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN 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 entry, using an event designator equivalent to !!!!, and substitutes one string for an- other in that line. It is described below under EEvveenntt DDeessiiggnnaattoorrss. This is the only history expansion that does not begin with the history expansion character. - Several shell options settable with the sshhoopptt builtin may be used to - tailor the behavior of history expansion. If the hhiissttvveerriiffyy shell op- - tion is enabled (see the description of the sshhoopptt builtin below), and - rreeaaddlliinnee is being used, history substitutions are not immediately - passed to the shell parser. Instead, the expanded line is reloaded + Several shell options settable with the sshhoopptt builtin may be used to + tailor the behavior of history expansion. If the hhiissttvveerriiffyy shell op- + tion is enabled (see the description of the sshhoopptt builtin below), and + rreeaaddlliinnee is being used, history substitutions are not immediately + passed to the shell parser. Instead, the expanded line is reloaded into the rreeaaddlliinnee editing buffer for further modification. If rreeaaddlliinnee is being used, and the hhiissttrreeeeddiitt shell option is enabled, a failed history substitution will be reloaded into the rreeaaddlliinnee editing buffer for correction. The --pp option to the hhiissttoorryy builtin command may be used to see what a history expansion will do before using it. The --ss option to the hhiissttoorryy builtin may be used to add commands to the end of - the history list without actually executing them, so that they are + the history list without actually executing 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- tory timestamps when writing the history file. @@ -4502,7 +4507,7 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN is enabled using the sshhoopptt builtin). !!_n Refer to command line _n. !!--_n Refer to the current command minus _n. - !!!! Refer to the previous command. This is a synonym for `!-1'. + !!!! Refer to the previous command. This is a synonym for "!-1". !!_s_t_r_i_n_g Refer to the most recent command preceding the current position in the history list starting with _s_t_r_i_n_g. @@ -4514,7 +4519,7 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN used; 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^'' + _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. @@ -4532,23 +4537,23 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN ^^ The first argument. That is, word 1. $$ 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 + %% 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. - _x--_y A range of words; `-_y' abbreviates `0-_y'. - ** All of the words but the zeroth. This is a synonym for `_1_-_$'. + _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 event; the empty string is returned 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. MMooddiiffiieerrss - After the optional word designator, there may appear a sequence of one - or more of the following modifiers, each preceded by a `:'. These mod- + After the optional word designator, there may appear a sequence of one + or more of the following modifiers, each preceded by a ":". These mod- ify, or edit, the word or words selected from the history event. hh Remove a trailing filename component, leaving only the head. @@ -4563,20 +4568,20 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN ss//_o_l_d//_n_e_w// 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 final delimiter is optional if it is the last character of the event line. The delimiter may be quoted in _o_l_d and _n_e_w with a single backslash. If & appears in _n_e_w, it is replaced by _o_l_d. - A single backslash will quote the &. If _o_l_d is null, it is set - to the last _o_l_d substituted, or, if no previous history substi- - tutions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. + A single backslash will quote the &. If _o_l_d is null, it is set + to the last _o_l_d substituted, or, if no previous history substi- + tutions 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 + 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 + GG Apply the following "ss" or "&&" modifier once to each word in the event line. SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS @@ -4589,38 +4594,39 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 and performing any specified redirections. The return status is zero. - .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] Read and execute commands from _f_i_l_e_n_a_m_e in the current shell en- vironment and return the exit status of the last command exe- cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, filenames in PPAATTHH are used to find the directory containing _f_i_l_e_n_a_m_e, but _f_i_l_e_n_a_m_e does not need to be executable. The file - searched for in PPAATTHH need not be executable. When bbaasshh is not - in _p_o_s_i_x _m_o_d_e, it searches the current directory if no file is - found in PPAATTHH. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin - command is turned off, the PPAATTHH is not searched. If any _a_r_g_u_- - _m_e_n_t_s are supplied, they become the positional parameters when - _f_i_l_e_n_a_m_e is executed. Otherwise the positional parameters are - unchanged. If the --TT option is enabled, .. inherits any trap on + searched for in PPAATTHH need not be executable. When bbaasshh is not + in _p_o_s_i_x _m_o_d_e, it searches the current directory if no file is + found in PPAATTHH. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin + command is turned off, the PPAATTHH is not searched. If any _a_r_g_u_- + _m_e_n_t_s are supplied, they become the positional parameters when + _f_i_l_e_n_a_m_e is executed. Otherwise the positional parameters 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 call to .., and .. unsets the DDEEBBUUGG trap while it exe- cutes. If --TT is not set, and the sourced file changes the DDEEBBUUGG - trap, the new value is retained when .. completes. The return - status is the status of the last command exited within the + trap, the new value is retained when .. completes. The return + status is the status of the last command exited within the script (0 if no commands are executed), and false 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] ...] AAlliiaass with no arguments or with the --pp option 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, an alias is defined 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 + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined 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. For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- plied, the name and value of the alias is printed. AAlliiaass re- @@ -4630,9 +4636,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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's - notion of the _c_u_r_r_e_n_t _j_o_b is used. 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 + notion of the _c_u_r_r_e_n_t _j_o_b is used. 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 without job control. bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVVXX] @@ -4642,8 +4648,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e 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 set a rreeaaddlliinnee + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee variable. Each non-option argument is a command as it would ap- pear in a rreeaaddlliinnee initialization file such as _._i_n_p_u_t_r_c, but each binding or command must be passed as a separate argument; @@ -4694,10 +4700,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS _m_a_n_d is executed, the shell sets the RREEAADDLLIINNEE__LLIINNEE vari- able 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__AARRGGUU-- - MMEENNTT variable. If there was no argument, that variable + 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__AARRGGUU-- + MMEENNTT variable. If there was no argument, that variable is not set. If the executed command changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADDLLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be reflected in the editing state. @@ -4705,22 +4711,22 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS associated commands in a format that can be reused as in- put. - The return value is 0 unless an unrecognized option is given or + The return value is 0 unless an unrecognized option is given or an error occurred. bbrreeaakk [_n] - Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is - specified, break _n levels. _n must be >= 1. If _n is greater - than the number of enclosing loops, all enclosing loops are ex- - ited. The return value is 0 unless _n is not greater than or + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are ex- + ited. 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, passing it _a_r_g_u_m_e_n_t_s, and + Execute the specified shell builtin, 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 func- tionality of the builtin within the function. The ccdd builtin is - commonly redefined this way. The return status is false if + commonly redefined this way. The return status 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] @@ -4729,38 +4735,38 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS out _e_x_p_r, ccaalllleerr displays the line number and source filename of the current subroutine call. If a non-negative integer is sup- plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, - and source file corresponding to that position in the current - 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 + and source file corresponding to that position in the current + 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 call stack. ccdd [--LL|[--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 the default. The vari- + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is the default. The vari- able CCDDPPAATTHH defines the search path for the directory containing - _d_i_r: each directory name in CCDDPPAATTHH is searched for _d_i_r. Alter- - native directory names in CCDDPPAATTHH are separated by a colon (:). - A null directory name in CCDDPPAATTHH is the same as the current di- - rectory, i.e., ``..''. If _d_i_r begins with a slash (/), then CCDD-- - PPAATTHH is not used. The --PP option causes ccdd to use the physical + _d_i_r: 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 the same as the current + directory, i.e., ".". If _d_i_r begins with a slash (/), then CCDD-- + PPAATTHH is not used. The --PP option causes ccdd to use the physical directory structure by resolving symbolic links while traversing _d_i_r and before processing instances of _._. in _d_i_r (see also the --PP option to the sseett builtin command); the --LL option forces sym- - bolic links to be followed by resolving the link after process- - ing instances of _._. in _d_i_r. If _._. appears in _d_i_r, it is pro- - cessed by removing the immediately previous pathname component - from _d_i_r, back to a slash or the beginning of _d_i_r. If the --ee - option is supplied with --PP, and the current working directory + bolic links to be followed by resolving the link after process- + ing instances of _._. in _d_i_r. If _._. appears in _d_i_r, it is + processed by removing the immediately previous pathname compo- + nent from _d_i_r, back to a slash or the beginning of _d_i_r. If the + --ee option is supplied with --PP, and the current working directory cannot be successfully determined after a successful directory change, ccdd will return an unsuccessful status. On systems that support it, the --@@ option presents the extended attributes asso- - ciated with a file as a directory. An argument of -- is con- - verted to $$OOLLDDPPWWDD before the directory change is attempted. If - a non-empty directory name from CCDDPPAATTHH is used, or if -- is the - first argument, and the directory change is successful, the ab- - solute pathname of the new working directory is written to the + ciated with a file as a directory. An argument of -- is con- + verted to $$OOLLDDPPWWDD before the directory change is attempted. If + a non-empty directory name from CCDDPPAATTHH is used, or if -- is the + first argument, and the directory change is successful, the ab- + solute pathname of the new working directory is written to the standard output. 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 @@ -4771,73 +4777,74 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ccoommmmaanndd [--ppVVvv] _c_o_m_m_a_n_d [_a_r_g ...] Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function lookup. Only builtin commands or commands found in the PPAATTHH are - executed. If the --pp option is given, 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 standard utilities. If either the --VV or --vv op- - tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv - option causes a single word indicating the command or filename + executed. If the --pp option is given, 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 standard utilities. If either the --VV or --vv op- + tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or filename used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a more verbose description. If the --VV or --vv option is supplied, the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- - not be found, the exit status is 127. Otherwise, the exit sta- + not be found, the exit status is 127. Otherwise, the exit sta- tus 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 sup- plied, ccoommppggeenn stores the generated completions 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 by the programmable completion facilities, while + 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 by the programmable completion facilities, while available, will not have useful values. 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, + tion specification with the same flags. If _w_o_r_d is specified, only those completions matching _w_o_r_d will be displayed. - 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] [--GG _g_l_o_b_p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] - [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] + [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e ...] ccoommpplleettee --pprr [--DDEEII] [_n_a_m_e ...] - Specify how arguments to each _n_a_m_e should be completed. If the - --pp option is supplied, or if no options are supplied, existing - completion specifications are printed in a way that allows them - to be reused as input. The --rr option removes a completion spec- - ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- - pletion specifications. The --DD option indicates that other sup- - plied options and actions should apply to the ``default'' com- - mand completion; that is, completion attempted on a command for - which no completion has previously been defined. The --EE option - indicates that other supplied options and actions should apply - to ``empty'' command completion; 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 usually 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 specified by the option. + 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 supplied, + existing completion specifications are printed in a way that al- + lows 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- + plied, all completion specifications. The --DD option indicates + that other supplied options and actions should apply to the "de- + fault" command completion; that is, completion attempted on a + command for which no completion has previously been defined. + The --EE option indicates that other supplied options and actions + should apply to "empty" command completion; 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 de- + limiter such as ;; or ||, which is usually command name comple- + tion. 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 ig- + nored; these completions only apply to the case specified by the + option. The process of applying these completion specifications when - word completion is attempted is described above under PPrrooggrraamm-- - mmaabbllee CCoommpplleettiioonn. + word completion is attempted is described above under PPrrooggrraammmmaa-- + bbllee 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 @@ -4871,13 +4878,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS tempted and any matches are added to the results of the other actions. --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 @@ -4885,7 +4892,7 @@ 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 names. May also be specified as --ff. ffuunnccttiioonn @@ -4894,17 +4901,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. @@ -4922,15 +4929,15 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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- - rent command line. When it finishes, the possible com- - pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY + the word preceding the word being completed on the cur- + rent command line. When it finishes, the possible com- + pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY array variable. --GG _g_l_o_b_p_a_t - The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to generate the possible completions. --PP _p_r_e_f_i_x - _p_r_e_f_i_x is added at the beginning of each possible com- + _p_r_e_f_i_x is added at the beginning of each possible com- pletion after all other options have been applied. --SS _s_u_f_f_i_x _s_u_f_f_i_x is appended to each possible completion after all @@ -4940,11 +4947,11 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS special variable as delimiters, and each resultant word is expanded. Shell quoting is honored within _w_o_r_d_l_i_s_t, in order 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- + shell metacharacters or characters in the value of IIFFSS. + The possible completions are the members of the resul- tant list which match the word being completed. --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. @@ -4953,52 +4960,52 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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_- _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 given, display the completion op- - tions 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 op- - tions should apply to the ``default'' command completion; that - is, completion attempted on a command for which no completion - has previously been defined. The --EE option indicates that other - supplied options should apply to ``empty'' command completion; + supplied. If no _o_p_t_i_o_ns are given, display the completion op- + tions 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 op- + tions should apply to the "default" command completion; that is, + completion attempted on a command for which no completion has + previously been defined. The --EE option indicates that other + supplied options should apply to "empty" command completion; that is, completion attempted on a blank line. The --II option indicates that other supplied options should apply to completion - on the initial non-assignment word on the line, or after a com- - mand delimiter such as ;; or ||, which is usually command name + on the initial non-assignment word on the line, or after a com- + mand delimiter such as ;; or ||, which is usually command name completion. - 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] Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or - sseelleecctt loop. If _n is specified, resume at the _nth enclosing - loop. _n must be >= 1. If _n is greater than the number of en- - closing loops, the last enclosing loop (the ``top-level'' loop) - is resumed. The return value is 0 unless _n is not greater than - or equal to 1. + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of en- + closing 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 - given then display the values of variables. The --pp option will + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. 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 than --ff and --FF, are ignored. When --pp is supplied without _n_a_m_e arguments, it will display the attributes and values of all variables having the attributes specified by the additional options. If no other - options are supplied with --pp, ddeeccllaarree will display the at- - tributes and values of all shell variables. The --ff option will - restrict the display to shell functions. The --FF option inhibits - the display of function definitions; only the function name and + options are supplied with --pp, ddeeccllaarree will display the attrib- + utes and values of all shell variables. The --ff option will re- + strict 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 --FF option implies @@ -5007,42 +5014,42 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS tion. It is ignored in all other cases. 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 variable with the same _n_a_m_e - at a surrounding scope. If there is no existing variable, the + 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 variables with the specified attri- - bute or to give variables attributes: + used to restrict output to variables with the specified at- + tribute or to give variables attributes: --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 above). --ff Use function names only. --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 _n_a_m_es for export to subsequent commands via the en- + --xx Mark _n_a_m_es for export to subsequent commands via the en- vironment. - Using `+' instead of `-' turns off the attribute instead, with - the exceptions that ++aa and ++AA may not be used to destroy array - variables and ++rr will not remove the readonly attribute. When + Using "+" instead of "-" turns off the attribute instead, with + the exceptions that ++aa and ++AA may not be used to destroy array + variables and ++rr will not remove the readonly attribute. When used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as with the llooccaall command, unless the --gg option is supplied. If a variable name is followed by =_v_a_l_u_e, the value of the variable @@ -5050,12 +5057,12 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ment 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 attempt is made to + to define a function using "-f foo=bar". an attempt is made to assign a value to a readonly variable, an attempt is made to as- sign a value to an array variable without using the compound as- - signment 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 read- - only status for a readonly variable, an attempt is made to turn + signment 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 read- + only 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. @@ -5066,17 +5073,17 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS list with the ppuusshhdd command; the ppooppdd command removes entries from the list. The current directory is always the first direc- tory in the stack. - --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. @@ -5090,7 +5097,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS is given, each _j_o_b_s_p_e_c is not removed from the table, but is marked so that SSIIGGHHUUPP is not sent to the job if the shell re- ceives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is supplied, the --aa option means - to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- + to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- gument restricts operation to running jobs. The return value is 0 unless a _j_o_b_s_p_e_c does not specify a valid job. @@ -5098,11 +5105,11 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 suppressed. If the --ee option - is given, interpretation of the following backslash-escaped - characters is enabled. The --EE option disables the interpreta- - tion of these escape characters, even on systems where they are - interpreted by default. The xxppgg__eecchhoo shell option may be used - to dynamically determine whether or not eecchhoo interprets any op- + is given, interpretation of the following backslash-escaped + characters is enabled. The --EE option disables the interpreta- + tion of these escape characters, even on systems where they are + interpreted by default. The xxppgg__eecchhoo shell option may be used + to dynamically determine whether or not eecchhoo interprets any op- tions and expands these escape characters by default. eecchhoo does not interpret ---- to mean the end of options. eecchhoo interprets the following escape sequences: @@ -5130,14 +5137,14 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 a disk command 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 disk commands. - If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- - abled. For example, to use the tteesstt binary found via the PPAATTHH - instead of the shell builtin version, run ``enable -n test''. - 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. - BBaasshh will use the value of the BBAASSHH__LLOOAADDAABBLLEESS__PPAATTHH variable as a + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- + abled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run "enable -n test". 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. 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, if _f_i_l_e_n_a_m_e does not contain a slash. The default is sys- tem-dependent, and may include "." to force a search of the cur- @@ -5149,25 +5156,25 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS printed. If --aa is supplied, the list printed includes all builtins, with an indication of whether or not each is enabled. If --ss is supplied, the output is restricted to the POSIX _s_p_e_c_i_a_l - builtins. 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 there + builtins. 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 there is an error loading a new builtin from a shared object. eevvaall [_a_r_g ...] - The _a_r_gs are read and concatenated together into a single com- - mand. This command is then read and executed by the shell, and - its exit status is returned as the value of eevvaall. If there are + The _a_r_gs are read and concatenated together into a single com- + mand. This command is then read and executed by the shell, and + its exit status is returned as the value 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. No new process - is created. The _a_r_g_u_m_e_n_t_s become the arguments to _c_o_m_m_a_n_d. If + If _c_o_m_m_a_n_d is specified, it replaces the shell. No new process + is created. 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 begin- ning of the zeroth 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 environment. If --aa is supplied, the shell passes _n_a_m_e + _g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with + an empty environment. 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 can- not be executed for some reason, a non-interactive shell exits, unless the eexxeeccffaaiill shell option is enabled. In that case, it @@ -5184,11 +5191,11 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS eexxppoorrtt [--ffnn] [_n_a_m_e[=_w_o_r_d]] ... 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 - given, the _n_a_m_e_s refer to functions. If no _n_a_m_e_s are given, or - if the --pp option is supplied, a list of names of all exported - variables is printed. The --nn option causes the export property + 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. If no _n_a_m_e_s are given, or + if the --pp option is supplied, a list of names of all exported + variables is printed. The --nn option causes the export property to be removed from each _n_a_m_e. If a variable name is followed by =_w_o_r_d, the value of the variable is set to _w_o_r_d. eexxppoorrtt returns an exit status of 0 unless an invalid option is encountered, one @@ -5208,8 +5215,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS _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); otherwise 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 + 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. @@ -5224,9 +5231,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS In the second form, _c_o_m_m_a_n_d is re-executed after each instance of _p_a_t is replaced by _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 this is ``r="fc -s"'', - so that typing ``r cc'' runs the last command beginning with - ``cc'' and typing ``r'' re-executes the last command. + _f_i_r_s_t above. A useful alias to use with this 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 0 unless an in- valid option is encountered or _f_i_r_s_t or _l_a_s_t specify history @@ -5240,20 +5247,20 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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, the shell's notion of the _c_u_r_r_e_n_t _j_o_b - is used. The return value is that of the command placed into - the foreground, or failure if run when job control is disabled + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- ify 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 _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g ...] ggeettooppttss is used by shell procedures to parse positional parame- ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- nized; if a character is followed by a colon, the option is ex- pected to have 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 shell variable _n_a_m_e, initializing + 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 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 op- @@ -5278,15 +5285,15 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS variable OOPPTTEERRRR is set to 0, no error messages will be dis- played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. - If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if - not silent, prints an error message and unsets OOPPTTAARRGG. If - ggeettooppttss is silent, the option character found is placed in OOPP-- - TTAARRGG and no diagnostic message is printed. + 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-- + TTAARRGG and does not print a diagnostic message. - If a required argument is not found, and ggeettooppttss is not silent, - a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a - diagnostic message is printed. If ggeettooppttss is silent, then a - colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + 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 character found. ggeettooppttss returns true if an option, specified or unspecified, is @@ -5297,11 +5304,11 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e is determined by searching the directories in $$PPAATTHH and remem- bered. Any previously-remembered pathname is discarded. If the - --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename - of the command. The --rr option causes the shell to forget all - remembered locations. Assigning to the PPAATTHH variable also - clears all hashed filenames. The --dd option causes the shell to - forget the remembered location of each _n_a_m_e. If the --tt option + --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename + of the command. The --rr option causes the shell to forget all + remembered locations. Assigning to the PPAATTHH variable also + clears all hashed filenames. The --dd option causes the shell to + forget the remembered location of each _n_a_m_e. If the --tt option is supplied, the full pathname to which each _n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are supplied with --tt, the _n_a_m_e is printed before the hashed full pathname. The --ll option @@ -5311,13 +5318,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS and --pp options (the options that act on the _n_a_m_e arguments) are mutually exclusive. Only one will be active. If more than one is supplied, --tt has higher priority than --pp, and both are higher - priority than --dd. The return status is true unless a _n_a_m_e is + priority than --dd. The return status is true unless a _n_a_m_e is not found or an invalid 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 help for all the builtins and shell control + 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 help for all the builtins and shell control structures is printed. --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 @@ -5331,8 +5338,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS hhiissttoorryy --dd _o_f_f_s_e_t hhiissttoorryy --dd _s_t_a_r_t-_e_n_d hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] - hhiissttoorryy --pp _a_r_g [_a_r_g _._._.] - hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] + hhiissttoorryy --pp _a_r_g [_a_r_g ...] + hhiissttoorryy --ss _a_r_g [_a_r_g ...] With no options, display the command history list with line num- bers. Lines listed with a ** have been modified. An argument of _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- @@ -5355,15 +5362,15 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Delete the range of history entries between positions _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values for _s_t_a_r_t and _e_n_d are interpreted as described above. - --aa Append the ``new'' history lines to the history file. + --aa Append the "new" history lines to the history file. These are history lines entered since the beginning of the current bbaasshh session, but not already appended to the history file. - --nn Read the history lines not already read from the history - file into the current history list. These are lines ap- - pended to the history file since the beginning of the + --nn Read the history lines not already read from the history + file into the current history list. These are lines ap- + pended to the history file since the beginning of the current bbaasshh session. - --rr Read the contents of the history file and append them to + --rr Read the contents of the history file and append them to the current history list. --ww Write the current history list to the history file, over- writing the history file's contents. @@ -5391,15 +5398,15 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS The first form lists the active jobs. The options have the fol- lowing meanings: --ll List process IDs in addition to the normal information. - --nn Display information only about jobs that have changed + --nn Display information only about jobs that have changed status since the user was last notified of their status. - --pp List only the process ID of the job's process group + --pp List only the process ID of the job's process group leader. --rr Display only running jobs. --ss Display only stopped jobs. - If _j_o_b_s_p_e_c is given, output is restricted to information about - that job. The return status is 0 unless an invalid option is + If _j_o_b_s_p_e_c is given, output is restricted to information about + that job. The return status is 0 unless an invalid option is encountered or an invalid _j_o_b_s_p_e_c is supplied. If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in @@ -5408,13 +5415,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ... kkiillll --ll|--LL [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s] - Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes - named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive - signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or - a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not - present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the - signal names. If any arguments are supplied when --ll is given, - the names of the signals corresponding to the arguments are + Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes + named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive + signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or + a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not + present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the + signal names. If any arguments are supplied when --ll is given, + the names of the signals corresponding to the arguments are listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to --ll is a number specifying either a signal number or the exit status of a process terminated by a signal. The --LL option is @@ -5431,22 +5438,22 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS For each argument, a local variable named _n_a_m_e is created, and assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddeeccllaarree. When llooccaall is used within a function, it causes the - variable _n_a_m_e to have a visible scope restricted to that func- - tion and its children. If _n_a_m_e is -, the set of shell options - is made local to the function in which llooccaall is invoked: shell - options changed using the sseett builtin inside the function after + variable _n_a_m_e to have a visible scope restricted to that func- + tion and its children. If _n_a_m_e is -, the set of shell options + is made local to the function in which llooccaall is invoked: shell + options changed using the sseett builtin inside the function after the call to llooccaall are restored to their original values when the function returns. The restore is effected as if a series of sseett - commands were executed to restore the values that were in place - before the function. With no operands, llooccaall writes a list of - local variables to the standard output. It is an error to use + commands were executed to restore the values that were in place + before the function. With no operands, llooccaall writes a list of + local variables to the standard output. It is an error to use llooccaall when not within a function. The return status is 0 unless llooccaall is used outside a function, an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable. llooggoouutt Exit a login shell. - mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC + mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] @@ -5458,31 +5465,31 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS input line, rather than newline. If _d_e_l_i_m is the empty string, mmaappffiillee will terminate a line when it reads a NUL character. - --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are + --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are copied. - --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default + --OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default index is 0. --ss Discard the first _c_o_u_n_t lines read. - --tt Remove a trailing _d_e_l_i_m (default newline) from each line + --tt Remove a trailing _d_e_l_i_m (default newline) from each line read. - --uu Read lines from file descriptor _f_d instead of the stan- + --uu Read lines from file descriptor _f_d instead of the stan- dard input. - --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The --cc option specifies _q_u_a_n_t_u_m. - --cc Specify the number of lines read between each call to + --cc Specify the number of lines read between each call to _c_a_l_l_b_a_c_k. - If --CC is specified without --cc, the default quantum is 5000. + If --CC is specified without --cc, the default quantum is 5000. When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that - element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after + element as additional arguments. _c_a_l_l_b_a_c_k is evaluated after the line is read but before the array element is assigned. - If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- + If not supplied with an explicit origin, mmaappffiillee will clear _a_r_- _r_a_y before assigning to it. - mmaappffiillee returns successfully unless an invalid option or option - argument is supplied, _a_r_r_a_y is invalid or unassignable, or if + mmaappffiillee returns successfully unless an invalid option or option + argument is supplied, _a_r_r_a_y is invalid or unassignable, or if _a_r_r_a_y is not an indexed array. ppooppdd [-nn] [+_n] [-_n] @@ -5491,16 +5498,16 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS With no arguments, ppooppdd removes the top directory from the stack, and changes to the new top directory. Arguments, if sup- plied, have the following meanings: - --nn Suppresses the normal change of directory when removing + --nn Suppresses the normal change of directory when removing directories from the stack, so that only the stack is ma- nipulated. ++_n Removes the _nth entry counting from the left of the list shown by ddiirrss, starting with zero, from the stack. For - example: ``popd +0'' removes the first directory, ``popd - +1'' the second. + example: "popd +0" removes the first directory, "popd +1" + the second. --_n Removes the _nth entry counting from the right of the list - shown by ddiirrss, starting with zero. For example: ``popd - -0'' removes the last directory, ``popd -1'' the next to + shown by ddiirrss, starting with zero. For example: "popd + -0" removes the last directory, "popd -1" the next to last. If the top element of the directory stack is modified, and the @@ -5508,7 +5515,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS to the directory at the top of the stack. If the ccdd fails, ppooppdd returns a non-zero value. - Otherwise, ppooppdd returns false if an invalid option is encoun- + Otherwise, ppooppdd returns false if an invalid option is encoun- tered, the directory stack is empty, or a non-existent directory stack entry is specified. @@ -5532,30 +5539,30 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ifiers: %%bb causes pprriinnttff to expand backslash escape sequences in the corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee. - %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a - format that can be reused as shell input. %%qq and %%QQ use - the $$'''' quoting style if any characters in the argument - string require it, and backslash quoting otherwise. If - the format string uses the _p_r_i_n_t_f alternate form, these + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. %%qq and %%QQ use + the $$'''' quoting style if any characters in the argument + string require it, and backslash quoting otherwise. If + the format string uses the _p_r_i_n_t_f alternate form, these two formats quote the argument string using single quotes. - %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- + %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- _m_e_n_t before quoting it. %%((_d_a_t_e_f_m_t))TT - causes pprriinnttff to output the date-time string resulting - from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). The corresponding _a_r_g_u_m_e_n_t is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. If no ar- gument is specified, conversion behaves as if -1 had been - given. This is an exception to the usual pprriinnttff behav- + given. This is an exception to the usual pprriinnttff behav- ior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that - many bytes from (or use that wide a field for) the expanded ar- - gument, which usually contains more characters than the origi- + many bytes from (or use that wide a field for) the expanded ar- + gument, which usually contains more characters than the origi- nal. The %n format specifier accepts a corresponding argument that is @@ -5568,10 +5575,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Arguments to non-string format specifiers are treated as C con- stants, except that a leading plus or minus sign is allowed, and - if the leading character is a single or double quote, the value + if the leading character is a single or double quote, the value is the ASCII value of the following character. - The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, the extra format specifications behave as if a zero value or null string, as appropriate, had been supplied. The return @@ -5597,7 +5604,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS _d_i_r Adds _d_i_r to the directory stack at the top After the stack has been modified, if the --nn option was not sup- - plied, ppuusshhdd uses the ccdd builtin to change to the directory at + plied, ppuusshhdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero value. @@ -5618,13 +5625,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS occurs while reading the name of the current directory or an in- valid option is supplied. - rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] + rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] One line is read from the standard input, or from the file de- scriptor _f_d supplied as an argument to the --uu option, split into - words as described above under WWoorrdd SSpplliittttiinngg, and the first - word is assigned to the first _n_a_m_e, the second word to the sec- - ond _n_a_m_e, and so on. If there are more words than names, the + words as described above under WWoorrdd SSpplliittttiinngg, and the first + word is assigned to the first _n_a_m_e, the second word to the sec- + ond _n_a_m_e, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned to the last _n_a_m_e. If there are fewer words read from the input stream than names, the remaining names are assigned empty val- @@ -5632,12 +5639,12 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS words using the same rules the shell uses for expansion (de- scribed above under WWoorrdd SSpplliittttiinngg). The backslash character (\\) may be used to remove any special meaning for the next char- - acter read and for line continuation. Options, if supplied, + acter read and for line continuation. Options, if supplied, have the following meanings: --aa _a_n_a_m_e The words are assigned to sequential indices of the array variable _a_n_a_m_e, starting at 0. _a_n_a_m_e is unset before any - new values are assigned. Other _n_a_m_e arguments are ig- + new values are assigned. Other _n_a_m_e arguments are ig- nored. --dd _d_e_l_i_m The first character of _d_e_l_i_m is used to terminate the in- @@ -5656,10 +5663,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS bash's default completion, including programmable comple- tion. --ii _t_e_x_t - If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is placed into the editing buffer before editing begins. --nn _n_c_h_a_r_s - rreeaadd returns after reading _n_c_h_a_r_s characters rather than + rreeaadd returns after reading _n_c_h_a_r_s characters rather than waiting for a complete line of input, but honors a delim- iter if fewer than _n_c_h_a_r_s characters are read before the delimiter. @@ -5684,13 +5691,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --ss Silent mode. If input is coming from a terminal, charac- ters are not echoed. --tt _t_i_m_e_o_u_t - Cause rreeaadd to time out and return failure if a complete - line of input (or a specified number of characters) is - not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- - mal number with a fractional portion following the deci- - mal point. This option is only effective if rreeaadd is - reading input from a terminal, pipe, or other special - file; it has no effect when reading from regular files. + Cause rreeaadd to time out and return failure if a complete + line of input (or a specified number of characters) is + not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- + mal number with a fractional portion following the deci- + mal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. If rreeaadd times out, rreeaadd saves any partial input read into the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd re- turns immediately, without trying to read any data. The @@ -5700,11 +5707,14 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS timeout is exceeded. --uu _f_d Read input from file descriptor _f_d. - If no _n_a_m_e_s are supplied, the line read, without the ending de- - limiter but otherwise unmodified, is assigned to the variable - RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- - tered, rreeaadd times out (in which case the status is greater than - 128), a variable assignment error (such as assigning to a read- + Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig- + nores any NUL characters in the input. + + If no _n_a_m_e_s are supplied, the line read, without the ending de- + limiter but otherwise unmodified, is assigned to the variable + RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- + tered, rreeaadd times out (in which case the status is greater than + 128), a variable assignment error (such as assigning to a read- only variable) occurs, or an invalid file descriptor is supplied as the argument to --uu. @@ -5715,7 +5725,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS marked. The --aa option restricts the variables to indexed ar- rays; the --AA option restricts the variables to associative ar- rays. If both options are supplied, --AA takes precedence. If no - _n_a_m_e arguments are given, or if the --pp option is supplied, a + _n_a_m_e arguments are given, or if the --pp option is supplied, a list of all readonly names is printed. The other options may be used to restrict the output to a subset of the set of readonly names. The --pp option causes output to be displayed in a format @@ -5726,9 +5736,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS a _n_a_m_e that is not a function. rreettuurrnn [_n] - Causes a function to stop executing and return the value speci- - fied by _n to its caller. If _n is omitted, the return status is - that of the last command executed in the function body. If rree-- + Causes a function to stop executing and return the value speci- + fied by _n to its caller. If _n is omitted, the return status is + that of the last command executed in the function body. If rree-- ttuurrnn is executed by a trap handler, the last command used to de- termine the status is the last command executed before the trap handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last @@ -5739,9 +5749,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS that script and return either _n or the exit status of the last command executed within the script as the exit status of the script. If _n is supplied, the return value is its least signif- - icant 8 bits. The return status is non-zero if rreettuurrnn is sup- - plied a non-numeric argument, or is used outside a function and - not during execution of a script by .. or ssoouurrccee. Any command + icant 8 bits. The return status is non-zero if rreettuurrnn is sup- + plied a non-numeric argument, or is used outside a function and + not during execution of a script by .. or ssoouurrccee. Any command associated with the RREETTUURRNN trap is executed before execution re- sumes after the function or script. @@ -5751,27 +5761,27 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS sseett ++oo Without options, display the name and value of each shell vari- able in a format that can be reused as input for setting or re- setting the currently-set variables. Read-only variables cannot - be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The - output is sorted according to the current locale. When options - are specified, they set or unset shell attributes. Any argu- - ments remaining after option processing are treated as values + be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The + output is sorted according to the current locale. When options + are specified, they set or unset shell attributes. Any argu- + ments remaining after option processing are treated as values for the positional parameters and are assigned, in order, to $$11, - $$22, ...... $$_n. Options, if specified, have the following mean- + $$22, ..., $$_n. Options, if specified, have the following mean- ings: --aa Each variable or function that is created or modified is - given the export attribute and marked for export to the + given the export attribute and marked for export to the environment of subsequent commands. - --bb Report the status of terminated background jobs immedi- + --bb Report the status of terminated background jobs immedi- ately, rather than before the next primary prompt. This is effective only when job control is enabled. --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d (see SSHHEELLLL GGRRAAMMMMAARR above), exits with a non-zero status. - The shell does not exit if the command that fails is - part of the command list immediately following a wwhhiillee - or uunnttiill keyword, part of the test following the iiff or - eelliiff reserved words, part of any command executed in a - &&&& or |||| list except the command following the final &&&& + The shell does not exit if the command that fails is + part of the command list immediately following a wwhhiillee + or uunnttiill keyword, part of the test following the iiff or + eelliiff reserved words, part of any command executed in a + &&&& or |||| list except the command following the final &&&& or ||||, any command in a pipeline but the last, or if the command's return value is being inverted with !!. If a compound command other than a subshell returns a non- @@ -5779,7 +5789,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ignored, the shell does not exit. A trap on EERRRR, if set, is executed before the shell exits. This option applies to the shell environment and each subshell envi- - ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT + ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT above), and may cause subshells to exit before executing all the commands in the subshell. @@ -5805,7 +5815,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS pletes, the shell prints a line containing its exit sta- tus. --nn Read commands but do not execute them. This may be used - to check a shell script for syntax errors. This is ig- + to check a shell script for syntax errors. This is ig- nored by interactive shells. --oo _o_p_t_i_o_n_-_n_a_m_e The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: @@ -5813,10 +5823,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Same as --aa. bbrraacceeeexxppaanndd Same as --BB. - eemmaaccss Use an emacs-style command line editing inter- + eemmaaccss Use an emacs-style command line editing inter- face. This is enabled by default when the shell is interactive, unless the shell is started with - the ----nnooeeddiittiinngg option. This also affects the + the ----nnooeeddiittiinngg option. This also affects the editing interface used for rreeaadd --ee. eerrrreexxiitt Same as --ee. eerrrrttrraaccee @@ -5830,9 +5840,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS HHIISSTTOORRYY. This option is on by default in inter- active shells. iiggnnoorreeeeooff - The effect is as if the shell command ``IG- - NOREEOF=10'' had been executed (see SShheellll VVaarrii-- - aabblleess above). + The effect is as if the shell command + "IGNOREEOF=10" had been executed (see SShheellll + VVaarriiaabblleess above). kkeeyywwoorrdd Same as --kk. mmoonniittoorr Same as --mm. nnoocclloobbbbeerr @@ -5846,14 +5856,14 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS pphhyyssiiccaall Same as --PP. ppiippeeffaaiill - If set, the return value of a pipeline is the - value of the last (rightmost) command to exit - with a non-zero status, or zero if all commands - in the pipeline exit successfully. This option + If set, the return value of a pipeline is the + value of the last (rightmost) command to exit + with a non-zero status, or zero if all commands + in the pipeline exit successfully. This option is disabled by default. - ppoossiixx 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 + 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. pprriivviilleeggeedd @@ -5863,18 +5873,18 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 $$EENNVV and - $$BBAASSHH__EENNVV files are not processed, shell functions are - not inherited from the environment, and the SSHHEELLLLOOPPTTSS, - BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- - pear 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 sup- + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- + pear 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 sup- plied, these actions are taken and the effective user id is set to the real user id. If the --pp option is sup- plied at startup, the effective user id is not reset. @@ -5893,18 +5903,18 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --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 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 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. This may be + --CC If set, bbaasshh does not overwrite an existing file with + the >>, >>&&, and <<>> redirection operators. This may be overridden when creating output files by using the redi- rection operator >>|| instead of >>. --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. @@ -5912,23 +5922,23 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 traps are normally not inherited in such cases. ---- If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parame- - ters are set to the _a_r_gs, even if some of them begin + ters are set to the _a_r_gs, even if some of them begin with a --. - -- Signal the end of options, cause all remaining _a_r_gs to + -- Signal the end of options, cause all remaining _a_r_gs to be assigned to the positional parameters. The --xx and --vv options are turned off. If there are no _a_r_gs, the posi- tional parameters 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 true unless an invalid option is encoun- @@ -5939,8 +5949,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Parameters represented by the numbers $$## down to $$##-_n+1 are un- set. _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 param- - eters are not changed. The return status is greater than zero + assumed to be 1. If _n is greater than $$##, the positional para- + meters 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 ...] @@ -5950,12 +5960,12 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS builtin command. With no options, or with the --pp option, a list of all settable options is displayed, with an indication of whether or not each is set; if _o_p_t_n_a_m_e_s are supplied, the output - is restricted to those options. The --pp option causes output to - be displayed in a form that may be reused as input. Other op- + is restricted to those options. The --pp option causes output to + be displayed in a form that may be reused as input. Other op- tions 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 given with --qq, the return sta- tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- @@ -5991,7 +6001,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS not a directory is assumed to be the name of a variable whose value is the directory to change to. ccddssppeellll If set, minor errors in the spelling of a directory com- - ponent in a ccdd command will be corrected. The errors + ponent in a ccdd command will be corrected. The errors checked for are transposed characters, a missing charac- ter, and one character too many. If a correction is found, the corrected filename is printed, and the com- @@ -5999,14 +6009,14 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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, a normal path search is per- + ble exists before trying to execute it. If a hashed + command no longer exists, a normal path search is per- formed. cchheecckkjjoobbss If set, bbaasshh lists the status of any stopped and running jobs before exiting an interactive shell. If any jobs are running, this causes the exit to be deferred until a - second exit is attempted without an intervening command + second exit is attempted without an intervening command (see JJOOBB CCOONNTTRROOLL above). The shell always postpones ex- iting if any jobs are stopped. cchheecckkwwiinnssiizzee @@ -6034,70 +6044,70 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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. - This changes the contents of the readline editing buf- - fer. If not set, bbaasshh attempts to preserve what the + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. + This changes the contents of the readline editing + 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 ````....'''' must always be matched explicitly, even if - ddoottgglloobb is set. + 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 ddoott-- + gglloobb 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 command. An interactive shell does not + not execute the file specified as an argument to the + eexxeecc builtin command. 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, 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. @@ -6109,17 +6119,17 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS above under PPaatthhnnaammee EExxppaannssiioonn are enabled. 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- @@ -6136,13 +6146,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS gglloobbsskkiippddoottss If set, pathname expansion will never match the file- - names ````..'''' and ````....'''', even if the pattern begins with - a ````..''''. This option is enabled by default. + 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 @@ -6155,20 +6165,20 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS its, rather than overwriting the file. hhiissttrreeeeddiitt - If set, and rreeaaddlliinnee is being used, a user is given the + If set, and rreeaaddlliinnee is being used, a user is given the opportunity to re-edit a failed history substitution. 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 @@ -6183,12 +6193,12 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS iinntteerraaccttiivvee__ccoommmmeennttss If set, allow a word beginning with ## to cause that word - and all remaining characters on that line to be ignored - in an interactive shell (see CCOOMMMMEENNTTSS above). This op- + and all remaining characters on that line to be ignored + in an interactive shell (see CCOOMMMMEENNTTSS above). This op- tion 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. @@ -6216,9 +6226,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS mmaaiillwwaarrnn If set, and a file that bbaasshh is checking for mail has - been accessed since the last time it was checked, the - message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- - played. + 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 will not at- @@ -6231,15 +6241,15 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 @@ -6267,31 +6277,31 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 + find the directory containing the file supplied as an argument. This option 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 RREE-- - DDIIRREECCTTIIOONN above) instead of leaving them open when the + 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 @@ -6310,19 +6320,19 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 op- - erand 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- - pends on the number of arguments; see below. Operator prece- + 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. Operator prece- dence is used 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 the normal precedence of operators. _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. @@ -6347,35 +6357,35 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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. the two-argument test using the second and - third arguments. If the first argument is exactly (( and - the fourth argument is exactly )), the result is the two- - argument test of the second and third arguments. Other- + the three-argument expression composed of the remaining + arguments. the two-argument test using the second and + third arguments. If the first argument is exactly (( and + the fourth argument is exactly )), the result is the two- + argument test of the second and third arguments. Other- wise, 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 precedence using the rules listed above. - If the shell is not in _p_o_s_i_x _m_o_d_e, when used with tteesstt or [[, the - << and >> operators sort lexicographically using ASCII ordering. - When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the - current locale. + When the shell is in _p_o_s_i_x _m_o_d_e, or if the expression is part of + the [[[[ command, the << and >> operators sort using the current lo- + cale. If the shell is not in _p_o_s_i_x _m_o_d_e, the tteesstt and [[ com- + mands sort lexicographically using ASCII ordering. ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. @@ -6391,9 +6401,9 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 @@ -6412,7 +6422,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _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, + _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, arithmetic _f_o_r command, and before the first command executes in a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the de- scription of the eexxttddeebbuugg option to the sshhoopptt builtin for de- @@ -6426,7 +6436,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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, or if the command's return value is being inverted using @@ -6445,31 +6455,31 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] With no options, 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 disk file, respectively. If the _n_a_m_e is - not found, then nothing is printed, and ttyyppee returns a non-zero - exit status. If the --pp option is used, ttyyppee either returns the - name of the executable file that would be found by searching - $$PPAATTHH if _n_a_m_e were specified as a command name, 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 name'' would not - return _f_i_l_e. If a command is hashed, --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, re- - served words, functions, and builtins, but the path search op- + 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 disk file, respectively. If the _n_a_m_e is + not found, then nothing is printed, and ttyyppee returns a non-zero + exit status. If the --pp option is used, ttyyppee either returns the + name of the executable file that would be found by searching + $$PPAATTHH if _n_a_m_e were specified as a command name, 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 name" would not re- + turn _f_i_l_e. If a command is hashed, --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, re- + served words, functions, and builtins, but the path search op- tions (--pp and --PP) can be supplied to restrict the output to exe- cutable files. ttyyppee does not consult the table of hashed com- mands 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 ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments + _n_a_m_e. The --ff option suppresses shell function lookup, as with + the ccoommmmaanndd 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 - to processes started by it, on systems that allow such control. + Provides control over the resources available to the shell and + to processes started by it, on systems that allow such control. The --HH and --SS options specify that 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 @@ -6477,8 +6487,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS fied, both the soft and hard limits are set. 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, re- - spectively. If _l_i_m_i_t is omitted, the current value of the soft + current hard limit, the current soft limit, and no limit, re- + spectively. If _l_i_m_i_t is omitted, the current value of the soft limit of the resource is printed, 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 op- @@ -6487,7 +6497,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --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") + --ee The maximum scheduling priority ("nice"). --ff The maximum size of files written by the shell and its children --ii The maximum number of pending signals @@ -6502,24 +6512,24 @@ 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 given, and the --aa option is not used, _l_i_m_i_t is the - new value of the specified resource. If no option is given, - 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 option or argument is supplied, or an error + If _l_i_m_i_t is given, and the --aa option is not used, _l_i_m_i_t is the + new value of the specified resource. If no option is given, + 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 option or argument is supplied, or an error occurs while setting a new limit. uummaasskk [--pp] [--SS] [_m_o_d_e] @@ -6542,41 +6552,41 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS uunnsseett [-ffvv] [-nn] [_n_a_m_e ...] 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. Read-only variables may not be - unset. If --ff is specified, each _n_a_m_e refers to a shell func- - tion, and the function definition is removed. 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. If no options are - supplied, each _n_a_m_e refers to a variable; if there is no vari- - able by that name, a function with that name, if any, is unset. - Each unset variable or function is removed from the environment - passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS, + and that variable is removed. Read-only variables may not be + unset. If --ff is specified, each _n_a_m_e refers to a shell func- + tion, and the function definition is removed. 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. If no options are + supplied, each _n_a_m_e refers to a variable; if there is no vari- + able by that name, a function with that name, if any, is unset. + Each unset variable or function is removed from the environment + passed to subsequent commands. If any of BBAASSHH__AALLIIAASSEESS, BBAASSHH__AARRGGVV00, BBAASSHH__CCMMDDSS, BBAASSHH__CCOOMMMMAANNDD, BBAASSHH__SSUUBBSSHHEELLLL, BBAASSHHPPIIDD, - CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- - NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are + CCOOMMPP__WWOORRDDBBRREEAAKKSS, DDIIRRSSTTAACCKK, EEPPOOCCHHRREEAALLTTIIMMEE, EEPPOOCCHHSSEECCOONNDDSS, FFUUNNCC-- + NNAAMMEE, GGRROOUUPPSS, HHIISSTTCCMMDD, LLIINNEENNOO, RRAANNDDOOMM, SSEECCOONNDDSS, or SSRRAANNDDOOMM are unset, they lose their special properties, even if they are sub- sequently reset. The exit status is true unless a _n_a_m_e is read- only or may not be unset. - wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.] + wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d ...] Wait for each specified child process and return its termination status. Each _i_d may be a process ID or a job specification; if a job spec is given, all processes in that job's pipeline are waited for. If _i_d is not given, 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 a single job from + If the --nn option is supplied, wwaaiitt waits for a single job from the list of _i_ds or, if no _i_ds are supplied, any job, to complete and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the - shell has no unwaited-for children, the exit status is 127. If - the --pp option is supplied, the process or job identifier of the - job for which the exit status is returned is assigned to the - variable _v_a_r_n_a_m_e named by the option argument. The variable - will be unset initially, before any assignment. This is useful - only when the --nn option is supplied. Supplying the --ff option, - when job control is enabled, forces wwaaiitt to wait for _i_d to ter- + shell has no unwaited-for children, the exit status is 127. If + the --pp option is supplied, the process or job identifier of the + job for which the exit status is returned is assigned to the + variable _v_a_r_n_a_m_e named by the option argument. The variable + will be unset initially, before any assignment. This is useful + only when the --nn option is supplied. Supplying the --ff option, + when job control is enabled, forces wwaaiitt to wait for _i_d to ter- minate before returning its status, instead of returning when it changes status. If _i_d specifies a non-existent process or job, the return status is 127. If wwaaiitt is interrupted by a signal, @@ -6586,13 +6596,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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- - fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, - ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil- - ity level -- each option is mutually exclusive. The compatibility - level is intended to allow users to select behavior from previous ver- - sions that is incompatible with newer versions while they migrate - scripts to use current features and behavior. It's intended to be a - temporary solution. + fied as a set of options to the shopt builtin (ccoommppaatt3311, ccoommppaatt3322, ccoomm-- + 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- + tion. This section does not mention behavior that is standard for a particu- lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the @@ -6606,12 +6616,12 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE 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- patibility level. @@ -6624,12 +6634,12 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE shopt option for the previous version. Users should control the compat- ibility level with BBAASSHH__CCOOMMPPAATT. - 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 @@ -6642,20 +6652,20 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE 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 _p_o_s_i_x 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 @@ -6700,47 +6710,47 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE ccoommppaatt5500 +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- duce slightly more randomness. If the shell compatibility - level is set to 50 or lower, it reverts to the method - from bash-5.0 and previous versions, so seeding the ran- - dom number generator by assigning a value to RRAANNDDOOMM will + 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 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 + +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 once +o the expressions in substring parameter brace expansion can be expanded more than once - +o the expressions in the $(( ... )) word expansion can be - expanded more than once - +o arithmetic expressions used as indexed array subscripts + +o the expressions in the $$((((...)))) word expansion can be ex- + panded more than once + +o arithmetic expressions used as indexed array subscripts can be expanded more than once - +o tteesstt --vv, when given an argument of AA[[@@]], where AAPP iiss aann - eexxiissttiinngg aassssoocciiaattiivvee aarrrraayy,, wwiillll rreettuurrnn ttrruuee iiff tthhee aarrrraayy - hhaass aannyy sseett eelleemmeennttss.. BBaasshh--55..22 wwiillll llooookk ffoorr aanndd rreeppoorrtt - oonn aa kkeeyy nnaammeedd @@.. - ++oo the ${_p_a_r_a_m_e_t_e_r[[::]]==_v_a_l_u_e} word expansion will return + +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 + 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 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- 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. RREESSTTRRIICCTTEEDD SSHHEELLLL @@ -6772,21 +6782,21 @@ RREESSTTRRIICCTTEEDD SSHHEELLLL +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at startup - +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- - ion operators + +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. @@ -6799,7 +6809,7 @@ SSEEEE AALLSSOO _B_a_s_h _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, Brian Fox and Chet Ramey _T_h_e _G_n_u _R_e_a_d_l_i_n_e _L_i_b_r_a_r_y, Brian Fox and Chet Ramey _T_h_e _G_n_u _H_i_s_t_o_r_y _L_i_b_r_a_r_y, Brian Fox and Chet Ramey - _P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_- + _P_o_r_t_a_b_l_e _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m _I_n_t_e_r_f_a_c_e _(_P_O_S_I_X_) _P_a_r_t _2_: _S_h_e_l_l _a_n_d _U_t_i_l_i_- _t_i_e_s, IEEE -- http://pubs.opengroup.org/onlinepubs/9699919799/ http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode @@ -6817,10 +6827,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 @@ -6841,8 +6851,8 @@ BBUUGG RREEPPOORRTTSS 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! Suggestions and `philosophical' bug reports may - be mailed to _b_u_g_-_b_a_s_h_@_g_n_u_._o_r_g or posted to the Usenet newsgroup + 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 ggnnuu..bbaasshh..bbuugg. ALL bug reports should include: @@ -6851,9 +6861,9 @@ BBUUGG RREEPPOORRTTSS The hardware and operating system The compiler used to compile A description of the bug behaviour - A short script or `recipe' which exercises the bug + 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 @@ -6869,17 +6879,16 @@ BBUUGGSS Shell builtin commands and functions are not stoppable/restartable. - Compound commands and command sequences of the form `a ; b ; c' are not + Compound commands and command sequences of the form "a ; b ; c" are not handled gracefully when process suspension is attempted. When a process is stopped, the shell immediately executes the next command in the sequence. It suffices to place the sequence of commands between parentheses to force it into a subshell, which may be stopped as a - unit. + unit, or to start the command in the background and immediately bring + it into the foreground. Array variables may not (yet) be exported. There may be only one active coprocess at a time. - - -GNU Bash 5.3 2023 December 14 BASH(1) +GNU Bash 5.3 2024 February 5 _B_A_S_H(1) diff --git a/doc/bash.1 b/doc/bash.1 index ff51f89b..a259ad6d 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -5,14 +5,14 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Fri Feb 2 09:38:21 EST 2024 +.\" Last Change: Mon Feb 5 10:51:21 EST 2024 .\" .\" bash_builtins, strip all but Built-Ins section .\" avoid a warning about an undefined register .\" .if !rzY .nr zY 0 .if \n(zZ=1 .ig zZ .if \n(zY=1 .ig zY -.TH BASH 1 "2024 February 2" "GNU Bash 5.3" +.TH BASH 1 "2024 February 5" "GNU Bash 5.3" .\" .\" There's some problem with having a `@' .\" in a tagged paragraph with the BSD man macros. @@ -41,7 +41,7 @@ .\" .\" File Name macro. This used to be `.PN', for Path Name, .\" but Sun doesn't seem to like that very much. -.\" The \% is to prevent the filename from hyphenation. +.\" \% at the beginning of the string protects the filename from hyphenation. .\" .de FN \%\fI\|\\$1\|\fP @@ -52,16 +52,17 @@ .\" .de Q .ie \n(.g \(lq\\$1\(rq\\$2 -.el \{ +.el \{\ . if t ``\\$1''\\$2 . if n "\\$1"\\$2 .\} .. +.\" Q but disallowing hyphenation of the string .de QN .ie \n(.g \%\(lq\\$1\(rq\\$2 -.el \{ -. if t \%``\%\\$1''\\$2 -. if n \%"\%\\$1"\\$2 +.el \{\ +. if t \%``\\$1''\\$2 +. if n \%"\\$1"\\$2 .\} .. .SH NAME @@ -377,7 +378,7 @@ behaves as if the following command were executed: .PP .RS .EX -if [ \-n "$BASH_ENV" ]; then . "$BASH_ENV"; fi +if [ \-n \(dq$BASH_ENV\(dq ]; then . \(dq$BASH_ENV\(dq; fi .EE .RE .PP @@ -557,7 +558,7 @@ or \fB|&\fP. The format for a pipeline is: .RS .PP -[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand1\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP ... ] +[\fBtime\fP [\fB\-p\fP]] [ ! ] \fIcommand1\fP [ [\fB|\fP\(bv\fB|&\fP] \fIcommand2\fP .\|.\|.\& ] .RE .PP The standard output of @@ -595,7 +596,8 @@ system time consumed by its execution are reported when the pipeline terminates. The \fB\-p\fP option changes the output format to that specified by POSIX. When the shell is in \fIposix mode\fP, it does not recognize -\fBtime\fP as a reserved word if the next token begins with a `-'. +\fBtime\fP as a reserved word if the next token begins with a +.Q \- . The .SM .B TIMEFORMAT @@ -855,7 +857,7 @@ operators do not evaluate \fIexpression2\fP if the value of the entire conditional expression. .RE .TP -\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword ...\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP +\fBfor\fP \fIname\fP [ [ \fBin\fP [ \fIword .\|.\|.\&\fP ] ] ; ] \fBdo\fP \fIlist\fP ; \fBdone\fP The list of words following \fBin\fP is expanded, generating a list of items. The variable \fIname\fP is set to each element of this list @@ -918,7 +920,8 @@ is the exit status of the last command executed in or zero if no commands were executed. .TP \fBcase\fP \fIword\fP \fBin\fP [ [(] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \ -... ) \fIlist\fP ;; ] ... \fBesac\fP +.\|.\|.\& ) \fIlist\fP ;; ] .\|.\|.\& \ +\fBesac\fP A \fBcase\fP command first expands \fIword\fP, and tries to match it against each \fIpattern\fP in turn, using the matching rules described under @@ -948,7 +951,7 @@ pattern matches. Otherwise, it is the exit status of the last command executed in \fIlist\fP. .TP \fBif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; \ -[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] ... \ +[ \fBelif\fP \fIlist\fP; \fBthen\fP \fIlist\fP; ] .\|.\|.\& \ [ \fBelse\fP \fIlist\fP; ] \fBfi\fP The .B if @@ -1154,7 +1157,7 @@ retains its special meaning only when followed by one of the following characters: .BR $ , .BR \` , -\^\fB"\fP\^, +\^\fB\(dq\fP\^, .BR \e , or .BR . @@ -1317,8 +1320,9 @@ below). If the variable has its .B integer attribute set, then .I value -is evaluated as an arithmetic expression even if the $((...)) expansion is -not used (see +is evaluated as an arithmetic expression even if the +.BR $(( .\|.\|.\& )) +expansion is not used (see .B "Arithmetic Expansion" below). Word splitting and pathname expansion are not performed. @@ -1424,8 +1428,12 @@ When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the .SM .B IFS -special variable. That is, "\fB$*\fP" is equivalent -to "\fB$1\fP\fIc\fP\fB$2\fP\fIc\fP\fB...\fP", where +special variable. +That is, +.B \(dq$*\(dq +is equivalent to +.BR \(dq$1\fIc\fP$2\fIc\fP.\|.\|.\(dq , +where .I c is the first character of the value of the .SM @@ -1447,15 +1455,19 @@ quotes, these words are subject to word splitting. In contexts where word splitting is not performed, this expands to a single word with each positional parameter separated by a space. -When the -expansion occurs within double quotes, each parameter expands to a -separate word. That is, "\fB$@\fP" is equivalent to -"\fB$1\fP"\ "\fB$2\fP"\ ... +When the expansion occurs within double quotes, +each parameter expands to a separate word. +That is, +.B \&\(dq$@\(dq +is equivalent to +.B \&\(dq\&$1\&\(dq\ \(dq$2\(dq\ .\|.\|. If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. -When there are no positional parameters, "\fB$@\fP" and +When there are no positional parameters, +.B \&\(dq$@\(dq +and .B $@ expand to nothing (i.e., they are removed). .TP @@ -2242,7 +2254,7 @@ Each array element contains one possible completion. .B EMACS If \fBbash\fP finds this variable in the environment when the shell starts with value -.Q "t" , +.Q t , it assumes that the shell is running in an Emacs shell buffer and disables line editing. .TP @@ -2284,7 +2296,7 @@ A filename whose suffix matches one of the entries in .B FIGNORE is excluded from the list of matched filenames. A sample value is -.Q ".o:\(ti" . +.Q .o:\(ti . .TP .B FUNCNEST If set to a numeric value greater than 0, defines a maximum function @@ -2384,15 +2396,20 @@ after reading any startup files. .B HISTIGNORE A colon-separated list of patterns used to decide which command lines should be saved on the history list. Each pattern is anchored at the -beginning of the line and must match the complete line (no implicit -`\fB*\fP' is appended). Each pattern is tested against the line +beginning of the line and must match the complete line +(\fBbash\fP will not implicitly append a +.Q \fB*\fP ). +Each pattern is tested against the line after the checks specified by .SM .B HISTCONTROL are applied. -In addition to the normal shell pattern matching characters, `\fB&\fP' -matches the previous history line. `\fB&\fP' may be escaped using a -backslash; the backslash is removed before attempting a match. +In addition to the normal shell pattern matching characters, +.Q \fB&\fP +matches the previous history line. +A backslash will escape the +.Q \fB&\fP ; +the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of .SM @@ -2412,7 +2429,7 @@ The shell sets the default value to 500 after reading any startup files. .TP .B HISTTIMEFORMAT If this variable is set and not null, its value is used as a format string -for +for .IR strftime (3) to print the time stamp associated with each history entry displayed by the \fBhistory\fP builtin. @@ -2555,13 +2572,16 @@ greater than or equal to zero, the shell disables mail checking. .B MAILPATH 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 `?'. +may be specified by separating the filename from the message with a +.Q ? . When used in the text of the message, \fB$_\fP expands to the name of the current mailfile. Example: .RS .PP -\fBMAILPATH\fP=\(aq/var/mail/bfox?"You have mail":\(ti/shell\-mail?"$_ has mail!"\(aq +.EX +\fBMAILPATH\fP=\(aq/var/mail/bfox?\(dqYou have mail\(dq:\(ti/shell\-mail?\(dq$_ has mail!\(dq\(aq +.EE .PP .B Bash can be configured to supply @@ -2643,14 +2663,14 @@ The value of this parameter is expanded (see .SM .B PROMPTING below) and used as the primary prompt string. The default value is -.Q "\es\-\ev\e$\ " . +.Q \es\-\ev\e$\ . .TP .B PS2 The value of this parameter is expanded as with .SM .B PS1 and used as the secondary prompt string. The default is -.Q ">\ " . +.Q >\ . .TP .B PS3 The value of this parameter is used as the prompt for the @@ -2672,8 +2692,8 @@ The first character of the expanded value of .B PS4 is replicated multiple times, as necessary, to indicate multiple levels of indirection. -The default is -.Q "+\ " . +The default is +.Q +\ . .TP .B SHELL This variable expands to the full pathname to the shell. @@ -2785,18 +2805,22 @@ and tokenization (see .B HISTORY EXPANSION below). The first character is the \fIhistory expansion\fP character, the character which signals the start of a history -expansion, normally `\fB!\fP'. +expansion, normally +.Q \fB!\fP . The second character is the \fIquick substitution\fP character, which is used as shorthand for re-running the previous command entered, substituting one string for another in the command, when it appears as the first character on the line. -The default is `\fB\(ha\fP'. -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 `\fB#\fP'. The history -comment character causes history substitution to be skipped 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. +The default is +.Q \fB\(ha\fP . +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 history comment character causes history substitution to be skipped +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. .PD .SS Arrays .B Bash @@ -2836,7 +2860,7 @@ and builtins. Each attribute applies to all members of an array. .PP Arrays are assigned to using compound assignments of the form -\fIname\fP=\fB(\fPvalue\fI1\fP ... value\fIn\fP\fB)\fP, where each +\fIname\fP=\fB(\fPvalue\fI1\fP .\|.\|.\& value\fIn\fP\fB)\fP, where each \fIvalue\fP may be of the form [\fIsubscript\fP]=\fIstring\fP. Indexed array assignments do not require anything but \fIstring\fP. Each \fIvalue\fP in the list is expanded using the shell expansions @@ -2856,9 +2880,10 @@ When assigning to an associative array, the words in a compound assignment may be either assignment statements, for which the subscript is required, or a list of words that is interpreted as a sequence of alternating keys and values: -\fIname\fP=\fB( \fP\fIkey1 value1 key2 value2\fP ...\fB)\fP. +\fIname\fP=\fB( \fP\fIkey1 value1 key2 value2\fP .\|.\|.\&\fB)\fP. These are treated identically to -\fIname\fP=\fB(\fP [\fIkey1\fP]=\fIvalue1\fP [\fIkey2\fP]=\fIvalue2\fP ...\fB)\fP. +\fIname\fP=\fB(\fP [\fIkey1\fP]=\fIvalue1\fP [\fIkey2\fP]=\fIvalue2\fP +\&.\|.\|.\&\fB)\fP. The first word in the list determines how the remaining words are interpreted; all assignments in a list must be of the same type. When using key/value pairs, the keys may not be missing or empty; @@ -3012,7 +3037,10 @@ Only brace expansion, word splitting, and pathname expansion can increase the number of words of the expansion; other expansions expand a single word to a single word. The only exceptions to this are the expansions of -"\fB$@\fP" and "\fB${\fP\fIname\fP\fB[@]}\fP", +.B \&\(dq$@\(dq +and +.B \&\(dq${\fIname\fP[@]}\(dq\c \" keep leading \& for AT&T troff +.BR \& , \" .BR + \& + \*" doesn't work with AT&T troff and, in most cases, \fB$*\fP and \fB${\fP\fIname\fP\fB[*]}\fP as explained above (see .SM @@ -3035,7 +3063,8 @@ to each resulting string, expanding left to right. .PP Brace expansions may be nested. The results of each expanded string are not sorted; left to right order is preserved. -For example, a\fB{\fPd,c,b\fB}\fPe expands into `ade ace abe'. +For example, a\fB{\fPd,c,b\fB}\fPe expands into +.Q "ade ace abe" . .PP A sequence expression takes the form \fB{\fP\fIx\fP\fB..\fP\fIy\fP\fB[..\fP\fIincr\fP\fB]}\fP, @@ -3043,8 +3072,8 @@ 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. -Supplied integers may be prefixed with \fI0\fP to force each term to have the -same width. +If the supplied integers are prefixed with \fI0\fP, each term will +have the same width, zero-padding if 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. @@ -3116,7 +3145,9 @@ command (see .B SHELL BUILTIN COMMANDS below). .SS Tilde Expansion -If a word begins with an unquoted tilde character (`\fB\(ti\fP'), all of +If a word begins with an unquoted tilde character (\c +.Q \fB\(ti\fP ), +all of the characters preceding the first unquoted slash (or all characters, if there is no unquoted slash) are considered a \fItilde-prefix\fP. If none of the characters in the tilde-prefix are quoted, the @@ -3134,22 +3165,35 @@ substituted instead. Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name. .PP -If the tilde-prefix is a `\(ti+', the value of the shell variable +If the tilde-prefix is a +.Q \(ti+ , +the value of the shell variable .SM .B PWD replaces the tilde-prefix. -If the tilde-prefix is a `\(ti\-', the value of the shell variable +If the tilde-prefix is a +.Q \(ti\- , +the value of the shell variable .SM .BR OLDPWD , if it is set, is substituted. If the characters following the tilde in the tilde-prefix consist of a number \fIN\fP, optionally prefixed -by a `+' or a `\-', the tilde-prefix is replaced with the corresponding +by a +.Q + +or a +.Q \- , +the tilde-prefix is replaced with the corresponding element from the directory stack, as it would be displayed by the .B dirs builtin invoked with the tilde-prefix as an argument. If the characters following the tilde in the tilde-prefix consist of a -number without a leading `+' or `\-', `+' is assumed. +number without a leading +.Q + +or +.Q \- , +.Q + +is assumed. .PP If the login name is invalid, or the tilde expansion fails, the word is unchanged. @@ -3178,14 +3222,17 @@ when they appear as arguments to simple commands. \fBBash\fP does not do this, except for the \fIdeclaration\fP commands listed above, when in \fIposix mode\fP. .SS Parameter Expansion -The `\fB$\fP' character introduces parameter expansion, +The +.Q \fB$\fP +character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. .PP -When braces are used, the matching ending brace is the first `\fB}\fP' +When braces are used, the matching ending brace is the first +.Q \fB}\fP not escaped by a backslash or within a quoted string, and not within an embedded arithmetic expansion, command substitution, or parameter expansion. @@ -3399,7 +3446,7 @@ the value of .IR parameter , then the result of the expansion is the expanded value of .I parameter -with the shortest matching pattern (the +with the shortest matching pattern (the .Q # case) or the longest matching pattern (the .Q ## @@ -3437,7 +3484,7 @@ If the pattern matches a trailing portion of the expanded value of .IR parameter , then the result of the expansion is the expanded value of .I parameter -with the shortest matching pattern (the +with the shortest matching pattern (the .Q % case) or the longest matching pattern (the .Q %% @@ -3479,7 +3526,7 @@ The match is performed using the rules described under .B Pattern Matching below. In the first form above, only the first match is replaced. -If there are two slashes separating \fIparameter\fP and \fIpattern\fP +If there are two slashes separating \fIparameter\fP and \fIpattern\fP (the second form above), all matches of \fIpattern\fP are replaced with \fIstring\fP. If \fIpattern\fP is preceded by \fB#\fP (the third form above), @@ -3601,7 +3648,8 @@ format that can be reused as input. .TP .B E The expansion is a string that is the value of \fIparameter\fP with backslash -escape sequences expanded as with the \fB$\(aq...\(aq\fP quoting mechanism. +escape sequences expanded as with the \fB$\(aq\fP.\|.\|.\%\fB\(aq\fP +quoting mechanism. .TP .B P The expansion is a string that is the result of expanding the value of @@ -3698,7 +3746,7 @@ the word without being followed by a shell metacharacter as a reserved word would usually require. .PP Any side effects of \fIcommand\fP take effect immediately -in the current execution environment and persist in the current +in the current execution environment and persist in the current environment after the command completes (e.g., the \fBexit\fP builtin will exit the shell). .PP @@ -3849,10 +3897,11 @@ If .SM .B IFS is unset, word splitting behaves as if it contained the default value -of +of .BR . .PP -Explicit null arguments (\^\f3"\^"\fP or \^\f3\(aq\^\(aq\fP\^) are retained +Explicit null arguments (\^\f3\(dq\^\(dq\fP or +\^\f3\(aq\^\(aq\fP\^) are retained and passed to commands as empty strings. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. @@ -3863,7 +3912,7 @@ When a quoted null argument appears as part of a word whose expansion is non-null, the null argument is removed. That is, the word .Q "\-d\(aq\^\(aq" -becomes +becomes .Q \-d after word splitting and null argument removal. .PP @@ -3916,7 +3965,7 @@ In order to match the filenames .Q .\& and .Q ..\& , -the pattern must begin with +the pattern must begin with .Q .\& (for example, .Q .?\& ), @@ -4035,7 +4084,7 @@ and subdirectories. .B ? Matches any single character. .TP -.B [...] +.BR [ .\|.\|. ] Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a \fIrange expression\fP; @@ -4177,7 +4226,7 @@ After the preceding expansions, all unquoted occurrences of the characters .BR \e , .BR \(aq , -and \^\f3"\fP\^ that did not result from one of the above +and \^\f3\(dq\fP\^ that did not result from one of the above expansions are removed. .SH REDIRECTION Before a command is executed, its input and output @@ -4572,7 +4621,7 @@ the word to see if it matches an alias name. If it matches, the shell replaces the word with the alias value, and reads that value as if it had been read instead of the word. The shell doesn't look at any characters following the word before -attempting alias substitution. +attempting alias substitution. .PP The characters \fB/\fP, \fB$\fP, \fB\`\fP, and \fB=\fP and any of the shell \fImetacharacters\fP or quoting characters @@ -4863,7 +4912,7 @@ logical OR .B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP conditional operator .TP -.B = *= /= %= += \-= <<= >>= &= \(ha= |= +.B "= *= /= %= += \-= <<= >>= &= \(ha= |=" assignment .TP .B \fIexpr1\fP , \fIexpr2\fP @@ -5484,7 +5533,7 @@ same process group as the terminal, and \fB\(haC\fP sends .B SIGINT to all processes in that process group. .PP -When \fBbash\fP is running without job control enabled and receives +When \fBbash\fP is running without job control enabled and receives .SM .B SIGINT while waiting for a foreground command, it waits until that foreground @@ -5576,7 +5625,7 @@ user so specifies with .Q "stty tostop" , write to the terminal. Background processes which attempt to read from (write to when -.Q "tostop" +.Q tostop is in effect) the terminal are sent a .SM .B SIGTTIN (SIGTTOU) @@ -5753,7 +5802,8 @@ time representation. The braces are required an ASCII escape character (033) .TP .B \eh -the hostname up to the first `.' +the hostname up to the first +.Q . .TP .B \eH the hostname @@ -5993,11 +6043,13 @@ When using the form \fBkeyname\fP:\^\fIfunction\-name\fP or \fImacro\fP, is the name of a key spelled out in English. For example: .PP .RS +.EX +.nf Control-u: universal\-argument -.br Meta-Rubout: backward-kill-word -.br -Control-o: "> output" +Control-o: \(dq> output\(dq +.fi +.EE .RE .LP In the above example, @@ -6014,7 +6066,8 @@ expressed on the right hand side (that is, to insert the text .Q "> output" into the line). .PP -In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +In the second form, +\fB\(dqkeyseq\(dq\fP:\^\fIfunction\-name\fP or \fImacro\fP, .B keyseq differs from .B keyname @@ -6025,11 +6078,13 @@ used, as in the following example, but the symbolic character names are not recognized. .PP .RS -"\eC\-u": universal\-argument -.br -"\eC\-x\eC\-r": re\-read\-init\-file -.br -"\ee[11\(ti": "Function Key 1" +.EX +.nf +\(dq\eC\-u\(dq: universal\-argument +\(dq\eC\-x\eC\-r\(dq: re\-read\-init\-file +\(dq\ee[11\(ti\(dq: \(dqFunction Key 1\(dq +.fi +.EE .RE .PP In this example, @@ -6060,8 +6115,8 @@ an escape character .B \e\e backslash .TP -.B \e" -literal " +.B \e\(dq +literal \(dq .TP .B \e\(aq literal \(aq @@ -6112,7 +6167,7 @@ be used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. Backslash will quote any other character in the macro text, -including " and \(aq. +including \(dq and \(aq. .PP .B Bash allows the current readline key bindings to be displayed or modified @@ -6147,14 +6202,18 @@ or .B Off (without regard to case). Unrecognized variable names are ignored. -When a variable value is read, empty or null values, "on" (case-insensitive), -and "1" are equivalent to \fBOn\fP. All other values are equivalent to +When readline reads a variable value, empty or null values, +.Q "on" +(case-insensitive), and +.Q 1 +are equivalent to \fBOn\fP. +All other values are equivalent to \fBOff\fP. The variables and their default values are: .PP .PD 0 .TP -.B active\-region\-start\-color +.B active\-region\-start\-color A string variable that controls the text color and background when displaying the text in the active region (see the description of \fBenable\-active\-region\fP below). @@ -6164,13 +6223,13 @@ It is output to the terminal before displaying the text in the active region. This variable is reset to the default value whenever the terminal type changes. The default value is the string that puts the terminal in standout mode, as obtained from the terminal's terminfo description. -A sample value might be -.Q "\ee[01;33m" . +A sample value might be +.Q \ee[01;33m . .TP -.B active\-region\-end\-color +.B active\-region\-end\-color A string variable that .Q undoes -the effects of \fBactive\-region\-start\-color\fP +the effects of \fBactive\-region\-start\-color\fP and restores .Q normal terminal display appearance after displaying text in the active region. @@ -6181,7 +6240,7 @@ This variable is reset to the default value whenever the terminal type changes. The default value is the string that restores the terminal from standout mode, as obtained from the terminal's terminfo description. A sample value might be -.Q "\ee[0m" . +.Q \ee[0m . .TP .B bell\-style (audible) Controls what happens when readline wants to ring the terminal bell. @@ -6190,10 +6249,9 @@ If set to \fBnone\fP, readline never rings the bell. If set to If set to \fBaudible\fP, readline attempts to ring the terminal's bell. .TP .B bind\-tty\-special\-chars (On) -If set to \fBOn\fP (the default), readline attempts to bind the control -characters that are -treated specially by the kernel's terminal driver to their -readline equivalents. +If set to \fBOn\fP (the default), readline attempts to bind +the control characters that are treated specially by the kernel's +terminal driver to their readline equivalents. These override the default readline bindings described here. Type .Q "stty \-a" @@ -6219,8 +6277,12 @@ If set to \fBOn\fP, readline displays possible completions using different colors to indicate their file type. The color definitions are taken from the value of the \fBLS_COLORS\fP environment variable. +.\" Tucking multiple macro calls into a paragraph tag requires some +.\" finesse. We require `\c`, and while the single-font macros don't +.\" honor input trap continuation, the font alternation macros do. .TP -.B comment\-begin (``#'') +.BR comment\-begin\ (\c +.Q \fB#\fP \fB)\fP The string that is inserted when the readline .B insert\-comment command is executed. @@ -6272,7 +6334,7 @@ by stripping the eighth bit and prefixing an escape character (in effect, using escape as the \fImeta prefix\fP). The default is \fIOn\fP, but readline will set it to \fIOff\fP if the locale contains eight-bit characters. -This variable is dependent on the \fBLC_CTYPE\fP locale category, and +This variable is dependent on the \fBLC_CTYPE\fP locale category, and may change if the locale is changed. .TP .B disable\-completion (Off) @@ -6307,9 +6369,9 @@ sequence into the mode string. .B enable\-active\-region (On) The \fIpoint\fP is the current cursor position, and \fImark\fP refers to a saved cursor position. -The text between the point and mark is referred to as the \fIregion\fP. +The text between the point and mark is referred to as the \fIregion\fP. When this variable is set to \fIOn\fP, readline allows certain commands -to designate the region as \fIactive\fP. +to designate the region as \fIactive\fP. When the region is active, readline highlights the text in the region using the value of the \fBactive\-region\-start\-color\fP, which defaults to the string that enables @@ -6371,7 +6433,8 @@ locale contains eight-bit characters. This variable is dependent on the \fBLC_CTYPE\fP locale category, and may change if the locale is changed. .TP -.B isearch\-terminators (``C\-[C\-J'') +.BR isearch\-terminators\ (\c +.Q \fBC\-[C\-J\fP \fB)\fP The string of characters that should terminate an incremental search without subsequently executing the character as a command. If this variable has not been given a value, the characters @@ -6416,11 +6479,13 @@ have a slash appended (subject to the value of \fBmark\-directories\fP). .TP .B match\-hidden\-files (On) -This variable, when set to \fBOn\fP, causes readline to match files whose -names begin with a `.' (hidden files) when performing filename -completion. -If set to \fBOff\fP, the leading `.' must be -supplied by the user in the filename to be completed. +This variable, when set to \fBOn\fP, forces readline to match files whose +names begin with a +.Q . +(hidden files) when performing filename completion. +If set to \fBOff\fP, the user must include the leading +.Q . +in the filename to be completed. .TP .B menu\-complete\-display\-prefix (Off) If set to \fBOn\fP, menu completion displays the common prefix of the @@ -6433,7 +6498,7 @@ eighth bit set directly rather than as a meta-prefixed escape sequence. The default is \fIOff\fP, but readline will set it to \fIOn\fP if the locale contains eight-bit characters. -This variable is dependent on the \fBLC_CTYPE\fP locale category, and +This variable is dependent on the \fBLC_CTYPE\fP locale category, and may change if the locale is changed. .TP .B page\-completions (On) @@ -6450,7 +6515,7 @@ before returning when \fBaccept\-line\fP is executed. By default, history lines may be modified and retain individual undo lists across calls to \fBreadline\fP. .TP -.B search\-ignore\-case (Off) +.B search\-ignore\-case (Off) If set to \fBOn\fP, readline performs incremental and non-incremental history list searches in a case\-insensitive fashion. .TP @@ -6516,7 +6581,8 @@ Readline 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 used. -.IP \fB$if\fP +.TP +.B $if The .B $if construct allows bindings to be made based on the @@ -6525,14 +6591,16 @@ readline. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it. .RS -.IP \fBmode\fP +.TP +.B mode The \fBmode=\fP form of the \fB$if\fP directive is used to test whether readline is in emacs or vi mode. This may be used in conjunction with the \fBset keymap\fP command, for instance, to set bindings in the \fIemacs\-standard\fP and \fIemacs\-ctlx\fP keymaps only if readline is starting out in emacs mode. -.IP \fBterm\fP +.TP +.B term The \fBterm=\fP 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 @@ -6545,7 +6613,8 @@ to match both and .IR sun\-cmd , for instance. -.IP \fBversion\fP +.TP +.B version The \fBversion\fP test may be used to perform comparisons against specific readline versions. The \fBversion\fP expands to the current readline version. @@ -6565,9 +6634,11 @@ minor version (e.g., \fB7.1\fP). If the minor version is omitted, it is assumed to be \fB0\fP. The operator may be separated from the string \fBversion\fP and from the version number argument by whitespace. -.IP \fBapplication\fP -The \fBapplication\fP construct is used to include -application-specific settings. Each program using the readline +.TP +.I application +The \fIapplication\fP construct is used to include +application-specific settings. +Each program using the readline library sets the \fIapplication name\fP, and an initialization file can test for a particular value. This could be used to bind key sequences to functions useful for @@ -6575,14 +6646,17 @@ a specific program. For instance, the following command adds a key sequence that quotes the current or previous word in \fBbash\fP: .PP .RS +.EX .nf \fB$if\fP Bash # Quote the current or previous word -"\eC\-xq": "\eeb\e"\eef\e"" +\(dq\eC-xq\(dq: \(dq\eeb\e\(dq\eef\e\(dq\(dq \fB$endif\fP .fi +.EE .RE -.IP \fIvariable\fP +.TP +.I variable The \fIvariable\fP construct provides simple equality tests for readline variables and values. The permitted comparison operators are \fI=\fP, \fI==\fP, and \fI!=\fP. @@ -6592,13 +6666,16 @@ side by whitespace. Both string and boolean variables may be tested. Boolean variables must be tested against the values \fIon\fP and \fIoff\fP. .RE -.IP \fB$endif\fP +.TP +.B $endif This command, as seen in the previous example, terminates an \fB$if\fP command. -.IP \fB$else\fP +.TP +.B $else Commands in this branch of the \fB$if\fP directive are executed if the test fails. -.IP \fB$include\fP +.TP +.B $include This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following directive would read \fI/etc/inputrc\fP: @@ -6756,12 +6833,16 @@ and make it the current line. Without an argument, move back to the first entry in the history list. .TP .B reverse\-search\-history (C\-r) -Search backward starting at the current line and moving `up' through -the history as necessary. This is an incremental search. +Search backward starting at the current line and moving +.Q up +through the history as necessary. +This is an incremental search. .TP .B forward\-search\-history (C\-s) -Search forward starting at the current line and moving `down' through -the history as necessary. This is an incremental search. +Search forward starting at the current line and moving +.Q down +through the history as necessary. +This is an incremental search. .TP .B non\-incremental\-reverse\-search\-history (M\-p) Search backward through the history starting at the current line @@ -6836,7 +6917,7 @@ See .B HISTORY EXPANSION below for a description of history expansion. .TP -.B history\-expand\-line (M\-^) +.B history\-expand\-line (M\-\(ha) Perform history expansion on the current line. See .SM @@ -6907,7 +6988,7 @@ how to insert characters like \fBC\-q\fP, for example. .B tab\-insert (C\-v TAB) Insert a tab character. .TP -.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +.B "self\-insert (a, b, A, 1, !, \fR.\|.\|.\fP)" Insert the character typed. .TP .B transpose\-chars (C\-t) @@ -7019,7 +7100,7 @@ or .SS Numeric Arguments .PD 0 .TP -.B digit\-argument (M\-0, M\-1, ..., M\-\-) +.B digit\-argument (M\-0, M\-1, \fR.\|.\|.\fP, M\-\-) Add this digit to the argument already accumulating, or start a new argument. M\-\- starts a negative argument. .TP @@ -7171,7 +7252,7 @@ Abort the current editing command and ring the terminal's bell (subject to the setting of .BR bell\-style ). .TP -.B do\-lowercase\-version (M\-A, M\-B, M\-\fIx\fP, ...) +.B do\-lowercase\-version (M\-A, M\-B, M\-\fIx\fP, \fR.\|.\|.\fP) If the metafied character \fIx\fP is uppercase, run the command that is bound to the corresponding metafied lowercase character. The behavior is undefined if \fIx\fP is already lowercase. @@ -7466,7 +7547,7 @@ completion function would load completions dynamically: .nf _completion_loader() { - . "/etc/bash_completion.d/$1.sh" \c + . \(dq/etc/bash_completion.d/$1.sh\(dq \c .if \n(LL<80n \{\ \e .br @@ -7748,7 +7829,8 @@ Refer to the current command minus .IR n . .TP .B !! -Refer to the previous command. This is a synonym for `!\-1'. +Refer to the previous command. This is a synonym for +.Q !\-1 . .TP .B !\fIstring\fR Refer to the most recent command preceding the current position in the @@ -7810,15 +7892,22 @@ The last word. This is usually the last argument, but will expand to the zeroth word if there is only one word in the line. .TP .B % -The first word matched by the most recent `?\fIstring\fR?' search, +The first word matched by the most recent +.Q ?\fIstring\fR?' +search, if the search string begins with a character that is part of a word. .TP .I x\fB\-\fPy -A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +A range of words; +.Q \-\fIy\fR +abbreviates +.Q 0\-\fIy\fR . .TP .B * -All of the words but the zeroth. This is a synonym -for `\fI1\-$\fP'. It is not an error to use +All of the words but the zeroth. +This is a synonym for +.Q \fI1\-$\fP . +It is not an error to use .B * if there is just one word in the event; the empty string is returned in that case. @@ -7835,7 +7924,8 @@ If a word designator is supplied without an event specification, the previous command is used as the event. .SS Modifiers After the optional word designator, there may appear a sequence of -one or more of the following modifiers, each preceded by a `:'. +one or more of the following modifiers, each preceded by a +.Q : . These modify, or edit, the word or words selected from the history event. .PP .PD 0 @@ -7906,17 +7996,26 @@ is deleted. Repeat the previous substitution. .TP .B g -Cause changes to be applied over the entire event line. This is -used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') -or `\fB:&\fP'. If used with -`\fB:s\fP', any delimiter can be used -in place of /, and the final delimiter is optional +Cause changes to be applied over the entire event line. +This is used in conjunction with +.Q \fB:s\fP +(e.g., +.Q \fB:gs/\fIold\fP/\fInew\fP/\fR ) +or +.Q \fB:&\fP . +If used with +.Q \fB:s\fP , +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 \fBa\fP may be used as a synonym for \fBg\fP. .TP .B G -Apply the following `\fBs\fP' or `\fB&\fP' modifier once to each word -in the event line. +Apply the following +.Q \fBs\fP +or +.Q \fB&\fP +modifier once to each word in the event line. .PD .SH "SHELL BUILTIN COMMANDS" .\" start of bash_builtins @@ -7948,7 +8047,7 @@ and performing any specified redirections. The return status is zero. .TP -\fB .\| \fP \fIfilename\fP [\fIarguments\fP] +\fB\&.\| \fP \fIfilename\fP [\fIarguments\fP] .PD 0 .TP \fBsource\fP \fIfilename\fP [\fIarguments\fP] @@ -7997,7 +8096,7 @@ the script (0 if no commands are executed), and false if .I filename is not found or cannot be read. .TP -\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBalias\fP [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] .\|.\|.] \fBAlias\fP with no arguments or with the .B \-p option prints the list of aliases in the form @@ -8011,7 +8110,7 @@ is supplied, the name and value of the alias is printed. \fBAlias\fP returns true unless a \fIname\fP is given for which no alias has been defined. .TP -\fBbg\fP [\fIjobspec\fP ...] +\fBbg\fP [\fIjobspec\fP .\|.\|.] Resume each suspended job \fIjobspec\fP in the background, as if it had been started with .BR & . @@ -8051,7 +8150,7 @@ Each non-option argument is a command as it would appear in a initialization file such as .IR .inputrc , but each binding or command must be passed as a separate argument; -e.g., '"\eC\-x\eC\-r": re\-read\-init\-file'. +e.g., \(aq\(dq\eC\-x\eC\-r\(dq: re\-read\-init\-file\(aq. In the following descriptions, output available to be re-read is formatted as commands that would appear in a .B readline @@ -8136,7 +8235,7 @@ and .B READLINE_MARK 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 +The shell assigns any numeric argument the user supplied to the .SM .B READLINE_ARGUMENT variable. @@ -8274,7 +8373,7 @@ directory before the change. The return value is true if the directory was successfully changed; false otherwise. .TP -\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP ...] +\fBcommand\fP [\fB\-pVv\fP] \fIcommand\fP [\fIarg\fP .\|.\|.] Run .I command with @@ -8351,10 +8450,11 @@ matches were generated. .br [\fB\-G\fP \fIglobpat\fP] [\fB\-W\fP \fIwordlist\fP] [\fB\-F\fP \fIfunction\fP] [\fB\-C\fP \fIcommand\fP] .br -[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] [\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname ...\fP] +[\fB\-X\fP \fIfilterpat\fP] [\fB\-P\fP \fIprefix\fP] \ +[\fB\-S\fP \fIsuffix\fP] \fIname\fP [\fIname\fP .\|.\|.] .PD 0 .TP -\fBcomplete\fP \fB\-pr\fP [\fB\-DEI\fP] [\fIname\fP ...] +\fBcomplete\fP \fB\-pr\fP [\fB\-DEI\fP] [\fIname\fP .\|.\|.] .PD Specify how arguments to each \fIname\fP should be completed. If the \fB\-p\fP option is supplied, or if no options or \fIname\fPs @@ -8640,10 +8740,12 @@ the last enclosing loop loop). The return value is 0 unless \fIn\fP is not greater than or equal to 1. .TP -\fBdeclare\fP [\fB\-aAfFgiIlnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBdeclare\fP [\fB\-aAfFgiIlnrtux\fP] [\fB\-p\fP] \ +[\fIname\fP[=\fIvalue\fP] .\|.\|.] .PD 0 .TP -\fBtypeset\fP [\fB\-aAfFgiIlnrtux\fP] [\fB\-p\fP] [\fIname\fP[=\fIvalue\fP] ...] +\fBtypeset\fP [\fB\-aAfFgiIlnrtux\fP] [\fB\-p\fP] \ +[\fIname\fP[=\fIvalue\fP] .\|.\|.] .PD Declare variables and/or give them attributes. If no \fIname\fPs are given then display the values of variables. @@ -8681,7 +8783,7 @@ It is ignored in all other cases. The .B \-I option causes local variables to inherit the attributes -(except the \fInameref\fP attribute) +(except the \fInameref\fP attribute) and value of any existing variable with the same \fIname\fP at a surrounding scope. If there is no existing variable, the local variable is initially unset. @@ -8748,7 +8850,10 @@ The lower-case attribute is disabled. Mark \fIname\fPs for export to subsequent commands via the environment. .PD .PP -Using `+' instead of `\-' +Using +.Q + +instead of +.Q \- turns off the attribute instead, with the exceptions that \fB+a\fP and \fB+A\fP may not be used to destroy array variables and \fB+r\fP will not @@ -8827,7 +8932,8 @@ invalid option is supplied or \fIn\fP indexes beyond the end of the directory stack. .RE .TP -\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] [\fIjobspec\fP ... | \fIpid\fP ... ] +\fBdisown\fP [\fB\-ar\fP] [\fB\-h\fP] \ +[\fIjobspec\fP .\|.\|. | \fIpid\fP .\|.\|. ] Without options, remove each .I jobspec from the table of active jobs. @@ -8856,7 +8962,7 @@ The return value is 0 unless a .I jobspec does not specify a valid job. .TP -\fBecho\fP [\fB\-neE\fP] [\fIarg\fP ...] +\fBecho\fP [\fB\-neE\fP] [\fIarg\fP .\|.\|.] Output the \fIarg\fPs, separated by spaces, followed by a newline. The return status is 0 unless a write error occurs. If \fB\-n\fP is specified, the trailing newline is @@ -8926,7 +9032,8 @@ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value .PD .RE .TP -\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] [\fIname\fP ...] +\fBenable\fP [\fB\-a\fP] [\fB\-dnps\fP] [\fB\-f\fP \fIfilename\fP] \ +[\fIname\fP .\|.\|.] Enable and disable builtin shell commands. Disabling a builtin allows a disk command which has the same name as a shell builtin to be executed without specifying a full pathname, @@ -8977,7 +9084,7 @@ The return value is 0 unless a is not a shell builtin or there is an error loading a new builtin from a shared object. .TP -\fBeval\fP [\fIarg\fP ...] +\fBeval\fP [\fIarg\fP .\|.\|.] The \fIarg\fPs are read and concatenated together into a single command. This command is then read and executed by the shell, and its exit status is returned as the value of @@ -9037,7 +9144,7 @@ A trap on .B EXIT is executed before the shell terminates. .TP -\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] ... +\fBexport\fP [\fB\-fn\fP\^] [\fIname\fP[=\fIword\fP]] .\|.\|. .PD 0 .TP .B export \-p @@ -9143,7 +9250,7 @@ In the second form, \fIcommand\fP is re-executed after each instance of \fIpat\fP is replaced by \fIrep\fP. \fICommand\fP is interpreted the same as \fIfirst\fP above. A useful alias to use with this is -.Q "r=""fc \-s""" , +.Q "r=\(dqfc \-s\(dq" , so that typing .Q "r cc" runs the last command beginning with @@ -9184,7 +9291,7 @@ does not specify a valid job or .I jobspec specifies a job that was started without job control. .TP -\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIarg ...\fP] +\fBgetopts\fP \fIoptstring\fP \fIname\fP [\fIarg\fP .\|.\|.] .B getopts is used by shell procedures to parse positional parameters. .I optstring @@ -9364,9 +9471,9 @@ The return status is 0 unless no command matches .TP \fBhistory\fP \fB\-anrw\fP [\fIfilename\fP] .TP -\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg ...\fP] +\fBhistory\fP \fB\-p\fP \fIarg\fP [\fIarg\fP .\|.\|.] .TP -\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg ...\fP] +\fBhistory\fP \fB\-s\fP \fIarg\fP [\fIarg\fP .\|.\|.] .PD With no options, display the command history list with line numbers. Lines listed @@ -9467,10 +9574,10 @@ error occurs while reading or writing the history file, an invalid history expansion supplied as an argument to \fB\-p\fP fails. .RE .TP -\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP ... ] +\fBjobs\fP [\fB\-lnprs\fP] [ \fIjobspec\fP .\|.\|. ] .PD 0 .TP -\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP ... ] +\fBjobs\fP \fB\-x\fP \fIcommand\fP [ \fIargs\fP .\|.\|. ] .PD The first form lists the active jobs. The options have the following meanings: @@ -9521,7 +9628,8 @@ passing it returning its exit status. .RE .TP -\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] [\fIpid\fP | \fIjobspec\fP] ... +\fBkill\fP [\fB\-s\fP \fIsigspec\fP | \fB\-n\fP \fIsignum\fP | \fB\-\fP\fIsigspec\fP] \ +[\fIpid\fP | \fIjobspec\fP] .\|.\|. .PD 0 .TP \fBkill\fP \fB\-l\fP|\fB\-L\fP [\fIsigspec\fP | \fIexit_status\fP] @@ -9568,7 +9676,7 @@ option is equivalent to \fB\-l\fP. returns true if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered. .TP -\fBlet\fP \fIarg\fP [\fIarg\fP ...] +\fBlet\fP \fIarg\fP [\fIarg\fP .\|.\|.] Each .I arg is an arithmetic expression to be evaluated (see @@ -9582,7 +9690,7 @@ evaluates to 0, .B let returns 1; 0 is returned otherwise. .TP -\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] ... | \- ] +\fBlocal\fP [\fIoption\fP] [\fIname\fP[=\fIvalue\fP] .\|.\|. | \- ] For each argument, a local variable named .I name is created, and assigned @@ -9901,7 +10009,11 @@ The return status is 0 unless an error occurs while reading the name of the current directory or an invalid option is supplied. .TP -\fBread\fP [\fB\-Eers\fP] [\fB\-a\fP \fIaname\fP] [\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] [\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] [\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] [\fB\-u\fP \fIfd\fP] [\fIname\fP ...] +\fBread\fP [\fB\-Eers\fP] [\fB\-a\fP \fIaname\fP] \ +[\fB\-d\fP \fIdelim\fP] [\fB\-i\fP \fItext\fP] \ +[\fB\-n\fP \fInchars\fP] [\fB\-N\fP \fInchars\fP] \ +[\fB\-p\fP \fIprompt\fP] [\fB\-t\fP \fItimeout\fP] \ +[\fB\-u\fP \fIfd\fP] [\fIname\fP .\|.\|.] One line is read from the standard input, or from the file descriptor \fIfd\fP supplied as an argument to the \fB\-u\fP option, split into words as described @@ -10052,7 +10164,7 @@ a variable assignment error (such as assigning to a readonly variable) occurs, or an invalid file descriptor is supplied as the argument to \fB\-u\fP. .RE .TP -\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] ...] +\fBreadonly\fP [\fB\-aAf\fP] [\fB\-p\fP] [\fIname\fP[=\fIword\fP] .\|.\|.] .PD The given \fInames\fP are marked readonly; the values of these @@ -10126,10 +10238,12 @@ function and not during execution of a script by \fB.\fP\^ or \fBsource\fP. Any command associated with the \fBRETURN\fP trap is executed before execution resumes after the function or script. .TP -\fBset\fP [\fB\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] [\fB\-\-\fP] [\fB\-\fP] [\fIarg\fP ...] +\fBset\fP [\fB\-abefhkmnptuvxBCEHPT\fP] [\fB\-o\fP \fIoption\-name\fP] \ +[\fB\-\-\fP] [\fB\-\fP] [\fIarg\fP .\|.\|.] .PD 0 .TP -\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] [\fB\-\-\fP] [\fB\-\fP] [\fIarg\fP ...] +\fBset\fP [\fB+abefhkmnptuvxBCEHPT\fP] [\fB+o\fP \fIoption\-name\fP] \ +[\fB\-\-\fP] [\fB\-\fP] [\fIarg\fP .\|.\|.] .TP \fBset \-o\fP .TP @@ -10146,7 +10260,7 @@ Any arguments remaining after option processing are treated as values for the positional parameters and are assigned, in order, to .BR $1 , .BR $2 , -.B ... +\&.\|.\|., .BR $\fIn\fP . Options, if specified, have the following meanings: .RS @@ -10429,11 +10543,17 @@ Exit after reading and executing one command. .TP 8 .B \-u Treat unset variables and parameters other than the special -parameters "@" and "*", -or array variables subscripted 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, +parameters +.Q @ +and +.Q * , +or array variables subscripted with +.Q @ +or +.Q * , +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. .TP 8 .B \-v @@ -10524,9 +10644,9 @@ The return status is always true unless an invalid option is encountered. .RE .TP \fBshift\fP [\fIn\fP] -The positional parameters from \fIn\fP+1 ... are renamed to +The positional parameters from \fIn\fP+1 .\|.\|.\& are renamed to .B $1 -.B .... +.B .\|.\|.. Parameters represented by the numbers \fB$#\fP down to \fB$#\fP\-\fIn\fP+1 are unset. .I n @@ -10546,7 +10666,7 @@ is greater than .B $# or less than zero; otherwise 0. .TP -\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP ...] +\fBshopt\fP [\fB\-pqsu\fP] [\fB\-o\fP] [\fIoptname\fP .\|.\|.] Toggle the values of settings controlling optional shell behavior. The settings can be either those listed below, or, if the .B \-o @@ -10613,7 +10733,7 @@ builtins that can perform variable assignments, and while executing builtins that perform array dereferencing. .TP 8 .B assoc_expand_once -Deprecated; a synonym for \fBarray_expand_once\fP. +Deprecated; a synonym for \fBarray_expand_once\fP. .TP 8 .B autocd If set, a command name that is the name of a directory is executed as if @@ -10819,7 +10939,7 @@ under \fBPathname Expansion\fP are enabled. .TP 8 .B extquote -If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP"\fIstring\fP" quoting is +If set, \fB$\fP\(aq\fIstring\fP\(aq and \fB$\fP\(dq\fIstring\fP\(dq quoting is performed within \fB${\fP\fIparameter\fP\fB}\fP expansions enclosed in double quotes. This option is enabled by default. .TP 8 @@ -11000,8 +11120,9 @@ or when filtering possible completions as part of programmable completion. .B noexpand_translation If set, .B bash -encloses the translated results of $"..." quoting in single quotes -instead of double quotes. +encloses the translated results of +.BR $\(dq .\|.\|.\& \(dq +quoting in single quotes instead of double quotes. If the string is not translated, this has no effect. .TP 8 .B nullglob @@ -11112,7 +11233,7 @@ Return a status of 0 (true) or 1 (false) depending on the evaluation of the conditional expression .IR expr . Each operator and operand must be a separate argument. -Expressions are composed of the primaries described +Expressions are composed of the primaries described .ie \n(zZ=1 in \fIbash\fP(1) .el above under @@ -11211,18 +11332,19 @@ The expression is parsed and evaluated according to precedence using the rules listed above. .PD .PP -If the shell is not in \fIposix mode\fP, -when used with \fBtest\fP or \fB[\fP, the \fB<\fP and \fB>\fP operators -sort lexicographically using ASCII ordering. -When the shell is in \fIposix mode\fP, these operators sort using the +When the shell is in \fIposix mode\fP, or if the expression is part +of the \fB[[\fP command, +the \fB<\fP and \fB>\fP operators sort using the current locale. +If the shell is not in \fIposix mode\fP, the \fBtest\fP and \fB[\fP +commands sort lexicographically using ASCII ordering. .RE .TP .B times Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. .TP -\fBtrap\fP [\fB\-lp\fP] [[\fIaction\fP] \fIsigspec\fP ...] +\fBtrap\fP [\fB\-lp\fP] [[\fIaction\fP] \fIsigspec\fP .\|.\|.] The .I action is a command that is read and executed when the shell receives @@ -11300,7 +11422,7 @@ the command .I action is executed before every \fIsimple command\fP, \fIfor\fP command, \fIcase\fP command, \fIselect\fP command, (( arithmetic command, -[[ conditional command, +[[ conditional command, arithmetic \fIfor\fP command, and before the first command executes in a shell function (see .SM @@ -11367,7 +11489,7 @@ returns true. \fBtrue\fP Does nothing, returns a 0 status. .TP -\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP ...] +\fBtype\fP [\fB\-aftpP\fP] \fIname\fP [\fIname\fP .\|.\|.] With no options, indicate how each .I name @@ -11433,7 +11555,7 @@ but the path search options (\fB\-p\fP and \fB\-P\fP) can be supplied to restrict the output to executable files. \fBtype\fP does not consult the table of hashed commands when using -.B \-a +.B \-a with .BR \-p , and only performs a @@ -11493,7 +11615,7 @@ The maximum size of core files created The maximum size of a process's data segment .TP .B \-e -The maximum scheduling priority ( +The maximum scheduling priority (\c .Q nice ). .TP .B \-f @@ -11607,7 +11729,7 @@ is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode was successfully changed or if no \fImode\fP argument was supplied, and false otherwise. .TP -\fBunalias\fP [\-\fBa\fP] [\fIname\fP ...] +\fBunalias\fP [\-\fBa\fP] [\fIname\fP .\|.\|.] Remove each \fIname\fP from the list of defined aliases. If .B \-a is supplied, all alias definitions are removed. The return @@ -11615,7 +11737,7 @@ value is true unless a supplied .I name is not a defined alias. .TP -\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP ...] +\fBunset\fP [\-\fBfv\fP] [\-\fBn\fP] [\fIname\fP .\|.\|.] For each .IR name , remove the corresponding variable or function. @@ -11683,7 +11805,7 @@ subsequently reset. The exit status is true unless a .I name is readonly or may not be unset. .TP -\fBwait\fP [\fB\-fn\fP] [\fP\-p\fP \fIvarname\fP] [\fIid ...\fP] +\fBwait\fP [\fB\-fn\fP] [\fP\-p\fP \fIvarname\fP] [\fIid\fP .\|.\|.] Wait for each specified child process and return its termination status. Each .I id @@ -11723,7 +11845,7 @@ Otherwise, the return status is the exit status of the last process or job waited for. .SH "SHELL COMPATIBILITY MODE" Bash-4.0 introduced the concept of a \fIshell compatibility level\fP, -specified as a set of options to the shopt builtin ( +specified as a set of options to the shopt builtin (\c .BR compat31 , .BR compat32 , .BR compat40 , @@ -11739,7 +11861,7 @@ behavior. It's intended to be a temporary solution. This section does not mention behavior that is standard for a particular version (e.g., setting \fBcompat32\fP means that quoting the rhs of the regexp matching operator quotes special regexp characters in the word, which is -default behavior in bash-3.2 and subsequent versions). +default behavior in bash-3.2 and subsequent versions). .PP If a user enables, say, \fBcompat32\fP, it may affect the behavior of other compatibility levels up to and including the current compatibility level. @@ -11770,7 +11892,7 @@ Eventually, the options will be removed in favor of .PP Bash-5.0 was the final version for which there will be an individual shopt option for the previous version. Users should control the compatibility -level with +level with .SM .BR BASH_COMPAT . .PP @@ -11926,7 +12048,9 @@ The \fBunset\fP builtin treats attempts to unset array subscripts \fB@\fP and \fB*\fP differently depending on whether the array is indexed or associative, and differently than in previous versions. .IP \(bu -arithmetic commands ( ((...)) ) and the expressions in an arithmetic for +arithmetic commands ( +.BR (( .\|.\|.\& )) +) and the expressions in an arithmetic for statement can be expanded more than once .IP \(bu expressions used as arguments to arithmetic operators in the \fB[[\fP @@ -11935,8 +12059,9 @@ conditional command can be expanded more than once the expressions in substring parameter brace expansion can be expanded more than once .IP \(bu -the expressions in the $(( ... )) word expansion can be expanded -more than once +the expressions in the +.BR $(( .\|.\|.\& )) +word expansion can be expanded more than once .IP \(bu arithmetic expressions used as indexed array subscripts can be expanded more than once @@ -12131,8 +12256,9 @@ Once you have determined that a bug actually exists, use the .I bashbug command to submit a bug report. If you have a fix, you are encouraged to mail that as well! -Suggestions and `philosophical' bug reports may be mailed -to \fIbug-bash@gnu.org\fP or posted to the Usenet +You may send suggestions and +.Q philosophical +bug reports to \fIbug-bash@gnu.org\fP or post them to the Usenet newsgroup .BR gnu.bash.bug . .PP @@ -12148,7 +12274,9 @@ The compiler used to compile .TP A description of the bug behaviour .TP -A short script or `recipe' which exercises the bug +A short script or \c +.Q recipe " \c" +which exercises the bug .PD .PP .I bashbug @@ -12174,13 +12302,15 @@ Aliases are confusing in some uses. .PP Shell builtin commands and functions are not stoppable/restartable. .PP -Compound commands and command sequences of the form `a ; b ; c' +Compound commands and command sequences of the form +.Q "a ; b ; c" are not handled gracefully when process suspension is attempted. When a process is stopped, the shell immediately executes the next command in the sequence. -It suffices to place the sequence of commands between -parentheses to force it into a subshell, which may be stopped as -a unit. +It suffices to place the sequence of commands between parentheses to +force it into a subshell, which may be stopped as a unit, +or to start the command in the background and immediately +bring it into the foreground. .PP Array variables may not (yet) be exported. .PP diff --git a/doc/bash.html b/doc/bash.html index 8ba73a9c..85d8d334 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2023 December 14BASH(1) +BASH(1)2024 February 5BASH(1)

Index @@ -30,6 +30,14 @@ + + + + + + + + @@ -465,12 +473,15 @@ expanded value as the name of a file to read and execute. behaves as if the following command were executed:

+

-if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi + +if [ -n dq$BASH_ENVdq ]; then . dq$BASH_ENVdq; fi

+ but the value of the PATH @@ -764,7 +775,8 @@ system time consumed by its execution are reported when the pipeline terminates. 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 `-'. +time as a reserved word if the next token begins with a + The TIMEFORMAT @@ -939,6 +951,7 @@ as if it were within double quotes, but double quote characters in expression are not treated specially and are removed.

[[ expression ]]
+ Return a status of 0 or 1 depending on the evaluation of the conditional expression expression. Expressions are composed of the primaries described below under @@ -953,14 +966,10 @@ substitution, and quote removal on those words (the expansions that would occur if the words were enclosed in double quotes). Conditional operators such as -f must be unquoted to be recognized as primaries. -

- - +

When used with [[, the < and > operators sort lexicographically using the current locale. -

- - +

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 Pattern Matching, @@ -975,15 +984,15 @@ The return value is 0 if the string matches (==) or does not match (!=) the pattern, and 1 otherwise. Any part of the pattern may be quoted to force the quoted portion to be matched as a string. -

- - +

An additional binary operator, =ti, 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 -usually described in regex(3)). +usually described in +regex(3)). + The return value is 0 if the string matches the pattern, and 1 otherwise. If the regular expression is syntactically incorrect, the conditional @@ -1001,9 +1010,7 @@ expansion forces the entire pattern to be matched literally. Treat bracket expressions in regular expressions carefully, since normal quoting and pattern characters lose their meanings between brackets. -

- - +

The pattern will match if it matches any part of the string. Anchor the pattern using the ha and $ regular expression operators to force it to match the entire string. @@ -1035,14 +1042,10 @@ string matching the nth parenthesized subexpression. in the global scope; declaring it as a local variable will lead to unexpected results. -

- - +

Expressions may be combined using the following operators, listed in decreasing order of precedence: -

- - +

@@ -1156,7 +1159,7 @@ is the exit status of the last command executed in or zero if no commands were executed.
case word in [ [(] pattern [ | pattern ] -
+.. ) list ;; ] ... esac
A case command first expands word, and tries to match it against each pattern in turn, using the matching rules described under @@ -1445,7 +1448,7 @@ characters: `, -", +dq, \, or @@ -1664,8 +1667,10 @@ below). If the variable has its attribute set, then value -is evaluated as an arithmetic expression even if the $((...)) expansion is -not used (see +is evaluated as an arithmetic expression even if the +$((...)) + +expansion is not used (see Arithmetic Expansion below). @@ -1725,12 +1730,15 @@ whose name is passed as an argument to the function. For instance, if a variable name is passed to a shell function as its first argument, running

+

-declare -n ref=$1 + +declare -n ref=$1

+ inside the function creates a nameref variable ref whose value is the variable name passed as the first argument. References and assignments to ref, and changes to its attributes, @@ -1793,8 +1801,14 @@ with the value of each parameter separated by the first character of the IFS -special variable. That is, "$*" is equivalent -to "$1c$2c...", where +special variable. +That is, +dq$*dq + +is equivalent to +dq$1c$2c...dq, + +where c is the first character of the value of the @@ -1821,15 +1835,22 @@ quotes, these words are subject to word splitting. In contexts where word splitting is not performed, this expands to a single word with each positional parameter separated by a space. -When the -expansion occurs within double quotes, each parameter expands to a -separate word. That is, "$@" is equivalent to -"$1" "$2" ... +When the expansion occurs within double quotes, +each parameter expands to a separate word. +That is, +dq$@dq + +is equivalent to +dq$1dq dq$2dq ... + If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. -When there are no positional parameters, "$@" and +When there are no positional parameters, +dq$@dq + +and $@ expand to nothing (i.e., they are removed). @@ -2186,7 +2207,9 @@ this instance of bash. The values assigned to the array members are as follows: +

+

BASH_VERSINFO[0] @@ -2208,7 +2231,7 @@ The build version.
BASH_VERSINFO[4]
-The release status (e.g., beta1). +The release status (e.g., beta).
BASH_VERSINFO[5]
@@ -2218,6 +2241,7 @@ The value of
+
BASH_VERSION
@@ -2331,8 +2355,10 @@ subsequently reset.
Each time this parameter is referenced, it expands to the number of seconds -since the Unix Epoch (see time(3)) as a floating point value -with micro-second granularity. +since the Unix Epoch (see +time(3)) + +as a floating point value with micro-second granularity. Assignments to EPOCHREALTIME @@ -2348,7 +2374,9 @@ subsequently reset.
Each time this parameter is referenced, it expands to the number of seconds -since the Unix Epoch (see time(3)). +since the Unix Epoch (see +time(3)). + Assignments to EPOCHSECONDS @@ -2368,12 +2396,12 @@ shell startup. This variable is readonly.
FUNCNAME
+ An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bottom-most element (the one with the highest index) is -"main". This variable exists only when a shell function is executing. Assignments to @@ -2387,9 +2415,7 @@ If is unset, it loses its special properties, even if it is subsequently reset. -

- - +

This variable can be used with BASH_LINENO and BASH_SOURCE. Each element of FUNCNAME has corresponding elements in BASH_LINENO and BASH_SOURCE to describe the call stack. @@ -2398,6 +2424,7 @@ For instance, ${FUNCNAME[$i]} was called from the file ${BASH_LINENO[$i]}. The caller builtin displays the current call stack using this information. +
GROUPS
@@ -2550,7 +2577,6 @@ subsequently reset.
Any numeric argument given to a readline command that was defined using -bind -x (see SHELL BUILTIN COMMANDS @@ -2565,7 +2591,6 @@ The contents of the readline line buffer, for use with -bind -x (see SHELL BUILTIN COMMANDS @@ -2579,7 +2604,6 @@ The position of the mark (saved insertion point) in the readline line buffer, for use with -bind -x (see SHELL BUILTIN COMMANDS @@ -2595,7 +2619,6 @@ The position of the insertion point in the readline line buffer, for use with -bind -x (see SHELL BUILTIN COMMANDS @@ -2669,7 +2692,14 @@ is started.
This variable expands to a 32-bit pseudo-random number each time it is referenced. The random number generator is not linear on systems that -support /dev/urandom or arc4random, so each returned number +support + +/dev/urandom + +or +arc4random(3), + +so each returned number has no relationship to the numbers preceding it. The random number generator cannot be seeded, so assignments to this variable have no effect. @@ -2714,7 +2744,7 @@ level is set to the default for the current version. If BASH_COMPAT is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level to the default for the current version. -The valid values correspond to the compatibility levels +A subset of the valid values correspond to the compatibility levels described below under SHELL COMPATIBILITY MODE. @@ -2746,7 +2776,6 @@ is not used to search for the resultant filename.
If set to an integer corresponding to a valid file descriptor, bash will write the trace output generated when -set -x is enabled to that file descriptor. The file descriptor is closed when @@ -2780,7 +2809,6 @@ for destination directories specified by the command. A sample value is -".:ti:/usr".
CHILD_MAX @@ -2814,7 +2842,6 @@ Each array element contains one possible completion.
If bash 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. @@ -2865,7 +2892,6 @@ A filename whose suffix matches one of the entries in is excluded from the list of matched filenames. A sample value is -".o:ti".
FUNCNEST @@ -2989,16 +3015,21 @@ after reading any startup files.
A colon-separated list of patterns used to decide which command lines should be saved on the history list. Each pattern is anchored at the -beginning of the line and must match the complete line (no implicit -`*' is appended). Each pattern is tested against the line +beginning of the line and must match the complete line +(bash will not implicitly append a + +Each pattern is tested against the line after the checks specified by HISTCONTROL are applied. -In addition to the normal shell pattern matching characters, `&' -matches the previous history line. `&' may be escaped using a -backslash; the backslash is removed before attempting a match. +In addition to the normal shell pattern matching characters, + +matches the previous history line. +A backslash will escape the + +the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTIGNORE. @@ -3022,7 +3053,10 @@ The shell sets the default value to 500 after reading any startup files.
If this variable is set and not null, its value is used as a format string -for strftime(3) to print the time stamp associated with each history +for +strftime(3) + +to print the time stamp associated with each history entry displayed by the history builtin. If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions. @@ -3077,7 +3111,7 @@ split lines into words with the read builtin command. The default value is -``<space><tab><newline>''. +
IGNOREEOF
@@ -3203,14 +3237,17 @@ greater than or equal to zero, the shell disables mail checking.
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 `?'. +may 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. Example:

-MAILPATH=aq/var/mail/bfox?"You have mail":ti/shell-mail?"$_ has mail!"aq + +MAILPATH=aq/var/mail/bfox?dqYou have maildq:ti/shell-mail?dq$_ has mail!dqaq +

Bash @@ -3263,7 +3300,6 @@ and is set by the administrator who installs A common value is -/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin.

POSIXLY_CORRECT @@ -3275,7 +3311,6 @@ enters posix mode before reading the startup files, as if the invocation option had been supplied. If it is set while the shell is running, bash 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 @@ -3315,7 +3350,7 @@ The value of this parameter is expanded (see below) and used as the primary prompt string. The default value is -``\s-\v\$ ''. +
PS2
@@ -3324,7 +3359,7 @@ The value of this parameter is expanded as with and used as the secondary prompt string. The default is -``> ''. +
PS3
@@ -3346,13 +3381,15 @@ The value of this parameter is expanded as with and the value is printed before each command bash -displays during an execution trace. The first character of -the expanded value of +displays during an execution trace. +The first character of the expanded value of PS4 is replicated multiple times, as necessary, to indicate multiple -levels of indirection. The default is ``+ ''. +levels of indirection. +The default is +
SHELL
@@ -3372,8 +3409,10 @@ reserved word should be displayed. The % character introduces an escape sequence that is expanded to a time value or other information. The escape sequences and their meanings are as follows; the -braces denote optional portions. +brackets denote optional portions. +

+

@@ -3400,6 +3439,7 @@ The CPU percentage, computed as (%U + %S) / %R.
+
The optional p is a digit specifying the precision, the number of fractional digits after a decimal point. @@ -3489,18 +3529,22 @@ and tokenization (see below). The first character is the history expansion character, the character which signals the start of a history -expansion, normally `!'. +expansion, normally + The second character is the quick substitution character, which is used as shorthand for re-running the previous command entered, substituting one string for another in the command, when it appears as the first character on the line. -The default is `ha'. -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 history -comment character causes history substitution to be skipped 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. +The default is + +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 history comment character causes history substitution to be skipped +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.
  @@ -3580,7 +3624,8 @@ or a list of words that is interpreted as a sequence of alternating keys and values: name=( key1 value1 key2 value2 ...). These are treated identically to -name=( [key1]=value1 [key2]=value2 ...). +name=( [key1]=value1 [key2]=value2 +...). The first word in the list determines how the remaining words are interpreted; all assignments in a list must be of the same type. When using key/value pairs, the keys may not be missing or empty; @@ -3729,7 +3774,7 @@ reused as assignments.

EXPANSION

Expansion is performed on the command line after it has been split into -words. There are seven kinds of expansion performed: +words. The shell performs these expansions: brace expansion, tilde expansion, @@ -3742,8 +3787,10 @@ words. There are seven kinds of expansion performed: word splitting, +pathname expansion, + and -pathname expansion. +quote removal .

@@ -3752,7 +3799,8 @@ brace expansion; tilde expansion, parameter and variable expansion, arithmetic expansion, and command substitution (done in a left-to-right fashion); word splitting; -and pathname expansion. +pathname expansion; +and quote removal.

On systems that can support it, there is an additional expansion @@ -3762,16 +3810,23 @@ same time as tilde, parameter, variable, and arithmetic expansion and command substitution.

-After these expansions are performed, quote characters present in the -original word are removed unless they have been quoted themselves -(quote removal). +Quote removal 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 increase the number of words of the expansion; other expansions expand a single word to a single word. The only exceptions to this are the expansions of -"$@" and "${name[@]}", +dq$@dq + +and +dq${name[@]}dq , + + + and, in most cases, $* and ${name[*]} as explained above (see PARAMETERS). @@ -3801,7 +3856,8 @@ to each resulting string, expanding left to right. Brace expansions may be nested. The results of each expanded string are not sorted; left to right order is preserved. -For example, a{d,c,b}e expands into `ade ace abe'. +For example, a{d,c,b}e expands into +

A sequence expression takes the form @@ -3810,8 +3866,8 @@ 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. -Supplied integers may be prefixed with 0 to force each term to have the -same width. +If the supplied integers are prefixed with 0, each term will +have the same width, zero-padding if 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. @@ -3905,7 +3961,9 @@ below).  

Tilde Expansion

-If a word begins with an unquoted tilde character (`ti'), all of +If a word begins with an unquoted tilde character ( + +all of the characters preceding the first unquoted slash (or all characters, if there is no unquoted slash) are considered a tilde-prefix. If none of the characters in the tilde-prefix are quoted, the @@ -3926,25 +3984,38 @@ Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name.

-If the tilde-prefix is a `ti+', the value of the shell variable +If the tilde-prefix is a + +the value of the shell variable PWD replaces the tilde-prefix. -If the tilde-prefix is a `ti-', the value of the shell variable +If the tilde-prefix is a + +the value of the shell variable OLDPWD, if it is set, is substituted. If the characters following the tilde in the tilde-prefix consist of a number N, optionally prefixed -by a `+' or a `-', the tilde-prefix is replaced with the corresponding +by a + +or a + +the tilde-prefix is replaced with the corresponding element from the directory stack, as it would be displayed by the dirs builtin invoked with the tilde-prefix as an argument. If the characters following the tilde in the tilde-prefix consist of a -number without a leading `+' or `-', `+' is assumed. +number without a leading + +or + + +is assumed.

If the login name is invalid, or the tilde expansion fails, the word @@ -3984,7 +4055,9 @@ above, when in posix mode.  

Parameter Expansion

-The `$' character introduces parameter expansion, +The + +character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from @@ -3992,7 +4065,8 @@ characters immediately following it which could be interpreted as part of the name.

-When braces are used, the matching ending brace is the first `}' +When braces are used, the matching ending brace is the first + not escaped by a backslash or within a quoted string, and not within an embedded arithmetic expansion, command substitution, or parameter expansion. @@ -4114,7 +4188,7 @@ and extending to the end of the value. below). -

+

If offset evaluates to a number less than zero, the value is used as an offset in characters from the end of the value of parameter. @@ -4125,7 +4199,7 @@ a number of characters, and the expansion is the characters between offset and that result. Note that a negative offset must be separated from the colon by at least one space to avoid being confused with the :- expansion. -

+

If parameter is @ or *, the result is length positional parameters beginning at offset. A negative offset is taken relative to one greater than the greatest @@ -4133,7 +4207,7 @@ positional parameter, so an offset of -1 evaluates to the last positional parameter (or 0 if there are no positional parameters). It is an expansion error if length evaluates to a number less than zero. -

+

If parameter is an indexed array name subscripted by @ or *, the result is the length members of the array beginning with ${parameter[offset]}. @@ -4141,10 +4215,10 @@ A negative offset is taken relative to one greater than the maximum index of the specified array. It is an expansion error if length evaluates to a number less than zero. -

+

Substring expansion applied to an associative array produces undefined results. -

+

Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1 by default. If offset is 0, and the positional parameters are used, $0 is @@ -4226,8 +4300,11 @@ the value of then the result of the expansion is the expanded value of parameter -with the shortest matching pattern (the ``#'' case) or the -longest matching pattern (the ``##'' case) deleted. +with the shortest matching pattern (the + +case) or the longest matching pattern (the + +case) deleted. If parameter @@ -4269,8 +4346,11 @@ If the pattern matches a trailing portion of the expanded value of then the result of the expansion is the expanded value of parameter -with the shortest matching pattern (the ``%'' case) or the -longest matching pattern (the ``%%'' case) deleted. +with the shortest matching pattern (the + +case) or the longest matching pattern (the + +case) deleted. If parameter @@ -4311,7 +4391,7 @@ The match is performed using the rules described under below. In the first form above, only the first match is replaced. -If there are two slashes separating parameter and pattern +If there are two slashes separating parameter and pattern (the second form above), all matches of pattern are replaced with string. If pattern is preceded by # (the third form above), @@ -4323,11 +4403,11 @@ matches of pattern are deleted. If string is null, matches of pattern are deleted and the / following pattern may be omitted. -

+

If the patsub_replacement shell option is enabled using shopt, any unquoted instances of & in string are replaced with the matching portion of pattern. -

+

Quoting any part of string inhibits replacement in the expansion of the quoted portion, including replacement strings stored in shell variables. @@ -4343,7 +4423,7 @@ expanding string; shell programmers should quote any occurrences of & they want to be taken literally in the replacement and ensure any instances of & they want to be replaced are unquoted. -

+

If the nocasematch @@ -4419,7 +4499,9 @@ array in turn, and the expansion is the resultant list. The expansion is either a transformation of the value of parameter or information about parameter itself, depending on the value of operator. Each operator is a single letter: +

+

@@ -4447,7 +4529,8 @@ format that can be reused as input.
The expansion is a string that is the value of parameter with backslash -escape sequences expanded as with the $aq...aq quoting mechanism. +escape sequences expanded as with the $aq...aq +quoting mechanism.
P
@@ -4503,11 +4586,11 @@ or the operation is applied to each member of the array in turn, and the expansion is the resultant list.

+ The result of the expansion is subject to word splitting and pathname expansion as described below.

-
 

Command Substitution

@@ -4576,7 +4659,7 @@ word would usually require.

Any side effects of command take effect immediately -in the current execution environment and persist in the current +in the current execution environment and persist in the current environment after the command completes (e.g., the exit builtin will exit the shell).

@@ -4769,12 +4852,13 @@ If is unset, word splitting behaves as if it contained the default value -of +of <space><tab><newline>.

-Explicit null arguments ("" or aqaq) are retained +Explicit null arguments (dqdq or +aqaq) are retained and passed to commands as empty strings. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. @@ -4784,8 +4868,10 @@ and passed to a command as an empty string. When a quoted null argument appears as part of a word whose expansion is non-null, the null argument is removed. That is, the word --daqaq becomes -d after word splitting and -null argument removal. + +becomes + +after word splitting and null argument removal.

Note that if no expansion occurs, no splitting @@ -4841,7 +4927,6 @@ is enabled, the match is performed without regard to the case of alphabetic characters. When a pattern is used for pathname expansion, the character -``.'' at the start of a name or immediately following a slash must be matched explicitly, unless the shell option @@ -4849,12 +4934,13 @@ must be matched explicitly, unless the shell option is set. In order to match the filenames -``.'' and -``..'', -the pattern must begin with ``.'' (for example, ``.?''), +the pattern must begin with + +(for example, + even if dotglob @@ -4863,16 +4949,12 @@ If the globskipdots shell option is enabled, the filenames -``.'' and -``..'' -are never matched, even if the pattern begins with a -``.''. +never match, even if the pattern begins with a When not matching pathnames, the -``.'' character is not treated specially. When matching a pathname, the slash character must always be @@ -4926,16 +5008,15 @@ If the nocaseglob option is set, the matching against the patterns in is performed without regard to case. The filenames -``.'' and -``..'' are always ignored when GLOBIGNORE -is set and not null. However, setting +is set and not null. +However, setting GLOBIGNORE @@ -4943,14 +5024,11 @@ to a non-null value has the effect of enabling the dotglob shell option, so all other filenames beginning with a -``.'' - +Q . will match. To get the old behavior of ignoring filenames beginning with a -``.'', make -``.*'' one of the patterns in GLOBIGNORE. @@ -4980,9 +5058,10 @@ described above.

Any character that appears in a pattern, other than the special pattern -characters described below, matches itself. The NUL character may not -occur in a pattern. A backslash escapes the following character; the -escaping backslash is discarded when matching. +characters described below, matches itself. +The NUL character may not occur in a pattern. +A backslash escapes the following character; the escaping backslash is +discarded when matching. The special pattern characters must be quoted if they are to be matched literally.

@@ -5007,11 +5086,11 @@ and subdirectories.

Matches any single character. -
[...] +
[...]
-Matches any one of the enclosed characters. A pair of characters -separated by a hyphen denotes a +Matches any one of the enclosed characters. +A pair of characters separated by a hyphen denotes a range expression; any character that falls between those two characters, inclusive, using the current locale's collating sequence and character set, @@ -5063,9 +5142,8 @@ A may be matched by including it as the first character in the set. -

- +

Within [ @@ -5075,21 +5153,18 @@ and character classes can be specified using the syntax [:class:], where class is one of the following classes defined in the POSIX standard: -
-

- +

alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit -
+
+
A character class matches any character belonging to that class. The word character class matches letters, digits, and the character _. -

- - +

Within [ @@ -5100,9 +5175,7 @@ an equivalence class can be specified using the syntax [=c=], which matches all characters with the same collation weight (as defined by the current locale) as the character c. -

- - +

Within [ @@ -5111,10 +5184,7 @@ and the syntax [.symbol.] matches the collating symbol symbol. - - - - +

@@ -5126,6 +5196,7 @@ Composite patterns may be formed using one or more of the following sub-patterns:

+

?(pattern-list)
@@ -5153,12 +5224,21 @@ patterns, including shell functions and command substitutions. When matching filenames, the dotglob shell option determines the set of filenames that are tested: when dotglob is enabled, the set of filenames includes all files -beginning with ``.'', but ``.'' and ``..'' must be matched by a -pattern or sub-pattern that begins with a dot; +beginning with + +but + +and + +must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not -include any filenames beginning with ``.'' unless the pattern -or sub-pattern begins with a ``.''. -As above, ``.'' only has a special meaning when matching filenames. +include any filenames beginning with + +unless the pattern or sub-pattern begins with a + +As above, + +only has a special meaning when matching filenames.

Complicated extended pattern matching against long strings is slow, @@ -5175,7 +5255,7 @@ characters aq, -and " that did not result from one of the above +and dq that did not result from one of the above expansions are removed.  

REDIRECTION

@@ -5728,7 +5808,7 @@ the word to see if it matches an alias name. If it matches, the shell replaces the word with the alias value, and reads that value as if it had been read instead of the word. The shell doesn't look at any characters following the word before -attempting alias substitution. +attempting alias substitution.

The characters /, $, `, and = and @@ -5893,14 +5973,17 @@ it calls). In the following description, the current scope is a currently- executing function. Previous scopes consist of that function's caller and so on, -back to the "global" scope, where the shell is not executing -any shell function. +back to the + +scope, where the shell is not executing any shell function. Consequently, a local variable at the current scope is a variable declared using the local or declare builtins in the function that is currently executing.

-Local variables "shadow" variables with the same name declared at +Local variables + +variables with the same name declared at previous scopes. For instance, a local variable declared in a function hides a global variable of the same name: references and assignments @@ -5915,10 +5998,11 @@ are a result of the sequence of function calls that caused execution to reach the current function. The value of a variable that a function sees depends on its value within its caller, if any, whether that caller is -the "global" scope or another shell function. +the global +scope or another shell function. This is also the value that a local variable -declaration "shadows", and the value that is restored when the function -returns. +declaration shadows, +and the value that is restored when the function returns.

For example, if a variable var is declared as local in function @@ -6160,7 +6244,6 @@ Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself.

- When used with [[, or when the shell is in posix mode, the < and > operators sort @@ -6169,6 +6252,7 @@ When the shell is not in posix mode, the test command sorts using ASCII ordering.

+

-a file @@ -6205,7 +6289,9 @@ True if file exists and is a symbolic link.
-k file
-True if file exists and its ``sticky'' bit is set. +True if file exists and its + +bit is set.
-p file
@@ -6552,7 +6638,6 @@ is to be executed, it is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell. -
*
the shell's open files, plus any modifications and additions specified @@ -6587,9 +6672,15 @@ subshell environment. Changes made to the subshell environment cannot affect the shell's execution environment.

-Subshells spawned to execute command substitutions inherit the value of -the -e option from the parent shell. When not in posix mode, +When the shell is in +posix mode, +subshells spawned to execute command substitutions inherit the value of +the -e option from their parent shell. +When not in posix mode, bash clears the -e option in such subshells. +See the +description of the inherit_errexit shell option below +for how to control this behavior when not in posix mode.

If a command is followed by a & and job control is not active, the @@ -6851,7 +6942,7 @@ same process group as the terminal, and haC sends to all processes in that process group.

-When bash is running without job control enabled and receives +When bash is running without job control enabled and receives SIGINT @@ -6969,11 +7060,12 @@ These processes are said to be in the processes are those whose process group ID differs from the terminal's; such processes are immune to keyboard-generated signals. Only foreground processes are allowed to read from or, if the -user so specifies with stty tostop, write to the -terminal. +user so specifies with + +write to the terminal. Background processes which attempt to read from (write to when -stty tostop is in effect) the -terminal are sent a + +is in effect) the terminal are sent a SIGTTIN (SIGTTOU) @@ -7093,13 +7185,12 @@ foreground: %1 is a synonym for -``fg %1'', + bringing job 1 from the background into the foreground. Similarly, -``%1 &'' resumes job 1 in the background, equivalent to -``bg %1''. +

The shell learns immediately whenever a job changes state. @@ -7190,11 +7281,17 @@ an ASCII bell character (07)

\d
-the date in "Weekday Month Date" format (e.g., "Tue May 26") +the date in + +format (e.g., +
\D{format}
-the format is passed to strftime(3) and the result is inserted +the format is passed to +strftime(3) + +and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required
\e @@ -7204,7 +7301,8 @@ an ASCII escape character (033)
\h
-the hostname up to the first `.' +the hostname up to the first +
\H
@@ -7473,6 +7571,8 @@ or C-Meta-u: universal-argument
+

+ into the inputrc @@ -7525,14 +7625,16 @@ When using the form keyname:function-name or macro, is the name of a key spelled out in English. For example:

+

-Control-u: universal-argument -
+
+Control-u: universal-argument
 Meta-Rubout: backward-kill-word
-
+Control-o: dq> outputdq +
+ -Control-o: "> output"

@@ -7553,12 +7655,12 @@ and is bound to run the macro expressed on the right hand side (that is, to insert the text -> output into the line).

-In the second form, "keyseq":function-name or macro, +In the second form, +dqkeyseqdq:function-name or macro, keyseq differs from @@ -7570,14 +7672,16 @@ within double quotes. Some GNU Emacs style key escapes can be used, as in the following example, but the symbolic character names are not recognized.

+

-"\C-u": universal-argument -
-"\C-x\C-r": re-read-init-file -
+
+dq\C-udq: universal-argument
+dq\C-x\C-rdq: re-read-init-file
+dq\e[11tidq: dqFunction Key 1dq
+
+ -"\e[11ti": "Function Key 1"

@@ -7597,7 +7701,6 @@ and ESC [ 1 1 ti is bound to insert the text -Function Key 1.

@@ -7621,10 +7724,10 @@ an escape character

backslash -
\ +
\dq
-literal " +literal dq
\aq
@@ -7691,7 +7794,7 @@ be used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. Backslash will quote any other character in the macro text, -including " and aq. +including dq and aq.

Bash @@ -7741,15 +7844,19 @@ or (without regard to case). Unrecognized variable names are ignored. -When a variable value is read, empty or null values, "on" (case-insensitive), -and "1" are equivalent to On. All other values are equivalent to +When readline reads a variable value, empty or null values, + +(case-insensitive), and + +are equivalent to On. +All other values are equivalent to Off. The variables and their default values are:

-
active-region-start-color +
active-region-start-color
A string variable that controls the text color and background when displaying @@ -7761,20 +7868,25 @@ It is output to the terminal before displaying the text in the active region. This variable is reset to the default value whenever the terminal type changes. The default value is the string that puts the terminal in standout mode, as obtained from the terminal's terminfo description. -A sample value might be "\e[01;33m". -
active-region-end-color +A sample value might be + +
active-region-end-color
-A string variable that "undoes" the effects of active-region-start-color -and restores "normal" terminal display appearance after displaying text -in the active region. +A string variable that + +the effects of active-region-start-color +and restores + +terminal display appearance after displaying text in the active region. This string must not take up any physical character positions on the display, so it should consist only of terminal escape sequences. It is output to the terminal after displaying the text in the active region. This variable is reset to the default value whenever the terminal type changes. The default value is the string that restores the terminal from standout mode, as obtained from the terminal's terminfo description. -A sample value might be "\e[0m". +A sample value might be +
bell-style (audible)
@@ -7785,12 +7897,13 @@ If set to audible, readline attempts to ring the terminal's bell.
bind-tty-special-chars (On)
-If set to On (the default), readline attempts to bind the control -characters that are -treated specially by the kernel's terminal driver to their -readline equivalents. +If set to On (the default), readline attempts to bind +the control characters that are treated specially by the kernel's +terminal driver to their readline equivalents. These override the default readline bindings described here. -Type stty -a at a bash prompt to see your current terminal settings, +Type + +at a bash prompt to see your current terminal settings, including the special control characters (usually cchars).
blink-matching-paren (Off) @@ -7805,7 +7918,8 @@ common prefix of the set of possible completions using a different color. The color definitions are taken from the value of the LS_COLORS environment variable. If there is a color definition in $LS_COLORS for the custom suffix -"readline-colored-completion-prefix", readline uses this color for + +readline uses this color for the common prefix instead of its default.
colored-stats (Off) @@ -7814,9 +7928,13 @@ If set to On, readline displays possible completions using different colors to indicate their file type. The color definitions are taken from the value of the LS_COLORS environment variable. -
comment-begin (``#'') + + + +
comment-begin (
+ The string that is inserted when the readline insert-comment @@ -7877,7 +7995,7 @@ by stripping the eighth bit and prefixing an escape character (in effect, using escape as the meta prefix). The default is On, but readline will set it to Off if the locale contains eight-bit characters. -This variable is dependent on the LC_CTYPE locale category, and +This variable is dependent on the LC_CTYPE locale category, and may change if the locale is changed.
disable-completion (Off) @@ -7920,9 +8038,9 @@ sequence into the mode string.
The point is the current cursor position, and mark refers to a saved cursor position. -The text between the point and mark is referred to as the region. +The text between the point and mark is referred to as the region. When this variable is set to On, readline allows certain commands -to designate the region as active. +to designate the region as active. When the region is active, readline highlights the text in the region using the value of the active-region-start-color, which defaults to the string that enables @@ -7992,9 +8110,10 @@ The default is Off, but readline will set it to On if the locale contains eight-bit characters. This variable is dependent on the LC_CTYPE locale category, and may change if the locale is changed. -
isearch-terminators (``C-[C-J'') +
isearch-terminators (
+ The string of characters that should terminate an incremental search without subsequently executing the character as a command. If this variable has not been given a value, the characters @@ -8048,11 +8167,13 @@ have a slash appended (subject to the value of
match-hidden-files (On)
-This variable, when set to On, causes readline to match files whose -names begin with a `.' (hidden files) when performing filename -completion. -If set to Off, the leading `.' must be -supplied by the user in the filename to be completed. +This variable, when set to On, forces readline to match files whose +names begin with a + +(hidden files) when performing filename completion. +If set to Off, the user must include the leading + +in the filename to be completed.
menu-complete-display-prefix (Off)
@@ -8067,7 +8188,7 @@ eighth bit set directly rather than as a meta-prefixed escape sequence. The default is Off, but readline will set it to On if the locale contains eight-bit characters. -This variable is dependent on the LC_CTYPE locale category, and +This variable is dependent on the LC_CTYPE locale category, and may change if the locale is changed.
page-completions (On) @@ -8086,7 +8207,7 @@ If set to On, readline will undo all changes to history lines before returning when accept-line is executed. By default, history lines may be modified and retain individual undo lists across calls to readline. -
search-ignore-case (Off) +
search-ignore-case (Off)
If set to On, readline performs incremental and non-incremental @@ -8167,7 +8288,9 @@ 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 used.
-
$if
+
$if + +
The $if @@ -8178,14 +8301,18 @@ extends to the end of the line; unless otherwise noted, no characters are required to isolate it.
-
mode
+
mode + +
The mode= form of the $if directive is used to test whether readline is in emacs or vi mode. This may be used in conjunction with the set keymap command, for instance, to set bindings in the emacs-standard and emacs-ctlx keymaps only if readline is starting out in emacs mode. -
term
+
term + +
The term= 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 @@ -8202,7 +8329,9 @@ and sun-cmd, for instance. -
version
+
version + +
The version test may be used to perform comparisons against specific readline versions. The version expands to the current readline version. @@ -8229,26 +8358,36 @@ minor version (e.g., 7.1). If the minor version is omitted, it is assumed to be 0. The operator may be separated from the string version and from the version number argument by whitespace. -
application
-The application construct is used to include -application-specific settings. Each program using the readline +
application + +
+The application construct is used to include +application-specific settings. +Each program using the readline library sets the application name, 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 bash: +

+

+
 $if Bash
 # Quote the current or previous word
-"\C-xq": "\eb\"\ef\""
+dq\C-xqdq: dq\eb\dq\ef\dqdq
 $endif
 
+
-
variable
+
+
variable + +
The variable construct provides simple equality tests for readline variables and values. The permitted comparison operators are =, ==, and !=. @@ -8259,17 +8398,25 @@ Both string and boolean variables may be tested. Boolean variables must be tested against the values on and off.
-
$endif
+
$endif + +
This command, as seen in the previous example, terminates an $if command. -
$else
+
$else + +
Commands in this branch of the $if directive are executed if the test fails. -
$include
+
$include + +
This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following directive would read /etc/inputrc: +

+

 $include  /etc/inputrc
@@ -8277,7 +8424,6 @@ would read /etc/inputrc:
 
 
-
 

Searching

@@ -8323,7 +8469,7 @@ the line, thereby executing the command from the history list. Readline remembers the last incremental search string. If two Control-Rs are typed without any intervening characters defining a -new search string, any remembered search string is used. +new search string, readline uses any remembered search string.

Non-incremental searches read the entire search string before starting @@ -8465,13 +8611,17 @@ Without an argument, move back to the first entry in the history list.

reverse-search-history (C-r)
-Search backward starting at the current line and moving `up' through -the history as necessary. This is an incremental search. +Search backward starting at the current line and moving + +through the history as necessary. +This is an incremental search.
forward-search-history (C-s)
-Search forward starting at the current line and moving `down' through -the history as necessary. This is an incremental search. +Search forward starting at the current line and moving + +through the history as necessary. +This is an incremental search.
non-incremental-reverse-search-history (M-p)
@@ -8521,7 +8671,9 @@ insert the nth word from the previous command (the words in the previous command begin with word 0). A negative argument inserts the nth word from the end of the previous command. Once the argument n is computed, the argument is extracted -as if the "!n" history expansion had been specified. +as if the + +history expansion had been specified.
yank-last-arg (M-., M-_)
@@ -8535,7 +8687,9 @@ 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). The history expansion facilities are used to extract the last word, -as if the "!$" history expansion had been specified. +as if the + +history expansion had been specified.
shell-expand-line (M-C-e)
@@ -8543,13 +8697,15 @@ Expand the line by performing shell word expansions. This performs alias and history expansion, $aqstringaq and $dqstringdq quoting, tilde expansion, parameter and variable expansion, arithmetic expansion, +command and process substitution, word splitting, and quote removal. +An explicit argument suppresses command and process substitution. See HISTORY EXPANSION below for a description of history expansion. -
history-expand-line (M-^) +
history-expand-line (M-ha)
Perform history expansion on the current line. @@ -8608,7 +8764,7 @@ and emacs as the editor, in that order.
The character indicating end-of-file as set, for example, by -stty. +stty(1). If this character is read when there are no characters on the line, and point is at the beginning of the line, readline @@ -8643,7 +8799,7 @@ how to insert characters like C-q, for example.
Insert a tab character. -
self-insert (a, b, A, 1, !, ...) +
self-insert (a, b, A, 1, !, ...)
Insert the character typed. @@ -8789,7 +8945,7 @@ or
-
digit-argument (M-0, M-1, ..., M--) +
digit-argument (M-0, M-1, ..., M--)
Add this digit to the argument already accumulating, or start a new @@ -9043,7 +9199,9 @@ character. A negative argument searches for subsequent occurrences. Read enough characters to consume a multi-key sequence such as those defined for keys like Home and End. Such sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this sequence is -bound to "\[", keys producing such sequences will have no effect +bound to + +keys producing such sequences will have no effect unless explicitly bound to a readline command, instead of inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[. @@ -9334,24 +9492,31 @@ being loaded 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 default completion function would load completions dynamically: -

- -_completion_loader() -
+

+
+_completion_loader()
 {
+  . dq/etc/bash_completion.d/$1.shdq 
+\
 
-
        . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
- +     +>/dev/null 2>&1 && return 124 } +complete -D -F _completion_loader +\
-complete -D -F _completion_loader -o bashdefault -o default
+     +-o bashdefault -o default +
+ + +
-  

HISTORY

@@ -9690,7 +9855,8 @@ Refer to the current command minus
!!
-Refer to the previous command. This is a synonym for `!-1'. +Refer to the previous command. This is a synonym for +
!string
@@ -9721,7 +9887,7 @@ with string2. Equivalent to -``!!:shastring1hastring2ha'' + (see Modifiers below).
!# @@ -9777,17 +9943,24 @@ zeroth word if there is only one word in the line.
%
-The first word matched by the most recent `?string?' search, +The first word matched by the most recent + +search, if the search string begins with a character that is part of a word.
x-y
-A range of words; `-y' abbreviates `0-y'. +A range of words; + +abbreviates +
*
-All of the words but the zeroth. This is a synonym -for `1-$'. It is not an error to use +All of the words but the zeroth. +This is a synonym for + +It is not an error to use * if there is just one @@ -9811,7 +9984,8 @@ previous command is used as the event.

Modifiers

After the optional word designator, there may appear a sequence of -one or more of the following modifiers, each preceded by a `:'. +one or more of the following modifiers, each preceded by a + These modify, or edit, the word or words selected from the history event.

@@ -9908,18 +10082,27 @@ Repeat the previous substitution.

g
-Cause changes to be applied over the entire event line. This is -used in conjunction with `:s' (e.g., `:gs/old/new/') -or `:&'. If used with -`:s', any delimiter can be used -in place of /, and the final delimiter is optional +Cause changes to be applied over the entire event line. +This is used in conjunction with + +(e.g., + +or + +If used with + +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 a may be used as a synonym for g.
G
-Apply the following `s' or `&' modifier once to each word -in the event line. +Apply the following + +or + +modifier once to each word in the event line.
  @@ -9948,6 +10131,7 @@ options interpret arguments beginning with - as invalid options and require -- to prevent this interpretation.

+

: [arguments]
@@ -9957,7 +10141,7 @@ No effect; the command does nothing beyond expanding and performing any specified redirections. The return status is zero. -
. filename [arguments]
+
. filename [arguments]
source filename [arguments]
@@ -10071,7 +10255,7 @@ initialization file such as .inputrc, but each binding or command must be passed as a separate argument; -e.g., '"\C-x\C-r": re-read-init-file'. +e.g., aqdq\C-x\C-rdq: re-read-init-fileaq. In the following descriptions, output available to be re-read is formatted as commands that would appear in a readline @@ -10178,7 +10362,7 @@ and 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 +The shell assigns any numeric argument the user supplied to the READLINE_ARGUMENT @@ -10269,11 +10453,11 @@ The variable defines the search path for the directory containing dir: -each directory name in +the shell searches each directory name in CDPATH -is searched for dir. +for dir. Alternative directory names in CDPATH @@ -10282,7 +10466,9 @@ are separated by a colon (:). A null directory name in CDPATH -is the same as the current directory, i.e., ``.''. If +is the same as the current directory, i.e., + +If dir begins with a slash (/), @@ -10428,13 +10614,13 @@ them to the standard output. When using the -F or -C options, the various shell variables set by the programmable completion facilities, while available, will not have useful values. -

+

The matches will be generated in the same way as if the programmable completion code had generated them directly from a completion specification with the same flags. If word is specified, only those completions matching word will be displayed. -

+

The return value is true unless an invalid option is supplied, or no matches were generated.
complete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action]
@@ -10443,22 +10629,27 @@ matches were generated. [-G globpat] [-W wordlist] [-F function] [-C command]
-[-X filterpat] [-P prefix] [-S suffix] name [name ...] +[-X filterpat] [-P prefix] [-S suffix] name [name ...]
complete -pr [-DEI] [name ...]
Specify how arguments to each name should be completed. -If the -p option is supplied, or if no options are supplied, +If the -p option is supplied, or if no options or names +are supplied, existing completion specifications are printed in a way that allows them to be reused as input. The -r option removes a completion specification for each name, or, if no names are supplied, all completion specifications. The -D option indicates that other supplied options and actions should -apply to the ``default'' command completion; that is, completion attempted +apply to the + +command completion; that is, completion attempted on a command for which no completion has previously been defined. The -E option indicates that other supplied options and actions should -apply to ``empty'' command completion; that is, completion attempted on a +apply to + +command completion; that is, completion attempted on a blank line. The -I option indicates that other supplied options and actions should apply to completion on the initial non-assignment word on the line, or after @@ -10469,12 +10660,12 @@ over -E, and both take precedence over -I. If any of -D, -E, or -I are supplied, any other name arguments are ignored; these completions only apply to the case specified by the option. -

+

The process of applying these completion specifications when word completion is attempted is described above under Programmable Completion. -

+

Other options, if specified, have the following meanings. The arguments to the -G, -W, and -X options (and, if necessary, the -P and -S options) @@ -10482,7 +10673,7 @@ should be quoted to protect them from expansion before the complete builtin is invoked. -

+

@@ -10729,16 +10920,19 @@ If no options are given, display the completion options for each The possible values of option are those valid for the complete builtin described above. The -D option indicates that other supplied options should -apply to the ``default'' command completion; that is, completion attempted +apply to the + +command completion; that is, completion attempted on a command for which no completion has previously been defined. The -E option indicates that other supplied options should -apply to ``empty'' command completion; that is, completion attempted on a -blank line. +apply to + +command completion; that is, completion attempted on a blank line. The -I option indicates that other supplied options should apply to completion on the initial non-assignment word on the line, or after a command delimiter such as ; or |, which is usually command name completion. -

+

The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a name for which no completion specification exists, or an output error occurs. @@ -10763,8 +10957,11 @@ is specified, resume at the nth enclosing loop. must be >= 1. If n -is greater than the number of enclosing loops, the last enclosing loop -(the ``top-level'' loop) is resumed. +is greater than the number of enclosing loops, the shell resumes +the last enclosing loop +(the + +loop). The return value is 0 unless n is not greater than or equal to 1.
declare [-aAfFgiIlnrtux] [-p] [name[=value] ...]
@@ -10815,7 +11012,7 @@ The -I option causes local variables to inherit the attributes -(except the nameref attribute) +(except the nameref attribute) and value of any existing variable with the same name at a surrounding scope. If there is no existing variable, the local variable is initially unset. @@ -10898,7 +11095,10 @@ Mark names for export to subsequent commands via the environment.

-Using `+' instead of `-' +Using + +instead of + turns off the attribute instead, with the exceptions that +a and +A may not be used to destroy array variables and +r will not @@ -10923,7 +11123,6 @@ 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 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 @@ -11135,7 +11334,14 @@ binary found via the instead of the shell builtin version, run -enable -n test. + + +``enable -n test''. + + + + + The -f @@ -11151,7 +11357,9 @@ on systems that support dynamic loading. colon-separated list of directories in which to search for filename, if filename does not contain a slash. The default is system-dependent, -and may include "." to force a search of the current directory. +and may include + +to force a search of the current directory. The -d @@ -11172,7 +11380,14 @@ If -s is supplied, the output is restricted to the POSIX 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, as if the command were -enable -f name name . + + +``enable -f name name''. + + + + + The return value is 0 unless a name @@ -11328,7 +11543,14 @@ If is not specified, it is set to the current command for listing (so that -fc -l -10 + +``fc -l -10'' + + + + + + prints the last 10 commands) and to first @@ -11338,7 +11560,7 @@ If is not specified, it is set to the previous command for editing and -16 for listing. -

+

The -n @@ -11379,24 +11601,20 @@ is not set. If neither variable is set, is used. When editing is complete, the edited commands are echoed and executed. -

+

In the second form, command is re-executed after each instance of pat is replaced by rep. Command is interpreted the same as first above. A useful alias to use with this 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 0 unless an invalid option is encountered or first @@ -11436,7 +11654,7 @@ does not specify a valid job or jobspec specifies a job that was started without job control. -
getopts optstring name [arg ...]
+
getopts optstring name [arg ...]
getopts is used by shell procedures to parse positional parameters. @@ -11483,7 +11701,7 @@ calls to within the same shell invocation if a new set of parameters is to be used. -

+

When the end of options is encountered, getopts exits with a return value greater than zero. OPTIND @@ -11491,7 +11709,7 @@ return value greater than zero. is set to the index of the first non-option argument, and name is set to ?. -

+

getopts normally parses the positional parameters, but if more arguments are @@ -11502,7 +11720,7 @@ values, getopts parses those instead. -

+

getopts can report errors in two ways. If the first character of @@ -11523,11 +11741,11 @@ character of optstring is not a colon. -

-If an invalid option is seen, +

+If getopts -places ? into +detects an invalid option, it places ? into name and, if not silent, @@ -11538,36 +11756,31 @@ prints an error message and unsets If getopts -is silent, -the option character found is placed in +is silent, it assigns the option character found to OPTARG -and no diagnostic message is printed. -

+and does not print a diagnostic message. +

If a required argument is not found, and getopts -is not silent, -a question mark (?) is placed in -name, - -OPTARG +is not silent, it sets the value of name to +a question mark (?), unsets +OPTARG, -is unset, and a diagnostic message is printed. +and prints a diagnostic message. If getopts -is silent, then a colon (:) is placed in -name - -and +is silent, it sets the value of name to a colon (:) +and sets OPTARG -is set to the option character found. -

+to the option character found. +

getopts returns true if an option, specified or unspecified, is found. @@ -11649,22 +11862,20 @@ Display the description of each pattern in a manpage-like format
Display only a short usage synopsis for each pattern -
-

+

+
The return status is 0 unless no command matches pattern. -
-
history [n]
history -c
history -d offset
history -d start-end
history -anrw [filename]
-
history -p arg [arg ...]
-
history -s arg [arg ...]
+
history -p arg [arg ...]
+
history -s arg [arg ...]
With no options, display the command history list with line numbers. Lines listed @@ -11683,8 +11894,10 @@ If the shell variable is set and not null, -it is used as a format string for strftime(3) to display -the time stamp associated with each displayed history entry. +it is used as a format string for +strftime(3) + +to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp and the history line. If filename is supplied, it is used as the @@ -11721,7 +11934,9 @@ are interpreted as described above.
-a
-Append the ``new'' history lines to the history file. +Append the + +history lines to the history file. These are history lines entered since the beginning of the current bash session, but not already appended to the history file.
-n @@ -12094,10 +12309,8 @@ shown by starting with zero, from the stack. For example: -popd +0 removes the first directory, -popd +1 the second.
-n
Removes the nth entry counting from the right of the list @@ -12106,10 +12319,8 @@ shown by starting with zero. For example: -popd -0 removes the last directory, -popd -1 the next to last.
@@ -12144,13 +12355,16 @@ Write the formatted arguments to the standard output under the control of the format. The -v option causes the output to be assigned to the variable var rather than being printed to the standard output. -

+

The format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences, which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive argument. -In addition to the standard printf(3) format characters +In addition to the standard +printf(3) + +format characters csndiouxXeEfFgGaA, printf interprets the following additional format specifiers: @@ -12182,7 +12396,9 @@ before quoting it.
causes printf to output the date-time string resulting from using -datefmt as a format string for strftime(3). +datefmt as a format string for +strftime(3). + The corresponding argument is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current @@ -12475,6 +12691,10 @@ Read input from file descriptor fd.

+Other than the case where delim is the empty string, read +ignores any NUL characters in the input. +

+ If no names @@ -12598,8 +12818,7 @@ as values for the positional parameters and are assigned, in order, to $2, -... - +..., $n. Options, if specified, have the following meanings: @@ -12621,6 +12840,7 @@ effective only when job control is enabled.

-e
+ Exit immediately if a pipeline (which may consist of a single simple command), a list, @@ -12671,9 +12891,7 @@ separately (see above), and may cause subshells to exit before executing all the commands in the subshell. -

- - +

If a compound command or shell function executes in a context where -e is being ignored, none of the commands executed within the compound command or function body @@ -12683,6 +12901,7 @@ If a compound command or shell function sets -e while executing in a context where -e is ignored, that setting will not have any effect until the compound command or the command containing the function call completes. +
-f
@@ -12791,7 +13010,14 @@ This option is on by default in interactive shells.
The effect is as if the shell command -IGNOREEOF=10 + + +``IGNOREEOF=10'' + + + + + had been executed (see @@ -12903,7 +13129,6 @@ This also affects the editing interface used for read -e. Same as -x. -

@@ -12973,11 +13198,17 @@ Exit after reading and executing one command.

Treat unset variables and parameters other than the special -parameters "@" and "*", -or array variables subscripted 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, +parameters + +and + +or array variables subscripted 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.
-v @@ -13201,7 +13432,6 @@ The list of shopt options is:

-

array_expand_once @@ -13214,7 +13444,7 @@ and while executing builtins that perform array dereferencing.
assoc_expand_once
-Deprecated; a synonym for array_expand_once. +Deprecated; a synonym for array_expand_once.
autocd
@@ -13373,13 +13603,12 @@ if the directory name initially supplied does not exist. If set, bash -includes filenames beginning with a `.' in the results of pathname -expansion. +includes filenames beginning with a + +in the results of pathname expansion. The filenames -``.'' and -``..'' must always be matched explicitly, even if dotglob @@ -13473,7 +13702,7 @@ under
extquote
-If set, $aqstringaq and $"string" quoting is +If set, $aqstringaq and $dqstringdq quoting is performed within ${parameter} expansions enclosed in double quotes. This option is enabled by default.
failglob @@ -13525,13 +13754,10 @@ and upper-case and lower-case ASCII characters will collate together.
If set, pathname expansion will never match the filenames -``.'' and -``..'', even if the pattern begins with a -``.''. This option is enabled by default.
globstar @@ -13657,8 +13883,9 @@ The value may not be changed.
If set, and a file that bash is checking for mail has been -accessed since the last time it was checked, the message ``The mail in -mailfile has been read'' is displayed. +accessed since the last time it was checked, +bash displays the message +
no_empty_cmd_completion
@@ -13702,8 +13929,10 @@ or when filtering possible completions as part of programmable completion. If set, bash -encloses the translated results of $"..." quoting in single quotes -instead of double quotes. +encloses the translated results of +$dq...dq + +quoting in single quotes instead of double quotes. If the string is not translated, this has no effect.
nullglob @@ -13826,12 +14055,13 @@ is not supplied.
test expr
[ expr ]
+ Return a status of 0 (true) or 1 (false) depending on the evaluation of the conditional expression expr. Each operator and operand must be a separate argument. -Expressions are composed of the primaries described +Expressions are composed of the primaries described above under @@ -13840,9 +14070,7 @@ under test 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 depends on the number of arguments; see below. @@ -13887,7 +14115,6 @@ expressions using a set of rules based on the number of arguments.

-

0 arguments
The expression is false. @@ -13938,20 +14165,18 @@ precedence using the rules listed above.
5 or more arguments
The expression is parsed and evaluated according to precedence using the rules listed above. -

-

-If the shell is not in posix mode, -when used with test or [, the < and > operators -sort lexicographically using ASCII ordering. -When the shell is in posix mode, these operators sort using the +When the shell is in posix mode, or if the expression is part +of the [[ command, +the < and > operators sort using the current locale. +If the shell is not in posix mode, the test and [ +commands sort lexicographically using ASCII ordering.

-
times
@@ -13981,9 +14206,7 @@ is the null string the signal specified by each sigspec is ignored by the shell and by the commands it invokes. -

- - +

If no arguments are supplied, trap @@ -14018,9 +14241,7 @@ The -P or -p options to trap may be used in a subshell environment (e.g., command substitution) and, as long as they are used before trap is used to change a signal's handling, will display the state of its parent's traps. -

- - +

The -l @@ -14036,9 +14257,7 @@ Signal names are case insensitive and the prefix is optional. -

- - +

If a sigspec @@ -14062,7 +14281,7 @@ the command is executed before every simple command, for command, case command, select command, (( arithmetic command, -[[ conditional command, +[[ conditional command, arithmetic for command, and before the first command executes in a shell function (see SHELL GRAMMAR @@ -14084,9 +14303,7 @@ the command is executed each time a shell function or a script executed with the . or source builtins finishes executing. -

- - +

If a sigspec @@ -14130,9 +14347,7 @@ being inverted using !. These are the same conditions obeyed by the errexit (-e) 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. @@ -14196,7 +14411,6 @@ if were specified as a command name, or nothing if -type -t name would not return file. @@ -14209,7 +14423,6 @@ option forces a search for each name, even if -type -t name would not return file. @@ -14239,7 +14452,7 @@ but the path search options (-p and -P) can be supplied to restrict the output to executable files. type does not consult the table of hashed commands when using --a +-a with -p, @@ -14313,7 +14526,8 @@ The maximum size of a process's data segment
-e
-The maximum scheduling priority ("nice") +The maximum scheduling priority ( +
-f
@@ -14565,7 +14779,7 @@ subsequently reset. The exit status is true unless a name is readonly or may not be unset. -
wait [-fn] [-p varname] [id ...]
+
wait [-fn] [-p varname] [id ...]
Wait for each specified child process and return its termination status. Each id @@ -14633,7 +14847,7 @@ behavior. It's intended to be a temporary solution. This section does not mention behavior that is standard for a particular version (e.g., setting compat32 means that quoting the rhs of the regexp matching operator quotes special regexp characters in the word, which is -default behavior in bash-3.2 and subsequent versions). +default behavior in bash-3.2 and subsequent versions).

If a user enables, say, compat32, it may affect the behavior of other @@ -14668,12 +14882,12 @@ Eventually, the options will be removed in favor of

-Bash-5.0 is the final version for which there will be an individual shopt -option for the previous version. Users should use -BASH_COMPAT +Bash-5.0 was the final version for which there will be an individual shopt +option for the previous version. Users should control the compatibility +level with +BASH_COMPAT. -on bash-5.0 and later versions.

The following table describes the behavior changes controlled by each @@ -14844,7 +15058,10 @@ The unset builtin treats attempts to unset array subscripts @ and * differently depending on whether the array is indexed or associative, and differently than in previous versions.

*
-arithmetic commands ( ((...)) ) and the expressions in an arithmetic for +arithmetic commands ( +((...)) + +) and the expressions in an arithmetic for statement can be expanded more than once
*
expressions used as arguments to arithmetic operators in the [[ @@ -14853,16 +15070,18 @@ conditional command can be expanded more than once the expressions in substring parameter brace expansion can be expanded more than once
*
-the expressions in the $(( ... )) word expansion can be expanded -more than once +the expressions in the +$((...)) + +word expansion can be expanded more than once
*
arithmetic expressions used as indexed array subscripts can be expanded more than once
*
-test -v, when given an argument of A[@], where AP is +test -v, when given an argument of A[@], where A is an existing associative array, will return true if the array has any set elements. -Bash-5.2 will look for and report on a key named @. +Bash-5.2 will look for and report on a key named @.
*
the ${parameter[:]=value} word expansion will return value, before any variable-specific transformations have been @@ -15110,8 +15329,9 @@ Once you have determined that a bug actually exists, use the command to submit a bug report. If you have a fix, you are encouraged to mail that as well! -Suggestions and `philosophical' bug reports may be mailed -to bug-bash@gnu.org or posted to the Usenet +You may send suggestions and + +bug reports to bug-bash@gnu.org or post them to the Usenet newsgroup gnu.bash.bug. @@ -15126,7 +15346,9 @@ ALL bug reports should include:
The hardware and operating system
The compiler used to compile
A description of the bug behaviour
-
A short script or `recipe' which exercises the bug
+
A short script or
+ +which exercises the bug

@@ -15166,13 +15388,15 @@ Aliases are confusing in some uses. Shell builtin commands and functions are not stoppable/restartable.

-Compound commands and command sequences of the form `a ; b ; c' +Compound commands and command sequences of the form + are not handled gracefully when process suspension is attempted. When a process is stopped, the shell immediately executes the next command in the sequence. -It suffices to place the sequence of commands between -parentheses to force it into a subshell, which may be stopped as -a unit. +It suffices to place the sequence of commands between parentheses to +force it into a subshell, which may be stopped as a unit, +or to start the command in the background and immediately +bring it into the foreground.

Array variables may not (yet) be exported. @@ -15185,7 +15409,7 @@ There may be only one active coprocess at a time.


-
GNU Bash 5.32023 December 14BASH(1) +GNU Bash 5.32024 February 5BASH(1)

@@ -15291,7 +15515,7 @@ There may be only one active coprocess at a time.
BUGS

-This document was created by man2html from /usr/local/src/bash/bash-20231212/doc/bash.1.
-Time: 14 December 2023 16:39:25 EST +This document was created by man2html from /usr/local/src/bash/bash-20240205/doc/bash.1.
+Time: 07 February 2024 09:26:02 EST diff --git a/doc/bash.info b/doc/bash.info index e0a50428..a217e31c 100644 --- a/doc/bash.info +++ b/doc/bash.info @@ -1,12 +1,12 @@ -This is bash.info, produced by makeinfo version 6.8 from bashref.texi. +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, 14 December 2023). +Bash shell (version 5.3, 2 February 2024). - This is Edition 5.3, last updated 14 December 2023, of 'The GNU Bash -Reference Manual', for 'Bash', Version 5.3. + This is Edition 5.3, last updated 2 February 2024, of ‘The GNU Bash +Reference Manual’, for ‘Bash’, Version 5.3. - Copyright (C) 1988-2023 Free Software Foundation, Inc. + Copyright © 1988-2023 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,16 +26,16 @@ Bash Features ************* This text is a brief description of the features that are present in the -Bash shell (version 5.3, 14 December 2023). The Bash home page is +Bash shell (version 5.3, 2 February 2024). The Bash home page is . - This is Edition 5.3, last updated 14 December 2023, of 'The GNU Bash -Reference Manual', for 'Bash', Version 5.3. + This is Edition 5.3, last updated 2 February 2024, of ‘The GNU Bash +Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some features that only appear in Bash. Some of the shells that Bash has -borrowed concepts from are the Bourne Shell ('sh'), the Korn Shell -('ksh'), and the C-shell ('csh' and its successor, 'tcsh'). The +borrowed concepts from are the Bourne Shell (‘sh’), the Korn Shell +(‘ksh’), and the C-shell (‘csh’ and its successor, ‘tcsh’). The following menu breaks the features up into categories, noting which features were inspired by other shells and which are specific to Bash. @@ -83,22 +83,22 @@ File: bash.info, Node: What is Bash?, Next: What is a shell?, Up: Introductio ================= Bash is the shell, or command language interpreter, for the GNU -operating system. The name is an acronym for the 'Bourne-Again SHell', +operating system. The name is an acronym for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of the -current Unix shell 'sh', which appeared in the Seventh Edition Bell Labs +current Unix shell ‘sh’, which appeared in the Seventh Edition Bell Labs Research version of Unix. - Bash is largely compatible with 'sh' and incorporates useful features -from the Korn shell 'ksh' and the C shell 'csh'. It is intended to be a + Bash is largely compatible with ‘sh’ and incorporates useful features +from the Korn shell ‘ksh’ and the C shell ‘csh’. It is intended to be a conformant implementation of the IEEE POSIX Shell and Tools portion of the IEEE POSIX specification (IEEE Standard 1003.1). It offers -functional improvements over 'sh' for both interactive and programming +functional improvements over ‘sh’ for both interactive and programming use. While the GNU operating system provides other shells, including a -version of 'csh', Bash is the default shell. Like other GNU software, +version of ‘csh’, Bash is the default shell. Like other GNU software, Bash is quite portable. It currently runs on nearly every version of -Unix and a few other operating systems - independently-supported ports +Unix and a few other operating systems − independently-supported ports exist for MS-DOS, OS/2, and Windows platforms.  @@ -117,7 +117,7 @@ interface to the rich set of GNU utilities. The programming language features allow these utilities to be combined. Files containing commands can be created, and become commands themselves. These new commands have the same status as system commands in directories such as -'/bin', allowing users or groups to establish custom environments to +‘/bin’, allowing users or groups to establish custom environments to automate their common tasks. Shells may be used interactively or non-interactively. In @@ -128,15 +128,15 @@ executing non-interactively, shells execute commands read from a file. asynchronously. The shell waits for synchronous commands to complete before accepting more input; asynchronous commands continue to execute in parallel with the shell while it reads and executes additional -commands. The "redirection" constructs permit fine-grained control of +commands. The “redirection” constructs permit fine-grained control of the input and output of those commands. Moreover, the shell allows control over the contents of commands' environments. - Shells also provide a small set of built-in commands ("builtins") + Shells also provide a small set of built-in commands (“builtins”) implementing functionality impossible or inconvenient to obtain via -separate utilities. For example, 'cd', 'break', 'continue', and 'exec' +separate utilities. For example, ‘cd’, ‘break’, ‘continue’, and ‘exec’ cannot be implemented outside of the shell because they directly -manipulate the shell itself. The 'history', 'getopts', 'kill', or 'pwd' +manipulate the shell itself. The ‘history’, ‘getopts’, ‘kill’, or ‘pwd’ builtins, among others, could be implemented in separate utilities, but they are more convenient to use as builtin commands. All of the shell builtins are described in subsequent sections. @@ -159,90 +159,90 @@ File: bash.info, Node: Definitions, Next: Basic Shell Features, Prev: Introdu These definitions are used throughout the remainder of this manual. -'POSIX' +‘POSIX’ A family of open system standards based on Unix. Bash is primarily concerned with the Shell and Utilities portion of the POSIX 1003.1 standard. -'blank' +‘blank’ A space or tab character. -'builtin' +‘builtin’ A command that is implemented internally by the shell itself, rather than by an executable program somewhere in the file system. -'control operator' - A 'token' that performs a control function. It is a 'newline' or - one of the following: '||', '&&', '&', ';', ';;', ';&', ';;&', '|', - '|&', '(', or ')'. +‘control operator’ + A ‘token’ that performs a control function. It is a ‘newline’ or + one of the following: ‘||’, ‘&&’, ‘&’, ‘;’, ‘;;’, ‘;&’, ‘;;&’, ‘|’, + ‘|&’, ‘(’, or ‘)’. -'exit status' +‘exit status’ The value returned by a command to its caller. The value is restricted to eight bits, so the maximum value is 255. -'field' +‘field’ A unit of text that is the result of one of the shell expansions. After expansion, when executing a command, the resulting fields are used as the command name and arguments. -'filename' +‘filename’ A string of characters used to identify a file. -'job' +‘job’ A set of processes comprising a pipeline, and any processes descended from it, that are all in the same process group. -'job control' +‘job control’ A mechanism by which users can selectively stop (suspend) and restart (resume) execution of processes. -'metacharacter' +‘metacharacter’ A character that, when unquoted, separates words. A metacharacter - is a 'space', 'tab', 'newline', or one of the following characters: - '|', '&', ';', '(', ')', '<', or '>'. + is a ‘space’, ‘tab’, ‘newline’, or one of the following characters: + ‘|’, ‘&’, ‘;’, ‘(’, ‘)’, ‘<’, or ‘>’. -'name' - A 'word' consisting solely of letters, numbers, and underscores, - and beginning with a letter or underscore. 'Name's are used as +‘name’ + A ‘word’ consisting solely of letters, numbers, and underscores, + and beginning with a letter or underscore. ‘Name’s are used as shell variable and function names. Also referred to as an - 'identifier'. + ‘identifier’. -'operator' - A 'control operator' or a 'redirection operator'. *Note +‘operator’ + A ‘control operator’ or a ‘redirection operator’. *Note Redirections::, for a list of redirection operators. Operators - contain at least one unquoted 'metacharacter'. + contain at least one unquoted ‘metacharacter’. -'process group' +‘process group’ A collection of related processes each having the same process group ID. -'process group ID' - A unique identifier that represents a 'process group' during its +‘process group ID’ + A unique identifier that represents a ‘process group’ during its lifetime. -'reserved word' - A 'word' that has a special meaning to the shell. Most reserved - words introduce shell flow control constructs, such as 'for' and - 'while'. +‘reserved word’ + A ‘word’ that has a special meaning to the shell. Most reserved + words introduce shell flow control constructs, such as ‘for’ and + ‘while’. -'return status' - A synonym for 'exit status'. +‘return status’ + A synonym for ‘exit status’. -'signal' +‘signal’ A mechanism by which a process may be notified by the kernel of an event occurring in the system. -'special builtin' +‘special builtin’ A shell builtin command that has been classified as special by the POSIX standard. -'token' +‘token’ A sequence of characters considered a single unit by the shell. It - is either a 'word' or an 'operator'. + is either a ‘word’ or an ‘operator’. -'word' +‘word’ A sequence of characters treated as a unit by the shell. Words may - not include unquoted 'metacharacters'. + not include unquoted ‘metacharacters’.  File: bash.info, Node: Basic Shell Features, Next: Shell Builtin Commands, Prev: Definitions, Up: Top @@ -250,7 +250,7 @@ File: bash.info, Node: Basic Shell Features, Next: Shell Builtin Commands, Pr 3 Basic Shell Features ********************** -Bash is an acronym for 'Bourne-Again SHell'. The Bourne shell is the +Bash is an acronym for ‘Bourne-Again SHell’. The Bourne shell is the traditional Unix shell originally written by Stephen Bourne. All of the Bourne shell builtin commands are available in Bash, The rules for evaluation and quoting are taken from the POSIX specification for the @@ -287,7 +287,7 @@ File: bash.info, Node: Shell Syntax, Next: Shell Commands, Up: Basic Shell Fe When the shell reads input, it proceeds through a sequence of operations. If the input indicates the beginning of a comment, the -shell ignores the comment symbol ('#'), and the rest of that line. +shell ignores the comment symbol (‘#’), and the rest of that line. Otherwise, roughly speaking, the shell reads its input and divides the input into words and operators, employing the quoting rules to @@ -309,12 +309,12 @@ The following is a brief description of the shell's operation when it reads and executes a command. Basically, the shell does the following: 1. Reads its input from a file (*note Shell Scripts::), from a string - supplied as an argument to the '-c' invocation option (*note + supplied as an argument to the ‘-c’ invocation option (*note Invoking Bash::), or from the user's terminal. 2. Breaks the input into words and operators, obeying the quoting rules described in *note Quoting::. These tokens are separated by - 'metacharacters'. Alias expansion is performed by this step (*note + ‘metacharacters’. Alias expansion is performed by this step (*note Aliases::). 3. Parses the tokens into simple and compound commands (*note Shell @@ -358,11 +358,11 @@ as such, and to prevent parameter expansion. Each of the shell metacharacters (*note Definitions::) 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 (*note -History Interaction::), the "history expansion" character, usually '!', +History Interaction::), the “history expansion” character, usually ‘!’, must be quoted to prevent history expansion. *Note Bash History Facilities::, for more details concerning history expansion. - There are three quoting mechanisms: the "escape character", single + There are three quoting mechanisms: the “escape character”, single quotes, and double quotes.  @@ -371,10 +371,10 @@ File: bash.info, Node: Escape Character, Next: Single Quotes, Up: Quoting 3.1.2.1 Escape Character ........................ -A non-quoted backslash '\' is the Bash escape character. It preserves +A non-quoted backslash ‘\’ is the Bash escape character. It preserves the literal value of the next character that follows, with the exception -of 'newline'. If a '\newline' pair appears, and the backslash itself is -not quoted, the '\newline' is treated as a line continuation (that is, +of ‘newline’. If a ‘\newline’ pair appears, and the backslash itself is +not quoted, the ‘\newline’ is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).  @@ -383,7 +383,7 @@ File: bash.info, Node: Single Quotes, Next: Double Quotes, Prev: Escape Chara 3.1.2.2 Single Quotes ..................... -Enclosing characters in single quotes (''') preserves the literal value +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. @@ -393,23 +393,23 @@ File: bash.info, Node: Double Quotes, Next: ANSI-C Quoting, Prev: Single Quot 3.1.2.3 Double Quotes ..................... -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 (*note Bash POSIX Mode::), the '!' has no special meaning +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 (*note Bash 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 +characters ‘$’ and ‘`’ retain their special meaning within double quotes (*note Shell Expansions::). The backslash retains its special meaning -only when followed by one of the following characters: '$', '`', '"', -'\', or 'newline'. Within double quotes, backslashes that are followed +only when followed by one of the following characters: ‘$’, ‘`’, ‘"’, +‘\’, or ‘newline’. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an -'!' appearing in double quotes is escaped using a backslash. The -backslash preceding the '!' is not removed. +‘!’ appearing in double quotes is escaped using a backslash. The +backslash preceding the ‘!’ is not removed. - The special parameters '*' and '@' have special meaning when in + The special parameters ‘*’ and ‘@’ have special meaning when in double quotes (*note Shell Parameter Expansion::).  @@ -418,50 +418,50 @@ File: bash.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Double 3.1.2.4 ANSI-C Quoting ...................... -Character sequences of the form '$'STRING'' are treated as a special +Character sequences of the form ‘$'STRING'’ are treated as a special kind of single quotes. The sequence expands to STRING, with backslash-escaped characters in STRING replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows: -'\a' +‘\a’ alert (bell) -'\b' +‘\b’ backspace -'\e' -'\E' +‘\e’ +‘\E’ an escape character (not ANSI C) -'\f' +‘\f’ form feed -'\n' +‘\n’ newline -'\r' +‘\r’ carriage return -'\t' +‘\t’ horizontal tab -'\v' +‘\v’ vertical tab -'\\' +‘\\’ backslash -'\'' +‘\'’ single quote -'\"' +‘\"’ double quote -'\?' +‘\?’ question mark -'\NNN' +‘\NNN’ the eight-bit character whose value is the octal value NNN (one to three octal digits) -'\xHH' +‘\xHH’ the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) -'\uHHHH' +‘\uHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits) -'\UHHHHHHHH' +‘\UHHHHHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits) -'\cX' +‘\cX’ a control-X character The expanded result is single-quoted, as if the dollar sign had not been @@ -478,17 +478,17 @@ File: bash.info, Node: Locale Translation, Prev: ANSI-C Quoting, Up: Quoting * Creating Internationalized Scripts:: How to use translations and different languages in your scripts. -Prefixing a double-quoted string with a dollar sign ('$'), such as +Prefixing a double-quoted string with a dollar sign (‘$’), such as $"hello, world", will cause the string to be translated according to the -current locale. The 'gettext' infrastructure performs the lookup and -translation, using the 'LC_MESSAGES', 'TEXTDOMAINDIR', and 'TEXTDOMAIN' +current locale. The ‘gettext’ infrastructure performs the lookup and +translation, using the ‘LC_MESSAGES’, ‘TEXTDOMAINDIR’, and ‘TEXTDOMAIN’ shell variables, as explained below. See the gettext documentation for -additional details not covered here. If the current locale is 'C' or -'POSIX', if there are no translations available, of if the string is not +additional details not covered here. If the current locale is ‘C’ or +‘POSIX’, if there are no translations available, of if the string is not translated, the dollar sign is ignored. Since this is a form of double quoting, the string remains double-quoted by default, whether or not it -is translated and replaced. If the 'noexpand_translation' option is -enabled using the 'shopt' builtin (*note The Shopt Builtin::), +is translated and replaced. If the ‘noexpand_translation’ option is +enabled using the ‘shopt’ builtin (*note The Shopt Builtin::), translated strings are single-quoted instead of double-quoted. The rest of this section is a brief overview of how you use gettext @@ -503,21 +503,21 @@ using $"...", you create a gettext "template" file using the command bash --dump-po-strings SCRIPTNAME > DOMAIN.pot -The DOMAIN is your "message domain". It's just an arbitrary string +The DOMAIN is your “message domain”. It's just an arbitrary string that's used to identify the files gettext needs, like a package or script name. It needs to be unique among all the message domains on systems where you install the translations, so gettext knows which translations correspond to your script. You'll use the template file to create translations for each target language. The template file -conventionally has the suffix '.pot'. +conventionally has the suffix ‘.pot’. You copy this template file to a separate file for each target language you want to support (called "PO" files, which use the suffix -'.po'). PO files use various naming conventions, but when you are +‘.po’). PO files use various naming conventions, but when you are working to translate a template file into a particular language, you first copy the template file to a file whose name is the language you -want to target, with the '.po' suffix. For instance, the Spanish -translations of your strings would be in a file named 'es.po', and to +want to target, with the ‘.po’ suffix. For instance, the Spanish +translations of your strings would be in a file named ‘es.po’, and to get started using a message domain named "example," you would run cp example.pot es.po @@ -534,7 +534,7 @@ be done manually. gettext tools to produce what are called "MO" files, which are compiled versions of the PO files the gettext tools use to look up translations efficiently. MO files are also called "message catalog" files. You use -the 'msgfmt' program to do this. For instance, if you had a file with +the ‘msgfmt’ program to do this. For instance, if you had a file with Spanish translations, you could run msgfmt -o es.mo es.po @@ -542,29 +542,29 @@ Spanish translations, you could run to produce the corresponding MO file. Once you have the MO files, you decide where to install them and use -the 'TEXTDOMAINDIR' shell variable to tell the gettext tools where they +the ‘TEXTDOMAINDIR’ shell variable to tell the gettext tools where they are. Make sure to use the same message domain to name the MO files as you did for the PO files when you install them. - Your users will use the 'LANG' or 'LC_MESSAGES' shell variables to + Your users will use the ‘LANG’ or ‘LC_MESSAGES’ shell variables to select the desired language. - You set the 'TEXTDOMAIN' variable to the script's message domain. As + You set the ‘TEXTDOMAIN’ variable to the script's message domain. As above, you use the message domain to name your translation files. - You, or possibly your users, set the 'TEXTDOMAINDIR' variable to the + You, or possibly your users, set the ‘TEXTDOMAINDIR’ variable to the name of a directory where the message catalog files are stored. If you install the message files into the system's standard message catalog directory, you don't need to worry about this variable. The directory where the message catalog files are stored varies between systems. Some use the message catalog selected by the -'LC_MESSAGES' shell variable. Others create the name of the message -catalog from the value of the 'TEXTDOMAIN' shell variable, possibly -adding the '.mo' suffix. If you use the 'TEXTDOMAIN' variable, you may -need to set the 'TEXTDOMAINDIR' variable to the location of the message +‘LC_MESSAGES’ shell variable. Others create the name of the message +catalog from the value of the ‘TEXTDOMAIN’ shell variable, possibly +adding the ‘.mo’ suffix. If you use the ‘TEXTDOMAIN’ variable, you may +need to set the ‘TEXTDOMAINDIR’ variable to the location of the message catalog files, as above. It's common to use both variables in this -fashion: '$TEXTDOMAINDIR'/'$LC_MESSAGES'/LC_MESSAGES/'$TEXTDOMAIN'.mo. +fashion: ‘$TEXTDOMAINDIR’/‘$LC_MESSAGES’/LC_MESSAGES/‘$TEXTDOMAIN’.mo. If you used that last convention, and you wanted to store the message catalog files with Spanish (es) and Esperanto (eo) translations into a @@ -579,7 +579,7 @@ local directory you use for custom translation files, you could run When all of this is done, and the message catalog files containing the compiled translations are installed in the correct location, your users will be able to see translated strings in any of the supported -languages by setting the 'LANG' or 'LC_MESSAGES' environment variables +languages by setting the ‘LANG’ or ‘LC_MESSAGES’ environment variables before running your script.  @@ -589,11 +589,11 @@ File: bash.info, Node: Comments, Prev: Quoting, Up: Shell Syntax -------------- In a non-interactive shell, or an interactive shell in which the -'interactive_comments' option to the 'shopt' builtin is enabled (*note -The Shopt Builtin::), a word beginning with '#' causes that word and all +‘interactive_comments’ option to the ‘shopt’ builtin is enabled (*note +The Shopt Builtin::), a word beginning with ‘#’ causes that word and all remaining characters on that line to be ignored. An interactive shell -without the 'interactive_comments' option enabled does not allow -comments. The 'interactive_comments' option is on by default in +without the ‘interactive_comments’ option enabled does not allow +comments. The ‘interactive_comments’ option is on by default in interactive shells. *Note Interactive Shells::, for a description of what makes a shell interactive. @@ -603,7 +603,7 @@ File: bash.info, Node: Shell Commands, Next: Shell Functions, Prev: Shell Syn 3.2 Shell Commands ================== -A simple shell command such as 'echo a b c' consists of the command +A simple shell command such as ‘echo a b c’ consists of the command itself followed by arguments, separated by spaces. More complex shell commands are composed of simple commands arranged @@ -634,14 +634,14 @@ are used to begin and end the shell's compound commands. The following words are recognized as reserved when unquoted and the first word of a command (see below for exceptions): -'if' 'then' 'elif' 'else' 'fi' 'time' -'for' 'in' 'until' 'while' 'do' 'done' -'case' 'esac' 'coproc''select''function' -'{' '}' '[[' ']]' '!' +‘if’ ‘then’ ‘elif’ ‘else’ ‘fi’ ‘time’ +‘for’ ‘in’ ‘until’ ‘while’ ‘do’ ‘done’ +‘case’ ‘esac’ ‘coproc’‘select’‘function’ +‘{’ ‘}’ ‘[[’ ‘]]’ ‘!’ -'in' is recognized as a reserved word if it is the third word of a -'case' or 'select' command. 'in' and 'do' are recognized as reserved -words if they are the third word in a 'for' command. +‘in’ is recognized as a reserved word if it is the third word of a +‘case’ or ‘select’ command. ‘in’ and ‘do’ are recognized as reserved +words if they are the third word in a ‘for’ command.  File: bash.info, Node: Simple Commands, Next: Pipelines, Prev: Reserved Words, Up: Shell Commands @@ -650,13 +650,13 @@ File: bash.info, Node: Simple Commands, Next: Pipelines, Prev: Reserved Words --------------------- A simple command is the kind of command encountered most often. It's -just a sequence of words separated by 'blank's, terminated by one of the +just a sequence of words separated by ‘blank’s, terminated by one of the shell's control operators (*note Definitions::). The first word generally specifies a command to be executed, with the rest of the words being that command's arguments. The return status (*note Exit Status::) of a simple command is its -exit status as provided by the POSIX 1003.1 'waitpid' function, or 128+N +exit status as provided by the POSIX 1003.1 ‘waitpid’ function, or 128+N if the command was terminated by signal N.  @@ -665,8 +665,8 @@ File: bash.info, Node: Pipelines, Next: Lists, Prev: Simple Commands, Up: Sh 3.2.3 Pipelines --------------- -A 'pipeline' is a sequence of one or more commands separated by one of -the control operators '|' or '|&'. +A ‘pipeline’ is a sequence of one or more commands separated by one of +the control operators ‘|’ or ‘|&’. The format for a pipeline is [time [-p]] [!] COMMAND1 [ | or |& COMMAND2 ] ... @@ -676,46 +676,46 @@ the input of the next command. That is, each command reads the previous command's output. This connection is performed before any redirections specified by COMMAND1. - If '|&' is used, COMMAND1's standard error, in addition to its + If ‘|&’ is used, COMMAND1's standard error, in addition to its standard output, is connected to COMMAND2's standard input through the -pipe; it is shorthand for '2>&1 |'. This implicit redirection of the +pipe; it is shorthand for ‘2>&1 |’. This implicit redirection of the standard error to the standard output is performed after any redirections specified by COMMAND1. - The reserved word 'time' causes timing statistics to be printed for + The reserved word ‘time’ causes timing statistics to be printed for the pipeline once it finishes. The statistics currently consist of elapsed (wall-clock) time and user and system time consumed by the -command's execution. The '-p' option changes the output format to that +command's execution. The ‘-p’ option changes the output format to that specified by POSIX. When the shell is in POSIX mode (*note Bash POSIX -Mode::), it does not recognize 'time' as a reserved word if the next -token begins with a '-'. The 'TIMEFORMAT' variable may be set to a +Mode::), it does not recognize ‘time’ as a reserved word if the next +token begins with a ‘-’. The ‘TIMEFORMAT’ variable may be set to a format string that specifies how the timing information should be displayed. *Note Bash Variables::, for a description of the available -formats. The use of 'time' as a reserved word permits the timing of -shell builtins, shell functions, and pipelines. An external 'time' +formats. The use of ‘time’ as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external ‘time’ command cannot time these easily. - When the shell is in POSIX mode (*note Bash POSIX Mode::), 'time' may + When the shell is in POSIX mode (*note Bash POSIX Mode::), ‘time’ may be followed by a newline. In this case, the shell displays the total user and system time consumed by the shell and its children. The -'TIMEFORMAT' variable specifies the format of the time information. +‘TIMEFORMAT’ variable specifies the format of the time information. If the pipeline is not executed asynchronously (*note Lists::), the shell waits for all commands in the pipeline to complete. Each command in a multi-command pipeline, where pipes are created, is -executed in its own "subshell", which is a separate process (*note -Command Execution Environment::). If the 'lastpipe' option is enabled -using the 'shopt' builtin (*note The Shopt Builtin::), the last element +executed in its own “subshell”, which is a separate process (*note +Command Execution Environment::). If the ‘lastpipe’ option is enabled +using the ‘shopt’ builtin (*note The Shopt Builtin::), the last element of a pipeline may be run by the shell process when job control is not active. The exit status of a pipeline is the exit status of the last command -in the pipeline, unless the 'pipefail' option is enabled (*note The Set -Builtin::). If 'pipefail' is enabled, the pipeline's return status is +in the pipeline, unless the ‘pipefail’ option is enabled (*note The Set +Builtin::). If ‘pipefail’ 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 successfully. If the reserved word -'!' precedes the pipeline, the exit status is the logical negation of +‘!’ precedes the pipeline, the exit status is the logical negation of the exit status as described above. The shell waits for all commands in the pipeline to terminate before returning a value. @@ -725,31 +725,31 @@ File: bash.info, Node: Lists, Next: Compound Commands, Prev: Pipelines, Up: 3.2.4 Lists of Commands ----------------------- -A 'list' is a sequence of one or more pipelines separated by one of the -operators ';', '&', '&&', or '||', and optionally terminated by one of -';', '&', or a 'newline'. +A ‘list’ is a sequence of one or more pipelines separated by one of the +operators ‘;’, ‘&’, ‘&&’, or ‘||’, and optionally terminated by one of +‘;’, ‘&’, or a ‘newline’. - Of these list operators, '&&' and '||' have equal precedence, -followed by ';' and '&', which have equal precedence. + 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 'list' to delimit + A sequence of one or more newlines may appear in a ‘list’ to delimit commands, equivalent to a semicolon. - If a command is terminated by the control operator '&', the shell + If a command is terminated by the control operator ‘&’, the shell executes the command asynchronously in a subshell. This is known as -executing the command in the "background", and these are referred to as -"asynchronous" commands. The shell does not wait for the command to +executing the command in the “background”, and these are referred to as +“asynchronous” commands. The shell does not wait for the command to finish, and the return status is 0 (true). When job control is not active (*note Job Control::), the standard input for asynchronous commands, in the absence of any explicit redirections, is redirected -from '/dev/null'. +from ‘/dev/null’. - Commands separated by a ';' are executed sequentially; the shell + Commands separated by a ‘;’ are executed sequentially; the shell waits for each command to terminate in turn. The return status is the exit status of the last command executed. AND and OR lists are sequences of one or more pipelines separated by -the control operators '&&' and '||', respectively. AND and OR lists are +the control operators ‘&&’ and ‘||’, respectively. AND and OR lists are executed with left associativity. An AND list has the form @@ -801,11 +801,11 @@ File: bash.info, Node: Looping Constructs, Next: Conditional Constructs, Up: Bash supports the following looping constructs. - Note that wherever a ';' appears in the description of a command's + Note that wherever a ‘;’ appears in the description of a command's syntax, it may be replaced with one or more newlines. -'until' - The syntax of the 'until' command is: +‘until’ + The syntax of the ‘until’ command is: until TEST-COMMANDS; do CONSEQUENT-COMMANDS; done @@ -814,8 +814,8 @@ syntax, it may be replaced with one or more newlines. the last command executed in CONSEQUENT-COMMANDS, or zero if none was executed. -'while' - The syntax of the 'while' command is: +‘while’ + The syntax of the ‘while’ command is: while TEST-COMMANDS; do CONSEQUENT-COMMANDS; done @@ -824,23 +824,23 @@ syntax, it may be replaced with one or more newlines. command executed in CONSEQUENT-COMMANDS, or zero if none was executed. -'for' - The syntax of the 'for' command is: +‘for’ + The syntax of the ‘for’ command is: for NAME [ [in [WORDS ...] ] ; ] do COMMANDS; done Expand WORDS (*note Shell Expansions::), and execute COMMANDS once for each member in the resultant list, with NAME bound to the - current member. If 'in WORDS' is not present, the 'for' command + current member. If ‘in WORDS’ is not present, the ‘for’ command executes the COMMANDS once for each positional parameter that is - set, as if 'in "$@"' had been specified (*note Special + set, as if ‘in "$@"’ had been specified (*note Special Parameters::). The return status is the exit status of the last command that executes. If there are no items in the expansion of WORDS, no commands are executed, and the return status is zero. - An alternate form of the 'for' command is also supported: + An alternate form of the ‘for’ command is also supported: for (( EXPR1 ; EXPR2 ; EXPR3 )) ; do COMMANDS ; done @@ -854,7 +854,7 @@ syntax, it may be replaced with one or more newlines. command in COMMANDS that is executed, or false if any of the expressions is invalid. - The 'break' and 'continue' builtins (*note Bourne Shell Builtins::) + The ‘break’ and ‘continue’ builtins (*note Bourne Shell Builtins::) may be used to control loop execution.  @@ -863,8 +863,8 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: 3.2.5.2 Conditional Constructs .............................. -'if' - The syntax of the 'if' command is: +‘if’ + The syntax of the ‘if’ command is: if TEST-COMMANDS; then CONSEQUENT-COMMANDS; @@ -875,33 +875,33 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: The TEST-COMMANDS list is executed, and if its return status is zero, the CONSEQUENT-COMMANDS list is executed. If TEST-COMMANDS - returns a non-zero status, each 'elif' list is executed in turn, + returns a non-zero status, each ‘elif’ list is executed in turn, and if its exit status is zero, the corresponding MORE-CONSEQUENTS - is executed and the command completes. If 'else - ALTERNATE-CONSEQUENTS' is present, and the final command in the - final 'if' or 'elif' clause has a non-zero exit status, then + is executed and the command completes. If ‘else + ALTERNATE-CONSEQUENTS’ is present, and the final command in the + final ‘if’ or ‘elif’ clause has a non-zero exit status, then ALTERNATE-CONSEQUENTS is executed. The return status is the exit status of the last command executed, or zero if no condition tested true. -'case' - The syntax of the 'case' command is: +‘case’ + The syntax of the ‘case’ command is: case WORD in [ [(] PATTERN [| PATTERN]...) COMMAND-LIST ;;]... esac - 'case' will selectively execute the COMMAND-LIST corresponding to + ‘case’ will selectively execute the COMMAND-LIST corresponding to the first PATTERN that matches WORD. The match is performed according to the rules described below in *note Pattern Matching::. - If the 'nocasematch' shell option (see the description of 'shopt' + If the ‘nocasematch’ shell option (see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed - without regard to the case of alphabetic characters. The '|' is - used to separate multiple patterns, and the ')' operator terminates + without regard to the case of alphabetic characters. The ‘|’ is + used to separate multiple patterns, and the ‘)’ operator terminates a pattern list. A list of patterns and an associated command-list is known as a CLAUSE. - Each clause must be terminated with ';;', ';&', or ';;&'. The WORD + Each clause must be terminated with ‘;;’, ‘;&’, or ‘;;&’. The WORD undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal (*note Shell Parameter Expansion::) before matching is attempted. Each PATTERN @@ -909,13 +909,13 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: substitution, arithmetic expansion, process substitution, and quote removal. - There may be an arbitrary number of 'case' clauses, each terminated - by a ';;', ';&', or ';;&'. The first pattern that matches + There may be an arbitrary number of ‘case’ clauses, each terminated + by a ‘;;’, ‘;&’, or ‘;;&’. The first pattern that matches determines the command-list that is executed. It's a common idiom - to use '*' as the final pattern to define the default case, since + to use ‘*’ as the final pattern to define the default case, since that pattern will always match. - Here is an example using 'case' in a script that could be used to + Here is an example using ‘case’ in a script that could be used to describe one interesting feature of an animal: echo -n "Enter the name of an animal: " @@ -928,11 +928,10 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: esac echo " legs." - - If the ';;' operator is used, no subsequent matches are attempted - after the first pattern match. Using ';&' in place of ';;' causes + If the ‘;;’ operator is used, no subsequent matches are attempted + after the first pattern match. Using ‘;&’ in place of ‘;;’ causes execution to continue with the COMMAND-LIST associated with the - next clause, if any. Using ';;&' in place of ';;' causes the shell + next clause, if any. Using ‘;;&’ in place of ‘;;’ causes the shell to test the patterns in the next clause, if any, and execute any associated COMMAND-LIST on a successful match, continuing the case statement execution as if the pattern list had not matched. @@ -940,27 +939,27 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: The return status is zero if no PATTERN is matched. Otherwise, the return status is the exit status of the COMMAND-LIST executed. -'select' +‘select’ - The 'select' construct allows the easy generation of menus. It has - almost the same syntax as the 'for' command: + The ‘select’ construct allows the easy generation of menus. It has + almost the same syntax as the ‘for’ command: select NAME [in WORDS ...]; do COMMANDS; done - The list of words following 'in' is expanded, generating a list of + The list of words following ‘in’ is expanded, generating a list of items, and the set of expanded words is printed on the standard - error output stream, each preceded by a number. If the 'in WORDS' - is omitted, the positional parameters are printed, as if 'in "$@"' - had been specified. 'select' then displays the 'PS3' prompt and + error output stream, each preceded by a number. If the ‘in WORDS’ + is omitted, the positional parameters are printed, as if ‘in "$@"’ + had been specified. ‘select’ then displays the ‘PS3’ prompt and reads a line from the standard input. If the line consists of a number corresponding to one of the displayed words, then the value of NAME is set to that word. If the line is empty, the words and - prompt are displayed again. If 'EOF' is read, the 'select' command + prompt are displayed again. If ‘EOF’ is read, the ‘select’ command completes and returns 1. Any other value read causes NAME to be - set to null. The line read is saved in the variable 'REPLY'. + set to null. The line read is saved in the variable ‘REPLY’. - The COMMANDS are executed after each selection until a 'break' - command is executed, at which point the 'select' command completes. + The COMMANDS are executed after each selection until a ‘break’ + command is executed, at which point the ‘select’ command completes. Here is an example that allows the user to pick a filename from the current directory, and displays the name and index of the file @@ -972,7 +971,7 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: break; done -'((...))' +‘((...))’ (( EXPRESSION )) The arithmetic EXPRESSION is evaluated according to the rules @@ -982,47 +981,47 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: are removed. If the value of the expression is non-zero, the return status is 0; otherwise the return status is 1. -'[[...]]' +‘[[...]]’ [[ EXPRESSION ]] Return a status of 0 or 1 depending on the evaluation of the conditional expression EXPRESSION. Expressions are composed of the primaries described below in *note Bash Conditional Expressions::. - The words between the '[[' and ']]' do not undergo word splitting + The words between the ‘[[’ and ‘]]’ do not undergo word splitting and filename expansion. The shell performs tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on those words (the expansions that would occur if the words were enclosed - in double quotes). Conditional operators such as '-f' must be + in double quotes). Conditional operators such as ‘-f’ must be unquoted to be recognized as primaries. - When used with '[[', the '<' and '>' operators sort + 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 in *note Pattern Matching::, as if the - 'extglob' shell option were enabled. The '=' operator is identical - to '=='. If the 'nocasematch' shell option (see the description of - 'shopt' in *note The Shopt Builtin::) is enabled, the match is + ‘extglob’ shell option were enabled. The ‘=’ operator is identical + to ‘==’. If the ‘nocasematch’ shell option (see the description of + ‘shopt’ in *note The Shopt Builtin::) 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. + return value is 0 if the string matches (‘==’) or does not match + (‘!=’) the pattern, and 1 otherwise. If you quote any part of the pattern, using any of the shell's quoting mechanisms, the quoted portion is matched literally. This means 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 you use '=~', the string to the + An additional binary operator, ‘=~’, is available, with the same + precedence as ‘==’ and ‘!=’. When you use ‘=~’, the string to the right of the operator is considered a POSIX extended regular expression pattern and matched accordingly (using the POSIX - 'regcomp' and 'regexec' interfaces usually described in regex(3)). + ‘regcomp’ and ‘regexec’ interfaces usually described in regex(3)). The return value is 0 if the string matches the pattern, and 1 if it does not. If the regular expression is syntactically incorrect, - the conditional expression returns 2. If the 'nocasematch' shell - option (see the description of 'shopt' in *note The Shopt + the conditional expression returns 2. If the ‘nocasematch’ shell + option (see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed without regard to the case of alphabetic characters. @@ -1034,39 +1033,39 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: The pattern will match if it matches any part of the string. If you want to force the pattern to match the entire string, anchor - the pattern using the '^' and '$' regular expression operators. + the pattern using the ‘^’ and ‘$’ regular expression operators. For example, the following will match a line (stored in the shell - variable 'line') if there is a sequence of characters anywhere in + variable ‘line’) if there is a sequence of characters anywhere in the value consisting of any number, including zero, of characters - in the 'space' character class, immediately followed by zero or one - instances of 'a', then a 'b': + in the ‘space’ character class, immediately followed by zero or one + instances of ‘a’, then a ‘b’: [[ $line =~ [[:space:]]*(a)?b ]] - That means values for 'line' like 'aab', ' aaaaaab', 'xaby', and ' - ab' will all match, as will a line containing a 'b' anywhere in its + That means values for ‘line’ like ‘aab’, ‘ aaaaaab’, ‘xaby’, and ‘ + ab’ will all match, as will a line containing a ‘b’ anywhere in its value. If you want to match a character that's special to the regular - expression grammar ('^$|[]()\.*+?'), it has to be quoted to remove - its special meaning. This means that in the pattern 'xxx.txt', the - '.' matches any character in the string (its usual regular - expression meaning), but in the pattern '"xxx.txt"', it can only - match a literal '.'. + expression grammar (‘^$|[]()\.*+?’), it has to be quoted to remove + its special meaning. This means that in the pattern ‘xxx.txt’, the + ‘.’ matches any character in the string (its usual regular + expression meaning), but in the pattern ‘"xxx.txt"’, it can only + match a literal ‘.’. Likewise, if you want to include a character in your pattern that has a special meaning to the regular expression grammar, you must make sure it's not quoted. If you want to anchor a pattern at the beginning or end of the string, for instance, you cannot quote the - '^' or '$' characters using any form of shell quoting. + ‘^’ or ‘$’ characters using any form of shell quoting. - If you want to match 'initial string' at the start of a line, the + If you want to match ‘initial string’ at the start of a line, the following will work: [[ $line =~ ^"initial string" ]] but this will not: [[ $line =~ "^initial string" ]] - because in the second example the '^' is quoted and doesn't have + because in the second example the ‘^’ is quoted and doesn't have its usual special meaning. It is sometimes difficult to specify a regular expression properly @@ -1104,13 +1103,13 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: The first two matches will succeed, but the second two will not, because in the second two the backslash will be part of the pattern to be matched. In the first two examples, the pattern passed to - the regular expression parser is '\.'. The backslash removes the - special meaning from '.', so the literal '.' matches. In the + the regular expression parser is ‘\.’. The backslash removes the + special meaning from ‘.’, so the literal ‘.’ matches. In the second two examples, the pattern passed to the regular expression - parser has the backslash quoted (e.g., '\\\.'), which will not + parser has the backslash quoted (e.g., ‘\\\.’), which will not match the string, since it does not contain a backslash. If the - string in the first examples were anything other than '.', say 'a', - the pattern would not match, because the quoted '.' in the pattern + string in the first examples were anything other than ‘.’, say ‘a’, + the pattern would not match, because the quoted ‘.’ in the pattern loses its special meaning of matching any single character. Bracket expressions in regular expressions can be sources of errors @@ -1121,7 +1120,7 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: purpose. Though it might seem like a strange way to write it, the following - pattern will match a '.' in the string: + pattern will match a ‘.’ in the string: [[ . =~ [.] ]] @@ -1134,35 +1133,35 @@ File: bash.info, Node: Conditional Constructs, Next: Command Grouping, Prev: twice as much as possible, so shell quoting should be sufficient to quote special pattern characters where that's necessary. - The array variable 'BASH_REMATCH' records which parts of the string - matched the pattern. The element of 'BASH_REMATCH' with index 0 + The array variable ‘BASH_REMATCH’ records which parts of the string + matched the pattern. The element of ‘BASH_REMATCH’ with index 0 contains the portion of the string matching the entire regular expression. Substrings matched by parenthesized subexpressions within the regular expression are saved in the remaining - 'BASH_REMATCH' indices. The element of 'BASH_REMATCH' with index N + ‘BASH_REMATCH’ indices. The element of ‘BASH_REMATCH’ with index N is the portion of the string matching the Nth parenthesized subexpression. - Bash sets 'BASH_REMATCH' in the global scope; declaring it as a + Bash sets ‘BASH_REMATCH’ in the global scope; declaring it as a local variable will lead to unexpected results. Expressions may be combined using the following operators, listed in decreasing order of precedence: - '( EXPRESSION )' + ‘( EXPRESSION )’ Returns the value of EXPRESSION. This may be used to override the normal precedence of operators. - '! EXPRESSION' + ‘! EXPRESSION’ True if EXPRESSION is false. - 'EXPRESSION1 && EXPRESSION2' + ‘EXPRESSION1 && EXPRESSION2’ True if both EXPRESSION1 and EXPRESSION2 are true. - 'EXPRESSION1 || EXPRESSION2' + ‘EXPRESSION1 || EXPRESSION2’ True if either EXPRESSION1 or EXPRESSION2 is true. - The '&&' and '||' operators do not evaluate EXPRESSION2 if the + The ‘&&’ and ‘||’ operators do not evaluate EXPRESSION2 if the value of EXPRESSION1 is sufficient to determine the return value of the entire conditional expression. @@ -1177,7 +1176,7 @@ unit. When commands are grouped, redirections may be applied to the entire command list. For example, the output of all the commands in the list may be redirected to a single stream. -'()' +‘()’ ( LIST ) Placing a list of commands between parentheses forces the shell to @@ -1186,7 +1185,7 @@ list may be redirected to a single stream. Since the LIST is executed in a subshell, variable assignments do not remain in effect after the subshell completes. -'{}' +‘{}’ { LIST; } Placing a list of commands between curly braces causes the list to @@ -1196,7 +1195,7 @@ list may be redirected to a single stream. In addition to the creation of a subshell, there is a subtle difference between these two constructs due to historical reasons. The braces are reserved words, so they must be separated from the LIST by -'blank's or other shell metacharacters. The parentheses are operators, +‘blank’s or other shell metacharacters. The parentheses are operators, and are recognized as separate tokens by the shell even if they are not separated from the LIST by whitespace. @@ -1209,9 +1208,9 @@ File: bash.info, Node: Coprocesses, Next: GNU Parallel, Prev: Compound Comman 3.2.6 Coprocesses ----------------- -A 'coprocess' is a shell command preceded by the 'coproc' reserved word. +A ‘coprocess’ is a shell command preceded by the ‘coproc’ 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 +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: @@ -1221,14 +1220,14 @@ established between the executing shell and the coprocess. This creates a coprocess named NAME. COMMAND may be either a simple command (*note Simple Commands::) or a compound command (*note Compound Commands::). NAME is a shell variable name. If NAME is not supplied, -the default name is 'COPROC'. +the default name is ‘COPROC’. The recommended form to use for a coprocess is coproc NAME { COMMAND; } This form is recommended because simple commands result in the coprocess -always being named 'COPROC', and it is simpler to use and more complete +always being named ‘COPROC’, and it is simpler to use and more complete than the other compound commands. There are other forms of coprocesses: @@ -1238,7 +1237,7 @@ than the other compound commands. coproc SIMPLE-COMMAND If COMMAND is a compound command, NAME is optional. The word following -'coproc' determines whether that word is interpreted as a variable name: +‘coproc’ determines whether that word is interpreted as a variable name: it is interpreted as NAME if it is not a reserved word that introduces a compound command. If COMMAND is a simple command, NAME is not allowed; this is to avoid confusion between NAME and the first word of the simple @@ -1258,11 +1257,11 @@ process substitutions, the file descriptors are not available in subshells. The process ID of the shell spawned to execute the coprocess is -available as the value of the variable 'NAME_PID'. The 'wait' builtin +available as the value of the variable ‘NAME_PID’. The ‘wait’ builtin command may be used to wait for the coprocess to terminate. Since the coprocess is created as an asynchronous command, the -'coproc' command always returns success. The return status of a +‘coproc’ command always returns success. The return status of a coprocess is the exit status of COMMAND.  @@ -1280,7 +1279,7 @@ arguments, whether they are filenames, usernames, hostnames, or lines read from files. GNU Parallel provides shorthand references to many of the most common operations (input lines, various portions of the input line, different ways to specify the input source, and so on). Parallel -can replace 'xargs' or feed commands from its input sources to several +can replace ‘xargs’ or feed commands from its input sources to several different instances of Bash. For a complete description, refer to the GNU Parallel documentation, @@ -1308,20 +1307,20 @@ new process is created to interpret them. function FNAME [()] COMPOUND-COMMAND [ REDIRECTIONS ] This defines a shell function named FNAME. The reserved word -'function' is optional. If the 'function' reserved word is supplied, -the parentheses are optional. The "body" of the function is the +‘function’ is optional. If the ‘function’ reserved word is supplied, +the parentheses are optional. The “body” of the function is the compound command COMPOUND-COMMAND (*note Compound Commands::). That command is usually a LIST enclosed between { and }, but may be any -compound command listed above. If the 'function' reserved word is used, +compound command listed above. If the ‘function’ reserved word is used, but the parentheses are not supplied, the braces are recommended. COMPOUND-COMMAND is executed whenever FNAME is specified as the name of a simple command. When the shell is in POSIX mode (*note Bash POSIX Mode::), FNAME must be a valid shell name and may not be the same as one of the special builtins (*note Special Builtins::). In default mode, a -function name can be any unquoted shell word that does not contain '$'. +function name can be any unquoted shell word that does not contain ‘$’. Any redirections (*note Redirections::) associated with the shell function are performed when the function is executed. A function -definition may be deleted using the '-f' option to the 'unset' builtin +definition may be deleted using the ‘-f’ option to the ‘unset’ builtin (*note Bourne Shell Builtins::). The exit status of a function definition is zero unless a syntax @@ -1331,55 +1330,55 @@ last command executed in the body. Note that for historical reasons, in the most common usage the curly braces that surround the body of the function must be separated from the -body by 'blank's or newlines. This is because the braces are reserved +body by ‘blank’s or newlines. This is because the braces are reserved words and are only recognized as such when they are separated from the command list by whitespace or another shell metacharacter. Also, when -using the braces, the LIST must be terminated by a semicolon, a '&', or +using the braces, the LIST must be terminated by a semicolon, a ‘&’, or a newline. When a function is executed, the arguments to the function become the positional parameters during its execution (*note Positional -Parameters::). The special parameter '#' that expands to the number of +Parameters::). The special parameter ‘#’ that expands to the number of positional parameters is updated to reflect the change. Special -parameter '0' is unchanged. The first element of the 'FUNCNAME' +parameter ‘0’ is unchanged. The first element of the ‘FUNCNAME’ variable is set to the name of the function while the function is executing. All other aspects of the shell execution environment are identical -between a function and its caller with these exceptions: the 'DEBUG' and -'RETURN' traps are not inherited unless the function has been given the -'trace' attribute using the 'declare' builtin or the '-o functrace' -option has been enabled with the 'set' builtin, (in which case all -functions inherit the 'DEBUG' and 'RETURN' traps), and the 'ERR' trap is -not inherited unless the '-o errtrace' shell option has been enabled. -*Note Bourne Shell Builtins::, for the description of the 'trap' +between a function and its caller with these exceptions: the ‘DEBUG’ and +‘RETURN’ traps are not inherited unless the function has been given the +‘trace’ attribute using the ‘declare’ builtin or the ‘-o functrace’ +option has been enabled with the ‘set’ builtin, (in which case all +functions inherit the ‘DEBUG’ and ‘RETURN’ traps), and the ‘ERR’ trap is +not inherited unless the ‘-o errtrace’ shell option has been enabled. +*Note Bourne Shell Builtins::, for the description of the ‘trap’ builtin. - The 'FUNCNEST' variable, if set to a numeric value greater than 0, + The ‘FUNCNEST’ variable, if set to a numeric value greater than 0, defines a maximum function nesting level. Function invocations that exceed the limit cause the entire command to abort. - If the builtin command 'return' is executed in a function, the + If the builtin command ‘return’ is executed in a function, the function completes and execution resumes with the next command after the -function call. Any command associated with the 'RETURN' trap is +function call. Any command associated with the ‘RETURN’ trap is executed before execution resumes. When a function completes, the -values of the positional parameters and the special parameter '#' are +values of the positional parameters and the special parameter ‘#’ are restored to the values they had prior to the function's execution. If a -numeric argument is given to 'return', that is the function's return +numeric argument is given to ‘return’, that is the function's return status; otherwise the function's return status is the exit status of the -last command executed before the 'return'. +last command executed before the ‘return’. - Variables local to the function may be declared with the 'local' -builtin ("local variables"). Ordinarily, variables and their values are + Variables local to the function may be declared with the ‘local’ +builtin (“local variables”). Ordinarily, variables and their values are shared between a function and its caller. These variables are visible only to the function and the commands it invokes. This is particularly important when a shell function calls other functions. - In the following description, the "current scope" is a currently- + In the following description, the “current scope” is a currently- executing function. Previous scopes consist of that function's caller and so on, back to the "global" scope, where the shell is not executing any shell function. Consequently, a local variable at the current local -scope is a variable declared using the 'local' or 'declare' builtins in +scope is a variable declared using the ‘local’ or ‘declare’ builtins in the function that is currently executing. Local variables "shadow" variables with the same name declared at @@ -1388,19 +1387,19 @@ hides a global variable of the same name: references and assignments refer to the local variable, leaving the global variable unmodified. When the function returns, the global variable is once again visible. - The shell uses "dynamic scoping" to control a variable's visibility + The shell uses “dynamic scoping” to control a variable's visibility within functions. With dynamic scoping, visible variables and their values are a result of the sequence of function calls that caused execution to reach the current function. The value of a variable that a function sees depends on its value within its caller, if any, whether -that caller is the "global" scope or another shell function. This is -also the value that a local variable declaration "shadows", and the -value that is restored when the function returns. +that caller is the global scope or another shell function. This is also +the value that a local variable declaration shadows, and the value that +is restored when the function returns. - For example, if a variable 'var' is declared as local in function -'func1', and 'func1' calls another function 'func2', references to 'var' -made from within 'func2' will resolve to the local variable 'var' from -'func1', shadowing any global variable named 'var'. + For example, if a variable ‘var’ is declared as local in function +‘func1’, and ‘func1’ calls another function ‘func2’, references to ‘var’ +made from within ‘func2’ will resolve to the local variable ‘var’ from +‘func1’, shadowing any global variable named ‘var’. The following script demonstrates this behavior. When executed, the script displays @@ -1421,8 +1420,8 @@ script displays var=global func1 - The 'unset' builtin also acts using the same dynamic scope: if a -variable is local to the current scope, 'unset' will unset it; otherwise + The ‘unset’ builtin also acts using the same dynamic scope: if a +variable is local to the current scope, ‘unset’ will unset it; otherwise the unset will refer to the variable found in any calling scope as described above. If a variable at the current local scope is unset, it will remain so (appearing as unset) until it is reset in that scope or @@ -1430,18 +1429,18 @@ until the function returns. Once the function returns, any instance of the variable at a previous scope will become 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 -'localvar_unset'shell option changes this behavior). +‘localvar_unset’shell option changes this behavior). - Function names and definitions may be listed with the '-f' option to -the 'declare' ('typeset') builtin command (*note Bash Builtins::). The -'-F' option to 'declare' or 'typeset' will list the function names only -(and optionally the source file and line number, if the 'extdebug' shell + Function names and definitions may be listed with the ‘-f’ option to +the ‘declare’ (‘typeset’) builtin command (*note Bash Builtins::). The +‘-F’ option to ‘declare’ or ‘typeset’ will list the function names only +(and optionally the source file and line number, if the ‘extdebug’ shell option is enabled). Functions may be exported so that child shell processes (those created when executing a separate shell invocation) -automatically have them defined with the '-f' option to the 'export' +automatically have them defined with the ‘-f’ option to the ‘export’ builtin (*note Bourne Shell Builtins::). - Functions may be recursive. The 'FUNCNEST' variable may be used to + Functions may be recursive. The ‘FUNCNEST’ variable may be used to limit the depth of the function call stack and restrict the number of function invocations. By default, no limit is placed on the number of recursive calls. @@ -1457,50 +1456,50 @@ File: bash.info, Node: Shell Parameters, Next: Shell Expansions, Prev: Shell * Positional Parameters:: The shell's command-line arguments. * Special Parameters:: Parameters denoted by special characters. -A "parameter" is an entity that stores values. It can be a 'name', a -number, or one of the special characters listed below. A "variable" is -a parameter denoted by a 'name'. A variable has a 'value' and zero or -more 'attributes'. Attributes are assigned using the 'declare' builtin -command (see the description of the 'declare' builtin in *note Bash +A “parameter” is an entity that stores values. It can be a ‘name’, a +number, or one of the special characters listed below. A “variable” is +a parameter denoted by a ‘name’. A variable has a ‘value’ and zero or +more ‘attributes’. Attributes are assigned using the ‘declare’ builtin +command (see the description of the ‘declare’ builtin in *note Bash Builtins::). 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 -the 'unset' builtin command. +the ‘unset’ builtin command. A variable may be assigned to by a statement of the form NAME=[VALUE] If VALUE is not given, the variable is assigned the null string. All VALUEs undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal (*note -Shell Parameter Expansion::). If the variable has its 'integer' +Shell Parameter Expansion::). If the variable has its ‘integer’ attribute set, then VALUE is evaluated as an arithmetic expression even -if the '$((...))' expansion is not used (*note Arithmetic Expansion::). +if the ‘$((...))’ expansion is not used (*note Arithmetic Expansion::). Word splitting and filename expansion are not performed. Assignment -statements may also appear as arguments to the 'alias', 'declare', -'typeset', 'export', 'readonly', and 'local' builtin commands -("declaration" commands). When in POSIX mode (*note Bash POSIX Mode::), +statements may also appear as arguments to the ‘alias’, ‘declare’, +‘typeset’, ‘export’, ‘readonly’, and ‘local’ builtin commands +(“declaration” commands). When in POSIX mode (*note Bash POSIX Mode::), these builtins may appear in a command after one or more instances of -the 'command' builtin and retain these assignment statement properties. +the ‘command’ 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 (*note Arrays::), the '+=' operator can +a shell variable or array index (*note Arrays::), the ‘+=’ operator can be used to append to or add to the variable's previous value. This -includes arguments to builtin commands such as 'declare' that accept -assignment statements (declaration commands). When '+=' is applied to a -variable for which the 'integer' attribute has been set, VALUE is +includes arguments to builtin commands such as ‘declare’ that accept +assignment statements (declaration commands). When ‘+=’ is applied to a +variable for which the ‘integer’ attribute has been set, VALUE is evaluated as an arithmetic expression and added to the variable's -current value, which is also evaluated. When '+=' is applied to an +current value, which is also evaluated. When ‘+=’ is applied to an array variable using compound assignment (*note Arrays::), the -variable's value is not unset (as it is when using '='), and new values +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. - A variable can be assigned the 'nameref' attribute using the '-n' -option to the 'declare' or 'local' builtin commands (*note Bash -Builtins::) to create a "nameref", or a reference to another variable. + A variable can be assigned the ‘nameref’ attribute using the ‘-n’ +option to the ‘declare’ or ‘local’ builtin commands (*note Bash +Builtins::) to create a “nameref”, or a reference to another variable. This allows variables to be manipulated indirectly. Whenever the nameref variable is referenced, assigned to, unset, or has its attributes modified (other than using or changing the nameref attribute @@ -1510,19 +1509,19 @@ shell functions to refer to a variable whose name is passed as an argument to the function. For instance, if a variable name is passed to a shell function as its first argument, running declare -n ref=$1 -inside the function creates a nameref variable 'ref' whose value is the +inside the function creates a nameref variable ‘ref’ whose value is the variable name passed as the first argument. References and assignments -to 'ref', and changes to its attributes, are treated as references, +to ‘ref’, and changes to its attributes, are treated as references, assignments, and attribute modifications to the variable whose name was -passed as '$1'. +passed as ‘$1’. - If the control variable in a 'for' loop has the nameref attribute, + If the control variable in a ‘for’ loop has the nameref attribute, the list of words can be a list of shell variables, and a name reference will be established for each word in the list, in turn, when the loop is executed. Array variables cannot be given the nameref attribute. However, nameref variables can reference array variables and subscripted -array variables. Namerefs can be unset using the '-n' option to the -'unset' builtin (*note Bourne Shell Builtins::). Otherwise, if 'unset' +array variables. Namerefs can be unset using the ‘-n’ option to the +‘unset’ builtin (*note Bourne Shell Builtins::). Otherwise, if ‘unset’ is executed with the name of a nameref variable as an argument, the variable referenced by the nameref variable will be unset. @@ -1532,13 +1531,13 @@ File: bash.info, Node: Positional Parameters, Next: Special Parameters, Up: S 3.4.1 Positional Parameters --------------------------- -A "positional parameter" is a parameter denoted by one or more digits, -other than the single digit '0'. Positional parameters are assigned +A “positional parameter” is a parameter denoted by one or more digits, +other than the single digit ‘0’. Positional parameters are assigned from the shell's arguments when it is invoked, and may be reassigned -using the 'set' builtin command. Positional parameter 'N' may be -referenced as '${N}', or as '$N' when 'N' consists of a single digit. +using the ‘set’ builtin command. Positional parameter ‘N’ may be +referenced as ‘${N}’, or as ‘$N’ when ‘N’ consists of a single digit. Positional parameters may not be assigned to with assignment statements. -The 'set' and 'shift' builtins are used to set and unset them (*note +The ‘set’ and ‘shift’ builtins are used to set and unset them (*note Shell Builtin Commands::). The positional parameters are temporarily replaced when a shell function is executed (*note Shell Functions::). @@ -1554,20 +1553,20 @@ File: bash.info, Node: Special Parameters, Prev: Positional Parameters, Up: S The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. -'*' +‘*’ ($*) Expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and filename expansion. When the expansion occurs within double quotes, it expands to a single word with the value of each - parameter separated by the first character of the 'IFS' special - variable. That is, '"$*"' is equivalent to '"$1C$2C..."', where C - is the first character of the value of the 'IFS' variable. If - 'IFS' is unset, the parameters are separated by spaces. If 'IFS' + parameter separated by the first character of the ‘IFS’ special + variable. That is, ‘"$*"’ is equivalent to ‘"$1C$2C..."’, where C + is the first character of the value of the ‘IFS’ variable. If + ‘IFS’ is unset, the parameters are separated by spaces. If ‘IFS’ is null, the parameters are joined without intervening separators. -'@' +‘@’ ($@) Expands to the positional parameters, starting from one. In contexts where word splitting is performed, this expands each positional parameter to a separate word; if not within double @@ -1576,41 +1575,41 @@ only be referenced; assignment to them is not allowed. word with each positional parameter separated by a space. When the expansion occurs within double quotes, and word splitting is performed, each parameter expands to a separate word. That is, - '"$@"' is equivalent to '"$1" "$2" ...'. If the double-quoted + ‘"$@"’ is equivalent to ‘"$1" "$2" ...’. If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. When there are no positional - parameters, '"$@"' and '$@' expand to nothing (i.e., they are + parameters, ‘"$@"’ and ‘$@’ expand to nothing (i.e., they are removed). -'#' +‘#’ ($#) Expands to the number of positional parameters in decimal. -'?' +‘?’ ($?) Expands to the exit status of the most recently executed foreground pipeline. -'-' +‘-’ ($-, a hyphen.) Expands to the current option flags as specified - upon invocation, by the 'set' builtin command, or those set by the - shell itself (such as the '-i' option). + upon invocation, by the ‘set’ builtin command, or those set by the + shell itself (such as the ‘-i’ option). -'$' +‘$’ ($$) Expands to the process ID of the shell. In a subshell, it expands to the process ID of the invoking shell, not the subshell. -'!' +‘!’ ($!) Expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or - using the 'bg' builtin (*note Job Control Builtins::). + using the ‘bg’ builtin (*note Job Control Builtins::). -'0' +‘0’ ($0) Expands to the name of the shell or shell script. This is set at shell initialization. If Bash is invoked with a file of - commands (*note Shell Scripts::), '$0' is set to the name of that - file. If Bash is started with the '-c' option (*note Invoking - Bash::), then '$0' is set to the first argument after the string to + commands (*note Shell Scripts::), ‘$0’ is set to the name of that + file. If Bash is started with the ‘-c’ option (*note Invoking + Bash::), then ‘$0’ is set to the first argument after the string to be executed, if one is present. Otherwise, it is set to the filename used to invoke Bash, as given by argument zero. @@ -1621,15 +1620,16 @@ File: bash.info, Node: Shell Expansions, Next: Redirections, Prev: Shell Para ==================== Expansion is performed on the command line after it has been split into -'token's. There are seven kinds of expansion performed: +‘token’s. Bash performs these expansions: - * brace expansion - * tilde expansion - * parameter and variable expansion - * command substitution - * arithmetic expansion - * word splitting - * filename expansion + • brace expansion + • tilde expansion + • parameter and variable expansion + • command substitution + • arithmetic expansion + • word splitting + • filename expansion + • quote removal * Menu: @@ -1648,23 +1648,24 @@ Expansion is performed on the command line after it has been split into 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; and -filename expansion. +substitution (done in a left-to-right fashion); word splitting; filename +expansion; and quote removal. On systems that can support it, there is an additional expansion -available: "process substitution". This is performed at the same time +available: “process substitution”. This is performed at the same time as tilde, parameter, variable, and arithmetic expansion and command substitution. - After these expansions are performed, quote characters present in the -original word are removed unless they have been quoted themselves -("quote removal"). *Note Quote Removal:: for more details. + “Quote removal” 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. *Note +Quote Removal:: for more details. Only brace expansion, word splitting, and filename expansion can increase the number of words of the expansion; other expansions expand a single word to a single word. The only exceptions to this are the -expansions of '"$@"' and '$*' (*note Special Parameters::), and -'"${NAME[@]}"' and '${NAME[*]}' (*note Arrays::). +expansions of ‘"$@"’ and ‘$*’ (*note Special Parameters::), and +‘"${NAME[@]}"’ and ‘${NAME[*]}’ (*note Arrays::).  File: bash.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Shell Expansions @@ -1673,7 +1674,7 @@ File: bash.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Shell Expa --------------------- Brace expansion is a mechanism by which arbitrary strings may be -generated. This mechanism is similar to "filename expansion" (*note +generated. This mechanism is similar to “filename expansion” (*note Filename Expansion::), but the filenames generated need not exist. Patterns to be brace expanded take the form of an optional PREAMBLE, followed by either a series of comma-separated strings or a sequence @@ -1687,18 +1688,17 @@ are not sorted; left to right order is preserved. For example, bash$ echo a{d,c,b}e ade ace abe - A sequence expression takes the form '{X..Y[..INCR]}', where X and Y + A sequence expression takes the form ‘{X..Y[..INCR]}’, where X and Y are either integers or letters, and INCR, an optional increment, is an integer. When integers are supplied, the expression expands to each -number between X and Y, inclusive. Supplied integers may be prefixed -with '0' to force each term to have the same width. 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. 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. Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It @@ -1709,10 +1709,10 @@ 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 '}'. +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: @@ -1726,62 +1726,62 @@ File: bash.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, Prev 3.5.2 Tilde Expansion --------------------- -If a word begins with an unquoted tilde character ('~'), all of the +If a word begins with an unquoted tilde character (‘~’), all of the characters up to the first unquoted slash (or all characters, if there -is no unquoted slash) are considered a "tilde-prefix". If none of the +is no unquoted slash) are considered a “tilde-prefix”. If none of the characters in the tilde-prefix are quoted, the characters in the -tilde-prefix following the tilde are treated as a possible "login name". +tilde-prefix following the tilde are treated as a possible “login name”. If this login name is the null string, the tilde is replaced with the -value of the 'HOME' shell variable. If 'HOME' is unset, the home +value of the ‘HOME’ shell variable. If ‘HOME’ is unset, the home directory of the user executing the shell is substituted instead. Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name. - If the tilde-prefix is '~+', the value of the shell variable 'PWD' -replaces the tilde-prefix. If the tilde-prefix is '~-', the value of -the shell variable 'OLDPWD', if it is set, is substituted. + If the tilde-prefix is ‘~+’, the value of the shell variable ‘PWD’ +replaces the tilde-prefix. If the tilde-prefix is ‘~-’, the value of +the shell variable ‘OLDPWD’, if it is set, is substituted. If the characters following the tilde in the tilde-prefix consist of -a number N, optionally prefixed by a '+' or a '-', the tilde-prefix is +a number N, optionally prefixed by a ‘+’ or a ‘-’, the tilde-prefix is replaced with the corresponding element from the directory stack, as it -would be displayed by the 'dirs' builtin invoked with the characters +would be displayed by the ‘dirs’ builtin invoked with the characters following tilde in the tilde-prefix as an argument (*note The Directory Stack::). If the tilde-prefix, sans the tilde, consists of a number -without a leading '+' or '-', '+' is assumed. +without a leading ‘+’ or ‘-’, ‘+’ is assumed. If the login name is invalid, or the tilde expansion fails, the word is left unchanged. Each variable assignment is checked for unquoted tilde-prefixes -immediately following a ':' or the first '='. In these cases, tilde +immediately following a ‘:’ or the first ‘=’. In these cases, tilde expansion is also performed. Consequently, one may use filenames with -tildes in assignments to 'PATH', 'MAILPATH', and 'CDPATH', and the shell +tildes in assignments to ‘PATH’, ‘MAILPATH’, and ‘CDPATH’, and the shell assigns the expanded value. The following table shows how Bash treats unquoted tilde-prefixes: -'~' - The value of '$HOME' -'~/foo' - '$HOME/foo' +‘~’ + The value of ‘$HOME’ +‘~/foo’ + ‘$HOME/foo’ -'~fred/foo' - The subdirectory 'foo' of the home directory of the user 'fred' +‘~fred/foo’ + The subdirectory ‘foo’ of the home directory of the user ‘fred’ -'~+/foo' - '$PWD/foo' +‘~+/foo’ + ‘$PWD/foo’ -'~-/foo' - '${OLDPWD-'~-'}/foo' +‘~-/foo’ + ‘${OLDPWD-'~-'}/foo’ -'~N' - The string that would be displayed by 'dirs +N' +‘~N’ + The string that would be displayed by ‘dirs +N’ -'~+N' - The string that would be displayed by 'dirs +N' +‘~+N’ + The string that would be displayed by ‘dirs +N’ -'~-N' - The string that would be displayed by 'dirs -N' +‘~-N’ + The string that would be displayed by ‘dirs -N’ Bash also performs tilde expansion on words satisfying the conditions of variable assignments (*note Shell Parameters::) when they appear as @@ -1794,13 +1794,13 @@ File: bash.info, Node: Shell Parameter Expansion, Next: Command Substitution, 3.5.3 Shell Parameter Expansion ------------------------------- -The '$' character introduces parameter expansion, command substitution, +The ‘$’ character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. - When braces are used, the matching ending brace is the first '}' not + When braces are used, the matching ending brace is the first ‘}’ not escaped by a backslash or within a quoted string, and not within an embedded arithmetic expansion, command substitution, or parameter expansion. @@ -1817,7 +1817,7 @@ PARAMETER is not a nameref, it introduces a level of indirection. Bash uses the value formed by expanding the rest of PARAMETER as the new PARAMETER; this is then expanded and that value is used in the rest of the expansion, rather than the expansion of the original PARAMETER. -This is known as 'indirect expansion'. The value is subject to tilde +This is known as ‘indirect expansion’. The value is subject to tilde expansion, parameter expansion, command substitution, and arithmetic expansion. If PARAMETER is a nameref, this expands to the name of the variable referenced by PARAMETER instead of performing the complete @@ -1829,13 +1829,13 @@ immediately follow the left brace in order to introduce indirection. parameter expansion, command substitution, and arithmetic expansion. When not performing substring expansion, using the forms described -below (e.g., ':-'), Bash tests for a parameter that is unset or null. +below (e.g., ‘:-’), Bash tests for a parameter that is unset or null. Omitting the colon results in a test only for a parameter that is unset. Put another way, if the colon is included, the operator tests for both PARAMETER's existence and that its value is not null; if the colon is omitted, the operator tests only for existence. -'${PARAMETER:-WORD}' +‘${PARAMETER:−WORD}’ If PARAMETER is unset or null, the expansion of WORD is substituted. Otherwise, the value of PARAMETER is substituted. @@ -1851,7 +1851,7 @@ omitted, the operator tests only for existence. $ echo ${v:-unset-or-null} unset-or-null -'${PARAMETER:=WORD}' +‘${PARAMETER:=WORD}’ If PARAMETER is unset or null, the expansion of WORD is assigned to PARAMETER. The value of PARAMETER is then substituted. Positional parameters and special parameters may not be assigned to in this @@ -1862,7 +1862,7 @@ omitted, the operator tests only for existence. $ echo $var DEFAULT -'${PARAMETER:?WORD}' +‘${PARAMETER:?WORD}’ If PARAMETER is null or unset, the expansion of WORD (or a message to that effect if WORD is not present) is written to the standard error and the shell, if it is not interactive, exits. Otherwise, @@ -1872,7 +1872,7 @@ omitted, the operator tests only for existence. $ : ${var:?var is unset or null} bash: var: var is unset or null -'${PARAMETER:+WORD}' +‘${PARAMETER:+WORD}’ If PARAMETER is null or unset, nothing is substituted, otherwise the expansion of WORD is substituted. @@ -1880,12 +1880,12 @@ omitted, the operator tests only for existence. $ echo ${var:+var is set and not null} var is set and not null -'${PARAMETER:OFFSET}' -'${PARAMETER:OFFSET:LENGTH}' +‘${PARAMETER:OFFSET}’ +‘${PARAMETER:OFFSET:LENGTH}’ This is referred to as Substring Expansion. It expands to up to LENGTH characters of the value of PARAMETER starting at the - character specified by OFFSET. If PARAMETER is '@' or '*', an - indexed array subscripted by '@' or '*', or an associative array + character specified by OFFSET. If PARAMETER is ‘@’ or ‘*’, an + indexed array subscripted by ‘@’ or ‘*’, or an associative array name, the results differ as described below. If LENGTH is omitted, it expands to the substring of the value of PARAMETER starting at the character specified by OFFSET and extending to the end of the @@ -1899,7 +1899,7 @@ omitted, the operator tests only for existence. rather than a number of characters, and the expansion is the characters between OFFSET and that result. Note that a negative offset must be separated from the colon by at least one space to - avoid being confused with the ':-' expansion. + avoid being confused with the ‘:-’ expansion. Here are some examples illustrating substring expansion on parameters and subscripted arrays: @@ -1956,7 +1956,7 @@ omitted, the operator tests only for existence. $ echo ${array[0]: -7:-2} bcdef - If PARAMETER is '@' or '*', the result is LENGTH positional + If PARAMETER is ‘@’ or ‘*’, the result is LENGTH positional parameters beginning at OFFSET. A negative OFFSET is taken relative to one greater than the greatest positional parameter, so an offset of -1 evaluates to the last positional parameter (or 0 if @@ -1984,9 +1984,9 @@ omitted, the operator tests only for existence. $ echo ${@: -7:0} - If PARAMETER is an indexed array name subscripted by '@' or '*', + If PARAMETER is an indexed array name subscripted by ‘@’ or ‘*’, the result is the LENGTH members of the array beginning with - '${PARAMETER[OFFSET]}'. A negative OFFSET is taken relative to one + ‘${PARAMETER[OFFSET]}’. A negative OFFSET is taken relative to one greater than the maximum index of the specified array. It is an expansion error if LENGTH evaluates to a number less than zero. @@ -2014,66 +2014,66 @@ omitted, the operator tests only for existence. Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1 by default. If - OFFSET is 0, and the positional parameters are used, '$0' is + OFFSET is 0, and the positional parameters are used, ‘$0’ is prefixed to the list. -'${!PREFIX*}' -'${!PREFIX@}' +‘${!PREFIX*}’ +‘${!PREFIX@}’ Expands to the names of variables whose names begin with PREFIX, - separated by the first character of the 'IFS' special variable. - When '@' is used and the expansion appears within double quotes, + separated by the first character of the ‘IFS’ special variable. + When ‘@’ is used and the expansion appears within double quotes, each variable name expands to a separate word. -'${!NAME[@]}' -'${!NAME[*]}' +‘${!NAME[@]}’ +‘${!NAME[*]}’ If NAME is an array variable, expands to the list of array indices (keys) assigned in NAME. If NAME is not an array, expands to 0 if - NAME is set and null otherwise. When '@' is used and the expansion + NAME is set and null otherwise. When ‘@’ is used and the expansion appears within double quotes, each key expands to a separate word. -'${#PARAMETER}' +‘${#PARAMETER}’ The length in characters of the expanded value of PARAMETER is - substituted. If PARAMETER is '*' or '@', the value substituted is + substituted. If PARAMETER is ‘*’ or ‘@’, the value substituted is the number of positional parameters. If PARAMETER is an array name - subscripted by '*' or '@', the value substituted is the number of + subscripted by ‘*’ or ‘@’, the value substituted is the number of elements in the array. If PARAMETER is an indexed array name subscripted by a negative number, that number is interpreted as relative to one greater than the maximum index of PARAMETER, so negative indices count back from the end of the array, and an index of -1 references the last element. -'${PARAMETER#WORD}' -'${PARAMETER##WORD}' +‘${PARAMETER#WORD}’ +‘${PARAMETER##WORD}’ The WORD is expanded to produce a pattern and matched according to the rules described below (*note Pattern Matching::). If the pattern matches the beginning of the expanded value of PARAMETER, then the result of the expansion is the expanded value of PARAMETER - with the shortest matching pattern (the '#' case) or the longest - matching pattern (the '##' case) deleted. If PARAMETER is '@' or - '*', the pattern removal operation is applied to each positional + with the shortest matching pattern (the ‘#’ case) or the longest + matching pattern (the ‘##’ case) deleted. If PARAMETER is ‘@’ or + ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If - PARAMETER is an array variable subscripted with '@' or '*', the + PARAMETER is an array variable subscripted with ‘@’ or ‘*’, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER%WORD}' -'${PARAMETER%%WORD}' +‘${PARAMETER%WORD}’ +‘${PARAMETER%%WORD}’ The WORD is expanded to produce a pattern and matched according to the rules described below (*note Pattern Matching::). If the pattern matches a trailing portion of the expanded value of PARAMETER, then the result of the expansion is the value of - PARAMETER with the shortest matching pattern (the '%' case) or the - longest matching pattern (the '%%' case) deleted. If PARAMETER is - '@' or '*', the pattern removal operation is applied to each + PARAMETER with the shortest matching pattern (the ‘%’ case) or the + longest matching pattern (the ‘%%’ case) deleted. If PARAMETER is + ‘@’ or ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant - list. If PARAMETER is an array variable subscripted with '@' or - '*', the pattern removal operation is applied to each member of the + list. If PARAMETER is an array variable subscripted with ‘@’ or + ‘*’, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER/PATTERN/STRING}' -'${PARAMETER//PATTERN/STRING}' -'${PARAMETER/#PATTERN/STRING}' -'${PARAMETER/%PATTERN/STRING}' +‘${PARAMETER/PATTERN/STRING}’ +‘${PARAMETER//PATTERN/STRING}’ +‘${PARAMETER/#PATTERN/STRING}’ +‘${PARAMETER/%PATTERN/STRING}’ The PATTERN is expanded to produce a pattern just as in filename expansion. PARAMETER is expanded and the longest match of PATTERN against its value is replaced with STRING. STRING undergoes tilde @@ -2085,30 +2085,30 @@ omitted, the operator tests only for existence. In the first form above, only the first match is replaced. If there are two slashes separating PARAMETER and PATTERN (the second form above), all matches of PATTERN are replaced with STRING. If - PATTERN is preceded by '#' (the third form above), it must match at + PATTERN is preceded by ‘#’ (the third form above), it must match at the beginning of the expanded value of PARAMETER. If PATTERN is - preceded by '%' (the fourth form above), it must match at the end + preceded by ‘%’ (the fourth form above), it must match at the end of the expanded value of PARAMETER. If the expansion of STRING is null, matches of PATTERN are deleted. If STRING is null, matches - of PATTERN are deleted and the '/' following PATTERN may be + of PATTERN are deleted and the ‘/’ following PATTERN may be omitted. - If the 'patsub_replacement' shell option is enabled using 'shopt', - any unquoted instances of '&' in STRING are replaced with the + If the ‘patsub_replacement’ shell option is enabled using ‘shopt’, + any unquoted instances of ‘&’ in STRING are replaced with the matching portion of PATTERN. This is intended to duplicate a - common 'sed' idiom. + common ‘sed’ idiom. Quoting any part of STRING inhibits replacement in the expansion of the quoted portion, including replacement strings stored in shell - variables. Backslash will escape '&' in STRING; the backslash is - removed in order to permit a literal '&' in the replacement string. + variables. Backslash will escape ‘&’ in STRING; the backslash is + removed in order to permit a literal ‘&’ in the replacement string. Users should take care if STRING is double-quoted to avoid unwanted interactions between the backslash and double-quoting, since backslash has special meaning within double quotes. Pattern - substitution performs the check for unquoted '&' after expanding + substitution performs the check for unquoted ‘&’ after expanding STRING, so users should ensure to properly quote any occurrences of - '&' they want to be taken literally in the replacement and ensure - any instances of '&' they want to be replaced are unquoted. + ‘&’ they want to be taken literally in the replacement and ensure + any instances of ‘&’ they want to be replaced are unquoted. For instance, @@ -2135,33 +2135,33 @@ omitted, the operator tests only for existence. a context that doesn't take any enclosing double quotes into account. - Since backslash can escape '&', it can also escape a backslash in - the replacement string. This means that '\\' will insert a literal - backslash into the replacement, so these two 'echo' commands + Since backslash can escape ‘&’, it can also escape a backslash in + the replacement string. This means that ‘\\’ will insert a literal + backslash into the replacement, so these two ‘echo’ commands var=abcdef rep='\\&xyz' echo ${var/abc/\\&xyz} echo ${var/abc/$rep} - will both output '\abcxyzdef'. + will both output ‘\abcxyzdef’. It should rarely be necessary to enclose only STRING in double quotes. - If the 'nocasematch' shell option (see the description of 'shopt' + If the ‘nocasematch’ shell option (see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed without regard to the case of alphabetic characters. If PARAMETER - is '@' or '*', the substitution operation is applied to each + is ‘@’ or ‘*’, the substitution operation is applied to each positional parameter in turn, and the expansion is the resultant - list. If PARAMETER is an array variable subscripted with '@' or - '*', the substitution operation is applied to each member of the + list. If PARAMETER is an array variable subscripted with ‘@’ or + ‘*’, the substitution operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER^PATTERN}' -'${PARAMETER^^PATTERN}' -'${PARAMETER,PATTERN}' -'${PARAMETER,,PATTERN}' +‘${PARAMETER^PATTERN}’ +‘${PARAMETER^^PATTERN}’ +‘${PARAMETER,PATTERN}’ +‘${PARAMETER,,PATTERN}’ This expansion modifies the case of alphabetic characters in PARAMETER. The PATTERN is expanded to produce a pattern just as in filename expansion. Each character in the expanded value of @@ -2169,68 +2169,68 @@ omitted, the operator tests only for existence. pattern, its case is converted. The pattern should not attempt to match more than one character. - The '^' operator converts lowercase letters matching PATTERN to - uppercase; the ',' operator converts matching uppercase letters to - lowercase. The '^^' and ',,' expansions convert each matched - character in the expanded value; the '^' and ',' expansions match + The ‘^’ operator converts lowercase letters matching PATTERN to + uppercase; the ‘,’ operator converts matching uppercase letters to + lowercase. The ‘^^’ and ‘,,’ expansions convert each matched + character in the expanded value; the ‘^’ and ‘,’ expansions match and convert only the first character in the expanded value. If - PATTERN is omitted, it is treated like a '?', which matches every + PATTERN is omitted, it is treated like a ‘?’, which matches every character. - If PARAMETER is '@' or '*', the case modification operation is + If PARAMETER is ‘@’ or ‘*’, the case modification operation is applied to each positional parameter in turn, and the expansion is the resultant list. If PARAMETER is an array variable subscripted - with '@' or '*', the case modification operation is applied to each + with ‘@’ or ‘*’, the case modification operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER@OPERATOR}' +‘${PARAMETER@OPERATOR}’ The expansion is either a transformation of the value of PARAMETER or information about PARAMETER itself, depending on the value of OPERATOR. Each OPERATOR is a single letter: - 'U' + ‘U’ The expansion is a string that is the value of PARAMETER with lowercase alphabetic characters converted to uppercase. - 'u' + ‘u’ The expansion is a string that is the value of PARAMETER with the first character converted to uppercase, if it is alphabetic. - 'L' + ‘L’ The expansion is a string that is the value of PARAMETER with uppercase alphabetic characters converted to lowercase. - 'Q' + ‘Q’ The expansion is a string that is the value of PARAMETER quoted in a format that can be reused as input. - 'E' + ‘E’ The expansion is a string that is the value of PARAMETER with - backslash escape sequences expanded as with the '$'...'' + backslash escape sequences expanded as with the ‘$'...'’ quoting mechanism. - 'P' + ‘P’ The expansion is a string that is the result of expanding the value of PARAMETER as if it were a prompt string (*note Controlling the Prompt::). - 'A' + ‘A’ The expansion is a string in the form of an assignment - statement or 'declare' command that, if evaluated, will + statement or ‘declare’ command that, if evaluated, will recreate PARAMETER with its attributes and value. - 'K' + ‘K’ Produces a possibly-quoted version of the value of PARAMETER, except that it prints the values of indexed and associative arrays as a sequence of quoted key-value pairs (*note Arrays::). - 'a' + ‘a’ The expansion is a string consisting of flag values representing PARAMETER's attributes. - 'k' - Like the 'K' transformation, but expands the keys and values + ‘k’ + Like the ‘K’ transformation, but expands the keys and values of indexed and associative arrays to separate words after word splitting. - If PARAMETER is '@' or '*', the operation is applied to each + If PARAMETER is ‘@’ or ‘*’, the operation is applied to each positional parameter in turn, and the expansion is the resultant - list. If PARAMETER is an array variable subscripted with '@' or - '*', the operation is applied to each member of the array in turn, + list. If PARAMETER is an array variable subscripted with ‘@’ or + ‘*’, the operation is applied to each member of the array in turn, and the expansion is the resultant list. The result of the expansion is subject to word splitting and @@ -2253,13 +2253,13 @@ Bash performs command substitution by executing COMMAND in a subshell environment and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. -The command substitution '$(cat FILE)' can be replaced by the equivalent -but faster '$(< FILE)'. +The command substitution ‘$(cat FILE)’ can be replaced by the equivalent +but faster ‘$(< FILE)’. With the old-style backquote form of substitution, backslash retains -its literal meaning except when followed by '$', '`', or '\'. The first +its literal meaning except when followed by ‘$’, ‘`’, or ‘\’. The first backquote not preceded by a backslash terminates the command -substitution. When using the '$(COMMAND)' form, all characters between +substitution. When using the ‘$(COMMAND)’ form, all characters between the parentheses make up the command; none are treated specially. There is an alternate form of command substitution: @@ -2270,7 +2270,7 @@ which executes COMMAND in the current execution environment and captures its output, again with trailing newlines removed. The character C following the open brace must be a space, tab, -newline, or '|', and the close brace must be in a position where a +newline, or ‘|’, and the close brace must be in a position where a reserved word may appear (i.e., preceded by a command terminator such as semicolon). Bash allows the close brace to be joined to the remaining characters in the word without being followed by a shell metacharacter @@ -2278,35 +2278,35 @@ as a reserved word would usually require. Any side effects of COMMAND take effect immediately in the current execution environment and persist in the current environment after the -command completes (e.g., the 'exit' builtin will exit the shell). +command completes (e.g., the ‘exit’ builtin will exit the shell). This type of command substitution superficially resembles executing an unnamed shell function: local variables are created as when a shell -function is executing, and the 'return' builtin forces COMMAND to +function is executing, and the ‘return’ builtin forces COMMAND to complete; however, the rest of the execution environment, including the positional parameters, is shared with the caller. - If the first character following the open brace is a '|', the -construct expands to the value of the 'REPLY' shell variable after + If the first character following the open brace is a ‘|’, the +construct expands to the value of the ‘REPLY’ shell variable after COMMAND executes, without removing any trailing newlines, and the standard output of COMMAND remains the same as in the calling shell. -Bash creates 'REPLY' as an initially-unset local variable when COMMAND -executes, and restores 'REPLY' to the value it had before the command +Bash creates ‘REPLY’ as an initially-unset local variable when COMMAND +executes, and restores ‘REPLY’ to the value it had before the command substitution after COMMAND completes, as with any local variable. - For example, this construct expands to '12345', and leaves the shell -variable 'X' unchanged in the current execution environment: + For example, this construct expands to ‘12345’, and leaves the shell +variable ‘X’ unchanged in the current execution environment: ${ local X=12345 ; echo $X; } -(not declaring 'X' as local would modify its value in the current +(not declaring ‘X’ as local would modify its value in the current environment, as with normal shell function execution), while this -construct does not require any output to expand to '12345': +construct does not require any output to expand to ‘12345’: ${| REPLY=12345; } -and restores 'REPLY' to the value it had before the command +and restores ‘REPLY’ to the value it had before the command substitution. Command substitutions may be nested. To nest when using the @@ -2352,13 +2352,13 @@ or >(LIST) The process LIST is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current -command as the result of the expansion. If the '>(LIST)' form is used, -writing to the file will provide input for LIST. If the '<(LIST)' form +command as the result of the expansion. If the ‘>(LIST)’ form is used, +writing to the file will provide input for LIST. If the ‘<(LIST)’ form is used, the file passed as an argument should be read to obtain the -output of LIST. Note that no space may appear between the '<' or '>' +output of LIST. Note that no space may appear between the ‘<’ or ‘>’ and the left parenthesis, otherwise the construct would be interpreted as a redirection. Process substitution is supported on systems that -support named pipes (FIFOs) or the '/dev/fd' method of naming open +support named pipes (FIFOs) or the ‘/dev/fd’ method of naming open files. When available, process substitution is performed simultaneously with @@ -2375,34 +2375,34 @@ The shell scans the results of parameter expansion, command substitution, and arithmetic expansion that did not occur within double quotes for word splitting. - The shell treats each character of '$IFS' as a delimiter, and splits + The shell treats each character of ‘$IFS’ as a delimiter, and splits the results of the other expansions into words using these characters as field terminators. - If 'IFS' is unset, or its value is exactly '', -the default, then sequences of 'space', 'tab', and 'newline' at the + If ‘IFS’ is unset, or its value is exactly ‘’, +the default, then sequences of ‘space’, ‘tab’, and ‘newline’ at the beginning and end of the results of the previous expansions are ignored, -and any sequence of 'IFS' characters not at the beginning or end serves -to delimit words. If 'IFS' has a value other than the default, then -sequences of the whitespace characters 'space', 'tab', and 'newline' are +and any sequence of ‘IFS’ characters not at the beginning or end serves +to delimit words. If ‘IFS’ has a value other than the default, then +sequences of the whitespace characters ‘space’, ‘tab’, and ‘newline’ are ignored at the beginning and end of the word, as long as the whitespace -character is in the value of 'IFS' (an 'IFS' whitespace character). Any -character in 'IFS' that is not 'IFS' whitespace, along with any adjacent -'IFS' whitespace characters, delimits a field. A sequence of 'IFS' +character is in the value of ‘IFS’ (an ‘IFS’ whitespace character). Any +character in ‘IFS’ that is not ‘IFS’ whitespace, along with any adjacent +‘IFS’ whitespace characters, delimits a field. A sequence of ‘IFS’ whitespace characters is also treated as a delimiter. - If the value of 'IFS' is null, no word splitting occurs. If 'IFS' is + If the value of ‘IFS’ is null, no word splitting occurs. If ‘IFS’ is unset, word splitting behaves as if it contained the default value -''. +‘’. - Explicit null arguments ('""' or '''') are retained and passed to + Explicit null arguments (‘""’ or ‘''’) are retained and passed to commands as empty strings. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. If a parameter with no value is expanded within double quotes, a null argument results and is retained and passed to a command as an empty string. When a quoted null argument appears as part of a word whose expansion is non-null, the null argument is removed. That is, the word -'-d''' becomes '-d' after word splitting and null argument removal. +‘-d''’ becomes ‘-d’ after word splitting and null argument removal. Note that if no expansion occurs, no splitting is performed. @@ -2416,26 +2416,26 @@ File: bash.info, Node: Filename Expansion, Next: Quote Removal, Prev: Word Sp * Pattern Matching:: How the shell matches patterns. -After word splitting, unless the '-f' option has been set (*note The Set -Builtin::), Bash scans each word for the characters '*', '?', and '['. +After word splitting, unless the ‘-f’ option has been set (*note The Set +Builtin::), Bash scans each word for the characters ‘*’, ‘?’, and ‘[’. If one of these characters appears, and is not quoted, then the word is regarded as a PATTERN, and replaced with an alphabetically sorted list of filenames matching the pattern (*note Pattern Matching::). If no -matching filenames are found, and the shell option 'nullglob' is -disabled, the word is left unchanged. If the 'nullglob' option is set, -and no matches are found, the word is removed. If the 'failglob' shell +matching filenames are found, and the shell option ‘nullglob’ is +disabled, the word is left unchanged. If the ‘nullglob’ option is set, +and no matches are found, the word is removed. If the ‘failglob’ shell option is set, and no matches are found, an error message is printed and -the command is not executed. If the shell option 'nocaseglob' is +the command is not executed. If the shell option ‘nocaseglob’ is enabled, the match is performed without regard to the case of alphabetic characters. - When a pattern is used for filename expansion, the character '.' at + When a pattern is used for filename expansion, the character ‘.’ at the start of a filename or immediately following a slash must be matched -explicitly, unless the shell option 'dotglob' is set. In order to match -the filenames '.' and '..', the pattern must begin with '.' (for -example, '.?'), even if 'dotglob' is set. If the 'globskipdots' shell -option is enabled, the filenames '.' and '..' are never matched, even if -the pattern begins with a '.'. When not matching filenames, the '.' +explicitly, unless the shell option ‘dotglob’ is set. In order to match +the filenames ‘.’ and ‘..’, the pattern must begin with ‘.’ (for +example, ‘.?’), even if ‘dotglob’ is set. If the ‘globskipdots’ shell +option is enabled, the filenames ‘.’ and ‘..’ never match, even if the +pattern begins with a ‘.’. When not matching filenames, the ‘.’ character is not treated specially. When matching a filename, the slash character must always be matched @@ -2443,25 +2443,25 @@ explicitly by a slash in the pattern, but in other matching contexts it can be matched by a special pattern character as described below (*note Pattern Matching::). - See the description of 'shopt' in *note The Shopt Builtin::, for a -description of the 'nocaseglob', 'nullglob', 'globskipdots', 'failglob', -and 'dotglob' options. - - The 'GLOBIGNORE' shell variable may be used to restrict the set of -file names matching a pattern. If 'GLOBIGNORE' is set, each matching -file name that also matches one of the patterns in 'GLOBIGNORE' is -removed from the list of matches. If the 'nocaseglob' option is set, -the matching against the patterns in 'GLOBIGNORE' is performed without -regard to case. The filenames '.' and '..' are always ignored when -'GLOBIGNORE' is set and not null. However, setting 'GLOBIGNORE' to a -non-null value has the effect of enabling the 'dotglob' shell option, so -all other filenames beginning with a '.' will match. To get the old -behavior of ignoring filenames beginning with a '.', make '.*' one of -the patterns in 'GLOBIGNORE'. The 'dotglob' option is disabled when -'GLOBIGNORE' is unset. + See the description of ‘shopt’ in *note The Shopt Builtin::, for a +description of the ‘nocaseglob’, ‘nullglob’, ‘globskipdots’, ‘failglob’, +and ‘dotglob’ options. + + The ‘GLOBIGNORE’ shell variable may be used to restrict the set of +file names matching a pattern. If ‘GLOBIGNORE’ is set, each matching +file name that also matches one of the patterns in ‘GLOBIGNORE’ is +removed from the list of matches. If the ‘nocaseglob’ option is set, +the matching against the patterns in ‘GLOBIGNORE’ is performed without +regard to case. The filenames ‘.’ and ‘..’ are always ignored when +‘GLOBIGNORE’ is set and not null. However, setting ‘GLOBIGNORE’ to a +non-null value has the effect of enabling the ‘dotglob’ shell option, so +all other filenames beginning with a ‘.’ will match. To get the old +behavior of ignoring filenames beginning with a ‘.’, make ‘.*’ one of +the patterns in ‘GLOBIGNORE’. The ‘dotglob’ option is disabled when +‘GLOBIGNORE’ is unset. After the pattern is expanded and matched against filenames, the -value of the 'GLOBSORT' variable controls how the results are sorted, as +value of the ‘GLOBSORT’ variable controls how the results are sorted, as described below (*note Bash Variables::).  @@ -2477,91 +2477,91 @@ escaping backslash is discarded when matching. The special pattern characters must be quoted if they are to be matched literally. The special pattern characters have the following meanings: -'*' - Matches any string, including the null string. When the 'globstar' - shell option is enabled, and '*' is used in a filename expansion - context, two adjacent '*'s used as a single pattern will match all +‘*’ + Matches any string, including the null string. When the ‘globstar’ + shell option is enabled, and ‘*’ is used in a filename expansion + context, two adjacent ‘*’s used as a single pattern will match all files and zero or more directories and subdirectories. If followed - by a '/', two adjacent '*'s will match only directories and + by a ‘/’, two adjacent ‘*’s will match only directories and subdirectories. -'?' +‘?’ Matches any single character. -'[...]' +‘[...]’ Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a RANGE EXPRESSION; any character that falls between those two characters, inclusive, using the current locale's collating sequence and character set, is matched. - If the first character following the '[' is a '!' or a '^' then any - character not enclosed is matched. A '-' may be matched by - including it as the first or last character in the set. A ']' may + If the first character following the ‘[’ is a ‘!’ or a ‘^’ then any + character not enclosed is matched. A ‘−’ may be matched by + including it as the first or last character in the set. A ‘]’ may be matched by including it as the first character in the set. The sorting order of characters in range expressions, and the characters included in the range, are determined by the current - locale and the values of the 'LC_COLLATE' and 'LC_ALL' shell + locale and the values of the ‘LC_COLLATE’ and ‘LC_ALL’ shell variables, if set. - For example, in the default C locale, '[a-dx-z]' is equivalent to - '[abcdxyz]'. Many locales sort characters in dictionary order, and - in these locales '[a-dx-z]' is typically not equivalent to - '[abcdxyz]'; it might be equivalent to '[aBbCcDdxYyZz]', for + For example, in the default C locale, ‘[a-dx-z]’ is equivalent to + ‘[abcdxyz]’. Many locales sort characters in dictionary order, and + in these locales ‘[a-dx-z]’ is typically not equivalent to + ‘[abcdxyz]’; it might be equivalent to ‘[aBbCcDdxYyZz]’, for example. To obtain the traditional interpretation of ranges in bracket expressions, you can force the use of the C locale by - setting the 'LC_COLLATE' or 'LC_ALL' environment variable to the - value 'C', or enable the 'globasciiranges' shell option. + setting the ‘LC_COLLATE’ or ‘LC_ALL’ environment variable to the + value ‘C’, or enable the ‘globasciiranges’ shell option. - Within '[' and ']', "character classes" can be specified using the - syntax '[:'CLASS':]', where CLASS is one of the following classes + Within ‘[’ and ‘]’, “character classes” can be specified using the + syntax ‘[:’CLASS‘:]’, where CLASS is one of the following classes defined in the POSIX standard: alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit A character class matches any character belonging to that class. - The 'word' character class matches letters, digits, and the - character '_'. + The ‘word’ character class matches letters, digits, and the + character ‘_’. - Within '[' and ']', an "equivalence class" can be specified using - the syntax '[='C'=]', which matches all characters with the same + Within ‘[’ and ‘]’, an “equivalence class” can be specified using + the syntax ‘[=’C‘=]’, which matches all characters with the same collation weight (as defined by the current locale) as the character C. - Within '[' and ']', the syntax '[.'SYMBOL'.]' matches the collating + Within ‘[’ and ‘]’, the syntax ‘[.’SYMBOL‘.]’ matches the collating symbol SYMBOL. - If the 'extglob' shell option is enabled using the 'shopt' builtin, + If the ‘extglob’ shell option is enabled using the ‘shopt’ builtin, the shell recognizes several extended pattern matching operators. In the following description, a PATTERN-LIST is a list of one or more -patterns separated by a '|'. When matching filenames, the 'dotglob' +patterns separated by a ‘|’. When matching filenames, the ‘dotglob’ shell option determines the set of filenames that are tested, as described above. Composite patterns may be formed using one or more of the following sub-patterns: -'?(PATTERN-LIST)' +‘?(PATTERN-LIST)’ Matches zero or one occurrence of the given patterns. -'*(PATTERN-LIST)' +‘*(PATTERN-LIST)’ Matches zero or more occurrences of the given patterns. -'+(PATTERN-LIST)' +‘+(PATTERN-LIST)’ Matches one or more occurrences of the given patterns. -'@(PATTERN-LIST)' +‘@(PATTERN-LIST)’ Matches one of the given patterns. -'!(PATTERN-LIST)' +‘!(PATTERN-LIST)’ Matches anything except one of the given patterns. - The 'extglob' option changes the behavior of the parser, since the + The ‘extglob’ option changes the behavior of the parser, since the parentheses are normally treated as operators with syntactic meaning. To ensure that extended matching patterns are parsed correctly, make -sure that 'extglob' is enabled before parsing constructs containing the +sure that ‘extglob’ is enabled before parsing constructs containing the patterns, including shell functions and command substitutions. - When matching filenames, the 'dotglob' shell option determines the -set of filenames that are tested: when 'dotglob' is enabled, the set of -filenames includes all files beginning with '.', but the filenames '.' -and '..' must be matched by a pattern or sub-pattern that begins with a + When matching filenames, the ‘dotglob’ shell option determines the +set of filenames that are tested: when ‘dotglob’ is enabled, the set of +filenames includes all files beginning with ‘.’, but the filenames ‘.’ +and ‘..’ must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames -beginning with "." unless the pattern or sub-pattern begins with a '.'. -As above, '.' only has a special meaning when matching filenames. +beginning with "." unless the pattern or sub-pattern begins with a ‘.’. +As above, ‘.’ only has a special meaning when matching filenames. Complicated extended pattern matching against long strings is slow, especially when the patterns contain alternations and the strings @@ -2576,7 +2576,7 @@ File: bash.info, Node: Quote Removal, Prev: Filename Expansion, Up: Shell Exp ------------------- After the preceding expansions, all unquoted occurrences of the -characters '\', ''', and '"' that did not result from one of the above +characters ‘\’, ‘'’, and ‘"’ that did not result from one of the above expansions are removed.  @@ -2585,8 +2585,8 @@ File: bash.info, Node: Redirections, Next: Executing Commands, Prev: Shell Ex 3.6 Redirections ================ -Before a command is executed, its input and output may be "redirected" -using a special notation interpreted by the shell. "Redirection" allows +Before a command is executed, its input and output may be “redirected” +using a special notation interpreted by the shell. “Redirection” allows commands' file handles to be duplicated, opened, closed, made to refer to different files, and can change the files the command reads from and writes to. Redirection may also be used to modify file handles in the @@ -2602,13 +2602,13 @@ file descriptor greater than 10 and assign it to {VARNAME}. If >&- or <&- is preceded by {VARNAME}, the value of VARNAME defines the file descriptor to close. If {VARNAME} is supplied, the redirection persists beyond the scope of the command, allowing the shell programmer to manage -the file descriptor's lifetime manually. The 'varredir_close' shell +the file descriptor's lifetime manually. The ‘varredir_close’ shell option manages this behavior (*note The Shopt Builtin::). In the following descriptions, if the file descriptor number is -omitted, and the first character of the redirection operator is '<', the +omitted, and the first character of the redirection operator is ‘<’, the redirection refers to the standard input (file descriptor 0). If the -first character of the redirection operator is '>', the redirection +first character of the redirection operator is ‘>’, the redirection refers to the standard output (file descriptor 1). The word following the redirection operator in the following @@ -2633,24 +2633,24 @@ system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with the behavior described below. -'/dev/fd/FD' +‘/dev/fd/FD’ If FD is a valid integer, file descriptor FD is duplicated. -'/dev/stdin' +‘/dev/stdin’ File descriptor 0 is duplicated. -'/dev/stdout' +‘/dev/stdout’ File descriptor 1 is duplicated. -'/dev/stderr' +‘/dev/stderr’ File descriptor 2 is duplicated. -'/dev/tcp/HOST/PORT' +‘/dev/tcp/HOST/PORT’ If HOST is a valid hostname or Internet address, and PORT is an integer port number or service name, Bash attempts to open the corresponding TCP socket. -'/dev/udp/HOST/PORT' +‘/dev/udp/HOST/PORT’ If HOST is a valid hostname or Internet address, and PORT is an integer port number or service name, Bash attempts to open the corresponding UDP socket. @@ -2665,8 +2665,8 @@ internally. ----------------------- Redirection of input causes the file whose name results from the -expansion of WORD to be opened for reading on file descriptor 'n', or -the standard input (file descriptor 0) if 'n' is not specified. +expansion of WORD to be opened for reading on file descriptor ‘n’, or +the standard input (file descriptor 0) if ‘n’ is not specified. The general format for redirecting input is: [N][|]WORD - If the redirection operator is '>', and the 'noclobber' option to the -'set' builtin has been enabled, the redirection will fail if the file + If the redirection operator is ‘>’, and the ‘noclobber’ option to the +‘set’ builtin has been enabled, the redirection will fail 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, the redirection is +file. If the redirection operator is ‘>|’, or the redirection operator +is ‘>’ and the ‘noclobber’ option is not enabled, the redirection is attempted even if the file named by WORD exists. 3.6.3 Appending Redirected Output @@ -2716,7 +2716,7 @@ and Of the two forms, the first is preferred. This is semantically equivalent to >WORD 2>&1 - When using the second form, WORD may not expand to a number or '-'. + When using the second form, WORD may not expand to a number or ‘-’. If it does, other redirection operators apply (see Duplicating File Descriptors below) for compatibility reasons. @@ -2743,7 +2743,7 @@ as the standard input (or file descriptor N if N is specified) for a command. The format of here-documents is: - [N]<<[-]WORD + [N]<<[−]WORD HERE-DOCUMENT DELIMITER @@ -2755,10 +2755,10 @@ removal on WORD, and the lines in the here-document are not expanded. If WORD is unquoted, DELIMITER is WORD itself, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion, the character sequence -'\newline' is ignored, and '\' must be used to quote the characters '\', -'$', and '`'. +‘\newline’ is ignored, and ‘\’ must be used to quote the characters ‘\’, +‘$’, and ‘`’. - If the redirection operator is '<<-', then all leading tab characters + If the redirection operator is ‘<<-’, then all leading tab characters are stripped from input lines and the line containing DELIMITER. This allows here-documents within shell scripts to be indented in a natural fashion. @@ -2784,7 +2784,7 @@ is used to duplicate input file descriptors. If WORD expands to one or more digits, the file descriptor denoted by N is made to be a copy of that file descriptor. If the digits in WORD do not specify a file descriptor open for input, a redirection error occurs. If WORD -evaluates to '-', file descriptor N is closed. If N is not specified, +evaluates to ‘-’, file descriptor N is closed. If N is not specified, the standard input (file descriptor 0) is used. The operator @@ -2792,9 +2792,9 @@ the standard input (file descriptor 0) is used. is used similarly to duplicate output file descriptors. If N is not specified, the standard output (file descriptor 1) is used. If the digits in WORD do not specify a file descriptor open for output, a -redirection error occurs. If WORD evaluates to '-', file descriptor N +redirection error occurs. If WORD evaluates to ‘-’, file descriptor N is closed. As a special case, if N is omitted, and WORD does not expand -to one or more digits or '-', the standard output and standard error are +to one or more digits or ‘-’, the standard output and standard error are redirected as described previously. 3.6.9 Moving File Descriptors @@ -2862,7 +2862,7 @@ following order. 3. Redirections are performed as described above (*note Redirections::). - 4. The text after the '=' in each variable assignment undergoes tilde + 4. The text after the ‘=’ in each variable assignment undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable. @@ -2905,14 +2905,14 @@ following actions. invoked. 3. If the name is neither a shell function nor a builtin, and contains - no slashes, Bash searches each element of '$PATH' for a directory + no slashes, Bash searches each element of ‘$PATH’ for a directory containing an executable file by that name. Bash uses a hash table to remember the full pathnames of executable files to avoid - multiple 'PATH' searches (see the description of 'hash' in *note + multiple ‘PATH’ searches (see the description of ‘hash’ in *note Bourne Shell Builtins::). A full search of the directories in - '$PATH' is performed only if the command is not found in the hash + ‘$PATH’ is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell searches for a - defined shell function named 'command_not_found_handle'. If that + defined shell function named ‘command_not_found_handle’. If that function exists, it is invoked in a separate execution environment with the original command and the original command's arguments as its arguments, and the function's exit status becomes the exit @@ -2927,7 +2927,7 @@ following actions. 5. If this execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a - "shell script" and the shell executes it as described in *note + “shell script” and the shell executes it as described in *note Shell Scripts::. 6. If the command was not begun asynchronously, the shell waits for @@ -2939,59 +2939,59 @@ File: bash.info, Node: Command Execution Environment, Next: Environment, Prev 3.7.3 Command Execution Environment ----------------------------------- -The shell has an "execution environment", which consists of the +The shell has an “execution environment”, which consists of the following: - * open files inherited by the shell at invocation, as modified by - redirections supplied to the 'exec' builtin + • open files inherited by the shell at invocation, as modified by + redirections supplied to the ‘exec’ builtin - * the current working directory as set by 'cd', 'pushd', or 'popd', + • the current working directory as set by ‘cd’, ‘pushd’, or ‘popd’, or inherited by the shell at invocation - * the file creation mode mask as set by 'umask' or inherited from the + • the file creation mode mask as set by ‘umask’ or inherited from the shell's parent - * current traps set by 'trap' + • current traps set by ‘trap’ - * shell parameters that are set by variable assignment or with 'set' + • shell parameters that are set by variable assignment or with ‘set’ or inherited from the shell's parent in the environment - * shell functions defined during execution or inherited from the + • shell functions defined during execution or inherited from the shell's parent in the environment - * options enabled at invocation (either by default or with - command-line arguments) or by 'set' + • options enabled at invocation (either by default or with + command-line arguments) or by ‘set’ - * options enabled by 'shopt' (*note The Shopt Builtin::) + • options enabled by ‘shopt’ (*note The Shopt Builtin::) - * shell aliases defined with 'alias' (*note Aliases::) + • shell aliases defined with ‘alias’ (*note Aliases::) - * various process IDs, including those of background jobs (*note - Lists::), the value of '$$', and the value of '$PPID' + • various process IDs, including those of background jobs (*note + Lists::), the value of ‘$$’, and the value of ‘$PPID’ When a simple command other than a builtin or shell function is to be executed, it is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell. - * the shell's open files, plus any modifications and additions + • the shell's open files, plus any modifications and additions specified by redirections to the command - * the current working directory + • the current working directory - * the file creation mode mask + • the file creation mode mask - * shell variables and functions marked for export, along with + • shell variables and functions marked for export, along with variables exported for the command, passed in the environment (*note Environment::) - * traps caught by the shell are reset to the values inherited from + • traps caught by the shell are reset to the values inherited from the shell's parent, and traps ignored by the shell are ignored A command invoked in this separate environment cannot affect the shell's execution environment. - A "subshell" is a copy of the shell process. + A “subshell” is a copy of the shell process. Command substitution, commands grouped with parentheses, and asynchronous commands are invoked in a subshell environment that is a @@ -3001,12 +3001,15 @@ at invocation. Builtin commands that are invoked as part of a pipeline are also executed in a subshell environment. Changes made to the subshell environment cannot affect the shell's execution environment. - Subshells spawned to execute command substitutions inherit the value -of the '-e' option from the parent shell. When not in POSIX mode, Bash -clears the '-e' option in such subshells. + When the shell is in POSIX mode, subshells spawned to execute command +substitutions inherit the value of the ‘-e’ option from the parent +shell. When not in POSIX mode, Bash clears the ‘-e’ option in such +subshells See the description of the ‘inherit_errexit’ shell option +(*note Bash Builtins::) for how to control this behavior when not in +POSIX mode. - If a command is followed by a '&' and job control is not active, the -default standard input for the command is the empty file '/dev/null'. + If a command is followed by a ‘&’ and job control is not active, the +default standard input for the command is the empty file ‘/dev/null’. Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections. @@ -3017,20 +3020,20 @@ File: bash.info, Node: Environment, Next: Exit Status, Prev: Command Executio ----------------- When a program is invoked it is given an array of strings called the -"environment". This is a list of name-value pairs, of the form -'name=value'. +“environment”. This is a list of name-value pairs, of the form +‘name=value’. Bash provides several ways to manipulate the environment. On invocation, the shell scans its own environment and creates a parameter -for each name found, automatically marking it for 'export' to child -processes. Executed commands inherit the environment. The 'export' and -'declare -x' commands allow parameters and functions to be added to and +for each name found, automatically marking it for ‘export’ to child +processes. Executed commands inherit the environment. The ‘export’ and +‘declare -x’ commands allow parameters and functions to be added to and deleted from the environment. If the value of a parameter in the environment is modified, the new value becomes part of the environment, replacing the old. The environment inherited by any executed command consists of the shell's initial environment, whose values may be -modified in the shell, less any pairs removed by the 'unset' and 'export --n' commands, plus any additions via the 'export' and 'declare -x' +modified in the shell, less any pairs removed by the ‘unset’ and ‘export +-n’ commands, plus any additions via the ‘export’ and ‘declare -x’ commands. The environment for any simple command or function may be augmented @@ -3038,11 +3041,11 @@ temporarily by prefixing it with parameter assignments, as described in *note Shell Parameters::. These assignment statements affect only the environment seen by that command. - If the '-k' option is set (*note The Set Builtin::), then all + If the ‘-k’ option is set (*note The Set Builtin::), then all parameter assignments are placed in the environment for a command, not just those that precede the command name. - When Bash invokes an external command, the variable '$_' is set to + When Bash invokes an external command, the variable ‘$_’ is set to the full pathname of the command and passed to that command in its environment. @@ -3053,7 +3056,7 @@ File: bash.info, Node: Exit Status, Next: Signals, Prev: Environment, Up: Ex ----------------- The exit status of an executed command is the value returned by the -'waitpid' system call or equivalent function. Exit statuses fall +‘waitpid’ system call or equivalent function. Exit statuses fall between 0 and 255, though, as explained below, the shell may use values above 125 specially. Exit statuses from shell builtins and compound commands are also limited to this range. Under certain circumstances, @@ -3093,63 +3096,63 @@ File: bash.info, Node: Signals, Prev: Exit Status, Up: Executing Commands ------------- When Bash is interactive, in the absence of any traps, it ignores -'SIGTERM' (so that 'kill 0' does not kill an interactive shell), and -'SIGINT' is caught and handled (so that the 'wait' builtin is -interruptible). When Bash receives a 'SIGINT', it breaks out of any -executing loops. In all cases, Bash ignores 'SIGQUIT'. If job control -is in effect (*note Job Control::), Bash ignores 'SIGTTIN', 'SIGTTOU', -and 'SIGTSTP'. +‘SIGTERM’ (so that ‘kill 0’ does not kill an interactive shell), and +‘SIGINT’ is caught and handled (so that the ‘wait’ builtin is +interruptible). When Bash receives a ‘SIGINT’, it breaks out of any +executing loops. In all cases, Bash ignores ‘SIGQUIT’. If job control +is in effect (*note Job Control::), Bash ignores ‘SIGTTIN’, ‘SIGTTOU’, +and ‘SIGTSTP’. Non-builtin commands started by Bash have signal handlers set to the values inherited by the shell from its parent. When job control is not -in effect, asynchronous commands ignore 'SIGINT' and 'SIGQUIT' in +in effect, asynchronous commands ignore ‘SIGINT’ and ‘SIGQUIT’ in addition to these inherited handlers. Commands run as a result of command substitution ignore the keyboard-generated job control signals -'SIGTTIN', 'SIGTTOU', and 'SIGTSTP'. +‘SIGTTIN’, ‘SIGTTOU’, and ‘SIGTSTP’. - The shell exits by default upon receipt of a 'SIGHUP'. Before -exiting, an interactive shell resends the 'SIGHUP' to all jobs, running -or stopped. Stopped jobs are sent 'SIGCONT' to ensure that they receive -the 'SIGHUP'. To prevent the shell from sending the 'SIGHUP' signal to + The shell exits by default upon receipt of a ‘SIGHUP’. Before +exiting, an interactive shell resends the ‘SIGHUP’ to all jobs, running +or stopped. Stopped jobs are sent ‘SIGCONT’ to ensure that they receive +the ‘SIGHUP’. To prevent the shell from sending the ‘SIGHUP’ signal to a particular job, it should be removed from the jobs table with the -'disown' builtin (*note Job Control Builtins::) or marked to not receive -'SIGHUP' using 'disown -h'. +‘disown’ builtin (*note Job Control Builtins::) or marked to not receive +‘SIGHUP’ using ‘disown -h’. - If the 'huponexit' shell option has been set with 'shopt' (*note The -Shopt Builtin::), Bash sends a 'SIGHUP' to all jobs when an interactive + If the ‘huponexit’ shell option has been set with ‘shopt’ (*note The +Shopt Builtin::), Bash sends a ‘SIGHUP’ to all jobs when an interactive login shell exits. If Bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes. When Bash is waiting for an asynchronous command via -the 'wait' builtin, the reception of a signal for which a trap has been -set will cause the 'wait' builtin to return immediately with an exit +the ‘wait’ builtin, the reception of a signal for which a trap has been +set will cause the ‘wait’ builtin to return immediately with an exit status greater than 128, immediately after which the trap is executed. When job control is not enabled, and Bash is waiting for a foreground command to complete, the shell receives keyboard-generated signals such -as 'SIGINT' (usually generated by '^C') that users commonly intend to +as ‘SIGINT’ (usually generated by ‘^C’) that users commonly intend to send to that command. This happens because the shell and the command -are in the same process group as the terminal, and '^C' sends 'SIGINT' +are in the same process group as the terminal, and ‘^C’ sends ‘SIGINT’ to all processes in that process group. See *note Job Control::, for a more in-depth discussion of process groups. When Bash is running without job control enabled and receives -'SIGINT' while waiting for a foreground command, it waits until that +‘SIGINT’ while waiting for a foreground command, it waits until that foreground command terminates and then decides what to do about the -'SIGINT': +‘SIGINT’: - 1. If the command terminates due to the 'SIGINT', Bash concludes that - the user meant to end the entire script, and acts on the 'SIGINT' - (e.g., by running a 'SIGINT' trap or exiting itself); + 1. If the command terminates due to the ‘SIGINT’, Bash concludes that + the user meant to end the entire script, and acts on the ‘SIGINT’ + (e.g., by running a ‘SIGINT’ trap or exiting itself); - 2. If the pipeline does not terminate due to 'SIGINT', the program - handled the 'SIGINT' itself and did not treat it as a fatal signal. - In that case, Bash does not treat 'SIGINT' as a fatal signal, - either, instead assuming that the 'SIGINT' was used as part of the - program's normal operation (e.g., 'emacs' uses it to abort editing + 2. If the pipeline does not terminate due to ‘SIGINT’, the program + handled the ‘SIGINT’ itself and did not treat it as a fatal signal. + In that case, Bash does not treat ‘SIGINT’ as a fatal signal, + either, instead assuming that the ‘SIGINT’ was used as part of the + program's normal operation (e.g., ‘emacs’ uses it to abort editing commands) or deliberately discarded. However, Bash will run any - trap set on 'SIGINT', as it does with any other trapped signal it + trap set on ‘SIGINT’, as it does with any other trapped signal it receives while it is waiting for the foreground command to complete, for compatibility. @@ -3161,38 +3164,38 @@ File: bash.info, Node: Shell Scripts, Prev: Executing Commands, Up: Basic She A shell script is a text file containing shell commands. When such a file is used as the first non-option argument when invoking Bash, and -neither the '-c' nor '-s' option is supplied (*note Invoking Bash::), +neither the ‘-c’ nor ‘-s’ option is supplied (*note Invoking Bash::), Bash reads and executes commands from the file, then exits. This mode of operation creates a non-interactive shell. The shell first searches for the file in the current directory, and looks in the directories in -'$PATH' if not found there. +‘$PATH’ if not found there. - When Bash runs a shell script, it sets the special parameter '0' to + When Bash runs a shell script, it sets the special parameter ‘0’ to the name of the file, rather than the name of the shell, and the positional parameters are set to the remaining arguments, if any are given. If no additional arguments are supplied, the positional parameters are unset. - A shell script may be made executable by using the 'chmod' command to + A shell script may be made executable by using the ‘chmod’ command to turn on the execute bit. When Bash finds such a file while searching -the '$PATH' for a command, it creates a new instance of itself to +the ‘$PATH’ for a command, it creates a new instance of itself to execute it. In other words, executing filename ARGUMENTS is equivalent to executing bash filename ARGUMENTS -if 'filename' is an executable shell script. This subshell +if ‘filename’ is an executable shell script. This subshell reinitializes itself, so that the effect is as if a new shell had been invoked to interpret the script, with the exception that the locations -of commands remembered by the parent (see the description of 'hash' in +of commands remembered by the parent (see the description of ‘hash’ in *note Bourne Shell Builtins::) are retained by the child. Most versions of Unix make this a part of the operating system's command execution mechanism. If the first line of a script begins with -the two characters '#!', the remainder of the line specifies an +the two characters ‘#!’, the remainder of the line specifies an interpreter for the program and, depending on the operating system, one or more optional arguments for that interpreter. Thus, you can specify -Bash, 'awk', Perl, or some other interpreter and write the rest of the +Bash, ‘awk’, Perl, or some other interpreter and write the rest of the script file in that language. The arguments to the interpreter consist of one or more optional @@ -3206,12 +3209,12 @@ older versions of Unix limit the interpreter name and a single argument to a maximum of 32 characters, so it's not portable to assume that using more than one argument will work. - Bash scripts often begin with '#! /bin/bash' (assuming that Bash has -been installed in '/bin'), since this ensures that Bash will be used to + Bash scripts often begin with ‘#! /bin/bash’ (assuming that Bash has +been installed in ‘/bin’), since this ensures that Bash will be used to interpret the script, even if it is executed under another shell. It's -a common idiom to use 'env' to find 'bash' even if it's been installed -in another directory: '#!/usr/bin/env bash' will find the first -occurrence of 'bash' in '$PATH'. +a common idiom to use ‘env’ to find ‘bash’ even if it's been installed +in another directory: ‘#!/usr/bin/env bash’ will find the first +occurrence of ‘bash’ in ‘$PATH’.  File: bash.info, Node: Shell Builtin Commands, Next: Shell Variables, Prev: Basic Shell Features, Up: Top @@ -3250,14 +3253,14 @@ Completion Builtins::). Many of the builtins have been extended by POSIX or Bash. Unless otherwise noted, each builtin command documented as accepting -options preceded by '-' accepts '--' to signify the end of the options. -The ':', 'true', 'false', and 'test'/'[' builtins do not accept options -and do not treat '--' specially. The 'exit', 'logout', 'return', -'break', 'continue', 'let', and 'shift' builtins accept and process -arguments beginning with '-' without requiring '--'. Other builtins +options preceded by ‘-’ accepts ‘--’ to signify the end of the options. +The ‘:’, ‘true’, ‘false’, and ‘test’/‘[’ builtins do not accept options +and do not treat ‘--’ specially. The ‘exit’, ‘logout’, ‘return’, +‘break’, ‘continue’, ‘let’, and ‘shift’ 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 interpretation. +interpret arguments beginning with ‘-’ as invalid options and require +‘--’ to prevent this interpretation.  File: bash.info, Node: Bourne Shell Builtins, Next: Bash Builtins, Up: Shell Builtin Commands @@ -3269,312 +3272,312 @@ The following shell builtin commands are inherited from the Bourne Shell. These commands are implemented as specified by the POSIX standard. -': (a colon)' +‘: (a colon)’ : [ARGUMENTS] Do nothing beyond expanding ARGUMENTS and performing redirections. The return status is zero. -'. (a period)' +‘. (a period)’ . FILENAME [ARGUMENTS] Read and execute commands from the FILENAME argument in the current - shell context. If FILENAME does not contain a slash, the 'PATH' + shell context. If FILENAME does not contain a slash, the ‘PATH’ variable is used to find FILENAME, but FILENAME does not need to be executable. When Bash is not in POSIX mode, it searches the - current directory if FILENAME is not found in '$PATH'. If any + current directory if FILENAME is not found in ‘$PATH’. If any ARGUMENTS are supplied, they become the positional parameters when FILENAME is executed. Otherwise the positional parameters are - unchanged. If the '-T' option is enabled, '.' inherits any trap on - 'DEBUG'; if it is not, any 'DEBUG' trap string is saved and - restored around the call to '.', and '.' unsets the 'DEBUG' trap - while it executes. If '-T' is not set, and the sourced file - changes the 'DEBUG' trap, the new value is retained when '.' + unchanged. If the ‘-T’ option is enabled, ‘.’ inherits any trap on + ‘DEBUG’; if it is not, any ‘DEBUG’ trap string is saved and + restored around the call to ‘.’, and ‘.’ unsets the ‘DEBUG’ trap + while it executes. If ‘-T’ is not set, and the sourced file + changes the ‘DEBUG’ trap, the new value is retained when ‘.’ completes. The return status is the exit status of the last command executed, or zero if no commands are executed. If FILENAME is not found, or cannot be read, the return status is non-zero. - This builtin is equivalent to 'source'. + This builtin is equivalent to ‘source’. -'break' +‘break’ break [N] - Exit from a 'for', 'while', 'until', or 'select' loop. If N is + Exit from a ‘for’, ‘while’, ‘until’, or ‘select’ loop. If N is supplied, the Nth enclosing loop is exited. N must be greater than or equal to 1. The return status is zero unless N is not greater than or equal to 1. -'cd' +‘cd’ cd [-L|[-P [-e]]] [-@] [DIRECTORY] Change the current working directory to DIRECTORY. If DIRECTORY is - not supplied, the value of the 'HOME' shell variable is used. If - the shell variable 'CDPATH' exists, it is used as a search path: - each directory name in 'CDPATH' is searched for DIRECTORY, with - alternative directory names in 'CDPATH' separated by a colon (':'). - If DIRECTORY begins with a slash, 'CDPATH' is not used. - - The '-P' option means to not follow symbolic links: symbolic links - are resolved while 'cd' is traversing DIRECTORY and before - processing an instance of '..' in DIRECTORY. - - By default, or when the '-L' option is supplied, symbolic links in - DIRECTORY are resolved after 'cd' processes an instance of '..' in + not supplied, the value of the ‘HOME’ shell variable is used. If + the shell variable ‘CDPATH’ exists, ‘cd’ uses it as a search path: + ‘cd’ searches each directory name in ‘CDPATH’ for DIRECTORY, with + alternative directory names in ‘CDPATH’ separated by a colon (‘:’). + If DIRECTORY begins with a slash, ‘CDPATH’ is not used. + + The ‘-P’ option means to not follow symbolic links: symbolic links + are resolved while ‘cd’ is traversing DIRECTORY and before + processing an instance of ‘..’ in DIRECTORY. + + By default, or when the ‘-L’ option is supplied, symbolic links in + DIRECTORY are resolved after ‘cd’ processes an instance of ‘..’ in DIRECTORY. - If '..' appears in DIRECTORY, it is processed by removing the + If ‘..’ appears in DIRECTORY, it is processed by removing the immediately preceding pathname component, back to a slash or the beginning of DIRECTORY. - If the '-e' option is supplied with '-P' and the current working + If the ‘-e’ option is supplied with ‘-P’ and the current working directory cannot be successfully determined after a successful - directory change, 'cd' will return an unsuccessful status. + directory change, ‘cd’ will return an unsuccessful 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. - If DIRECTORY is '-', it is converted to '$OLDPWD' before the + If DIRECTORY is ‘-’, it is converted to ‘$OLDPWD’ before the directory change is attempted. - If a non-empty directory name from 'CDPATH' is used, or if '-' is + If a non-empty directory name from ‘CDPATH’ is used, or if ‘-’ is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. - If the directory change is successful, 'cd' sets the value of the - 'PWD' environment variable to the new directory name, and sets the - 'OLDPWD' environment variable to the value of the current working + If the directory change is successful, ‘cd’ sets the value of the + ‘PWD’ environment variable to the new directory name, and sets the + ‘OLDPWD’ environment variable to the value of the current working directory before the change. The return status is zero if the directory is successfully changed, non-zero otherwise. -'continue' +‘continue’ continue [N] - Resume the next iteration of an enclosing 'for', 'while', 'until', - or 'select' loop. If N is supplied, the execution of the Nth + Resume the next iteration of an enclosing ‘for’, ‘while’, ‘until’, + or ‘select’ loop. If N is supplied, the execution of the Nth enclosing loop is resumed. N must be greater than or equal to 1. The return status is zero unless N is not greater than or equal to 1. -'eval' +‘eval’ eval [ARGUMENTS] The arguments are concatenated together into a single command, which is then read and executed, and its exit status returned as - the exit status of 'eval'. If there are no arguments or only empty + the exit status of ‘eval’. If there are no arguments or only empty arguments, the return status is zero. -'exec' +‘exec’ exec [-cl] [-a NAME] [COMMAND [ARGUMENTS]] If COMMAND is supplied, it replaces the shell without creating a - new process. If the '-l' option is supplied, the shell places a + new process. If the ‘-l’ option is supplied, the shell places a dash at the beginning of the zeroth argument passed to COMMAND. - This is what the 'login' program does. The '-c' option causes - COMMAND to be executed with an empty environment. If '-a' is + This is what the ‘login’ program does. The ‘-c’ option causes + COMMAND to be executed with an empty environment. If ‘-a’ is supplied, the shell passes NAME as the zeroth argument to COMMAND. If COMMAND cannot be executed for some reason, a non-interactive - shell exits, unless the 'execfail' shell option is enabled. In + shell exits, unless the ‘execfail’ shell option is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed. A subshell exits - unconditionally if 'exec' fails. If no COMMAND is specified, + unconditionally if ‘exec’ fails. If no COMMAND is specified, redirections may be used to affect the current shell environment. If there are no redirection errors, the return status is zero; otherwise the return status is non-zero. -'exit' +‘exit’ exit [N] Exit the shell, returning a status of N to the shell's parent. If N is omitted, the exit status is that of the last command executed. - Any trap on 'EXIT' is executed before the shell terminates. + Any trap on ‘EXIT’ is executed before the shell terminates. -'export' +‘export’ export [-fn] [-p] [NAME[=VALUE]] Mark each NAME to be passed to child processes in the environment. - If the '-f' option is supplied, the NAMEs refer to shell functions; - otherwise the names refer to shell variables. The '-n' option + If the ‘-f’ option is supplied, the NAMEs refer to shell functions; + otherwise the names refer to shell variables. The ‘-n’ option means to no longer mark each NAME for export. If no NAMEs are - supplied, or if the '-p' option is given, a list of names of all - exported variables is displayed. The '-p' option displays output + supplied, or if the ‘-p’ option is given, a list of names of all + exported variables is displayed. The ‘-p’ option displays output in a form that may be reused as input. If a variable name is followed by =VALUE, the value of the variable is set to VALUE. The return status is zero unless an invalid option is supplied, one - of the names is not a valid shell variable name, or '-f' is + of the names is not a valid shell variable name, or ‘-f’ is supplied with a name that is not a shell function. -'false' +‘false’ false Does nothing, returns a non-zero status. -'getopts' +‘getopts’ getopts OPTSTRING NAME [ARG ...] - 'getopts' is used by shell scripts to parse positional parameters. + ‘getopts’ is used by shell scripts to parse positional parameters. OPTSTRING 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 whitespace. The - colon (':') and question mark ('?') may not be used as option - characters. Each time it is invoked, 'getopts' places the next + colon (‘:’) and question mark (‘?’) may not be used as option + characters. Each time it is invoked, ‘getopts’ places the next option in the shell variable NAME, initializing NAME if it does not exist, and the index of the next argument to be processed into the - variable 'OPTIND'. 'OPTIND' is initialized to 1 each time the + variable ‘OPTIND’. ‘OPTIND’ is initialized to 1 each time the shell or a shell script is invoked. When an option requires an - argument, 'getopts' places that argument into the variable - 'OPTARG'. The shell does not reset 'OPTIND' automatically; it must - be manually reset between multiple calls to 'getopts' within the + argument, ‘getopts’ places that argument into the variable + ‘OPTARG’. The shell does not reset ‘OPTIND’ automatically; it must + be manually reset between multiple calls to ‘getopts’ within the same shell invocation if a new set of parameters is to be used. - When the end of options is encountered, 'getopts' exits with a - return value greater than zero. 'OPTIND' is set to the index of - the first non-option argument, and NAME is set to '?'. + When the end of options is encountered, ‘getopts’ exits with a + return value greater than zero. ‘OPTIND’ is set to the index of + the first non-option argument, and NAME is set to ‘?’. - 'getopts' normally parses the positional parameters, but if more - arguments are supplied as ARG values, 'getopts' parses those + ‘getopts’ normally parses the positional parameters, but if more + arguments are supplied as ARG values, ‘getopts’ parses those instead. - 'getopts' can report errors in two ways. If the first character of + ‘getopts’ can report errors in two ways. If the first character of OPTSTRING is a colon, SILENT error reporting is used. In normal operation, diagnostic messages are printed when invalid options or - missing option arguments are encountered. If the variable 'OPTERR' + missing option arguments are encountered. If the variable ‘OPTERR’ is set to 0, no error messages will be displayed, even if the first - character of 'optstring' is not a colon. + character of ‘optstring’ is not a colon. - If an invalid option is seen, 'getopts' places '?' into NAME and, - if not silent, prints an error message and unsets 'OPTARG'. If - 'getopts' is silent, the option character found is placed in - 'OPTARG' and no diagnostic message is printed. + If ‘getopts’ detects an invalid option, it places ‘?’ into NAME + and, if not silent, prints an error message and unsets ‘OPTARG’. + If ‘getopts’ is silent, it assigns the option character found to + ‘OPTARG’ and does not print a diagnostic message. - If a required argument is not found, and 'getopts' is not silent, a - question mark ('?') is placed in NAME, 'OPTARG' is unset, and a - diagnostic message is printed. If 'getopts' is silent, then a - colon (':') is placed in NAME and 'OPTARG' is set to the option - character found. + If a required argument is not found, and ‘getopts’ is not silent, + it sets the value of NAME to a question mark (‘?’), unsets + ‘OPTARG’, and prints a diagnostic message. If ‘getopts’ is silent, + it sets the value of NAME to a colon (‘:’), and sets ‘OPTARG’ to + the option character found. -'hash' +‘hash’ hash [-r] [-p FILENAME] [-dt] [NAME] - Each time 'hash' is invoked, it remembers the full filenames of the + Each time ‘hash’ is invoked, it remembers the full filenames of the commands specified as NAME arguments, so they need not be searched for on subsequent invocations. The commands are found by searching - through the directories listed in '$PATH'. Any - previously-remembered filename is discarded. The '-p' option + through the directories listed in ‘$PATH’. Any + previously-remembered filename is discarded. The ‘-p’ option inhibits the path search, and FILENAME is used as the location of - NAME. The '-r' option causes the shell to forget all remembered - locations. Assigning to the 'PATH' variable also clears all hashed - filenames. The '-d' option causes the shell to forget the - remembered location of each NAME. If the '-t' option is supplied, + NAME. The ‘-r’ option causes the shell to forget all remembered + locations. Assigning to the ‘PATH’ variable also clears all hashed + filenames. The ‘-d’ option causes the shell to forget the + remembered location of each NAME. If the ‘-t’ option is supplied, the full pathname to which each NAME corresponds is printed. If - multiple NAME arguments are supplied with '-t', the NAME is printed - before the hashed full pathname. The '-l' option causes output to + multiple NAME arguments are supplied with ‘-t’, the NAME is printed + before the hashed full pathname. The ‘-l’ option causes output to be displayed in a format that may be reused as input. If no - arguments are given, or if only '-l' is supplied, information about - remembered commands is printed. The '-t', '-d', and '-p' options + arguments are given, or if only ‘-l’ is supplied, information about + remembered commands is printed. The ‘-t’, ‘-d’, and ‘-p’ options (the options that act on the NAME arguments) are mutually exclusive. Only one will be active. If more than one is supplied, - '-t' has higher priority than '-p', and both are higher priority - than '-d'. The return status is zero unless a NAME is not found or + ‘-t’ has higher priority than ‘-p’, and both are higher priority + than ‘-d’. The return status is zero unless a NAME is not found or an invalid option is supplied. -'pwd' +‘pwd’ pwd [-LP] Print the absolute pathname of the current working directory. If - the '-P' option is supplied, the pathname printed will not contain - symbolic links. If the '-L' option is supplied, the pathname + the ‘-P’ option is supplied, the pathname printed will not contain + symbolic links. If the ‘-L’ option is supplied, the pathname printed may contain symbolic links. The return status is zero unless an error is encountered while determining the name of the current directory or an invalid option is supplied. -'readonly' +‘readonly’ readonly [-aAf] [-p] [NAME[=VALUE]] ... Mark each NAME as readonly. The values of these names may not be - changed by subsequent assignment. If the '-f' option is supplied, - each NAME refers to a shell function. The '-a' option means each - NAME refers to an indexed array variable; the '-A' option means + changed by subsequent assignment. If the ‘-f’ option is supplied, + each NAME refers to a shell function. The ‘-a’ option means each + NAME refers to an indexed array variable; the ‘-A’ option means each NAME refers to an associative array variable. If both options - are supplied, '-A' takes precedence. If no NAME arguments are - given, or if the '-p' option is supplied, a list of all readonly + are supplied, ‘-A’ takes precedence. If no NAME arguments are + given, or if the ‘-p’ option is supplied, a list of all readonly names is printed. The other options may be used to restrict the - output to a subset of the set of readonly names. The '-p' option + output to a subset of the set of readonly names. The ‘-p’ option causes output to be displayed in a format that may be reused as input. If a variable name is followed by =VALUE, the value of the variable is set to VALUE. The return status is zero unless an invalid option is supplied, one of the NAME arguments is not a - valid shell variable or function name, or the '-f' option is + valid shell variable or function name, or the ‘-f’ option is supplied with a name that is not a shell function. -'return' +‘return’ return [N] Cause a shell function to stop executing and return the value N to its caller. If N is not supplied, the return value is the exit - status of the last command executed in the function. If 'return' + status of the last command executed in the function. If ‘return’ is executed by a trap handler, the last command used to determine the status is the last command executed before the trap handler. - If 'return' is executed during a 'DEBUG' trap, the last command + If ‘return’ is executed during a ‘DEBUG’ trap, the last command used to determine the status is the last command executed by the - trap handler before 'return' was invoked. 'return' may also be - used to terminate execution of a script being executed with the '.' - ('source') builtin, returning either N or the exit status of the + trap handler before ‘return’ was invoked. ‘return’ may also be + used to terminate execution of a script being executed with the ‘.’ + (‘source’) builtin, returning either N or the exit status of the last command executed within the script as the exit status of the script. If N is supplied, the return value is its least - significant 8 bits. Any command associated with the 'RETURN' trap + significant 8 bits. Any command associated with the ‘RETURN’ trap is executed before execution resumes after the function or script. - The return status is non-zero if 'return' is supplied a non-numeric + The return status is non-zero if ‘return’ is supplied a non-numeric argument or is used outside a function and not during the execution - of a script by '.' or 'source'. + of a script by ‘.’ or ‘source’. -'shift' +‘shift’ shift [N] Shift the positional parameters to the left by N. The positional - parameters from N+1 ... '$#' are renamed to '$1' ... '$#'-N. - Parameters represented by the numbers '$#' down to '$#'-N+1 are - unset. N must be a non-negative number less than or equal to '$#'. - If N is zero or greater than '$#', the positional parameters are + parameters from N+1 ... ‘$#’ are renamed to ‘$1’ ... ‘$#’-N. + Parameters represented by the numbers ‘$#’ down to ‘$#’-N+1 are + unset. N must be a non-negative number less than or equal to ‘$#’. + If N is zero or greater than ‘$#’, the positional parameters are not changed. If N is not supplied, it is assumed to be 1. The - return status is zero unless N is greater than '$#' or less than + return status is zero unless N is greater than ‘$#’ or less than zero, non-zero otherwise. -'test' -'[' +‘test’ +‘[’ test EXPR Evaluate a conditional expression EXPR and return a status of 0 (true) or 1 (false). Each operator and operand must be a separate argument. Expressions are composed of the primaries described - below in *note Bash Conditional Expressions::. 'test' does not + below in *note Bash Conditional Expressions::. ‘test’ does not accept any options, nor does it accept and ignore an argument of - '--' as signifying the end of options. + ‘--’ as signifying the end of options. - When the '[' form is used, the last argument to the command must be - a ']'. + When the ‘[’ form is used, the last argument to the command must be + a ‘]’. Expressions may be combined using the following operators, listed in decreasing order of precedence. The evaluation depends on the number of arguments; see below. Operator precedence is used when there are five or more arguments. - '! EXPR' + ‘! EXPR’ True if EXPR is false. - '( EXPR )' + ‘( EXPR )’ Returns the value of EXPR. This may be used to override the normal precedence of operators. - 'EXPR1 -a EXPR2' + ‘EXPR1 -a EXPR2’ True if both EXPR1 and EXPR2 are true. - 'EXPR1 -o EXPR2' + ‘EXPR1 -o EXPR2’ True if either EXPR1 or EXPR2 is true. - The 'test' and '[' builtins evaluate conditional expressions using + The ‘test’ and ‘[’ builtins evaluate conditional expressions using a set of rules based on the number of arguments. 0 arguments @@ -3585,7 +3588,7 @@ standard. null. 2 arguments - If the first argument is '!', the expression is true if and + If the first argument is ‘!’, the expression is true if and only if the second argument is null. If the first argument is one of the unary conditional operators (*note Bash Conditional Expressions::), the expression is true if the unary test is @@ -3599,24 +3602,24 @@ standard. operators (*note Bash Conditional Expressions::), the result of the expression is the result of the binary test using the first and third arguments as operands. The - '-a' and '-o' operators are considered binary operators + ‘-a’ and ‘-o’ operators are considered binary operators when there are three arguments. - 2. If the first argument is '!', the value is the negation + 2. If the first argument is ‘!’, the value is the negation of the two-argument test using the second and third arguments. - 3. If the first argument is exactly '(' and the third - argument is exactly ')', the result is the one-argument + 3. If the first argument is exactly ‘(’ and the third + argument is exactly ‘)’, the result is the one-argument test of the second argument. 4. Otherwise, the expression is false. 4 arguments The following conditions are applied in the order listed. - 1. If the first argument is '!', the result is the negation + 1. If the first argument is ‘!’, the result is the negation of the three-argument expression composed of the remaining arguments. - 2. If the first argument is exactly '(' and the fourth - argument is exactly ')', the result is the two-argument + 2. If the first argument is exactly ‘(’ and the fourth + argument is exactly ‘)’, the result is the two-argument test of the second and third arguments. 3. Otherwise, the expression is parsed and evaluated according to precedence using the rules listed above. @@ -3625,18 +3628,18 @@ standard. The expression is parsed and evaluated according to precedence using the rules listed above. - If the shell is not in POSIX mode, when used with 'test' or '[', - the '<' and '>' operators sort lexicographically using ASCII - ordering. If the shell is in POSIX mode, these operators use the - current locale. + If the shell is in POSIX mode, or if the expression is part of the + ‘[[’ command, the ‘<’ and ‘>’ operators sort using the current + locale. If the shell is not in POSIX mode, the ‘test’ and ‘[’ + 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 standard has deprecated the '-a' and '-o' + primaries. The POSIX standard has deprecated the ‘-a’ and ‘-o’ 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 '-a' - and '-o' with the shell's '&&' and '||' list operators. For + test invocations to a single primary, and to replace uses of ‘-a’ + and ‘-o’ with the shell's ‘&&’ and ‘||’ list operators. For example, use test -n string1 && test -n string2 @@ -3645,64 +3648,64 @@ standard. test -n string1 -a -n string2 -'times' +‘times’ times Print out the user and system times used by the shell and its children. The return status is zero. -'trap' +‘trap’ trap [-Plp] [ACTION] [SIGSPEC ...] The ACTION is a command that is read and executed when the shell receives signal SIGSPEC. If ACTION is absent (and there is a - single SIGSPEC) or equal to '-', each specified signal's + single SIGSPEC) or equal to ‘-’, each specified signal'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. - If no arguments are supplied, 'trap' prints the actions associated - with each trapped signal as a set of 'trap' commands that can be + If no arguments are supplied, ‘trap’ prints the actions associated + with each trapped signal as a set of ‘trap’ commands that can be reused as shell input to restore the current signal dispositions. - If ACTION is not present and '-p' has been supplied, 'trap' + If ACTION is not present and ‘-p’ has been supplied, ‘trap’ displays the trap commands associated with each SIGSPEC, or, if no - SIGSPECs are supplied, for all trapped signals, as a set of 'trap' + SIGSPECs are supplied, for all trapped signals, as a set of ‘trap’ commands that can be reused as shell input to restore the current - signal dispositions. The '-P' option behaves similarly, but + signal dispositions. The ‘-P’ option behaves similarly, but displays only the actions associated with each SIGSPEC argument. - '-P' requires at least one SIGSPEC argument. The '-P' or '-p' - options to 'trap' may be used in a subshell environment (e.g., - command substitution) and, as long as they are used before 'trap' + ‘-P’ requires at least one SIGSPEC argument. The ‘-P’ or ‘-p’ + options to ‘trap’ may be used in a subshell environment (e.g., + command substitution) and, as long as they are used before ‘trap’ is used to change a signal's handling, will display the state of its parent's traps. - The '-l' option causes 'trap' to print a list of signal names and + The ‘-l’ option causes ‘trap’ to print a list of signal names and their corresponding numbers. Each SIGSPEC is either a signal name or a signal number. Signal names are case insensitive and the - 'SIG' prefix is optional. + ‘SIG’ prefix is optional. - If a SIGSPEC is '0' or 'EXIT', ACTION is executed when the shell - exits. If a SIGSPEC is 'DEBUG', ACTION is executed before every - simple command, 'for' command, 'case' command, 'select' command, (( - arithmetic command, [[ conditional command, arithmetic 'for' + If a SIGSPEC is ‘0’ or ‘EXIT’, ACTION is executed when the shell + exits. If a SIGSPEC is ‘DEBUG’, ACTION is executed before every + simple command, ‘for’ command, ‘case’ command, ‘select’ command, (( + arithmetic command, [[ conditional command, arithmetic ‘for’ command, and before the first command executes in a shell function. - Refer to the description of the 'extdebug' option to the 'shopt' + Refer to the description of the ‘extdebug’ option to the ‘shopt’ builtin (*note The Shopt Builtin::) for details of its effect on - the 'DEBUG' trap. If a SIGSPEC is 'RETURN', ACTION is executed - each time a shell function or a script executed with the '.' or - 'source' builtins finishes executing. + the ‘DEBUG’ trap. If a SIGSPEC is ‘RETURN’, ACTION is executed + each time a shell function or a script executed with the ‘.’ or + ‘source’ builtins finishes executing. - If a SIGSPEC is 'ERR', ACTION is executed whenever a pipeline + If a SIGSPEC is ‘ERR’, ACTION 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 'ERR' trap is not executed if the failed + following conditions. The ‘ERR’ trap is not executed if the failed command is part of the command list immediately following an - 'until' or 'while' keyword, part of the test following the 'if' or - 'elif' reserved words, part of a command executed in a '&&' or '||' - list except the command following the final '&&' or '||', any + ‘until’ or ‘while’ keyword, part of the test following the ‘if’ or + ‘elif’ reserved words, part of a command executed in a ‘&&’ or ‘||’ + list except the command following the final ‘&&’ or ‘||’, any command in a pipeline but the last, or if the command's return - status is being inverted using '!'. These are the same conditions - obeyed by the 'errexit' ('-e') option. + status is being inverted using ‘!’. These are the same conditions + obeyed by the ‘errexit’ (‘-e’) option. Signals ignored upon entry to a non-interactive shell cannot be trapped or reset. Interactive shells permit trapping signals @@ -3713,39 +3716,39 @@ standard. The return status is zero unless a SIGSPEC does not specify a valid signal. -'true' +‘true’ true Does nothing, returns a 0 status. -'umask' +‘umask’ umask [-p] [-S] [MODE] Set the shell process's file creation mask to MODE. If MODE begins with a digit, it is interpreted as an octal number; if not, it is interpreted as a symbolic mode mask similar to that accepted by the - 'chmod' command. If MODE is omitted, the current value of the mask - is printed. If the '-S' option is supplied without a MODE - argument, the mask is printed in a symbolic format. If the '-p' + ‘chmod’ command. If MODE is omitted, the current value of the mask + is printed. If the ‘-S’ option is supplied without a MODE + argument, the mask is printed in a symbolic format. If the ‘-p’ option is supplied, and MODE is omitted, the output is in a form that may be reused as input. The return status is zero if the mode is successfully changed or if no MODE argument is supplied, and non-zero otherwise. Note that when the mode is interpreted as an octal number, each - number of the umask is subtracted from '7'. Thus, a umask of '022' - results in permissions of '755'. + number of the umask is subtracted from ‘7’. Thus, a umask of ‘022’ + results in permissions of ‘755’. -'unset' +‘unset’ unset [-fnv] [NAME] - Remove each variable or function NAME. If the '-v' option is + Remove each variable or function NAME. If the ‘-v’ option is given, each NAME refers to a shell variable and that variable is - removed. If the '-f' option is given, the NAMEs refer to shell - functions, and the function definition is removed. If the '-n' - option is supplied, and NAME is a variable with the 'nameref' + removed. If the ‘-f’ option is given, the NAMEs refer to shell + functions, and the function definition is removed. If the ‘-n’ + option is supplied, and NAME is a variable with the ‘nameref’ attribute, NAME will be unset rather than the variable it - references. '-n' has no effect if the '-f' option is supplied. If + references. ‘-n’ has no effect if the ‘-f’ option is supplied. If no options are supplied, each NAME refers to a variable; if there is no variable by that name, a function with that name, if any, is unset. Readonly variables and functions may not be unset. Some @@ -3764,17 +3767,17 @@ This section describes builtin commands which are unique to or have been extended in Bash. Some of these commands are specified in the POSIX standard. -'alias' +‘alias’ alias [-p] [NAME[=VALUE] ...] - Without arguments or with the '-p' option, 'alias' prints the list + Without arguments or with the ‘-p’ option, ‘alias’ prints the list of aliases on the standard output in a form that allows them to be reused as input. If arguments are supplied, an alias is defined for each NAME whose VALUE is given. If no VALUE is given, the name and value of the alias is printed. Aliases are described in *note Aliases::. -'bind' +‘bind’ bind [-m KEYMAP] [-lpsvPSVX] bind [-m KEYMAP] [-q FUNCTION] [-u FUNCTION] [-r KEYSEQ] bind [-m KEYMAP] -f FILENAME @@ -3788,60 +3791,60 @@ standard. macro, or set a Readline variable. Each non-option argument is a command as it would appear in a Readline initialization file (*note Readline Init File::), but each binding or command must be passed - as a separate argument; e.g., '"\C-x\C-r":re-read-init-file'. + as a separate argument; e.g., ‘"\C-x\C-r":re-read-init-file’. Options, if supplied, have the following meanings: - '-m KEYMAP' + ‘-m KEYMAP’ Use KEYMAP as the keymap to be affected by the subsequent - bindings. Acceptable KEYMAP names are 'emacs', - 'emacs-standard', 'emacs-meta', 'emacs-ctlx', 'vi', 'vi-move', - 'vi-command', and 'vi-insert'. 'vi' is equivalent to - 'vi-command' ('vi-move' is also a synonym); 'emacs' is - equivalent to 'emacs-standard'. + bindings. Acceptable KEYMAP names are ‘emacs’, + ‘emacs-standard’, ‘emacs-meta’, ‘emacs-ctlx’, ‘vi’, ‘vi-move’, + ‘vi-command’, and ‘vi-insert’. ‘vi’ is equivalent to + ‘vi-command’ (‘vi-move’ is also a synonym); ‘emacs’ is + equivalent to ‘emacs-standard’. - '-l' + ‘-l’ List the names of all Readline functions. - '-p' + ‘-p’ Display Readline function names and bindings in such a way - that they can be used as an argument to a subsequent 'bind' + that they can be used as an argument to a subsequent ‘bind’ command or in a Readline initialization file. - '-P' + ‘-P’ List current Readline function names and bindings. - '-v' + ‘-v’ Display Readline variable names and values in such a way that - they can be used as an argument to a subsequent 'bind' command + they can be used as an argument to a subsequent ‘bind’ command or in a Readline initialization file. - '-V' + ‘-V’ List current Readline variable names and values. - '-s' + ‘-s’ Display Readline 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 'bind' command or in a Readline initialization + to a subsequent ‘bind’ command or in a Readline initialization file. - '-S' + ‘-S’ Display Readline key sequences bound to macros and the strings they output. - '-f FILENAME' + ‘-f FILENAME’ Read key bindings from FILENAME. - '-q FUNCTION' + ‘-q FUNCTION’ Query about which keys invoke the named FUNCTION. - '-u FUNCTION' + ‘-u FUNCTION’ Unbind all keys bound to the named FUNCTION. - '-r KEYSEQ' + ‘-r KEYSEQ’ Remove any current binding for KEYSEQ. - '-x KEYSEQ:SHELL-COMMAND' + ‘-x KEYSEQ:SHELL-COMMAND’ Cause SHELL-COMMAND to be executed whenever KEYSEQ is entered. The separator between KEYSEQ and SHELL-COMMAND is either whitespace or a colon optionally followed by whitespace. If @@ -3853,26 +3856,26 @@ standard. before saving it. Since the entire key binding expression must be a single argument, it should be enclosed in 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 + ‘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 insertion point (the MARK), respectively. The shell assigns any numeric argument the user supplied to the - 'READLINE_ARGUMENT' variable. If there was no argument, that + ‘READLINE_ARGUMENT’ variable. If there was no argument, that variable is not set. If the executed command changes the - value of any of 'READLINE_LINE', 'READLINE_POINT', or - 'READLINE_MARK', those new values will be reflected in the + value of any of ‘READLINE_LINE’, ‘READLINE_POINT’, or + ‘READLINE_MARK’, those new values will be reflected in the editing state. - '-X' + ‘-X’ 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 'bind' command. + argument to a subsequent ‘bind’ command. The return status is zero unless an invalid option is supplied or an error occurs. -'builtin' +‘builtin’ builtin [SHELL-BUILTIN [ARGS]] Run a shell builtin, passing it ARGS, and return its exit status. @@ -3881,15 +3884,15 @@ standard. the function. The return status is non-zero if SHELL-BUILTIN is not a shell builtin command. -'caller' +‘caller’ caller [EXPR] Returns the context of any active subroutine call (a shell function - or a script executed with the '.' or 'source' builtins). + or a script executed with the ‘.’ or ‘source’ builtins). - Without EXPR, 'caller' displays the line number and source filename + Without EXPR, ‘caller’ displays the line number and source filename of the current subroutine call. If a non-negative integer is - supplied as EXPR, 'caller' displays the line number, subroutine + supplied as EXPR, ‘caller’ displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack. This extra information may be used, for example, to print a stack trace. The current frame is frame 0. @@ -3898,316 +3901,316 @@ standard. subroutine call or EXPR does not correspond to a valid position in the call stack. -'command' +‘command’ command [-pVv] COMMAND [ARGUMENTS ...] Runs COMMAND with ARGUMENTS ignoring any shell function named COMMAND. Only shell builtin commands or commands found by - searching the 'PATH' are executed. If there is a shell function - named 'ls', running 'command ls' within the function will execute - the external command 'ls' instead of calling the function - recursively. The '-p' option means to use a default value for - 'PATH' that is guaranteed to find all of the standard utilities. + searching the ‘PATH’ are executed. If there is a shell function + named ‘ls’, running ‘command ls’ within the function will execute + the external command ‘ls’ instead of calling the function + recursively. The ‘-p’ option means to use a default value for + ‘PATH’ that is guaranteed to find all of the standard utilities. The return status in this case is 127 if COMMAND cannot be found or an error occurred, and the exit status of COMMAND otherwise. - If either the '-V' or '-v' option is supplied, a description of - COMMAND is printed. The '-v' option causes a single word + If either the ‘-V’ or ‘-v’ option is supplied, a description of + COMMAND is printed. The ‘-v’ option causes a single word indicating the command or file name used to invoke COMMAND to be - displayed; the '-V' option produces a more verbose description. In + displayed; the ‘-V’ option produces a more verbose description. In this case, the return status is zero if COMMAND is found, and non-zero if not. -'declare' +‘declare’ declare [-aAfFgiIlnrtux] [-p] [NAME[=VALUE] ...] Declare variables and give them attributes. If no NAMEs are given, then display the values of variables instead. - The '-p' option will display the attributes and values of each - NAME. When '-p' is used with NAME arguments, additional options, - other than '-f' and '-F', are ignored. + The ‘-p’ option will display the attributes and values of each + NAME. When ‘-p’ is used with NAME arguments, additional options, + other than ‘-f’ and ‘-F’, are ignored. - When '-p' is supplied without NAME arguments, 'declare' will + When ‘-p’ is supplied without NAME arguments, ‘declare’ will display the attributes and values of all variables having the attributes specified by the additional options. If no other - options are supplied with '-p', 'declare' will display the - attributes and values of all shell variables. The '-f' option will + options are supplied with ‘-p’, ‘declare’ will display the + attributes and values of all shell variables. The ‘-f’ option will restrict the display to shell functions. - The '-F' option inhibits the display of function definitions; only - the function name and attributes are printed. If the 'extdebug' - shell option is enabled using 'shopt' (*note The Shopt Builtin::), + The ‘-F’ option inhibits the display of function definitions; only + the function name and attributes are printed. If the ‘extdebug’ + shell option is enabled using ‘shopt’ (*note The Shopt Builtin::), the source file name and line number where each NAME is defined are - displayed as well. '-F' implies '-f'. + displayed as well. ‘-F’ implies ‘-f’. - The '-g' option forces variables to be created or modified at the - global scope, even when 'declare' is executed in a shell function. + The ‘-g’ option forces variables to be created or modified at the + global scope, even when ‘declare’ is executed in a shell function. It is ignored in all other cases. - The '-I' option causes local variables to inherit the attributes - (except the 'nameref' attribute) and value of any existing variable + The ‘-I’ option causes local variables to inherit the attributes + (except the ‘nameref’ attribute) and value of any existing variable with the same NAME 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 variables with the specified attributes or to give variables attributes: - '-a' + ‘-a’ Each NAME is an indexed array variable (*note Arrays::). - '-A' + ‘-A’ Each NAME is an associative array variable (*note Arrays::). - '-f' + ‘-f’ Use function names only. - '-i' + ‘-i’ The variable is to be treated as an integer; arithmetic evaluation (*note Shell Arithmetic::) is performed when the variable is assigned a value. - '-l' + ‘-l’ When the variable is assigned a value, all upper-case characters are converted to lower-case. The upper-case attribute is disabled. - '-n' - Give each NAME the 'nameref' attribute, making it a name + ‘-n’ + Give each NAME the ‘nameref’ attribute, making it a name reference to another variable. That other variable is defined by the value of NAME. All references, assignments, and attribute modifications to NAME, except for those using or - changing the '-n' attribute itself, are performed on the + changing the ‘-n’ attribute itself, are performed on the variable referenced by NAME's value. The nameref attribute cannot be applied to array variables. - '-r' + ‘-r’ Make NAMEs readonly. These names cannot then be assigned values by subsequent assignment statements or unset. - '-t' - Give each NAME the 'trace' attribute. Traced functions - inherit the 'DEBUG' and 'RETURN' traps from the calling shell. + ‘-t’ + Give each NAME the ‘trace’ attribute. Traced functions + inherit the ‘DEBUG’ and ‘RETURN’ traps from the calling shell. The trace attribute has no special meaning for variables. - '-u' + ‘-u’ When the variable is assigned a value, all lower-case characters are converted to upper-case. The lower-case attribute is disabled. - '-x' + ‘-x’ Mark each NAME for export to subsequent commands via the environment. - Using '+' instead of '-' turns off the attribute instead, with the - exceptions that '+a' and '+A' may not be used to destroy array - variables and '+r' will not remove the readonly attribute. When - used in a function, 'declare' makes each NAME local, as with the - 'local' command, unless the '-g' option is used. If a variable + Using ‘+’ instead of ‘-’ turns off the attribute instead, with the + exceptions that ‘+a’ and ‘+A’ may not be used to destroy array + variables and ‘+r’ will not remove the readonly attribute. When + used in a function, ‘declare’ makes each NAME local, as with the + ‘local’ command, unless the ‘-g’ option is used. If a variable name is followed by =VALUE, the value of the variable is set to VALUE. - When using '-a' or '-A' and the compound assignment syntax to + When using ‘-a’ or ‘-A’ and the compound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments. The return status is zero unless an invalid option is encountered, - an attempt is made to define a function using '-f foo=bar', an + 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 attempt is made to assign a value to an array variable without using the compound assignment syntax (*note Arrays::), one of the NAMEs 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 attempt - is made to display a non-existent function with '-f'. + is made to display a non-existent function with ‘-f’. -'echo' +‘echo’ echo [-neE] [ARG ...] Output the ARGs, separated by spaces, terminated with a newline. - The return status is 0 unless a write error occurs. If '-n' is - specified, the trailing newline is suppressed. If the '-e' option + The return status is 0 unless a write error occurs. If ‘-n’ is + specified, the trailing newline is suppressed. If the ‘-e’ option is given, interpretation of the following backslash-escaped - characters is enabled. The '-E' option disables the interpretation + characters is enabled. The ‘-E’ option disables the interpretation of these escape characters, even on systems where they are - interpreted by default. The 'xpg_echo' shell option may be used to - dynamically determine whether or not 'echo' interprets any options - and expands these escape characters by default. 'echo' does not - interpret '--' to mean the end of options. + interpreted by default. The ‘xpg_echo’ shell option may be used to + dynamically determine whether or not ‘echo’ interprets any options + and expands these escape characters by default. ‘echo’ does not + interpret ‘--’ to mean the end of options. - 'echo' interprets the following escape sequences: - '\a' + ‘echo’ interprets the following escape sequences: + ‘\a’ alert (bell) - '\b' + ‘\b’ backspace - '\c' + ‘\c’ suppress further output - '\e' - '\E' + ‘\e’ + ‘\E’ escape - '\f' + ‘\f’ form feed - '\n' + ‘\n’ new line - '\r' + ‘\r’ carriage return - '\t' + ‘\t’ horizontal tab - '\v' + ‘\v’ vertical tab - '\\' + ‘\\’ backslash - '\0NNN' + ‘\0NNN’ the eight-bit character whose value is the octal value NNN (zero to three octal digits) - '\xHH' + ‘\xHH’ the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) - '\uHHHH' + ‘\uHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits) - '\UHHHHHHHH' + ‘\UHHHHHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits) -'enable' +‘enable’ enable [-a] [-dnps] [-f FILENAME] [NAME ...] Enable and disable builtin shell commands. Disabling a builtin allows a disk command 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 disk commands. If '-n' + shell normally searches for builtins before disk commands. If ‘-n’ is used, the NAMEs become disabled. Otherwise NAMEs are enabled. - For example, to use the 'test' binary found via '$PATH' instead of - the shell builtin version, type 'enable -n test'. + For example, to use the ‘test’ binary found via ‘$PATH’ instead of + the shell builtin version, type ‘enable -n test’. - If the '-p' option is supplied, or no NAME arguments appear, a list + If the ‘-p’ option is supplied, or no NAME arguments appear, a list of shell builtins is printed. With no other arguments, the list - consists of all enabled shell builtins. The '-a' option means to + consists of all enabled shell builtins. The ‘-a’ option means to list each builtin with an indication of whether or not it is enabled. - The '-f' option means to load the new builtin command NAME from + The ‘-f’ option means to load the new builtin command NAME from shared object FILENAME, on systems that support dynamic loading. - Bash will use the value of the 'BASH_LOADABLES_PATH' variable as a + Bash will use the value of the ‘BASH_LOADABLES_PATH’ variable as a colon-separated list of directories in which to search for FILENAME, if FILENAME does not contain a slash. The default is system-dependent, and may include "." to force a search of the - current directory. The '-d' option will delete a builtin loaded - with '-f'. + current directory. The ‘-d’ option will delete a builtin loaded + with ‘-f’. If there are no options, a list of the shell builtins is displayed. - The '-s' option restricts 'enable' to the POSIX special builtins. - If '-s' is used with '-f', the new builtin becomes a special + The ‘-s’ option restricts ‘enable’ to the POSIX special builtins. + If ‘-s’ is used with ‘-f’, the new builtin becomes a 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, - as if the command were 'enable -f NAME NAME'. + ‘enable’ will attempt to load NAME from a shared object named NAME, + as if the command were ‘enable -f NAME NAME’. The return status is zero unless a NAME is not a shell builtin or there is an error loading a new builtin from a shared object. -'help' +‘help’ help [-dms] [PATTERN] Display helpful information about builtin commands. If PATTERN is - specified, 'help' gives detailed help on all commands matching + specified, ‘help’ gives detailed help on all commands matching PATTERN, otherwise a list of the builtins is printed. Options, if supplied, have the following meanings: - '-d' + ‘-d’ Display a short description of each PATTERN - '-m' + ‘-m’ Display the description of each PATTERN in a manpage-like format - '-s' + ‘-s’ Display only a short usage synopsis for each PATTERN The return status is zero unless no command matches PATTERN. -'let' +‘let’ let EXPRESSION [EXPRESSION ...] - The 'let' builtin allows arithmetic to be performed on shell + The ‘let’ builtin allows arithmetic to be performed on shell variables. Each EXPRESSION is evaluated according to the rules given below in *note Shell Arithmetic::. If the last EXPRESSION - evaluates to 0, 'let' returns 1; otherwise 0 is returned. + evaluates to 0, ‘let’ returns 1; otherwise 0 is returned. -'local' +‘local’ local [OPTION] NAME[=VALUE] ... For each argument, a local variable named NAME is created, and assigned VALUE. The OPTION can be any of the options accepted by - 'declare'. 'local' can only be used within a function; it makes + ‘declare’. ‘local’ can only be used within a function; it makes the variable NAME have a visible scope restricted to that function - and its children. If NAME is '-', the set of shell options is made - local to the function in which 'local' is invoked: shell options - changed using the 'set' builtin inside the function after the call - to 'local' are restored to their original values when the function - returns. The restore is effected as if a series of 'set' commands + and its children. If NAME is ‘-’, the set of shell options is made + local to the function in which ‘local’ is invoked: shell options + changed using the ‘set’ builtin inside the function after the call + to ‘local’ are restored to their original values when the function + returns. The restore is effected as if a series of ‘set’ commands were executed to restore the values that were in place before the - function. The return status is zero unless 'local' is used outside + function. The return status is zero unless ‘local’ is used outside a function, an invalid NAME is supplied, or NAME is a readonly variable. -'logout' +‘logout’ logout [N] Exit a login shell, returning a status of N to the shell's parent. -'mapfile' +‘mapfile’ mapfile [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY] Read lines from the standard input into the indexed array variable - ARRAY, or from file descriptor FD if the '-u' option is supplied. - The variable 'MAPFILE' is the default ARRAY. Options, if supplied, + ARRAY, or from file descriptor FD if the ‘-u’ option is supplied. + The variable ‘MAPFILE’ is the default ARRAY. Options, if supplied, have the following meanings: - '-d' + ‘-d’ The first character of DELIM is used to terminate each input line, rather than newline. If DELIM is the empty string, - 'mapfile' will terminate a line when it reads a NUL character. - '-n' + ‘mapfile’ will terminate a line when it reads a NUL character. + ‘-n’ Copy at most COUNT lines. If COUNT is 0, all lines are copied. - '-O' + ‘-O’ Begin assigning to ARRAY at index ORIGIN. The default index is 0. - '-s' + ‘-s’ Discard the first COUNT lines read. - '-t' + ‘-t’ Remove a trailing DELIM (default newline) from each line read. - '-u' + ‘-u’ Read lines from file descriptor FD instead of the standard input. - '-C' - Evaluate CALLBACK each time QUANTUM lines are read. The '-c' + ‘-C’ + Evaluate CALLBACK each time QUANTUM lines are read. The ‘-c’ option specifies QUANTUM. - '-c' + ‘-c’ Specify the number of lines read between each call to CALLBACK. - If '-C' is specified without '-c', the default quantum is 5000. + If ‘-C’ is specified without ‘-c’, the default quantum is 5000. When CALLBACK is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that element as additional arguments. CALLBACK is evaluated after the line is read but before the array element is assigned. - If not supplied with an explicit origin, 'mapfile' will clear ARRAY + If not supplied with an explicit origin, ‘mapfile’ will clear ARRAY before assigning to it. - 'mapfile' returns successfully unless an invalid option or option + ‘mapfile’ returns successfully unless an invalid option or option argument is supplied, ARRAY is invalid or unassignable, or ARRAY is not an indexed array. -'printf' +‘printf’ printf [-v VAR] FORMAT [ARGUMENTS] Write the formatted ARGUMENTS to the standard output under the - control of the FORMAT. The '-v' option causes the output to be + control of the FORMAT. The ‘-v’ option causes the output to be assigned to the variable VAR rather than being printed to the standard output. @@ -4216,35 +4219,35 @@ standard. output, character escape sequences, which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive ARGUMENT. In addition to - the standard 'printf(3)' format characters 'csndiouxXeEfFgGaA', - 'printf' interprets the following additional format specifiers: + the standard ‘printf(3)’ format characters ‘csndiouxXeEfFgGaA’, + ‘printf’ interprets the following additional format specifiers: - '%b' - Causes 'printf' to expand backslash escape sequences in the - corresponding ARGUMENT in the same way as 'echo -e' (*note + ‘%b’ + Causes ‘printf’ to expand backslash escape sequences in the + corresponding ARGUMENT in the same way as ‘echo -e’ (*note Bash Builtins::). - '%q' - Causes 'printf' to output the corresponding ARGUMENT in a - format that can be reused as shell input. '%q' and '%Q'P use + ‘%q’ + Causes ‘printf’ to output the corresponding ARGUMENT in a + format that can be reused as shell input. ‘%q’ and ‘%Q’P use the ANSI-C quoting style (*note ANSI-C Quoting::) if any characters in the argument string require it, and backslash - quoting otherwise. If the format string uses the 'printf' + quoting otherwise. If the format string uses the ‘printf’ ALTERNATE FORM, these two formats quote the argument string using single quotes. - '%Q' - like '%q', but applies any supplied precision to the ARGUMENT + ‘%Q’ + like ‘%q’, but applies any supplied precision to the ARGUMENT before quoting it. - '%(DATEFMT)T' - Causes 'printf' to output the date-time string resulting from - using DATEFMT as a format string for 'strftime'(3). The + ‘%(DATEFMT)T’ + Causes ‘printf’ to output the date-time string resulting from + using DATEFMT as a format string for ‘strftime’(3). The corresponding ARGUMENT is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. If no argument is specified, conversion behaves as if -1 had been given. This is an - exception to the usual 'printf' behavior. + exception to the usual ‘printf’ behavior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that @@ -4271,277 +4274,280 @@ standard. success, non-zero if an invalid option is supplied or a write or assignment error occurs. -'read' +‘read’ read [-Eers] [-a ANAME] [-d DELIM] [-i TEXT] [-n NCHARS] [-N NCHARS] [-p PROMPT] [-t TIMEOUT] [-u FD] [NAME ...] One line is read from the standard input, or from the file - descriptor FD supplied as an argument to the '-u' option, split + descriptor FD supplied as an argument to the ‘-u’ option, split into words as described above in *note Word Splitting::, and the first word is assigned to the first NAME, the second word to the second NAME, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned to the last NAME. If there are fewer words read from the input stream than names, the remaining names are assigned empty values. The - characters in the value of the 'IFS' variable are used to split the + characters in the value of the ‘IFS’ variable are used to split the line into words using the same rules the shell uses for expansion (described above in *note Word Splitting::). The backslash - character '\' may be used to remove any special meaning for the + character ‘\’ may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: - '-a ANAME' + ‘-a ANAME’ The words are assigned to sequential indices of the array variable ANAME, starting at 0. All elements are removed from ANAME before the assignment. Other NAME arguments are ignored. - '-d DELIM' + ‘-d DELIM’ The first character of DELIM is used to terminate the input line, rather than newline. If DELIM is the empty string, - 'read' will terminate a line when it reads a NUL character. + ‘read’ will terminate a line when it reads a NUL character. - '-e' + ‘-e’ Readline (*note Command Line Editing::) is used to obtain the line. Readline uses the current (or default, if line editing was not previously active) editing settings, but uses Readline's default filename completion. - '-E' + ‘-E’ Readline (*note Command Line Editing::) is used to obtain the line. Readline uses the current (or default, if line editing was not previously active) editing settings, but uses Bash's default completion, including programmable completion. - '-i TEXT' + ‘-i TEXT’ If Readline is being used to read the line, TEXT is placed into the editing buffer before editing begins. - '-n NCHARS' - 'read' returns after reading NCHARS characters rather than + ‘-n NCHARS’ + ‘read’ returns after reading NCHARS characters rather than waiting for a complete line of input, but honors a delimiter if fewer than NCHARS characters are read before the delimiter. - '-N NCHARS' - 'read' returns after reading exactly NCHARS characters rather + ‘-N NCHARS’ + ‘read’ returns after reading exactly NCHARS characters rather than waiting for a complete line of input, unless EOF is - encountered or 'read' times out. Delimiter characters + encountered or ‘read’ times out. Delimiter characters encountered in the input are not treated specially and do not - cause 'read' to return until NCHARS characters are read. The - result is not split on the characters in 'IFS'; the intent is + cause ‘read’ to return until NCHARS characters are read. The + result is not split on the characters in ‘IFS’; the intent is that the variable is assigned exactly the characters read - (with the exception of backslash; see the '-r' option below). + (with the exception of backslash; see the ‘-r’ option below). - '-p PROMPT' + ‘-p PROMPT’ Display PROMPT, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. - '-r' + ‘-r’ If this option is given, backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not then be used as a line continuation. - '-s' + ‘-s’ Silent mode. If input is coming from a terminal, characters are not echoed. - '-t TIMEOUT' - Cause 'read' to time out and return failure if a complete line + ‘-t TIMEOUT’ + Cause ‘read’ to time out and return failure if a complete line of input (or a specified number of characters) is not read within TIMEOUT seconds. TIMEOUT may be a decimal number with a fractional portion following the decimal point. This option - is only effective if 'read' is reading input from a terminal, + is only effective if ‘read’ is reading input from a terminal, pipe, or other special file; it has no effect when reading - from regular files. If 'read' times out, 'read' saves any + from regular files. If ‘read’ times out, ‘read’ saves any partial input read into the specified variable NAME. If - TIMEOUT is 0, 'read' returns immediately, without trying to + TIMEOUT is 0, ‘read’ returns immediately, without trying to read any data. The exit status is 0 if input is available on the specified file descriptor, or the read will return EOF, non-zero otherwise. The exit status is greater than 128 if the timeout is exceeded. - '-u FD' + ‘-u FD’ Read input from file descriptor FD. + Other than the case where DELIM is the empty string, ‘read’ ignores + any NUL characters in the input. + If no NAMEs are supplied, the line read, without the ending delimiter but otherwise unmodified, is assigned to the variable - 'REPLY'. The exit status is zero, unless end-of-file is - encountered, 'read' times out (in which case the status is greater + ‘REPLY’. The exit status is zero, unless end-of-file is + encountered, ‘read’ times out (in which case the status is greater than 128), a variable assignment error (such as assigning to a readonly variable) occurs, or an invalid file descriptor is - supplied as the argument to '-u'. + supplied as the argument to ‘-u’. -'readarray' +‘readarray’ readarray [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY] Read lines from the standard input into the indexed array variable - ARRAY, or from file descriptor FD if the '-u' option is supplied. + ARRAY, or from file descriptor FD if the ‘-u’ option is supplied. - A synonym for 'mapfile'. + A synonym for ‘mapfile’. -'source' +‘source’ source FILENAME - A synonym for '.' (*note Bourne Shell Builtins::). + A synonym for ‘.’ (*note Bourne Shell Builtins::). -'type' +‘type’ type [-afptP] [NAME ...] For each NAME, indicate how it would be interpreted if used as a command name. - If the '-t' option is used, 'type' prints a single word which is - one of 'alias', 'keyword', 'function', 'builtin', or 'file', if + If the ‘-t’ option is used, ‘type’ prints a single word which is + one of ‘alias’, ‘keyword’, ‘function’, ‘builtin’, or ‘file’, if NAME is an alias, shell reserved word, shell function, shell builtin, or executable disk file, respectively. If the NAME is not - found, then nothing is printed, and 'type' returns a failure + found, then nothing is printed, and ‘type’ returns a failure status. - If the '-p' option is used, 'type' either returns the name of the - executable file that would be found by searching '$PATH', or - nothing if '-t' would not return 'file'. + If the ‘-p’ option is used, ‘type’ either returns the name of the + executable file that would be found by searching ‘$PATH’, or + nothing if ‘-t’ would not return ‘file’. - The '-P' option forces a path search for each NAME, even if '-t' - would not return 'file'. + The ‘-P’ option forces a path search for each NAME, even if ‘-t’ + would not return ‘file’. - If a NAME is present in the table of hashed commands, options '-p' - and '-P' print the hashed value, which is not necessarily the file - that appears first in '$PATH'. + If a NAME is present in the table of hashed commands, options ‘-p’ + and ‘-P’ print the hashed value, which is not necessarily the file + that appears first in ‘$PATH’. - If the '-a' option is used, 'type' returns all of the places that + If the ‘-a’ option is used, ‘type’ returns all of the places that contain a command named NAME. This includes aliases, reserved - words, functions, and builtins, but the path search options ('-p' - and '-P') can be supplied to restrict the output to executable - files. If '-a' is supplied with '-p', 'type' does not look in the - table of hashed commands, and only performs a 'PATH' search for + words, functions, and builtins, but the path search options (‘-p’ + and ‘-P’) can be supplied to restrict the output to executable + files. If ‘-a’ is supplied with ‘-p’, ‘type’ does not look in the + table of hashed commands, and only performs a ‘PATH’ search for NAME. - If the '-f' option is used, 'type' does not attempt to find shell - functions, as with the 'command' builtin. + If the ‘-f’ option is used, ‘type’ does not attempt to find shell + functions, as with the ‘command’ builtin. The return status is zero if all of the NAMEs are found, non-zero if any are not found. -'typeset' +‘typeset’ typeset [-afFgrxilnrtux] [-p] [NAME[=VALUE] ...] - The 'typeset' command is supplied for compatibility with the Korn - shell. It is a synonym for the 'declare' builtin command. + The ‘typeset’ command is supplied for compatibility with the Korn + shell. It is a synonym for the ‘declare’ builtin command. -'ulimit' +‘ulimit’ ulimit [-HS] -a ulimit [-HS] [-bcdefiklmnpqrstuvxPRT] [LIMIT] - 'ulimit' provides control over the resources available to processes + ‘ulimit’ provides control over the resources available to processes started by the shell, on systems that allow such control. If an option is given, it is interpreted as follows: - '-S' + ‘-S’ Change and report the soft limit associated with a resource. - '-H' + ‘-H’ Change and report the hard limit associated with a resource. - '-a' + ‘-a’ All current limits are reported; no limits are set. - '-b' + ‘-b’ The maximum socket buffer size. - '-c' + ‘-c’ The maximum size of core files created. - '-d' + ‘-d’ The maximum size of a process's data segment. - '-e' + ‘-e’ The maximum scheduling priority ("nice"). - '-f' + ‘-f’ The maximum size of files written by the shell and its children. - '-i' + ‘-i’ The maximum number of pending signals. - '-k' + ‘-k’ The maximum number of kqueues that may be allocated. - '-l' + ‘-l’ The maximum size that may be locked into memory. - '-m' + ‘-m’ The maximum resident set size (many systems do not honor this limit). - '-n' + ‘-n’ The maximum number of open file descriptors (most systems do not allow this value to be set). - '-p' + ‘-p’ The pipe buffer size. - '-q' + ‘-q’ The maximum number of bytes in POSIX message queues. - '-r' + ‘-r’ The maximum real-time scheduling priority. - '-s' + ‘-s’ The maximum stack size. - '-t' + ‘-t’ The maximum amount of cpu time in seconds. - '-u' + ‘-u’ The maximum number of processes available to a single user. - '-v' + ‘-v’ The maximum amount of virtual memory available to the shell, and, on some systems, to its children. - '-x' + ‘-x’ The maximum number of file locks. - '-P' + ‘-P’ The maximum number of pseudoterminals. - '-R' + ‘-R’ The maximum time a real-time process can run before blocking, in microseconds. - '-T' + ‘-T’ The maximum number of threads. - If LIMIT is given, and the '-a' option is not used, LIMIT is the + If LIMIT is given, and the ‘-a’ option is not used, LIMIT is the new value of the specified resource. The special LIMIT values - 'hard', 'soft', and 'unlimited' stand for the current hard limit, + ‘hard’, ‘soft’, and ‘unlimited’ stand for the current hard limit, the current soft limit, and no limit, respectively. 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. Otherwise, the current value of the soft limit for the specified resource is - printed, unless the '-H' option is supplied. When more than one + printed, unless the ‘-H’ option is supplied. When more than one resource is specified, the limit name and unit, if appropriate, are - printed before the value. When setting new limits, if neither '-H' - nor '-S' is supplied, both the hard and soft limits are set. If no - option is given, then '-f' is assumed. 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::), '-c' and '-f', which + printed before the value. When setting new limits, if neither ‘-H’ + nor ‘-S’ is supplied, both the hard and soft limits are set. If no + option is given, then ‘-f’ is assumed. 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::), ‘-c’ and ‘-f’, which are in 512-byte increments. The return status is zero unless an invalid option or argument is supplied, or an error occurs while setting a new limit. -'unalias' +‘unalias’ unalias [-a] [NAME ... ] - Remove each NAME from the list of aliases. If '-a' is supplied, + Remove each NAME from the list of aliases. If ‘-a’ is supplied, all aliases are removed. Aliases are described in *note Aliases::.  @@ -4562,17 +4568,17 @@ File: bash.info, Node: The Set Builtin, Next: The Shopt Builtin, Up: Modifyin 4.3.1 The Set Builtin --------------------- -This builtin is so complicated that it deserves its own section. 'set' +This builtin is so complicated that it deserves its own section. ‘set’ allows you to change the values of shell options and set the positional parameters, or to display the names and values of shell variables. -'set' +‘set’ set [-abefhkmnptuvxBCEHPT] [-o OPTION-NAME] [--] [-] [ARGUMENT ...] set [+abefhkmnptuvxBCEHPT] [+o OPTION-NAME] [--] [-] [ARGUMENT ...] set -o set +o - If no options or arguments are supplied, 'set' displays the names + If no options or arguments are supplied, ‘set’ displays the names and values of all shell variables and functions, sorted according to the current locale, in a format that may be reused as input for setting or resetting the currently-set variables. Read-only @@ -4582,30 +4588,30 @@ parameters, or to display the names and values of shell variables. When options are supplied, they set or unset shell attributes. Options, if specified, have the following meanings: - '-a' + ‘-a’ Each variable or function that is created or modified is given the export attribute and marked for export to the environment of subsequent commands. - '-b' + ‘-b’ Cause the status of terminated background jobs to be reported immediately, rather than before printing the next primary prompt. - '-e' + ‘-e’ Exit immediately if a pipeline (*note Pipelines::), which may consist of a single simple command (*note Simple Commands::), a list (*note Lists::), or a compound command (*note Compound Commands::) returns a non-zero status. The shell does not exit if the command that fails is part of the command list - immediately following a 'while' or 'until' keyword, part of - the test in an 'if' statement, part of any command executed in - a '&&' or '||' list except the command following the final - '&&' or '||', any command in a pipeline but the last, or if - the command's return status is being inverted with '!'. If a + immediately following a ‘while’ or ‘until’ keyword, part of + the test in an ‘if’ statement, part of any command executed in + a ‘&&’ or ‘||’ list except the command following the final + ‘&&’ or ‘||’, any command in a pipeline but the last, or if + the command's return status is being inverted with ‘!’. If a compound command other than a subshell returns a non-zero - status because a command failed while '-e' was being ignored, - the shell does not exit. A trap on 'ERR', if set, is executed + status because a command failed while ‘-e’ was being ignored, + the shell does not exit. A trap on ‘ERR’, if set, is executed before the shell exits. This option applies to the shell environment and each subshell @@ -4614,237 +4620,237 @@ parameters, or to display the names and values of shell variables. executing all the commands in the subshell. If a compound command or shell function executes in a context - where '-e' is being ignored, none of the commands executed + where ‘-e’ is being ignored, none of the commands executed within the compound command or function body will be affected - by the '-e' setting, even if '-e' is set and a command returns + by the ‘-e’ setting, even if ‘-e’ is set and a command returns a failure status. If a compound command or shell function - sets '-e' while executing in a context where '-e' is ignored, + sets ‘-e’ while executing in a context where ‘-e’ is ignored, that setting will not have any effect until the compound command or the command containing the function call completes. - '-f' + ‘-f’ Disable filename expansion (globbing). - '-h' + ‘-h’ Locate and remember (hash) commands as they are looked up for execution. This option is enabled by default. - '-k' + ‘-k’ All arguments in the form of assignment statements are placed in the environment for a command, not just those that precede the command name. - '-m' + ‘-m’ Job control is enabled (*note Job Control::). All processes run in a separate process group. When a background job completes, the shell prints a line containing its exit status. - '-n' + ‘-n’ Read commands but do not execute them. This may be used to check a script for syntax errors. This option is ignored by interactive shells. - '-o OPTION-NAME' + ‘-o OPTION-NAME’ - Set the option corresponding to OPTION-NAME. If '-o' is - supplied with no OPTION-NAME, 'set' prints the current shell - options settings. If '+o' is supplied with no OPTION-NAME, - 'set' prints a series of 'set' commands to recreate the + Set the option corresponding to OPTION-NAME. If ‘-o’ is + supplied with no OPTION-NAME, ‘set’ prints the current shell + options settings. If ‘+o’ is supplied with no OPTION-NAME, + ‘set’ prints a series of ‘set’ commands to recreate the current option settings on the standard output. Valid option names are: - 'allexport' - Same as '-a'. + ‘allexport’ + Same as ‘-a’. - 'braceexpand' - Same as '-B'. + ‘braceexpand’ + Same as ‘-B’. - 'emacs' - Use an 'emacs'-style line editing interface (*note + ‘emacs’ + Use an ‘emacs’-style line editing interface (*note Command Line Editing::). This also affects the editing - interface used for 'read -e'. + interface used for ‘read -e’. - 'errexit' - Same as '-e'. + ‘errexit’ + Same as ‘-e’. - 'errtrace' - Same as '-E'. + ‘errtrace’ + Same as ‘-E’. - 'functrace' - Same as '-T'. + ‘functrace’ + Same as ‘-T’. - 'hashall' - Same as '-h'. + ‘hashall’ + Same as ‘-h’. - 'histexpand' - Same as '-H'. + ‘histexpand’ + Same as ‘-H’. - 'history' + ‘history’ Enable command history, as described in *note Bash History Facilities::. This option is on by default in interactive shells. - 'ignoreeof' + ‘ignoreeof’ An interactive shell will not exit upon reading EOF. - 'keyword' - Same as '-k'. + ‘keyword’ + Same as ‘-k’. - 'monitor' - Same as '-m'. + ‘monitor’ + Same as ‘-m’. - 'noclobber' - Same as '-C'. + ‘noclobber’ + Same as ‘-C’. - 'noexec' - Same as '-n'. + ‘noexec’ + Same as ‘-n’. - 'noglob' - Same as '-f'. + ‘noglob’ + Same as ‘-f’. - 'nolog' + ‘nolog’ Currently ignored. - 'notify' - Same as '-b'. + ‘notify’ + Same as ‘-b’. - 'nounset' - Same as '-u'. + ‘nounset’ + Same as ‘-u’. - 'onecmd' - Same as '-t'. + ‘onecmd’ + Same as ‘-t’. - 'physical' - Same as '-P'. + ‘physical’ + Same as ‘-P’. - 'pipefail' + ‘pipefail’ If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands in the pipeline exit successfully. This option is disabled by default. - 'posix' + ‘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. - 'privileged' - Same as '-p'. + ‘privileged’ + Same as ‘-p’. - 'verbose' - Same as '-v'. + ‘verbose’ + Same as ‘-v’. - 'vi' - Use a 'vi'-style line editing interface. This also - affects the editing interface used for 'read -e'. + ‘vi’ + Use a ‘vi’-style line editing interface. This also + affects the editing interface used for ‘read -e’. - 'xtrace' - Same as '-x'. + ‘xtrace’ + Same as ‘-x’. - '-p' - Turn on privileged mode. In this mode, the '$BASH_ENV' and - '$ENV' files are not processed, shell functions are not - inherited from the environment, and the 'SHELLOPTS', - 'BASHOPTS', 'CDPATH' and 'GLOBIGNORE' variables, if they + ‘-p’ + Turn on privileged mode. In this mode, the ‘$BASH_ENV’ and + ‘$ENV’ files are not processed, shell functions are not + inherited from the environment, and the ‘SHELLOPTS’, + ‘BASHOPTS’, ‘CDPATH’ and ‘GLOBIGNORE’ 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 '-p' option is not supplied, + real user (group) id, and the ‘-p’ option is not supplied, these actions are taken and the effective user id is set to - the real user id. If the '-p' option is supplied at startup, + the real user id. If the ‘-p’ option is supplied at startup, the effective user id is not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids. - '-r' + ‘-r’ Enable restricted shell mode (*note The Restricted Shell::). This option cannot be unset once it has been set. - '-t' + ‘-t’ Exit after reading and executing one command. - '-u' + ‘-u’ Treat unset variables and parameters other than the special - parameters '@' or '*', or array variables subscripted with '@' - or '*', as an error when performing parameter expansion. An + parameters ‘@’ or ‘*’, or array variables subscripted with ‘@’ + or ‘*’, as an error when performing parameter expansion. An error message will be written to the standard error, and a non-interactive shell will exit. - '-v' + ‘-v’ Print shell input lines as they are read. - '-x' - Print a trace of simple commands, 'for' commands, 'case' - commands, 'select' commands, and arithmetic 'for' commands and + ‘-x’ + Print a trace of simple commands, ‘for’ commands, ‘case’ + commands, ‘select’ commands, and arithmetic ‘for’ commands and their arguments or associated word lists to standard error after they are expanded and before they are executed. The - shell prints the expanded value of the 'PS4' variable before + shell prints the expanded value of the ‘PS4’ variable before the command and its expanded arguments. - '-B' + ‘-B’ The shell will perform brace expansion (*note Brace Expansion::). This option is on by default. - '-C' - Prevent output redirection using '>', '>&', and '<>' from + ‘-C’ + Prevent output redirection using ‘>’, ‘>&’, and ‘<>’ from overwriting existing files. - '-E' - If set, any trap on 'ERR' is inherited by shell functions, + ‘-E’ + If set, any trap on ‘ERR’ is inherited by shell functions, command substitutions, and commands executed in a subshell - environment. The 'ERR' trap is normally not inherited in such + environment. The ‘ERR’ trap is normally not inherited in such cases. - '-H' - Enable '!' style history substitution (*note History + ‘-H’ + Enable ‘!’ style history substitution (*note History Interaction::). This option is on by default for interactive shells. - '-P' + ‘-P’ If set, do not resolve symbolic links when performing commands - such as 'cd' which change the current directory. The physical + such as ‘cd’ which change the current directory. The physical directory is used instead. By default, Bash follows the logical chain of directories when performing commands which change the current directory. - For example, if '/usr/sys' is a symbolic link to - '/usr/local/sys' then: + For example, if ‘/usr/sys’ is a symbolic link to + ‘/usr/local/sys’ then: $ cd /usr/sys; echo $PWD /usr/sys $ cd ..; pwd /usr - If 'set -P' is on, then: + If ‘set -P’ is on, then: $ cd /usr/sys; echo $PWD /usr/local/sys $ cd ..; pwd /usr/local - '-T' - If set, any trap on 'DEBUG' and 'RETURN' are inherited by + ‘-T’ + If set, any trap on ‘DEBUG’ and ‘RETURN’ are inherited by shell functions, command substitutions, and commands executed - in a subshell environment. The 'DEBUG' and 'RETURN' traps are + in a subshell environment. The ‘DEBUG’ and ‘RETURN’ traps are normally not inherited in such cases. - '--' + ‘--’ If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the ARGUMENTS, even if some of them begin with a - '-'. + ‘-’. - '-' + ‘-’ Signal the end of options, cause all remaining ARGUMENTS to be - assigned to the positional parameters. The '-x' and '-v' + assigned to the positional parameters. The ‘-x’ and ‘-v’ options are turned off. If there are no arguments, the positional parameters remain unchanged. - Using '+' rather than '-' causes these options to be turned off. + Using ‘+’ rather than ‘-’ causes these options to be turned off. The options can also be used upon invocation of the shell. The - current set of options may be found in '$-'. + current set of options may be found in ‘$-’. The remaining N ARGUMENTS are positional parameters and are - assigned, in order, to '$1', '$2', ... '$N'. The special parameter - '#' is set to N. + assigned, in order, to ‘$1’, ‘$2’, ... ‘$N’. The special parameter + ‘#’ is set to N. The return status is always zero unless an invalid option is supplied. @@ -4857,39 +4863,39 @@ File: bash.info, Node: The Shopt Builtin, Prev: The Set Builtin, Up: Modifyin This builtin allows you to change additional shell optional behavior. -'shopt' +‘shopt’ shopt [-pqsu] [-o] [OPTNAME ...] Toggle the values of settings controlling optional shell behavior. - The settings can be either those listed below, or, if the '-o' - option is used, those available with the '-o' option to the 'set' + The settings can be either those listed below, or, if the ‘-o’ + option is used, those available with the ‘-o’ option to the ‘set’ builtin command (*note The Set Builtin::). With no options, or - with the '-p' option, a list of all settable options is displayed, + with the ‘-p’ option, a list of all settable options is displayed, with an indication of whether or not each is set; if OPTNAMEs are - supplied, the output is restricted to those options. The '-p' + supplied, the output is restricted to those options. The ‘-p’ option causes output to be displayed in a form that may be reused as input. Other options have the following meanings: - '-s' + ‘-s’ Enable (set) each OPTNAME. - '-u' + ‘-u’ Disable (unset) each OPTNAME. - '-q' + ‘-q’ Suppresses normal output; the return status indicates whether the OPTNAME is set or unset. If multiple OPTNAME arguments - are given with '-q', the return status is zero if all OPTNAMEs + are given with ‘-q’, the return status is zero if all OPTNAMEs are enabled; non-zero otherwise. - '-o' + ‘-o’ Restricts the values of OPTNAME to be those defined for the - '-o' option to the 'set' builtin (*note The Set Builtin::). + ‘-o’ option to the ‘set’ builtin (*note The Set Builtin::). - If either '-s' or '-u' is used with no OPTNAME arguments, 'shopt' + If either ‘-s’ or ‘-u’ is used with no OPTNAME arguments, ‘shopt’ shows only those options which are set or unset, respectively. - Unless otherwise noted, the 'shopt' options are disabled (off) by + Unless otherwise noted, the ‘shopt’ options are disabled (off) by default. The return status when listing options is zero if all OPTNAMEs are @@ -4897,42 +4903,42 @@ This builtin allows you to change additional shell optional behavior. the return status is zero unless an OPTNAME is not a valid shell option. - The list of 'shopt' options is: + The list of ‘shopt’ options is: - 'array_expand_once' + ‘array_expand_once’ If set, the shell suppresses multiple evaluation of associative and indexed array subscripts during arithmetic expression evaluation, while executing builtins that can perform variable assignments, and while executing builtins that perform array dereferencing. - 'assoc_expand_once' - Deprecated; a synonym for 'array_expand_once'. + ‘assoc_expand_once’ + Deprecated; a synonym for ‘array_expand_once’. - 'autocd' + ‘autocd’ If set, a command name that is the name of a directory is - executed as if it were the argument to the 'cd' command. This + executed as if it were the argument to the ‘cd’ command. This option is only used by interactive shells. - 'cdable_vars' - If this is set, an argument to the 'cd' builtin command that + ‘cdable_vars’ + If this is set, an argument to the ‘cd’ builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to. - 'cdspell' + ‘cdspell’ If set, minor errors in the spelling of a directory component - in a 'cd' command will be corrected. The errors checked for + in a ‘cd’ command will be corrected. The errors checked for are transposed characters, a missing character, and a character too many. If a correction is found, the corrected path is printed, and the command proceeds. This option is only used by interactive shells. - 'checkhash' + ‘checkhash’ If this is set, Bash checks that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal path search is performed. - 'checkjobs' + ‘checkjobs’ If set, Bash lists the status of any stopped and running jobs before exiting an interactive shell. If any jobs are running, this causes the exit to be deferred until a second exit is @@ -4940,29 +4946,29 @@ This builtin allows you to change additional shell optional behavior. Control::). The shell always postpones exiting if any jobs are stopped. - 'checkwinsize' + ‘checkwinsize’ If set, Bash checks the window size after each external (non-builtin) command and, if necessary, updates the values of - 'LINES' and 'COLUMNS'. This option is enabled by default. + ‘LINES’ and ‘COLUMNS’. This option is enabled by default. - 'cmdhist' + ‘cmdhist’ If set, Bash 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 (*note Bash History Facilities::). - 'compat31' - 'compat32' - 'compat40' - 'compat41' - 'compat42' - 'compat43' - 'compat44' + ‘compat31’ + ‘compat32’ + ‘compat40’ + ‘compat41’ + ‘compat42’ + ‘compat43’ + ‘compat44’ These control aspects of the shell's compatibility mode (*note Shell Compatibility Mode::). - 'complete_fullquote' + ‘complete_fullquote’ If set, Bash quotes all shell metacharacters in filenames and directory names when performing completion. If not set, Bash removes metacharacters such as the dollar sign from the set of @@ -4976,254 +4982,254 @@ This builtin allows you to change additional shell optional behavior. set by default, which is the default Bash behavior in versions through 4.2. - 'direxpand' + ‘direxpand’ If set, Bash replaces directory names with the results of word expansion when performing filename completion. This changes the contents of the Readline editing buffer. If not set, Bash attempts to preserve what the user typed. - 'dirspell' + ‘dirspell’ If set, Bash attempts spelling correction on directory names during word completion if the directory name initially supplied does not exist. - 'dotglob' + ‘dotglob’ If set, Bash includes filenames beginning with a '.' in the - results of filename expansion. The filenames '.' and '..' - must always be matched explicitly, even if 'dotglob' is set. + results of filename expansion. The filenames ‘.’ and ‘..’ + must always be matched explicitly, even if ‘dotglob’ is set. - 'execfail' + ‘execfail’ If this is set, a non-interactive shell will not exit if it - cannot execute the file specified as an argument to the 'exec' - builtin command. An interactive shell does not exit if 'exec' + cannot execute the file specified as an argument to the ‘exec’ + builtin command. An interactive shell does not exit if ‘exec’ fails. - 'expand_aliases' + ‘expand_aliases’ If set, aliases are expanded as described below under Aliases, *note Aliases::. This option is enabled by default for interactive shells. - 'extdebug' + ‘extdebug’ If set at shell invocation, or in a shell startup file, arrange to execute the debugger profile before the shell - starts, identical to the '--debugger' option. If set after + starts, identical to the ‘--debugger’ option. If set after invocation, behavior intended for use by debuggers is enabled: - 1. The '-F' option to the 'declare' builtin (*note Bash + 1. The ‘-F’ option to the ‘declare’ builtin (*note Bash Builtins::) displays the source file name and line number corresponding to each function name supplied as an argument. - 2. If the command run by the 'DEBUG' trap returns a non-zero + 2. If the command run by the ‘DEBUG’ trap returns a non-zero value, the next command is skipped and not executed. - 3. If the command run by the 'DEBUG' trap returns a value of + 3. If the command run by the ‘DEBUG’ trap returns a value of 2, and the shell is executing in a subroutine (a shell - function or a shell script executed by the '.' or - 'source' builtins), the shell simulates a call to - 'return'. + function or a shell script executed by the ‘.’ or + ‘source’ builtins), the shell simulates a call to + ‘return’. - 4. 'BASH_ARGC' and 'BASH_ARGV' are updated as described in + 4. ‘BASH_ARGC’ and ‘BASH_ARGV’ are updated as described in their descriptions (*note Bash Variables::). 5. Function tracing is enabled: command substitution, shell - functions, and subshells invoked with '( COMMAND )' - inherit the 'DEBUG' and 'RETURN' traps. + functions, and subshells invoked with ‘( COMMAND )’ + inherit the ‘DEBUG’ and ‘RETURN’ traps. 6. Error tracing is enabled: command substitution, shell - functions, and subshells invoked with '( COMMAND )' - inherit the 'ERR' trap. + functions, and subshells invoked with ‘( COMMAND )’ + inherit the ‘ERR’ trap. - 'extglob' + ‘extglob’ If set, the extended pattern matching features described above (*note Pattern Matching::) are enabled. - 'extquote' - If set, '$'STRING'' and '$"STRING"' quoting is performed - within '${PARAMETER}' expansions enclosed in double quotes. + ‘extquote’ + If set, ‘$'STRING'’ and ‘$"STRING"’ quoting is performed + within ‘${PARAMETER}’ expansions enclosed in double quotes. This option is enabled by default. - 'failglob' + ‘failglob’ If set, patterns which fail to match filenames during filename expansion result in an expansion error. - 'force_fignore' - If set, the suffixes specified by the 'FIGNORE' shell variable + ‘force_fignore’ + If set, the suffixes specified by the ‘FIGNORE’ shell variable cause words to be ignored when performing word completion even if the ignored words are the only possible completions. *Note - Bash Variables::, for a description of 'FIGNORE'. This option + Bash Variables::, for a description of ‘FIGNORE’. This option is enabled by default. - 'globasciiranges' + ‘globasciiranges’ If set, range expressions used in pattern matching bracket expressions (*note Pattern Matching::) behave as if in the traditional C locale when performing comparisons. That is, the current locale's collating sequence is not taken into - account, so 'b' will not collate between 'A' and 'B', and + account, so ‘b’ will not collate between ‘A’ and ‘B’, and upper-case and lower-case ASCII characters will collate together. - 'globskipdots' - If set, filename expansion will never match the filenames '.' - and '..', even if the pattern begins with a '.'. This option + ‘globskipdots’ + If set, filename expansion will never match the filenames ‘.’ + and ‘..’, even if the pattern begins with a ‘.’. This option is enabled by default. - 'globstar' - If set, the pattern '**' used in a filename expansion context + ‘globstar’ + If set, the pattern ‘**’ used in a filename expansion context will match all files and zero or more directories and - subdirectories. If the pattern is followed by a '/', only + subdirectories. If the pattern is followed by a ‘/’, only directories and subdirectories match. - 'gnu_errfmt' + ‘gnu_errfmt’ If set, shell error messages are written in the standard GNU error message format. - 'histappend' + ‘histappend’ If set, the history list is appended to the file named by the - value of the 'HISTFILE' variable when the shell exits, rather + value of the ‘HISTFILE’ variable when the shell exits, rather than overwriting the file. - 'histreedit' + ‘histreedit’ If set, and Readline is being used, a user is given the opportunity to re-edit a failed history substitution. - 'histverify' + ‘histverify’ If set, and Readline is being used, the results of history substitution are not immediately passed to the shell parser. Instead, the resulting line is loaded into the Readline editing buffer, allowing further modification. - 'hostcomplete' + ‘hostcomplete’ If set, and Readline is being used, Bash will attempt to - perform hostname completion when a word containing a '@' is + perform hostname completion when a word containing a ‘@’ is being completed (*note Commands For Completion::). This option is enabled by default. - 'huponexit' - If set, Bash will send 'SIGHUP' to all jobs when an + ‘huponexit’ + If set, Bash will send ‘SIGHUP’ to all jobs when an interactive login shell exits (*note Signals::). - 'inherit_errexit' + ‘inherit_errexit’ If set, command substitution inherits the value of the - 'errexit' option, instead of unsetting it in the subshell + ‘errexit’ option, instead of unsetting it in the subshell environment. This option is enabled when POSIX mode is enabled. - 'interactive_comments' - Allow a word beginning with '#' to cause that word and all + ‘interactive_comments’ + Allow a word beginning with ‘#’ to cause that word and all remaining characters on that line to be ignored in an interactive shell. This option is enabled by default. - 'lastpipe' + ‘lastpipe’ If set, and job control is not active, the shell runs the last command of a pipeline not executed in the background in the current shell environment. - 'lithist' - If enabled, and the 'cmdhist' option is enabled, multi-line + ‘lithist’ + If enabled, and the ‘cmdhist’ option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible. - 'localvar_inherit' + ‘localvar_inherit’ If set, local variables inherit the value and attributes of a variable of the same name that exists at a previous scope - before any new value is assigned. The 'nameref' attribute is + before any new value is assigned. The ‘nameref’ attribute is not inherited. - 'localvar_unset' - If set, calling 'unset' on local variables in previous + ‘localvar_unset’ + If set, calling ‘unset’ on local variables in previous function scopes marks them so subsequent lookups find them unset until that function returns. This is identical to the behavior of unsetting local variables at the current function scope. - 'login_shell' + ‘login_shell’ The shell sets this option if it is started as a login shell (*note Invoking Bash::). The value may not be changed. - 'mailwarn' + ‘mailwarn’ If set, and a file that Bash is checking for mail has been - accessed since the last time it was checked, the message '"The - mail in MAILFILE has been read"' is displayed. + accessed since the last time it was checked, the message ‘"The + mail in MAILFILE has been read"’ is displayed. - 'no_empty_cmd_completion' + ‘no_empty_cmd_completion’ If set, and Readline is being used, Bash will not attempt to - search the 'PATH' for possible completions when completion is + search the ‘PATH’ for possible completions when completion is attempted on an empty line. - 'nocaseglob' + ‘nocaseglob’ If set, Bash matches filenames in a case-insensitive fashion when performing filename expansion. - 'nocasematch' + ‘nocasematch’ If set, Bash matches patterns in a case-insensitive fashion - when performing matching while executing 'case' or '[[' + when performing matching while executing ‘case’ or ‘[[’ conditional commands (*note Conditional Constructs::, when performing pattern substitution word expansions, or when filtering possible completions as part of programmable completion. - 'noexpand_translation' + ‘noexpand_translation’ If set, Bash encloses the translated results of $"..." quoting in single quotes instead of double quotes. If the string is not translated, this has no effect. - 'nullglob' + ‘nullglob’ If set, filename expansion patterns which match no files (*note Filename Expansion::) expand to nothing and are removed, rather than expanding to themselves. - 'patsub_replacement' - If set, Bash expands occurrences of '&' in the replacement + ‘patsub_replacement’ + If set, Bash expands occurrences of ‘&’ in the replacement string of pattern substitution to the text matched by the pattern, as described above (*note Shell Parameter Expansion::). This option is enabled by default. - 'progcomp' + ‘progcomp’ If set, the programmable completion facilities (*note Programmable Completion::) are enabled. This option is enabled by default. - 'progcomp_alias' + ‘progcomp_alias’ If set, and programmable completion is enabled, Bash treats a command name that doesn't have any completions as a possible alias and attempts alias expansion. If it has an alias, Bash attempts programmable completion using the command word resulting from the expanded alias. - 'promptvars' + ‘promptvars’ If set, prompt strings undergo parameter expansion, command substitution, arithmetic expansion, and quote removal after being expanded as described below (*note Controlling the Prompt::). This option is enabled by default. - 'restricted_shell' + ‘restricted_shell’ The shell sets this option if it is started in restricted mode (*note The Restricted Shell::). The value may not be changed. This is not reset when the startup files are executed, allowing the startup files to discover whether or not a shell is restricted. - 'shift_verbose' - If this is set, the 'shift' builtin prints an error message + ‘shift_verbose’ + If this is set, the ‘shift’ builtin prints an error message when the shift count exceeds the number of positional parameters. - 'sourcepath' - If set, the '.' ('source') builtin uses the value of 'PATH' to + ‘sourcepath’ + If set, the ‘.’ (‘source’) builtin uses the value of ‘PATH’ to find the directory containing the file supplied as an argument. This option is enabled by default. - 'varredir_close' + ‘varredir_close’ If set, the shell automatically closes file descriptors - assigned using the '{varname}' redirection syntax (*note + assigned using the ‘{varname}’ redirection syntax (*note Redirections::) instead of leaving them open when the command completes. - 'xpg_echo' - If set, the 'echo' builtin expands backslash-escape sequences - by default. If the 'posix' shell option (*note The Set - Builtin::) is also enabled, 'echo' does not interpret any + ‘xpg_echo’ + If set, the ‘echo’ builtin expands backslash-escape sequences + by default. If the ‘posix’ shell option (*note The Set + Builtin::) is also enabled, ‘echo’ does not interpret any options.  @@ -5278,53 +5284,53 @@ File: bash.info, Node: Bourne Shell Variables, Next: Bash Variables, Up: Shel Bash uses certain shell variables in the same way as the Bourne shell. In some cases, Bash assigns a default value to the variable. -'CDPATH' +‘CDPATH’ A colon-separated list of directories used as a search path for the - 'cd' builtin command. + ‘cd’ builtin command. -'HOME' - The current user's home directory; the default for the 'cd' builtin +‘HOME’ + The current user's home directory; the default for the ‘cd’ builtin command. The value of this variable is also used by tilde expansion (*note Tilde Expansion::). -'IFS' +‘IFS’ A list of characters that separate fields; used when the shell splits words as part of expansion. -'MAIL' +‘MAIL’ If this parameter is set to a filename or directory name and the - 'MAILPATH' variable is not set, Bash informs the user of the + ‘MAILPATH’ variable is not set, Bash informs the user of the arrival of mail in the specified file or Maildir-format directory. -'MAILPATH' +‘MAILPATH’ A colon-separated list of filenames which the shell periodically checks for new mail. Each list entry can specify the message that is printed when new mail arrives in the mail file by separating the - filename from the message with a '?'. When used in the text of the - message, '$_' expands to the name of the current mail file. + filename from the message with a ‘?’. When used in the text of the + message, ‘$_’ expands to the name of the current mail file. -'OPTARG' - The value of the last option argument processed by the 'getopts' +‘OPTARG’ + The value of the last option argument processed by the ‘getopts’ builtin. -'OPTIND' - The index of the last option argument processed by the 'getopts' +‘OPTIND’ + The index of the last option argument processed by the ‘getopts’ builtin. -'PATH' +‘PATH’ A colon-separated list of directories in which the shell looks for commands. A zero-length (null) directory name in the value of - 'PATH' indicates the current directory. A null directory name may + ‘PATH’ indicates the current directory. A null directory name may appear as two adjacent colons, or as an initial or trailing colon. -'PS1' - The primary prompt string. The default value is '\s-\v\$ '. *Note +‘PS1’ + The primary prompt string. The default value is ‘\s-\v\$ ’. *Note Controlling the Prompt::, for the complete list of escape sequences - that are expanded before 'PS1' is displayed. + that are expanded before ‘PS1’ is displayed. -'PS2' - The secondary prompt string. The default value is '> '. 'PS2' is - expanded in the same way as 'PS1' before being displayed. +‘PS2’ + The secondary prompt string. The default value is ‘> ’. ‘PS2’ is + expanded in the same way as ‘PS1’ before being displayed.  File: bash.info, Node: Bash Variables, Prev: Bourne Shell Variables, Up: Shell Variables @@ -5339,7 +5345,7 @@ normally treat them specially. variables for controlling the job control facilities (*note Job Control Variables::). -'_' +‘_’ ($_, an underscore.) At shell startup, set to the pathname used to invoke the shell or shell script being executed as passed in the environment or argument list. Subsequently, expands to the last @@ -5349,431 +5355,431 @@ Variables::). command. When checking mail, this parameter holds the name of the mail file. -'BASH' +‘BASH’ The full pathname used to execute the current instance of Bash. -'BASHOPTS' +‘BASHOPTS’ A colon-separated list of enabled shell options. Each word in the - list is a valid argument for the '-s' option to the 'shopt' builtin + list is a valid argument for the ‘-s’ option to the ‘shopt’ builtin command (*note The Shopt Builtin::). The options appearing in - 'BASHOPTS' are those reported as 'on' by 'shopt'. If this variable + ‘BASHOPTS’ are those reported as ‘on’ by ‘shopt’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files. This variable is readonly. -'BASHPID' +‘BASHPID’ Expands to the process ID of the current Bash process. This - differs from '$$' under certain circumstances, such as subshells + differs from ‘$$’ under certain circumstances, such as subshells that do not require Bash to be re-initialized. Assignments to - 'BASHPID' have no effect. If 'BASHPID' is unset, it loses its + ‘BASHPID’ have no effect. If ‘BASHPID’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_ALIASES' +‘BASH_ALIASES’ An associative array variable whose members correspond to the - internal list of aliases as maintained by the 'alias' builtin. + internal list of aliases as maintained by the ‘alias’ builtin. (*note Bourne Shell Builtins::). Elements added to this array appear in the alias list; however, unsetting array elements currently does not cause aliases to be removed from the alias list. - If 'BASH_ALIASES' is unset, it loses its special properties, even + If ‘BASH_ALIASES’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_ARGC' +‘BASH_ARGC’ An array variable whose values are the number of parameters in each frame of the current Bash execution call stack. The number of parameters to the current subroutine (shell function or script - executed with '.' or 'source') is at the top of the stack. When a + executed with ‘.’ or ‘source’) is at the top of the stack. When a subroutine is executed, the number of parameters passed is pushed - onto 'BASH_ARGC'. The shell sets 'BASH_ARGC' only when in extended + onto ‘BASH_ARGC’. The shell sets ‘BASH_ARGC’ only when in extended debugging mode (see *note The Shopt Builtin:: for a description of - the 'extdebug' option to the 'shopt' builtin). Setting 'extdebug' + the ‘extdebug’ option to the ‘shopt’ builtin). Setting ‘extdebug’ after the shell has started to execute a script, or referencing - this variable when 'extdebug' is not set, may result in - inconsistent values. Assignments to 'BASH_ARGC' have no effect, + this variable when ‘extdebug’ is not set, may result in + inconsistent values. Assignments to ‘BASH_ARGC’ have no effect, and it may not be unset. -'BASH_ARGV' +‘BASH_ARGV’ An array variable containing all of the parameters in the current Bash execution call stack. The final parameter of the last subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is executed, - the parameters supplied are pushed onto 'BASH_ARGV'. The shell - sets 'BASH_ARGV' only when in extended debugging mode (see *note - The Shopt Builtin:: for a description of the 'extdebug' option to - the 'shopt' builtin). Setting 'extdebug' after the shell has + the parameters supplied are pushed onto ‘BASH_ARGV’. The shell + sets ‘BASH_ARGV’ only when in extended debugging mode (see *note + The Shopt Builtin:: for a description of the ‘extdebug’ option to + the ‘shopt’ builtin). Setting ‘extdebug’ after the shell has started to execute a script, or referencing this variable when - 'extdebug' is not set, may result in inconsistent values. - Assignments to 'BASH_ARGV' have no effect, and it may not be unset. + ‘extdebug’ is not set, may result in inconsistent values. + Assignments to ‘BASH_ARGV’ have no effect, and it may not be unset. -'BASH_ARGV0' +‘BASH_ARGV0’ When referenced, this variable expands to the name of the shell or - shell script (identical to '$0'; *Note Special Parameters::, for + shell script (identical to ‘$0’; *Note Special Parameters::, for the description of special parameter 0). Assignment to - 'BASH_ARGV0' causes the value assigned to also be assigned to '$0'. - If 'BASH_ARGV0' is unset, it loses its special properties, even if + ‘BASH_ARGV0’ causes the value assigned to also be assigned to ‘$0’. + If ‘BASH_ARGV0’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_CMDS' +‘BASH_CMDS’ An associative array variable whose members correspond to the - internal hash table of commands as maintained by the 'hash' builtin + internal hash table of commands as maintained by the ‘hash’ builtin (*note Bourne Shell Builtins::). Elements added to this array appear in the hash table; however, unsetting array elements currently does not cause command names to be removed from the hash - table. If 'BASH_CMDS' is unset, it loses its special properties, + table. If ‘BASH_CMDS’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_COMMAND' +‘BASH_COMMAND’ The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, in which case it is the command executing at the time of the trap. If - 'BASH_COMMAND' is unset, it loses its special properties, even if + ‘BASH_COMMAND’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_COMPAT' +‘BASH_COMPAT’ The value is used to set the shell's compatibility level. *Note Shell Compatibility Mode::, for a description of the various compatibility levels and their effects. The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) corresponding to the - desired compatibility level. If 'BASH_COMPAT' is unset or set to + desired compatibility level. If ‘BASH_COMPAT’ is unset or set to the empty string, the compatibility level is set to the default for - the current version. If 'BASH_COMPAT' is set to a value that is + the current version. If ‘BASH_COMPAT’ is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level to the default for - the current version. The valid values correspond to the - compatibility levels described below (*note Shell Compatibility + the current version. A subset of the valid values correspond to + the compatibility levels described below (*note Shell Compatibility Mode::). For example, 4.2 and 42 are valid values that correspond - to the 'compat42' 'shopt' option and set the compatibility level to + to the ‘compat42’ ‘shopt’ option and set the compatibility level to 42. The current version is also a valid value. -'BASH_ENV' +‘BASH_ENV’ If this variable is set when Bash is invoked to execute a shell script, its value is expanded and used as the name of a startup file to read before executing the script. *Note Bash Startup Files::. -'BASH_EXECUTION_STRING' - The command argument to the '-c' invocation option. +‘BASH_EXECUTION_STRING’ + The command argument to the ‘-c’ invocation option. -'BASH_LINENO' +‘BASH_LINENO’ An array variable whose members are the line numbers in source - files where each corresponding member of 'FUNCNAME' was invoked. - '${BASH_LINENO[$i]}' is the line number in the source file - ('${BASH_SOURCE[$i+1]}') where '${FUNCNAME[$i]}' was called (or - '${BASH_LINENO[$i-1]}' if referenced within another shell - function). Use 'LINENO' to obtain the current line number. - Assignments to 'BASH_LINENO' have no effect, and it may not be + files where each corresponding member of ‘FUNCNAME’ was invoked. + ‘${BASH_LINENO[$i]}’ is the line number in the source file + (‘${BASH_SOURCE[$i+1]}’) where ‘${FUNCNAME[$i]}’ was called (or + ‘${BASH_LINENO[$i-1]}’ if referenced within another shell + function). Use ‘LINENO’ to obtain the current line number. + Assignments to ‘BASH_LINENO’ have no effect, and it may not be unset. -'BASH_LOADABLES_PATH' +‘BASH_LOADABLES_PATH’ A colon-separated list of directories in which the shell looks for - dynamically loadable builtins specified by the 'enable' command. + dynamically loadable builtins specified by the ‘enable’ command. -'BASH_MONOSECONDS' +‘BASH_MONOSECONDS’ Each time this variable is referenced, it expands to the value returned by the system's monotonic clock, if one is available. If - there is no monotonic clock, this is equivalent to 'EPOCHSECONDS'. - If 'BASH_MONOSECONDS' is unset, it loses its special properties, + there is no monotonic clock, this is equivalent to ‘EPOCHSECONDS’. + If ‘BASH_MONOSECONDS’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_REMATCH' - An array variable whose members are assigned by the '=~' binary - operator to the '[[' conditional command (*note Conditional +‘BASH_REMATCH’ + An array variable whose members are assigned by the ‘=~’ binary + operator to the ‘[[’ conditional command (*note Conditional Constructs::). The element with index 0 is the portion of the string matching the entire regular expression. The element with index N is the portion of the string matching the Nth parenthesized subexpression. -'BASH_SOURCE' +‘BASH_SOURCE’ An array variable whose members are the source filenames where the - corresponding shell function names in the 'FUNCNAME' array variable - are defined. The shell function '${FUNCNAME[$i]}' is defined in - the file '${BASH_SOURCE[$i]}' and called from - '${BASH_SOURCE[$i+1]}' Assignments to 'BASH_SOURCE' have no effect, + corresponding shell function names in the ‘FUNCNAME’ array variable + are defined. The shell function ‘${FUNCNAME[$i]}’ is defined in + the file ‘${BASH_SOURCE[$i]}’ and called from + ‘${BASH_SOURCE[$i+1]}’ Assignments to ‘BASH_SOURCE’ have no effect, and it may not be unset. -'BASH_SUBSHELL' +‘BASH_SUBSHELL’ Incremented by one within each subshell or subshell environment when the shell begins executing in that environment. The initial - value is 0. If 'BASH_SUBSHELL' is unset, it loses its special + value is 0. If ‘BASH_SUBSHELL’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_TRAPSIG' +‘BASH_TRAPSIG’ Set to the signal number corresponding to the trap action being - executed during its execution. See the description of 'trap' + executed during its execution. See the description of ‘trap’ (*note Bourne Shell Builtins::) for information about signal numbers and trap execution. -'BASH_VERSINFO' +‘BASH_VERSINFO’ A readonly array variable (*note Arrays::) whose members hold version information for this instance of Bash. The values assigned to the array members are as follows: - 'BASH_VERSINFO[0]' - The major version number (the "release"). + ‘BASH_VERSINFO[0]’ + The major version number (the “release”). - 'BASH_VERSINFO[1]' - The minor version number (the "version"). + ‘BASH_VERSINFO[1]’ + The minor version number (the “version”). - 'BASH_VERSINFO[2]' + ‘BASH_VERSINFO[2]’ The patch level. - 'BASH_VERSINFO[3]' + ‘BASH_VERSINFO[3]’ The build version. - 'BASH_VERSINFO[4]' - The release status (e.g., 'beta1'). + ‘BASH_VERSINFO[4]’ + The release status (e.g., ‘beta’). - 'BASH_VERSINFO[5]' - The value of 'MACHTYPE'. + ‘BASH_VERSINFO[5]’ + The value of ‘MACHTYPE’. -'BASH_VERSION' +‘BASH_VERSION’ The version number of the current instance of Bash. -'BASH_XTRACEFD' +‘BASH_XTRACEFD’ If set to an integer corresponding to a valid file descriptor, Bash - will write the trace output generated when 'set -x' is enabled to + will write the trace output generated when ‘set -x’ is enabled to that file descriptor. This allows tracing output to be separated from diagnostic and error messages. The file descriptor is closed - when 'BASH_XTRACEFD' is unset or assigned a new value. Unsetting - 'BASH_XTRACEFD' or assigning it the empty string causes the trace + when ‘BASH_XTRACEFD’ is unset or assigned a new value. Unsetting + ‘BASH_XTRACEFD’ or assigning it the empty string causes the trace output to be sent to the standard error. Note that setting - 'BASH_XTRACEFD' to 2 (the standard error file descriptor) and then + ‘BASH_XTRACEFD’ to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed. -'CHILD_MAX' +‘CHILD_MAX’ 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. The minimum value is system-dependent. -'COLUMNS' - Used by the 'select' command to determine the terminal width when - printing selection lists. Automatically set if the 'checkwinsize' +‘COLUMNS’ + Used by the ‘select’ command to determine the terminal width when + printing selection lists. Automatically set if the ‘checkwinsize’ option is enabled (*note The Shopt Builtin::), or in an interactive - shell upon receipt of a 'SIGWINCH'. + shell upon receipt of a ‘SIGWINCH’. -'COMP_CWORD' - An index into '${COMP_WORDS}' of the word containing the current +‘COMP_CWORD’ + An index into ‘${COMP_WORDS}’ of the word containing the current cursor position. This variable is available only in shell functions invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_LINE' +‘COMP_LINE’ The current command line. This variable is available only in shell functions and external commands invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_POINT' +‘COMP_POINT’ The index of the current cursor position relative to the beginning of the current command. If the current cursor position is at the end of the current command, the value of this variable is equal to - '${#COMP_LINE}'. This variable is available only in shell + ‘${#COMP_LINE}’. This variable is available only in shell functions and external commands invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_TYPE' +‘COMP_TYPE’ Set to an integer value corresponding to the type of completion attempted that caused a completion function to be called: , - for normal completion, '?', for listing completions after - successive tabs, '!', for listing alternatives on partial word - completion, '@', to list completions if the word is not unmodified, - or '%', for menu completion. This variable is available only in + for normal completion, ‘?’, for listing completions after + successive tabs, ‘!’, for listing alternatives on partial word + completion, ‘@’, to list completions if the word is not unmodified, + or ‘%’, for menu completion. This variable is available only in shell functions and external commands invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_KEY' +‘COMP_KEY’ The key (or final key of a key sequence) used to invoke the current completion function. -'COMP_WORDBREAKS' +‘COMP_WORDBREAKS’ The set of characters that the Readline library treats as word - separators when performing word completion. If 'COMP_WORDBREAKS' + separators when performing word completion. If ‘COMP_WORDBREAKS’ is unset, it loses its special properties, even if it is subsequently reset. -'COMP_WORDS' +‘COMP_WORDS’ An array variable consisting of the individual words in the current command line. The line is split into words as Readline would split - it, using 'COMP_WORDBREAKS' as described above. This variable is + it, using ‘COMP_WORDBREAKS’ as described above. This variable is available only in shell functions invoked by the programmable completion facilities (*note Programmable Completion::). -'COMPREPLY' +‘COMPREPLY’ An array variable from which Bash reads the possible completions generated by a shell function invoked by the programmable completion facility (*note Programmable Completion::). Each array element contains one possible completion. -'COPROC' +‘COPROC’ An array variable created to hold the file descriptors for output from and input to an unnamed coprocess (*note Coprocesses::). -'DIRSTACK' +‘DIRSTACK’ An array variable containing the current contents of the directory stack. Directories appear in the stack in the order they are - displayed by the 'dirs' builtin. Assigning to members of this + displayed by the ‘dirs’ builtin. Assigning to members of this array variable may be used to modify directories already in the - stack, but the 'pushd' and 'popd' builtins must be used to add and + stack, but the ‘pushd’ and ‘popd’ builtins must be used to add and remove directories. Assignment to this variable will not change - the current directory. If 'DIRSTACK' is unset, it loses its + the current directory. If ‘DIRSTACK’ is unset, it loses its special properties, even if it is subsequently reset. -'EMACS' +‘EMACS’ If Bash finds this variable in the environment when the shell - starts with value 't', it assumes that the shell is running in an + starts with value ‘t’, it assumes that the shell is running in an Emacs shell buffer and disables line editing. -'ENV' - Expanded and executed similarly to 'BASH_ENV' (*note Bash Startup +‘ENV’ + Expanded and executed similarly to ‘BASH_ENV’ (*note Bash Startup Files::) when an interactive shell is invoked in POSIX Mode (*note Bash POSIX Mode::). -'EPOCHREALTIME' +‘EPOCHREALTIME’ Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch as a floating point value with micro-second granularity (see the documentation for the C library - function 'time' for the definition of Epoch). Assignments to - 'EPOCHREALTIME' are ignored. If 'EPOCHREALTIME' is unset, it loses + function ‘time’ for the definition of Epoch). Assignments to + ‘EPOCHREALTIME’ are ignored. If ‘EPOCHREALTIME’ is unset, it loses its special properties, even if it is subsequently reset. -'EPOCHSECONDS' +‘EPOCHSECONDS’ Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch (see the documentation for the C - library function 'time' for the definition of Epoch). Assignments - to 'EPOCHSECONDS' are ignored. If 'EPOCHSECONDS' is unset, it + library function ‘time’ for the definition of Epoch). Assignments + to ‘EPOCHSECONDS’ are ignored. If ‘EPOCHSECONDS’ is unset, it loses its special properties, even if it is subsequently reset. -'EUID' +‘EUID’ The numeric effective user id of the current user. This variable is readonly. -'EXECIGNORE' +‘EXECIGNORE’ A colon-separated list of shell patterns (*note Pattern Matching::) defining the list of filenames to be ignored by command search - using 'PATH'. Files whose full pathnames match one of these + using ‘PATH’. Files whose full pathnames match one of these patterns are not considered executable files for the purposes of - completion and command execution via 'PATH' lookup. This does not - affect the behavior of the '[', 'test', and '[[' commands. Full + completion and command execution via ‘PATH’ lookup. This does not + affect the behavior of the ‘[’, ‘test’, and ‘[[’ commands. Full pathnames in the command hash table are not subject to - 'EXECIGNORE'. Use this variable to ignore shared library files + ‘EXECIGNORE’. Use this variable to ignore shared library files that have the executable bit set, but are not executable files. - The pattern matching honors the setting of the 'extglob' shell + The pattern matching honors the setting of the ‘extglob’ shell option. -'FCEDIT' - The editor used as a default by the '-e' option to the 'fc' builtin +‘FCEDIT’ + The editor used as a default by the ‘-e’ option to the ‘fc’ builtin command. -'FIGNORE' +‘FIGNORE’ A colon-separated list of suffixes to ignore when performing filename completion. A filename whose suffix matches one of the - entries in 'FIGNORE' is excluded from the list of matched - filenames. A sample value is '.o:~' + entries in ‘FIGNORE’ is excluded from the list of matched + filenames. A sample value is ‘.o:~’ -'FUNCNAME' +‘FUNCNAME’ An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The - bottom-most element (the one with the highest index) is '"main"'. + bottom-most element (the one with the highest index) is ‘"main"’. This variable exists only when a shell function is executing. - Assignments to 'FUNCNAME' have no effect. If 'FUNCNAME' is unset, + Assignments to ‘FUNCNAME’ have no effect. If ‘FUNCNAME’ is unset, it loses its special properties, even if it is subsequently reset. - This variable can be used with 'BASH_LINENO' and 'BASH_SOURCE'. - Each element of 'FUNCNAME' has corresponding elements in - 'BASH_LINENO' and 'BASH_SOURCE' to describe the call stack. For - instance, '${FUNCNAME[$i]}' was called from the file - '${BASH_SOURCE[$i+1]}' at line number '${BASH_LINENO[$i]}'. The - 'caller' builtin displays the current call stack using this + This variable can be used with ‘BASH_LINENO’ and ‘BASH_SOURCE’. + Each element of ‘FUNCNAME’ has corresponding elements in + ‘BASH_LINENO’ and ‘BASH_SOURCE’ to describe the call stack. For + instance, ‘${FUNCNAME[$i]}’ was called from the file + ‘${BASH_SOURCE[$i+1]}’ at line number ‘${BASH_LINENO[$i]}’. The + ‘caller’ builtin displays the current call stack using this information. -'FUNCNEST' +‘FUNCNEST’ If set to a numeric value greater than 0, defines a maximum function nesting level. Function invocations that exceed this nesting level will cause the current command to abort. -'GLOBIGNORE' +‘GLOBIGNORE’ A colon-separated list of patterns defining the set of file names to be ignored by filename expansion. If a file name matched by a filename expansion pattern also matches one of the patterns in - 'GLOBIGNORE', it is removed from the list of matches. The pattern - matching honors the setting of the 'extglob' shell option. + ‘GLOBIGNORE’, it is removed from the list of matches. The pattern + matching honors the setting of the ‘extglob’ shell option. -'GLOBSORT' +‘GLOBSORT’ Control how the results of filename expansion are sorted. The value of this variable specifies the sort criteria and sort order for the results of filename expansion. If this variable is unset or set to the null string, filename expansion uses the historical behavior of sorting by name. If set, a valid value begins with an - optional '+', which is ignored, or '-', which reverses the sort + optional ‘+’, which is ignored, or ‘-’, which reverses the sort order from ascending to descending, followed by a sort specifier. - The valid sort specifiers are 'name', 'size', 'mtime', 'atime', - 'ctime', and 'blocks', which sort the files on name, file size, + The valid sort specifiers are ‘name’, ‘size’, ‘mtime’, ‘atime’, + ‘ctime’, and ‘blocks’, which sort the files on name, file size, modification time, access time, inode change time, and number of blocks, respectively. - For example, a value of '-mtime' sorts the results in descending + For example, a value of ‘-mtime’ sorts the results in descending order by modification time (newest first). - A sort specifier of 'nosort' disables sorting completely; the + A sort specifier of ‘nosort’ disables sorting completely; the results are returned in the order they are read from the file system,. If the sort specifier is missing, it defaults to NAME, so a value - of '+' is equivalent to the null string, and a value of '-' sorts + 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. -'GROUPS' +‘GROUPS’ An array variable containing the list of groups of which the - current user is a member. Assignments to 'GROUPS' have no effect. - If 'GROUPS' is unset, it loses its special properties, even if it + current user is a member. Assignments to ‘GROUPS’ have no effect. + If ‘GROUPS’ is unset, it loses its special properties, even if it is subsequently reset. -'histchars' +‘histchars’ Up to three characters which control history expansion, quick substitution, and tokenization (*note History Interaction::). The - first character is the "history expansion" character, that is, the + first character is the “history expansion” character, that is, the character which signifies the start of a history expansion, - normally '!'. The second character is the character which + normally ‘!’. The second character is the character which signifies "quick substitution" when seen as the first character on - a line, normally '^'. The optional third character is the + a line, normally ‘^’. 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 '#'. + comment when found as the first character of a word, usually ‘#’. The history comment character causes history substitution to be skipped 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' +‘HISTCMD’ The history number, or index in the history list, of the current - command. Assignments to 'HISTCMD' are ignored. If 'HISTCMD' is + command. Assignments to ‘HISTCMD’ are ignored. If ‘HISTCMD’ is unset, it loses its special properties, even if it is subsequently reset. -'HISTCONTROL' +‘HISTCONTROL’ A colon-separated list of values controlling how commands are saved - on the history list. If the list of values includes 'ignorespace', + on the history list. If the list of values includes ‘ignorespace’, lines which begin with a space character are not saved in the - history list. A value of 'ignoredups' causes lines which match the - previous history entry to not be saved. A value of 'ignoreboth' is - shorthand for 'ignorespace' and 'ignoredups'. A value of - 'erasedups' causes all previous lines matching the current line to + history list. A value of ‘ignoredups’ causes lines which match the + previous history entry to not be saved. A value of ‘ignoreboth’ is + shorthand for ‘ignorespace’ and ‘ignoredups’. A value of + ‘erasedups’ 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 'HISTCONTROL' is unset, + value not in the above list is ignored. If ‘HISTCONTROL’ is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of - 'HISTIGNORE'. The second and subsequent lines of a multi-line + ‘HISTIGNORE’. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history - regardless of the value of 'HISTCONTROL'. + regardless of the value of ‘HISTCONTROL’. -'HISTFILE' +‘HISTFILE’ The name of the file to which the command history is saved. Bash - assigns a default value of '~/.bash_history'. If 'HISTFILE' is + assigns a default value of ‘~/.bash_history’. If ‘HISTFILE’ is unset or null, the command history is not saved when a shell exits. -'HISTFILESIZE' +‘HISTFILESIZE’ The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if necessary, to contain no more than that number of lines by @@ -5781,287 +5787,288 @@ Variables::). this size after writing it when a shell exits. If the value is 0, the history file is truncated to zero size. Non-numeric values and numeric values less than zero inhibit truncation. The shell sets - the default value to the value of 'HISTSIZE' after reading any + the default value to the value of ‘HISTSIZE’ after reading any startup files. -'HISTIGNORE' +‘HISTIGNORE’ A colon-separated list of patterns used to decide which command lines should be saved on the history list. Each pattern is anchored at the beginning of the line and must match the complete - line (no implicit '*' is appended). Each pattern is tested against - the line after the checks specified by 'HISTCONTROL' are applied. - In addition to the normal shell pattern matching characters, '&' - matches the previous history line. '&' may be escaped using a - backslash; the backslash is removed before attempting a match. The - second and subsequent lines of a multi-line compound command are - not tested, and are added to the history regardless of the value of - 'HISTIGNORE'. The pattern matching honors the setting of the - 'extglob' shell option. - - 'HISTIGNORE' subsumes the function of 'HISTCONTROL'. A pattern of - '&' is identical to 'ignoredups', and a pattern of '[ ]*' is - identical to 'ignorespace'. Combining these two patterns, + line (Bash will not implicitly append a ‘*’). Each pattern is + tested against the line after the checks specified by ‘HISTCONTROL’ + are applied. In addition to the normal shell pattern matching + characters, ‘&’ matches the previous history line. ‘&’ may be + escaped using a backslash; the backslash is removed before + attempting a match. The second and subsequent lines of a + multi-line compound command are not tested, and are added to the + history regardless of the value of ‘HISTIGNORE’. The pattern + matching honors the setting of the ‘extglob’ shell option. + + ‘HISTIGNORE’ subsumes the function of ‘HISTCONTROL’. A pattern of + ‘&’ is identical to ‘ignoredups’, and a pattern of ‘[ ]*’ is + identical to ‘ignorespace’. Combining these two patterns, separating them with a colon, provides the functionality of - 'ignoreboth'. + ‘ignoreboth’. -'HISTSIZE' +‘HISTSIZE’ The maximum number of commands to remember on the history list. If the value is 0, commands are not saved in the history list. Numeric values less than zero result in every command being saved on the history list (there is no limit). The shell sets the default value to 500 after reading any startup files. -'HISTTIMEFORMAT' +‘HISTTIMEFORMAT’ If this variable is set and not null, its value is used as a format - string for 'strftime' to print the time stamp associated with each - history entry displayed by the 'history' builtin. If this variable - is set, time stamps are written to the history file so they may be - preserved across shell sessions. This uses the history comment - character to distinguish timestamps from other history lines. - -'HOSTFILE' - Contains the name of a file in the same format as '/etc/hosts' that + string for ‘strftime’(3) to print the time stamp associated with + each history entry displayed by the ‘history’ builtin. If this + variable is set, time stamps are written to the history file so + they may be preserved across shell sessions. This uses the history + comment character to distinguish timestamps from other history + lines. + +‘HOSTFILE’ + Contains the name of a file in the same format as ‘/etc/hosts’ that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, Bash adds the contents of the new file - to the existing list. If 'HOSTFILE' is set, but has no value, or - does not name a readable file, Bash attempts to read '/etc/hosts' + to the existing list. If ‘HOSTFILE’ is set, but has no value, or + does not name a readable file, Bash attempts to read ‘/etc/hosts’ to obtain the list of possible hostname completions. When - 'HOSTFILE' is unset, the hostname list is cleared. + ‘HOSTFILE’ is unset, the hostname list is cleared. -'HOSTNAME' +‘HOSTNAME’ The name of the current host. -'HOSTTYPE' +‘HOSTTYPE’ A string describing the machine Bash is running on. -'IGNOREEOF' - Controls the action of the shell on receipt of an 'EOF' character +‘IGNOREEOF’ + Controls the action of the shell on receipt of an ‘EOF’ character as the sole input. If set, the value denotes the number of - consecutive 'EOF' characters that can be read as the first + consecutive ‘EOF’ characters that can be read as the first character on an input line before the shell will exit. If the variable exists but does not have a numeric value, or has no value, - then the default is 10. If the variable does not exist, then 'EOF' + then the default is 10. If the variable does not exist, then ‘EOF’ signifies the end of input to the shell. This is only in effect for interactive shells. -'INPUTRC' +‘INPUTRC’ The name of the Readline initialization file, overriding the - default of '~/.inputrc'. + default of ‘~/.inputrc’. -'INSIDE_EMACS' +‘INSIDE_EMACS’ If Bash finds this variable in the environment when the shell starts, it assumes that the shell is running in an Emacs shell buffer and may disable line editing depending on the value of - 'TERM'. + ‘TERM’. -'LANG' +‘LANG’ Used to determine the locale category for any category not - specifically selected with a variable starting with 'LC_'. + specifically selected with a variable starting with ‘LC_’. -'LC_ALL' - This variable overrides the value of 'LANG' and any other 'LC_' +‘LC_ALL’ + This variable overrides the value of ‘LANG’ and any other ‘LC_’ variable specifying a locale category. -'LC_COLLATE' +‘LC_COLLATE’ This variable determines the collation order used when sorting the results of filename expansion, and determines the behavior of range expressions, equivalence classes, and collating sequences within filename expansion and pattern matching (*note Filename Expansion::). -'LC_CTYPE' +‘LC_CTYPE’ This variable determines the interpretation of characters and the behavior of character classes within filename expansion and pattern matching (*note Filename Expansion::). -'LC_MESSAGES' +‘LC_MESSAGES’ This variable determines the locale used to translate double-quoted - strings preceded by a '$' (*note Locale Translation::). + strings preceded by a ‘$’ (*note Locale Translation::). -'LC_NUMERIC' +‘LC_NUMERIC’ This variable determines the locale category used for number formatting. -'LC_TIME' +‘LC_TIME’ This variable determines the locale category used for data and time formatting. -'LINENO' +‘LINENO’ The line number in the script or shell function currently - executing. If 'LINENO' is unset, it loses its special properties, + executing. If ‘LINENO’ is unset, it loses its special properties, even if it is subsequently reset. -'LINES' - Used by the 'select' command to determine the column length for - printing selection lists. Automatically set if the 'checkwinsize' +‘LINES’ + Used by the ‘select’ command to determine the column length for + printing selection lists. Automatically set if the ‘checkwinsize’ option is enabled (*note The Shopt Builtin::), or in an interactive - shell upon receipt of a 'SIGWINCH'. + shell upon receipt of a ‘SIGWINCH’. -'MACHTYPE' +‘MACHTYPE’ A string that fully describes the system type on which Bash is executing, in the standard GNU CPU-COMPANY-SYSTEM format. -'MAILCHECK' +‘MAILCHECK’ How often (in seconds) that the shell should check for mail in the - files specified in the 'MAILPATH' or 'MAIL' variables. The default + files specified in the ‘MAILPATH’ or ‘MAIL’ variables. The default 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. -'MAPFILE' - An array variable created to hold the text read by the 'mapfile' +‘MAPFILE’ + An array variable created to hold the text read by the ‘mapfile’ builtin when no variable name is supplied. -'OLDPWD' - The previous working directory as set by the 'cd' builtin. +‘OLDPWD’ + The previous working directory as set by the ‘cd’ builtin. -'OPTERR' +‘OPTERR’ If set to the value 1, Bash displays error messages generated by - the 'getopts' builtin command. + the ‘getopts’ builtin command. -'OSTYPE' +‘OSTYPE’ A string describing the operating system Bash is running on. -'PIPESTATUS' +‘PIPESTATUS’ An array variable (*note Arrays::) containing a list of exit status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command). -'POSIXLY_CORRECT' +‘POSIXLY_CORRECT’ If this variable is in the environment when Bash starts, the shell enters POSIX mode (*note Bash POSIX Mode::) before reading the - startup files, as if the '--posix' invocation option had been + startup files, as if the ‘--posix’ invocation option had been supplied. If it is set while the shell is running, Bash 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. -'PPID' +‘PPID’ The process ID of the shell's parent process. This variable is readonly. -'PROMPT_COMMAND' +‘PROMPT_COMMAND’ If this variable is set, and is an array, the value of each set element is interpreted as a command to execute before printing the - primary prompt ('$PS1'). If this is set but not an array variable, + primary prompt (‘$PS1’). If this is set but not an array variable, its value is used as a command to execute instead. -'PROMPT_DIRTRIM' +‘PROMPT_DIRTRIM’ If set to a number greater than zero, the value is used as the number of trailing directory components to retain when expanding - the '\w' and '\W' prompt string escapes (*note Controlling the + the ‘\w’ and ‘\W’ prompt string escapes (*note Controlling the Prompt::). Characters removed are replaced with an ellipsis. -'PS0' - The value of this parameter is expanded like 'PS1' and displayed by +‘PS0’ + The value of this parameter is expanded like ‘PS1’ and displayed by interactive shells after reading a command and before the command is executed. -'PS3' - The value of this variable is used as the prompt for the 'select' - command. If this variable is not set, the 'select' command prompts - with '#? ' +‘PS3’ + The value of this variable is used as the prompt for the ‘select’ + command. If this variable is not set, the ‘select’ command prompts + with ‘#? ’ -'PS4' - The value of this parameter is expanded like 'PS1' and the expanded +‘PS4’ + The value of this parameter is expanded like ‘PS1’ and the expanded value is the prompt printed before the command line is echoed when - the '-x' option is set (*note The Set Builtin::). The first + the ‘-x’ option is set (*note The Set Builtin::). The first character of the expanded value is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default - is '+ '. + is ‘+ ’. -'PWD' - The current working directory as set by the 'cd' builtin. +‘PWD’ + The current working directory as set by the ‘cd’ builtin. -'RANDOM' +‘RANDOM’ Each time this parameter is referenced, it expands to a random integer between 0 and 32767. Assigning a value to this variable - seeds the random number generator. If 'RANDOM' is unset, it loses + seeds the random number generator. If ‘RANDOM’ is unset, it loses its special properties, even if it is subsequently reset. -'READLINE_ARGUMENT' +‘READLINE_ARGUMENT’ Any numeric argument given to a Readline command that was defined - using 'bind -x' (*note Bash Builtins:: when it was invoked. + using ‘bind -x’ (*note Bash Builtins:: when it was invoked. -'READLINE_LINE' - The contents of the Readline line buffer, for use with 'bind -x' +‘READLINE_LINE’ + The contents of the Readline line buffer, for use with ‘bind -x’ (*note Bash Builtins::). -'READLINE_MARK' - The position of the "mark" (saved insertion point) in the Readline - line buffer, for use with 'bind -x' (*note Bash Builtins::). The +‘READLINE_MARK’ + The position of the “mark” (saved insertion point) in the Readline + line buffer, for use with ‘bind -x’ (*note Bash Builtins::). The characters between the insertion point and the mark are often - called the "region". + called the “region”. -'READLINE_POINT' +‘READLINE_POINT’ The position of the insertion point in the Readline line buffer, - for use with 'bind -x' (*note Bash Builtins::). + for use with ‘bind -x’ (*note Bash Builtins::). -'REPLY' - The default variable for the 'read' builtin. +‘REPLY’ + The default variable for the ‘read’ builtin. -'SECONDS' +‘SECONDS’ This variable expands to the number of seconds since the shell was started. Assignment to this variable resets the count to the value assigned, and the expanded value becomes the value assigned plus the number of seconds since the assignment. The number of seconds at shell invocation and the current time are always determined by - querying the system clock. If 'SECONDS' is unset, it loses its + querying the system clock. If ‘SECONDS’ is unset, it loses its special properties, even if it is subsequently reset. -'SHELL' +‘SHELL’ This environment variable expands to the full pathname to the shell. If it is not set when the shell starts, Bash assigns to it the full pathname of the current user's login shell. -'SHELLOPTS' +‘SHELLOPTS’ A colon-separated list of enabled shell options. Each word in the - list is a valid argument for the '-o' option to the 'set' builtin + list is a valid argument for the ‘-o’ option to the ‘set’ builtin command (*note The Set Builtin::). The options appearing in - 'SHELLOPTS' are those reported as 'on' by 'set -o'. If this + ‘SHELLOPTS’ are those reported as ‘on’ by ‘set -o’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files. This variable is readonly. -'SHLVL' +‘SHLVL’ Incremented by one each time a new instance of Bash is started. This is intended to be a count of how deeply your Bash shells are nested. -'SRANDOM' +‘SRANDOM’ This variable expands to a 32-bit pseudo-random number each time it is referenced. The random number generator is not linear on - systems that support '/dev/urandom' or 'arc4random', so each + systems that support ‘/dev/urandom’ or ‘arc4random’, so each returned number has no relationship to the numbers preceding it. The random number generator cannot be seeded, so assignments to - this variable have no effect. If 'SRANDOM' is unset, it loses its + this variable have no effect. If ‘SRANDOM’ is unset, it loses its special properties, even if it is subsequently reset. -'TIMEFORMAT' +‘TIMEFORMAT’ The value of this parameter is used as a format string specifying - how the timing information for pipelines prefixed with the 'time' - reserved word should be displayed. The '%' character introduces an + how the timing information for pipelines prefixed with the ‘time’ + reserved word should be displayed. The ‘%’ character introduces an escape sequence that is expanded to a time value or other information. The escape sequences and their meanings are as - follows; the braces denote optional portions. + follows; the brackets denote optional portions. - '%%' - A literal '%'. + ‘%%’ + A literal ‘%’. - '%[P][l]R' + ‘%[P][l]R’ The elapsed time in seconds. - '%[P][l]U' + ‘%[P][l]U’ The number of CPU seconds spent in user mode. - '%[P][l]S' + ‘%[P][l]S’ The number of CPU seconds spent in system mode. - '%P' + ‘%P’ The CPU percentage, computed as (%U + %S) / %R. The optional P is a digit specifying the precision, the number of @@ -6070,7 +6077,7 @@ Variables::). the decimal point may be specified; values of P greater than 6 are changed to 6. If P is not specified, the value 3 is used. - The optional 'l' specifies a longer format, including minutes, of + The optional ‘l’ specifies a longer format, including minutes, of the form MMmSS.FFs. The value of P determines whether or not the fraction is included. @@ -6079,11 +6086,11 @@ Variables::). If the value is null, Bash does not display any timing information. A trailing newline is added when the format string is displayed. -'TMOUT' - If set to a value greater than zero, 'TMOUT' is treated as the - default timeout for the 'read' builtin (*note Bash Builtins::). - The 'select' command (*note Conditional Constructs::) terminates if - input does not arrive after 'TMOUT' seconds when input is coming +‘TMOUT’ + If set to a value greater than zero, ‘TMOUT’ is treated as the + default timeout for the ‘read’ builtin (*note Bash Builtins::). + The ‘select’ command (*note Conditional Constructs::) terminates if + input does not arrive after ‘TMOUT’ seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of @@ -6091,11 +6098,11 @@ Variables::). prompt. Bash terminates after waiting for that number of seconds if a complete line of input does not arrive. -'TMPDIR' +‘TMPDIR’ If set, Bash uses its value as the name of a directory in which Bash creates temporary files for the shell's use. -'UID' +‘UID’ The numeric real user id of the current user. This variable is readonly. @@ -6114,7 +6121,7 @@ This chapter describes features unique to Bash. * Bash Startup Files:: When and how Bash executes scripts. * Interactive Shells:: What an interactive shell is. * Bash Conditional Expressions:: Primitives used in composing expressions for - the 'test' builtin. + the ‘test’ builtin. * Shell Arithmetic:: Arithmetic on shell variables. * Aliases:: Substituting one command for another. * Arrays:: Array Variables. @@ -6139,139 +6146,139 @@ File: bash.info, Node: Invoking Bash, Next: Bash Startup Files, Up: Bash Feat bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...] - All of the single-character options used with the 'set' builtin + All of the single-character options used with the ‘set’ builtin (*note The Set Builtin::) can be used as options when the shell is invoked. In addition, there are several multi-character options that you can use. These options must appear on the command line before the single-character options to be recognized. -'--debugger' +‘--debugger’ Arrange for the debugger profile to be executed before the shell starts. Turns on extended debugging mode (see *note The Shopt - Builtin:: for a description of the 'extdebug' option to the 'shopt' + Builtin:: for a description of the ‘extdebug’ option to the ‘shopt’ builtin). -'--dump-po-strings' - A list of all double-quoted strings preceded by '$' is printed on - the standard output in the GNU 'gettext' PO (portable object) file - format. Equivalent to '-D' except for the output format. +‘--dump-po-strings’ + A list of all double-quoted strings preceded by ‘$’ is printed on + the standard output in the GNU ‘gettext’ PO (portable object) file + format. Equivalent to ‘-D’ except for the output format. -'--dump-strings' - Equivalent to '-D'. +‘--dump-strings’ + Equivalent to ‘-D’. -'--help' +‘--help’ Display a usage message on standard output and exit successfully. -'--init-file FILENAME' -'--rcfile FILENAME' - Execute commands from FILENAME (instead of '~/.bashrc') in an +‘--init-file FILENAME’ +‘--rcfile FILENAME’ + Execute commands from FILENAME (instead of ‘~/.bashrc’) in an interactive shell. -'--login' - Equivalent to '-l'. +‘--login’ + Equivalent to ‘-l’. -'--noediting' +‘--noediting’ Do not use the GNU Readline library (*note Command Line Editing::) to read command lines when the shell is interactive. -'--noprofile' - Don't load the system-wide startup file '/etc/profile' or any of - the personal initialization files '~/.bash_profile', - '~/.bash_login', or '~/.profile' when Bash is invoked as a login +‘--noprofile’ + Don't load the system-wide startup file ‘/etc/profile’ or any of + the personal initialization files ‘~/.bash_profile’, + ‘~/.bash_login’, or ‘~/.profile’ when Bash is invoked as a login shell. -'--norc' - Don't read the '~/.bashrc' initialization file in an interactive - shell. This is on by default if the shell is invoked as 'sh'. +‘--norc’ + Don't read the ‘~/.bashrc’ initialization file in an interactive + shell. This is on by default if the shell is invoked as ‘sh’. -'--posix' +‘--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. -'--restricted' - Equivalent to '-r'. Make the shell a restricted shell (*note The +‘--restricted’ + Equivalent to ‘-r’. Make the shell a restricted shell (*note The Restricted Shell::). -'--verbose' - Equivalent to '-v'. Print shell input lines as they're read. +‘--verbose’ + Equivalent to ‘-v’. Print shell input lines as they're read. -'--version' +‘--version’ Show version information for this instance of Bash on the standard output and exit successfully. There are several single-character options that may be supplied at -invocation which are not available with the 'set' builtin. +invocation which are not available with the ‘set’ builtin. -'-c' +‘-c’ Read and execute commands from the first non-option argument COMMAND_STRING, then exit. If there are arguments after the - COMMAND_STRING, the first argument is assigned to '$0' and any + COMMAND_STRING, the first argument is assigned to ‘$0’ and any remaining arguments are assigned to the positional parameters. The - assignment to '$0' sets the name of the shell, which is used in + assignment to ‘$0’ sets the name of the shell, which is used in warning and error messages. -'-i' +‘-i’ Force the shell to run interactively. Interactive shells are described in *note Interactive Shells::. -'-l' +‘-l’ Make this shell act as if it had been directly invoked by login. When the shell is interactive, this is equivalent to starting a - login shell with 'exec -l bash'. When the shell is not - interactive, the login shell startup files will be executed. 'exec - bash -l' or 'exec bash --login' will replace the current shell with + login shell with ‘exec -l bash’. When the shell is not + interactive, the login shell startup files will be executed. ‘exec + bash -l’ or ‘exec bash --login’ will replace the current shell with a Bash login shell. *Note Bash Startup Files::, for a description of the special behavior of a login shell. -'-r' +‘-r’ Make the shell a restricted shell (*note The Restricted Shell::). -'-s' +‘-s’ If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell or when reading input through a pipe. -'-D' - A list of all double-quoted strings preceded by '$' is printed on +‘-D’ + A list of all double-quoted strings preceded by ‘$’ is printed on the standard output. These are the strings that are subject to - language translation when the current locale is not 'C' or 'POSIX' - (*note Locale Translation::). This implies the '-n' option; no + language translation when the current locale is not ‘C’ or ‘POSIX’ + (*note Locale Translation::). This implies the ‘-n’ option; no commands will be executed. -'[-+]O [SHOPT_OPTION]' - SHOPT_OPTION is one of the shell options accepted by the 'shopt' +‘[-+]O [SHOPT_OPTION]’ + SHOPT_OPTION is one of the shell options accepted by the ‘shopt’ builtin (*note The Shopt Builtin::). If SHOPT_OPTION is present, - '-O' sets the value of that option; '+O' unsets it. If + ‘-O’ sets the value of that option; ‘+O’ unsets it. If SHOPT_OPTION is not supplied, the names and values of the shell - options accepted by 'shopt' are printed on the standard output. If - the invocation option is '+O', the output is displayed in a format + options accepted by ‘shopt’ are printed on the standard output. If + the invocation option is ‘+O’, 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 +‘--’ + A ‘--’ signals the end of options and disables further option + processing. Any arguments after the ‘--’ are treated as a shell script filename (*note Shell Scripts::) and arguments passed to that script. -'-' - Equivalent to '--'. +‘-’ + Equivalent to ‘--’. - A _login_ shell is one whose first character of argument zero is '-', -or one invoked with the '--login' option. + 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, -unless '-s' is specified, without specifying the '-c' option, and whose +unless ‘-s’ is specified, without specifying the ‘-c’ option, and whose input and output are both connected to terminals (as determined by -'isatty(3)'), or one started with the '-i' option. *Note Interactive +‘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 + 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 +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 @@ -6290,32 +6297,32 @@ Tilde Expansion::). Interactive shells are described in *note Interactive Shells::. -Invoked as an interactive login shell, or with '--login' +Invoked as an interactive login shell, or with ‘--login’ ........................................................ When Bash is invoked as an interactive login shell, or as a -non-interactive shell with the '--login' option, it first reads and -executes commands from the file '/etc/profile', if that file exists. -After reading that file, it looks for '~/.bash_profile', -'~/.bash_login', and '~/.profile', in that order, and reads and executes +non-interactive shell with the ‘--login’ option, it first reads and +executes commands from the file ‘/etc/profile’, if that file exists. +After reading that file, it looks for ‘~/.bash_profile’, +‘~/.bash_login’, and ‘~/.profile’, in that order, and reads and executes commands from the first one that exists and is readable. The -'--noprofile' option may be used when the shell is started to inhibit +‘--noprofile’ 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 'exit' builtin command, Bash reads and executes -commands from the file '~/.bash_logout', if it exists. +shell executes the ‘exit’ builtin command, Bash reads and executes +commands from the file ‘~/.bash_logout’, if it exists. Invoked as an interactive non-login shell ......................................... When an interactive shell that is not a login shell is started, Bash -reads and executes commands from '~/.bashrc', if that file exists. This -may be inhibited by using the '--norc' option. The '--rcfile FILE' +reads and executes commands from ‘~/.bashrc’, if that file exists. This +may be inhibited by using the ‘--norc’ option. The ‘--rcfile FILE’ option will force Bash to read and execute commands from FILE instead of -'~/.bashrc'. +‘~/.bashrc’. - So, typically, your '~/.bash_profile' contains the line + So, typically, your ‘~/.bash_profile’ contains the line if [ -f ~/.bashrc ]; then . ~/.bashrc; fi after (or before) any login-specific initializations. @@ -6323,46 +6330,46 @@ Invoked non-interactively ......................... When Bash is started non-interactively, to run a shell script, for -example, it looks for the variable 'BASH_ENV' in the environment, +example, it looks for the variable ‘BASH_ENV’ 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. Bash behaves as if the following command were executed: if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi -but the value of the 'PATH' variable is not used to search for the +but the value of the ‘PATH’ variable is not used to search for the filename. As noted above, if a non-interactive shell is invoked with the -'--login' option, Bash attempts to read and execute commands from the +‘--login’ option, Bash attempts to read and execute commands from the login shell startup files. -Invoked with name 'sh' +Invoked with name ‘sh’ ...................... -If Bash is invoked with the name 'sh', it tries to mimic the startup -behavior of historical versions of 'sh' as closely as possible, while +If Bash is invoked with the name ‘sh’, it tries to mimic the startup +behavior of historical versions of ‘sh’ as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or as a non-interactive -shell with the '--login' option, it first attempts to read and execute -commands from '/etc/profile' and '~/.profile', in that order. The -'--noprofile' option may be used to inhibit this behavior. When invoked -as an interactive shell with the name 'sh', Bash looks for the variable -'ENV', expands its value if it is defined, and uses the expanded value +shell with the ‘--login’ option, it first attempts to read and execute +commands from ‘/etc/profile’ and ‘~/.profile’, in that order. The +‘--noprofile’ option may be used to inhibit this behavior. When invoked +as an interactive shell with the name ‘sh’, Bash looks for the variable +‘ENV’, 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 -'sh' does not attempt to read and execute commands from any other -startup files, the '--rcfile' option has no effect. A non-interactive -shell invoked with the name 'sh' does not attempt to read any other +‘sh’ does not attempt to read and execute commands from any other +startup files, the ‘--rcfile’ option has no effect. A non-interactive +shell invoked with the name ‘sh’ does not attempt to read any other startup files. - When invoked as 'sh', Bash enters POSIX mode after the startup files + When invoked as ‘sh’, Bash enters POSIX mode after the startup files are read. Invoked in POSIX mode ..................... -When Bash is started in POSIX mode, as with the '--posix' command line +When Bash is started in POSIX mode, as with the ‘--posix’ command line option, it follows the POSIX standard for startup files. In this mode, -interactive shells expand the 'ENV' variable and commands are read and +interactive shells expand the ‘ENV’ variable and commands are read and executed from the file whose name is the expanded value. No other startup files are read. @@ -6371,12 +6378,12 @@ Invoked by remote shell daemon Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the historical -remote shell daemon, usually 'rshd', or the secure shell daemon 'sshd'. +remote shell daemon, usually ‘rshd’, or the secure shell daemon ‘sshd’. If Bash determines it is being run non-interactively in this fashion, it -reads and executes commands from '~/.bashrc', if that file exists and is -readable. It will not do this if invoked as 'sh'. The '--norc' option -may be used to inhibit this behavior, and the '--rcfile' option may be -used to force another file to be read, but neither 'rshd' nor 'sshd' +reads and executes commands from ‘~/.bashrc’, if that file exists and is +readable. It will not do this if invoked as ‘sh’. The ‘--norc’ option +may be used to inhibit this behavior, and the ‘--rcfile’ option may be +used to force another file to be read, but neither ‘rshd’ nor ‘sshd’ generally invoke the shell with those options or allow them to be specified. @@ -6384,11 +6391,11 @@ Invoked with unequal effective and real UID/GIDs ................................................ If Bash is started with the effective user (group) id not equal to the -real user (group) id, and the '-p' option is not supplied, no startup +real user (group) id, and the ‘-p’ option is not supplied, no startup files are read, shell functions are not inherited from the environment, -the 'SHELLOPTS', 'BASHOPTS', 'CDPATH', and 'GLOBIGNORE' variables, if +the ‘SHELLOPTS’, ‘BASHOPTS’, ‘CDPATH’, and ‘GLOBIGNORE’ variables, if they appear in the environment, are ignored, and the effective user id -is set to the real user id. If the '-p' option is supplied at +is set to the real user id. If the ‘-p’ option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset. @@ -6411,14 +6418,14 @@ File: bash.info, Node: What is an Interactive Shell?, Next: Is this Shell Inte ----------------------------------- An interactive shell is one started without non-option arguments (unless -'-s' is specified) and without specifying the '-c' option, whose input +‘-s’ is specified) and without specifying the ‘-c’ option, whose input and error output are both connected to terminals (as determined by -'isatty(3)'), or one started with the '-i' option. +‘isatty(3)’), or one started with the ‘-i’ option. An interactive shell generally reads from and writes to a user's terminal. - The '-s' invocation option may be used to set the positional + The ‘-s’ invocation option may be used to set the positional parameters when an interactive shell is started.  @@ -6428,15 +6435,15 @@ File: bash.info, Node: Is this Shell Interactive?, Next: Interactive Shell Beh -------------------------------- To determine within a startup script whether or not Bash is running -interactively, test the value of the '-' special parameter. It contains -'i' when the shell is interactive. For example: +interactively, test the value of the ‘-’ special parameter. It contains +‘i’ when the shell is interactive. For example: case "$-" in *i*) echo This shell is interactive ;; *) echo This shell is not interactive ;; esac - Alternatively, startup scripts may examine the variable 'PS1'; it is + Alternatively, startup scripts may examine the variable ‘PS1’; it is unset in non-interactive shells, and set in interactive shells. Thus: if [ -z "$PS1" ]; then @@ -6459,55 +6466,55 @@ several ways. 2. Job Control (*note Job Control::) is enabled by default. When job control is in effect, Bash ignores the keyboard-generated job - control signals 'SIGTTIN', 'SIGTTOU', and 'SIGTSTP'. + control signals ‘SIGTTIN’, ‘SIGTTOU’, and ‘SIGTSTP’. - 3. Bash expands and displays 'PS1' before reading the first line of a - command, and expands and displays 'PS2' before reading the second + 3. Bash expands and displays ‘PS1’ before reading the first line of a + command, and expands and displays ‘PS2’ before reading the second and subsequent lines of a multi-line command. Bash expands and - displays 'PS0' after it reads a command but before executing it. + displays ‘PS0’ after it reads a command but before executing it. See *note Controlling the Prompt::, for a complete list of prompt string escape sequences. 4. Bash executes the values of the set elements of the - 'PROMPT_COMMAND' array variable as commands before printing the - primary prompt, '$PS1' (*note Bash Variables::). + ‘PROMPT_COMMAND’ array variable as commands before printing the + primary prompt, ‘$PS1’ (*note Bash Variables::). 5. Readline (*note Command Line Editing::) is used to read commands from the user's terminal. - 6. Bash inspects the value of the 'ignoreeof' option to 'set -o' - instead of exiting immediately when it receives an 'EOF' on its + 6. Bash inspects the value of the ‘ignoreeof’ option to ‘set -o’ + instead of exiting immediately when it receives an ‘EOF’ on its standard input when reading a command (*note The Set Builtin::). 7. Command history (*note Bash History Facilities::) and history expansion (*note History Interaction::) are enabled by default. - Bash will save the command history to the file named by '$HISTFILE' + Bash will save the command history to the file named by ‘$HISTFILE’ when a shell with history enabled exits. 8. Alias expansion (*note Aliases::) is performed by default. - 9. In the absence of any traps, Bash ignores 'SIGTERM' (*note + 9. In the absence of any traps, Bash ignores ‘SIGTERM’ (*note Signals::). - 10. In the absence of any traps, 'SIGINT' is caught and handled (*note - Signals::). 'SIGINT' will interrupt some shell builtins. + 10. In the absence of any traps, ‘SIGINT’ is caught and handled (*note + Signals::). ‘SIGINT’ will interrupt some shell builtins. - 11. An interactive login shell sends a 'SIGHUP' to all jobs on exit if - the 'huponexit' shell option has been enabled (*note Signals::). + 11. An interactive login shell sends a ‘SIGHUP’ to all jobs on exit if + the ‘huponexit’ shell option has been enabled (*note Signals::). - 12. The '-n' invocation option is ignored, and 'set -n' has no effect + 12. The ‘-n’ invocation option is ignored, and ‘set -n’ has no effect (*note The Set Builtin::). 13. Bash will check for mail periodically, depending on the values of - the 'MAIL', 'MAILPATH', and 'MAILCHECK' shell variables (*note Bash + the ‘MAIL’, ‘MAILPATH’, and ‘MAILCHECK’ shell variables (*note Bash Variables::). 14. Expansion errors due to references to unbound shell variables - after 'set -u' has been enabled will not cause the shell to exit + after ‘set -u’ has been enabled will not cause the shell to exit (*note The Set Builtin::). 15. The shell will not exit on expansion errors caused by VAR being - unset or null in '${VAR:?WORD}' expansions (*note Shell Parameter + unset or null in ‘${VAR:?WORD}’ expansions (*note Shell Parameter Expansion::). 16. Redirection errors encountered by shell builtins will not cause @@ -6516,20 +6523,20 @@ several ways. 17. When running in POSIX mode, a special builtin returning an error status will not cause the shell to exit (*note Bash POSIX Mode::). - 18. A failed 'exec' will not cause the shell to exit (*note Bourne + 18. A failed ‘exec’ will not cause the shell to exit (*note Bourne Shell Builtins::). 19. Parser syntax errors will not cause the shell to exit. - 20. If the 'cdspell' shell option is enabled, the shell will attempt - simple spelling correction for directory arguments to the 'cd' - builtin (see the description of the 'cdspell' option to the 'shopt' - builtin in *note The Shopt Builtin::). The 'cdspell' option is + 20. If the ‘cdspell’ shell option is enabled, the shell will attempt + simple spelling correction for directory arguments to the ‘cd’ + builtin (see the description of the ‘cdspell’ option to the ‘shopt’ + builtin in *note The Shopt Builtin::). The ‘cdspell’ option is only effective in interactive shells. - 21. The shell will check the value of the 'TMOUT' variable and exit if + 21. The shell will check the value of the ‘TMOUT’ variable and exit if a command is not read within the specified number of seconds after - printing '$PS1' (*note Bash Variables::). + printing ‘$PS1’ (*note Bash Variables::).  File: bash.info, Node: Bash Conditional Expressions, Next: Shell Arithmetic, Prev: Interactive Shells, Up: Bash Features @@ -6537,9 +6544,9 @@ File: bash.info, Node: Bash Conditional Expressions, Next: Shell Arithmetic, 6.4 Bash Conditional Expressions ================================ -Conditional expressions are used by the '[[' compound command (*note -Conditional Constructs::) and the 'test' and '[' builtin commands (*note -Bourne Shell Builtins::). The 'test' and '[' commands determine their +Conditional expressions are used by the ‘[[’ compound command (*note +Conditional Constructs::) and the ‘test’ and ‘[’ builtin commands (*note +Bourne Shell Builtins::). The ‘test’ and ‘[’ commands determine their behavior based on the number of arguments; see the descriptions of those commands for any other command-specific actions. @@ -6550,137 +6557,137 @@ well. Bash handles several filenames specially when they are used in expressions. If the operating system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with this behavior: If the FILE argument to one of the -primaries is of the form '/dev/fd/N', then file descriptor N is checked. -If the FILE argument to one of the primaries is one of '/dev/stdin', -'/dev/stdout', or '/dev/stderr', file descriptor 0, 1, or 2, +primaries is of the form ‘/dev/fd/N’, then file descriptor N is checked. +If the FILE argument to one of the primaries is one of ‘/dev/stdin’, +‘/dev/stdout’, or ‘/dev/stderr’, file descriptor 0, 1, or 2, respectively, is checked. - When used with '[[', the '<' and '>' operators sort lexicographically -using the current locale. The 'test' command uses ASCII ordering. + When used with ‘[[’, the ‘<’ and ‘>’ operators sort lexicographically +using the current locale. The ‘test’ command uses ASCII ordering. Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself. -'-a FILE' +‘-a FILE’ True if FILE exists. -'-b FILE' +‘-b FILE’ True if FILE exists and is a block special file. -'-c FILE' +‘-c FILE’ True if FILE exists and is a character special file. -'-d FILE' +‘-d FILE’ True if FILE exists and is a directory. -'-e FILE' +‘-e FILE’ True if FILE exists. -'-f FILE' +‘-f FILE’ True if FILE exists and is a regular file. -'-g FILE' +‘-g FILE’ True if FILE exists and its set-group-id bit is set. -'-h FILE' +‘-h FILE’ True if FILE exists and is a symbolic link. -'-k FILE' +‘-k FILE’ True if FILE exists and its "sticky" bit is set. -'-p FILE' +‘-p FILE’ True if FILE exists and is a named pipe (FIFO). -'-r FILE' +‘-r FILE’ True if FILE exists and is readable. -'-s FILE' +‘-s FILE’ True if FILE exists and has a size greater than zero. -'-t FD' +‘-t FD’ True if file descriptor FD is open and refers to a terminal. -'-u FILE' +‘-u FILE’ True if FILE exists and its set-user-id bit is set. -'-w FILE' +‘-w FILE’ True if FILE exists and is writable. -'-x FILE' +‘-x FILE’ True if FILE exists and is executable. -'-G FILE' +‘-G FILE’ True if FILE exists and is owned by the effective group id. -'-L FILE' +‘-L FILE’ True if FILE exists and is a symbolic link. -'-N FILE' +‘-N FILE’ True if FILE exists and has been modified since it was last read. -'-O FILE' +‘-O FILE’ True if FILE exists and is owned by the effective user id. -'-S FILE' +‘-S FILE’ True if FILE exists and is a socket. -'FILE1 -ef FILE2' +‘FILE1 -ef FILE2’ True if FILE1 and FILE2 refer to the same device and inode numbers. -'FILE1 -nt FILE2' +‘FILE1 -nt FILE2’ True if FILE1 is newer (according to modification date) than FILE2, or if FILE1 exists and FILE2 does not. -'FILE1 -ot FILE2' +‘FILE1 -ot FILE2’ True if FILE1 is older than FILE2, or if FILE2 exists and FILE1 does not. -'-o OPTNAME' +‘-o OPTNAME’ True if the shell option OPTNAME is enabled. The list of options - appears in the description of the '-o' option to the 'set' builtin + appears in the description of the ‘-o’ option to the ‘set’ builtin (*note The Set Builtin::). -'-v VARNAME' +‘-v VARNAME’ True if the shell variable VARNAME is set (has been assigned a value). If VARNAME is an indexed array variable name subscripted - by '@' or '*', this returns true if the array has any set elements. - If VARNAME is an associative array variable name subscripted by '@' - or '*', this returns true if an element with that key is set. + by ‘@’ or ‘*’, this returns true if the array has any set elements. + If VARNAME is an associative array variable name subscripted by ‘@’ + or ‘*’, this returns true if an element with that key is set. -'-R VARNAME' +‘-R VARNAME’ True if the shell variable VARNAME is set and is a name reference. -'-z STRING' +‘-z STRING’ True if the length of STRING is zero. -'-n STRING' -'STRING' +‘-n STRING’ +‘STRING’ True if the length of STRING is non-zero. -'STRING1 == STRING2' -'STRING1 = STRING2' - True if the strings are equal. When used with the '[[' command, +‘STRING1 == STRING2’ +‘STRING1 = STRING2’ + True if the strings are equal. When used with the ‘[[’ command, this performs pattern matching as described above (*note Conditional Constructs::). - '=' should be used with the 'test' command for POSIX conformance. + ‘=’ should be used with the ‘test’ command for POSIX conformance. -'STRING1 != STRING2' +‘STRING1 != STRING2’ True if the strings are not equal. -'STRING1 < STRING2' +‘STRING1 < STRING2’ True if STRING1 sorts before STRING2 lexicographically. -'STRING1 > STRING2' +‘STRING1 > STRING2’ True if STRING1 sorts after STRING2 lexicographically. -'ARG1 OP ARG2' - 'OP' is one of '-eq', '-ne', '-lt', '-le', '-gt', or '-ge'. These +‘ARG1 OP ARG2’ + ‘OP’ is one of ‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. These arithmetic binary operators return true if ARG1 is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to ARG2, respectively. ARG1 and ARG2 may be - positive or negative integers. When used with the '[[' command, + positive or negative integers. When used with the ‘[[’ command, ARG1 and ARG2 are evaluated as arithmetic expressions (*note Shell Arithmetic::). @@ -6691,8 +6698,8 @@ File: bash.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Conditiona ==================== The shell allows arithmetic expressions to be evaluated, as one of the -shell expansions or by using the '((' compound command, the 'let' -builtin, or the '-i' option to the 'declare' builtin. +shell expansions or by using the ‘((’ compound command, the ‘let’ +builtin, or the ‘-i’ option to the ‘declare’ builtin. Evaluation is done in fixed-width integers with no check for overflow, though division by 0 is trapped and flagged as an error. The @@ -6701,58 +6708,58 @@ as in the C language. The following list of operators is grouped into levels of equal-precedence operators. The levels are listed in order of decreasing precedence. -'ID++ ID--' +‘ID++ ID--’ variable post-increment and post-decrement -'++ID --ID' +‘++ID --ID’ variable pre-increment and pre-decrement -'- +' +‘- +’ unary minus and plus -'! ~' +‘! ~’ logical and bitwise negation -'**' +‘**’ exponentiation -'* / %' +‘* / %’ multiplication, division, remainder -'+ -' +‘+ -’ addition, subtraction -'<< >>' +‘<< >>’ left and right bitwise shifts -'<= >= < >' +‘<= >= < >’ comparison -'== !=' +‘== !=’ equality and inequality -'&' +‘&’ bitwise AND -'^' +‘^’ bitwise exclusive OR -'|' +‘|’ bitwise OR -'&&' +‘&&’ logical AND -'||' +‘||’ logical OR -'expr ? if-true-expr : if-false-expr' +‘expr ? if-true-expr : if-false-expr’ conditional operator -'= *= /= %= += -= <<= >>= &= ^= |=' +‘= *= /= %= += -= <<= >>= &= ^= |=’ assignment -'expr1 , expr2' +‘expr1 , expr2’ comma Shell variables are allowed as operands; parameter expansion is @@ -6762,19 +6769,19 @@ parameter expansion syntax. A shell variable that is null or unset evaluates to 0 when referenced by name without using the parameter expansion syntax. The value of a variable is evaluated as an arithmetic expression when it is referenced, or when a variable which has been -given the 'integer' attribute using 'declare -i' is assigned a value. A -null value evaluates to 0. A shell variable need not have its 'integer' +given the ‘integer’ attribute using ‘declare -i’ is assigned a value. A +null value evaluates to 0. A shell variable need not have its ‘integer’ attribute turned on to be used in an expression. Integer constants follow the C language definition, without suffixes or character constants. Constants with a leading 0 are interpreted as -octal numbers. A leading '0x' or '0X' denotes hexadecimal. Otherwise, -numbers take the form [BASE'#']N, where the optional BASE is a decimal +octal numbers. A leading ‘0x’ or ‘0X’ denotes hexadecimal. Otherwise, +numbers take the form [BASE‘#’]N, where the optional BASE is a decimal number between 2 and 64 representing the arithmetic base, and N is a -number in that base. If BASE'#' is omitted, then base 10 is used. When +number in that base. If BASE‘#’ is omitted, then base 10 is used. When specifying N, if a non-digit is required, the digits greater than 9 are -represented by the lowercase letters, the uppercase letters, '@', and -'_', in that order. If BASE is less than or equal to 36, lowercase and +represented by the lowercase letters, the uppercase letters, ‘@’, and +‘_’, in that order. If BASE is less than or equal to 36, lowercase and uppercase letters may be used interchangeably to represent numbers between 10 and 35. @@ -6788,10 +6795,10 @@ File: bash.info, Node: Aliases, Next: Arrays, Prev: Shell Arithmetic, Up: Ba 6.6 Aliases =========== -"Aliases" allow a string to be substituted for a word that is in a +“Aliases” allow a string to be substituted for a word that is in a position in the input where it can be the first word of a simple command. Aliases have names and corresponding values that are set and -unset using the 'alias' and 'unalias' builtin commands (*note Shell +unset using the ‘alias’ and ‘unalias’ builtin commands (*note Shell Builtin Commands::). If the shell reads an unquoted word in the right position, it checks @@ -6800,27 +6807,27 @@ replaces the word with the alias value, and reads that value as if it had been read instead of the word. The shell doesn't look at any characters following the word before attempting alias substitution. - The characters '/', '$', '`', '=' and any of the shell metacharacters + The characters ‘/’, ‘$’, ‘`’, ‘=’ and any of the shell metacharacters or quoting characters listed above may not appear in an alias name. The replacement text may contain any valid shell input, including shell metacharacters. The first word of the replacement text is tested for aliases, but a word that is identical to an alias being expanded is not -expanded a second time. This means that one may alias 'ls' to '"ls --F"', for instance, and Bash does not try to recursively expand the +expanded a second time. This means that one may alias ‘ls’ to ‘"ls +-F"’, for instance, and Bash does not try to recursively expand the replacement text. - If the last character of the alias value is a 'blank', then the next + If the last character of the alias value is a ‘blank’, then the next command word following the alias is also checked for alias expansion. - Aliases are created and listed with the 'alias' command, and removed -with the 'unalias' command. + Aliases are created and listed with the ‘alias’ command, and removed +with the ‘unalias’ command. There is no mechanism for using arguments in the replacement text, as -in 'csh'. If arguments are needed, use a shell function (*note Shell +in ‘csh’. If arguments are needed, use a shell function (*note Shell Functions::) instead. Aliases are not expanded when the shell is not interactive, unless -the 'expand_aliases' shell option is set using 'shopt' (*note The Shopt +the ‘expand_aliases’ shell option is set using ‘shopt’ (*note The Shopt Builtin::). The rules concerning the definition and use of aliases are somewhat @@ -6836,7 +6843,7 @@ expanded when a function definition is read, not when the function is executed, because a function definition is itself a command. As a consequence, aliases defined in a function are not available until after that function is executed. To be safe, always put alias definitions on -a separate line, and do not use 'alias' in compound commands. +a separate line, and do not use ‘alias’ in compound commands. For almost every purpose, shell functions are preferred over aliases. @@ -6847,7 +6854,7 @@ File: bash.info, Node: Arrays, Next: The Directory Stack, Prev: Aliases, Up: ========== Bash provides one-dimensional indexed and associative array variables. -Any variable may be used as an indexed array; the 'declare' builtin will +Any variable may be used as an indexed array; the ‘declare’ builtin will explicitly declare an array. 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 integers (including @@ -6869,13 +6876,13 @@ is also accepted; the SUBSCRIPT is ignored. Associative arrays are created using declare -A NAME - Attributes may be specified for an array variable using the 'declare' -and 'readonly' builtins. Each attribute applies to all members of an + Attributes may be specified for an array variable using the ‘declare’ +and ‘readonly’ builtins. Each attribute applies to all members of an array. Arrays are assigned to using compound assignments of the form NAME=(VALUE1 VALUE2 ... ) -where each VALUE may be of the form '[SUBSCRIPT]='STRING. Indexed array +where each VALUE may be of the form ‘[SUBSCRIPT]=’STRING. Indexed array assignments do not require anything but STRING. When assigning to indexed arrays, if the optional subscript is supplied, that index is assigned to; otherwise the index of the element assigned is the last @@ -6896,8 +6903,8 @@ interpreted; all assignments in a list must be of the same type. When using key/value pairs, the keys may not be missing or empty; a final missing value is treated like the empty string. - This syntax is also accepted by the 'declare' builtin. Individual -array elements may be assigned to using the 'NAME[SUBSCRIPT]=VALUE' + This syntax is also accepted by the ‘declare’ builtin. Individual +array elements may be assigned to using the ‘NAME[SUBSCRIPT]=VALUE’ syntax introduced above. When assigning to an indexed array, if NAME is subscripted by a @@ -6905,26 +6912,26 @@ negative number, that number is interpreted as relative to one greater than the maximum index of NAME, so negative indices count back from the end of the array, and an index of -1 references the last element. - The '+=' operator will append to an array variable when assigning + The ‘+=’ operator will append to an array variable when assigning using the compound assignment syntax; see *note Shell Parameters:: above. - Any element of an array may be referenced using '${NAME[SUBSCRIPT]}'. + Any element of an array may be referenced using ‘${NAME[SUBSCRIPT]}’. The braces are required to avoid conflicts with the shell's filename -expansion operators. If the SUBSCRIPT is '@' or '*', the word expands +expansion operators. If the SUBSCRIPT is ‘@’ or ‘*’, the word expands to all members of the array NAME, unless otherwise 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 -double-quoted, '${NAME[*]}' expands to a single word with the value of -each array member separated by the first character of the 'IFS' -variable, and '${NAME[@]}' expands each element of NAME to a separate -word. When there are no array members, '${NAME[@]}' expands to nothing. +double-quoted, ‘${NAME[*]}’ expands to a single word with the value of +each array member separated by the first character of the ‘IFS’ +variable, and ‘${NAME[@]}’ expands each element of NAME to a separate +word. When there are no array members, ‘${NAME[@]}’ 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 original word, and the expansion of the last parameter is joined with the last part of the original word. This is analogous to the expansion of the -special parameters '@' and '*'. '${#NAME[SUBSCRIPT]}' expands to the -length of '${NAME[SUBSCRIPT]}'. If SUBSCRIPT is '@' or '*', the +special parameters ‘@’ and ‘*’. ‘${#NAME[SUBSCRIPT]}’ expands to the +length of ‘${NAME[SUBSCRIPT]}’. If SUBSCRIPT is ‘@’ or ‘*’, the expansion is the number of elements in the array. If the SUBSCRIPT used to reference an element of an indexed array evaluates to a number less than zero, it is interpreted as relative to one greater than the maximum @@ -6941,32 +6948,32 @@ 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. ${!NAME[@]} and ${!NAME[*]} expand to the indices assigned in array variable NAME. The treatment when in double quotes is similar -to the expansion of the special parameters '@' and '*' within double +to the expansion of the special parameters ‘@’ and ‘*’ within double quotes. - The 'unset' builtin is used to destroy arrays. 'unset -NAME[SUBSCRIPT]' destroys the array element at index SUBSCRIPT. + The ‘unset’ builtin is used to destroy arrays. ‘unset +NAME[SUBSCRIPT]’ destroys the array element at index SUBSCRIPT. Negative subscripts to indexed arrays are interpreted as described above. Unsetting the last element of an array variable does not unset -the variable. 'unset NAME', where NAME is an array, removes the entire -array. 'unset NAME[SUBSCRIPT]' behaves differently depending on the -array type when given a subscript of '*' or '@'. When NAME is an -associative array, it removes the element with key '*' or '@'. If NAME -is an indexed array, 'unset' removes all of the elements, but does not +the variable. ‘unset NAME’, where NAME is an array, removes the entire +array. ‘unset NAME[SUBSCRIPT]’ behaves differently depending on the +array type when given a subscript of ‘*’ or ‘@’. When NAME is an +associative array, it removes the element with key ‘*’ or ‘@’. If NAME +is an indexed array, ‘unset’ removes all of the elements, but does not remove the array itself. When using a variable name with a subscript as an argument to a -command, such as with 'unset', without using the word expansion syntax +command, such as with ‘unset’, without using the word expansion syntax described above, the argument is subject to the shell's filename expansion. If filename expansion is not desired, the argument should be quoted. - The 'declare', 'local', and 'readonly' builtins each accept a '-a' -option to specify an indexed array and a '-A' option to specify an -associative array. If both options are supplied, '-A' takes precedence. -The 'read' builtin accepts a '-a' option to assign a list of words read + The ‘declare’, ‘local’, and ‘readonly’ builtins each accept a ‘-a’ +option to specify an indexed array and a ‘-A’ option to specify an +associative array. If both options are supplied, ‘-A’ takes precedence. +The ‘read’ builtin accepts a ‘-a’ option to assign a list of words read from the standard input to an array, and can read values from the -standard input into individual array elements. The 'set' and 'declare' +standard input into individual array elements. The ‘set’ and ‘declare’ builtins display array values in a way that allows them to be reused as input. @@ -6982,14 +6989,14 @@ File: bash.info, Node: The Directory Stack, Next: Controlling the Prompt, Pre the directory stack. The directory stack is a list of recently-visited directories. The -'pushd' builtin adds directories to the stack as it changes the current -directory, and the 'popd' builtin removes specified directories from the +‘pushd’ builtin adds directories to the stack as it changes the current +directory, and the ‘popd’ builtin removes specified directories from the stack and changes the current directory to the directory removed. The -'dirs' builtin displays the contents of the directory stack. The +‘dirs’ builtin displays the contents of the directory stack. The current directory is always the "top" of the directory stack. The contents of the directory stack are also visible as the value of -the 'DIRSTACK' shell variable. +the ‘DIRSTACK’ shell variable.  File: bash.info, Node: Directory Stack Builtins, Up: The Directory Stack @@ -6997,105 +7004,105 @@ File: bash.info, Node: Directory Stack Builtins, Up: The Directory Stack 6.8.1 Directory Stack Builtins ------------------------------ -'dirs' +‘dirs’ dirs [-clpv] [+N | -N] Display the list of currently remembered directories. Directories - are added to the list with the 'pushd' command; the 'popd' command + are added to the list with the ‘pushd’ command; the ‘popd’ command removes directories from the list. The current directory is always the first directory in the stack. - '-c' + ‘-c’ Clears the directory stack by deleting all of the elements. - '-l' + ‘-l’ Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. - '-p' - Causes 'dirs' to print the directory stack with one entry per + ‘-p’ + Causes ‘dirs’ to print the directory stack with one entry per line. - '-v' - Causes 'dirs' to print the directory stack with one entry per + ‘-v’ + Causes ‘dirs’ to print the directory stack with one entry per line, prefixing each entry with its index in the stack. - '+N' + ‘+N’ Displays the Nth directory (counting from the left of the list - printed by 'dirs' when invoked without options), starting with + printed by ‘dirs’ when invoked without options), starting with zero. - '-N' + ‘-N’ Displays the Nth directory (counting from the right of the - list printed by 'dirs' when invoked without options), starting + list printed by ‘dirs’ when invoked without options), starting with zero. -'popd' +‘popd’ popd [-n] [+N | -N] Removes elements from the directory stack. The elements are - numbered from 0 starting at the first directory listed by 'dirs'; - that is, 'popd' is equivalent to 'popd +0'. + numbered from 0 starting at the first directory listed by ‘dirs’; + that is, ‘popd’ is equivalent to ‘popd +0’. - When no arguments are given, 'popd' removes the top directory from + When no arguments are given, ‘popd’ removes the top directory from the stack and changes to the new top directory. Arguments, if supplied, have the following meanings: - '-n' + ‘-n’ Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. - '+N' + ‘+N’ Removes the Nth directory (counting from the left of the list - printed by 'dirs'), starting with zero, from the stack. - '-N' + printed by ‘dirs’), starting with zero, from the stack. + ‘-N’ Removes the Nth directory (counting from the right of the list - printed by 'dirs'), starting with zero, from the stack. + printed by ‘dirs’), starting with zero, from the stack. - If the top element of the directory stack is modified, and the '-n' - option was not supplied, 'popd' uses the 'cd' builtin to change to - the directory at the top of the stack. If the 'cd' fails, 'popd' + If the top element of the directory stack is modified, and the ‘-n’ + option was not supplied, ‘popd’ uses the ‘cd’ builtin to change to + the directory at the top of the stack. If the ‘cd’ fails, ‘popd’ returns a non-zero value. - Otherwise, 'popd' returns an unsuccessful status if an invalid + Otherwise, ‘popd’ returns an unsuccessful status if an invalid option is encountered, the directory stack is empty, or a non-existent directory stack entry is specified. - If the 'popd' command is successful, Bash runs 'dirs' to show the + If the ‘popd’ command is successful, Bash runs ‘dirs’ to show the final contents of the directory stack, and the return status is 0. -'pushd' +‘pushd’ pushd [-n] [+N | -N | DIR] Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working - directory. With no arguments, 'pushd' exchanges the top two + directory. With no arguments, ‘pushd’ exchanges the top two elements of the directory stack. Arguments, if supplied, have the following meanings: - '-n' + ‘-n’ Suppresses the normal change of directory when rotating or adding directories to the stack, so that only the stack is manipulated. - '+N' + ‘+N’ Brings the Nth directory (counting from the left of the list - printed by 'dirs', starting with zero) to the top of the list + printed by ‘dirs’, starting with zero) to the top of the list by rotating the stack. - '-N' + ‘-N’ Brings the Nth directory (counting from the right of the list - printed by 'dirs', starting with zero) to the top of the list + printed by ‘dirs’, starting with zero) to the top of the list by rotating the stack. - 'DIR' + ‘DIR’ Makes DIR be the top of the stack. - After the stack has been modified, if the '-n' option was not - supplied, 'pushd' uses the 'cd' builtin to change to the directory - at the top of the stack. If the 'cd' fails, 'pushd' returns a + After the stack has been modified, if the ‘-n’ option was not + supplied, ‘pushd’ uses the ‘cd’ builtin to change to the directory + at the top of the stack. If the ‘cd’ fails, ‘pushd’ returns a non-zero value. - Otherwise, if no arguments are supplied, 'pushd' returns 0 unless + Otherwise, if no arguments are supplied, ‘pushd’ returns 0 unless the directory stack is empty. When rotating the directory stack, - 'pushd' returns 0 unless the directory stack is empty or a + ‘pushd’ returns 0 unless the directory stack is empty or a non-existent directory stack element is specified. - If the 'pushd' command is successful, Bash runs 'dirs' to show the + If the ‘pushd’ command is successful, Bash runs ‘dirs’ to show the final contents of the directory stack.  @@ -7104,72 +7111,72 @@ File: bash.info, Node: Controlling the Prompt, Next: The Restricted Shell, Pr 6.9 Controlling the Prompt ========================== -Bash examines the value of the array variable 'PROMPT_COMMAND' just +Bash examines the value of the array variable ‘PROMPT_COMMAND’ just before printing each primary prompt. If any elements in -'PROMPT_COMMAND' are set and non-null, Bash executes each value, in +‘PROMPT_COMMAND’ are set and non-null, Bash executes each value, in numeric order, just as if it had been typed on the command line. In addition, the following table describes the special characters -which can appear in the prompt variables 'PS0', 'PS1', 'PS2', and 'PS4': +which can appear in the prompt variables ‘PS0’, ‘PS1’, ‘PS2’, and ‘PS4’: -'\a' +‘\a’ A bell character. -'\d' +‘\d’ The date, in "Weekday Month Date" format (e.g., "Tue May 26"). -'\D{FORMAT}' - The FORMAT is passed to 'strftime'(3) and the result is inserted +‘\D{FORMAT}’ + The FORMAT is passed to ‘strftime’(3) and the result is inserted into the prompt string; an empty FORMAT results in a locale-specific time representation. The braces are required. -'\e' +‘\e’ An escape character. -'\h' +‘\h’ The hostname, up to the first '.'. -'\H' +‘\H’ The hostname. -'\j' +‘\j’ The number of jobs currently managed by the shell. -'\l' +‘\l’ The basename of the shell's terminal device name. -'\n' +‘\n’ A newline. -'\r' +‘\r’ A carriage return. -'\s' - The name of the shell, the basename of '$0' (the portion following +‘\s’ + The name of the shell, the basename of ‘$0’ (the portion following the final slash). -'\t' +‘\t’ The time, in 24-hour HH:MM:SS format. -'\T' +‘\T’ The time, in 12-hour HH:MM:SS format. -'\@' +‘\@’ The time, in 12-hour am/pm format. -'\A' +‘\A’ The time, in 24-hour HH:MM format. -'\u' +‘\u’ The username of the current user. -'\v' +‘\v’ The version of Bash (e.g., 2.00) -'\V' +‘\V’ The release of Bash, version + patchlevel (e.g., 2.00.0) -'\w' - The value of the 'PWD' shell variable ('$PWD'), with '$HOME' - abbreviated with a tilde (uses the '$PROMPT_DIRTRIM' variable). -'\W' - The basename of '$PWD', with '$HOME' abbreviated with a tilde. -'\!' +‘\w’ + The value of the ‘PWD’ shell variable (‘$PWD’), with ‘$HOME’ + abbreviated with a tilde (uses the ‘$PROMPT_DIRTRIM’ variable). +‘\W’ + The basename of ‘$PWD’, with ‘$HOME’ abbreviated with a tilde. +‘\!’ The history number of this command. -'\#' +‘\#’ The command number of this command. -'\$' - If the effective uid is 0, '#', otherwise '$'. -'\NNN' +‘\$’ + If the effective uid is 0, ‘#’, otherwise ‘$’. +‘\NNN’ The character whose ASCII code is the octal value NNN. -'\\' +‘\\’ A backslash. -'\[' +‘\[’ Begin a sequence of non-printing characters. This could be used to embed a terminal control sequence into the prompt. -'\]' +‘\]’ End a sequence of non-printing characters. The command number and the history number are usually different: the @@ -7180,7 +7187,7 @@ of commands executed during the current shell session. After the string is decoded, it is expanded via parameter expansion, command substitution, arithmetic expansion, and quote removal, subject -to the value of the 'promptvars' shell option (*note The Shopt +to the value of the ‘promptvars’ shell option (*note The Shopt Builtin::). This can have unwanted side effects if escaped portions of the string appear within command substitution or contain characters special to word expansion. @@ -7191,54 +7198,54 @@ File: bash.info, Node: The Restricted Shell, Next: Bash POSIX Mode, Prev: Con 6.10 The Restricted Shell ========================= -If Bash is started with the name 'rbash', or the '--restricted' or '-r' +If Bash is started with the name ‘rbash’, or the ‘--restricted’ or ‘-r’ option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than -the standard shell. A restricted shell behaves identically to 'bash' +the standard shell. A restricted shell behaves identically to ‘bash’ with the exception that the following are disallowed or not performed: - * Changing directories with the 'cd' builtin. - * Setting or unsetting the values of the 'SHELL', 'PATH', 'HISTFILE', - 'ENV', or 'BASH_ENV' variables. - * Specifying command names containing slashes. - * Specifying a filename containing a slash as an argument to the '.' + • Changing directories with the ‘cd’ builtin. + • Setting or unsetting the values of the ‘SHELL’, ‘PATH’, ‘HISTFILE’, + ‘ENV’, or ‘BASH_ENV’ variables. + • Specifying command names containing slashes. + • Specifying a filename containing a slash as an argument to the ‘.’ builtin command. - * Specifying a filename containing a slash as an argument to the - 'history' builtin command. - * Specifying a filename containing a slash as an argument to the '-p' - option to the 'hash' builtin command. - * Importing function definitions from the shell environment at + • Specifying a filename containing a slash as an argument to the + ‘history’ builtin command. + • Specifying a filename containing a slash as an argument to the ‘-p’ + option to the ‘hash’ builtin command. + • Importing function definitions from the shell environment at startup. - * Parsing the value of 'SHELLOPTS' from the shell environment at + • Parsing the value of ‘SHELLOPTS’ from the shell environment at startup. - * Redirecting output using the '>', '>|', '<>', '>&', '&>', and '>>' + • Redirecting output using the ‘>’, ‘>|’, ‘<>’, ‘>&’, ‘&>’, and ‘>>’ redirection operators. - * Using the 'exec' builtin to replace the shell with another command. - * Adding or deleting builtin commands with the '-f' and '-d' options - to the 'enable' builtin. - * Using the 'enable' builtin command to enable disabled shell + • Using the ‘exec’ builtin to replace the shell with another command. + • Adding or deleting builtin commands with the ‘-f’ and ‘-d’ options + to the ‘enable’ builtin. + • Using the ‘enable’ builtin command to enable disabled shell builtins. - * Specifying the '-p' option to the 'command' builtin. - * Turning off restricted mode with 'set +r' or 'shopt -u - restricted_shell'. + • Specifying the ‘-p’ option to the ‘command’ builtin. + • Turning off restricted mode with ‘set +r’ or ‘shopt -u + restricted_shell’. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed (*note -Shell Scripts::), 'rbash' turns off any restrictions in the shell +Shell Scripts::), ‘rbash’ turns off any restrictions in the shell spawned to execute the script. The restricted shell mode is only one component of a useful -restricted environment. It should be accompanied by setting 'PATH' to a +restricted environment. It should be accompanied by setting ‘PATH’ to a value that allows execution of only a few verified commands (commands that allow shell escapes are particularly vulnerable), changing the -current directory to a non-writable directory other than '$HOME' after +current directory to a non-writable directory other than ‘$HOME’ after login, not allowing the restricted shell to execute shell scripts, and cleaning the environment of variables that cause some commands to modify -their behavior (e.g., 'VISUAL' or 'PAGER'). +their behavior (e.g., ‘VISUAL’ or ‘PAGER’). Modern systems provide more secure ways to implement a restricted -environment, such as 'jails', 'zones', or 'containers'. +environment, such as ‘jails’, ‘zones’, or ‘containers’.  File: bash.info, Node: Bash POSIX Mode, Next: Shell Compatibility Mode, Prev: The Restricted Shell, Up: Bash Features @@ -7277,10 +7284,10 @@ variable expansion, and quoting. The special builtins, which must be implemented as part of the shell to provide the desired functionality, are specified as being part of the -shell; examples of these are 'eval' and 'export'. Other utilities +shell; examples of these are ‘eval’ and ‘export’. Other utilities appear in the sections of POSIX not devoted to the shell which are commonly (and in some cases must be) implemented as builtin commands, -such as 'read' and 'test'. POSIX also specifies aspects of the shell's +such as ‘read’ and ‘test’. POSIX also specifies aspects of the shell's interactive behavior, including job control and command line editing. Only vi-style line editing commands have been standardized; emacs editing commands were left out due to objections. @@ -7290,35 +7297,35 @@ 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 +specification. The Bash “posix mode” changes the Bash behavior in these areas so that it conforms to the standard more closely. - Starting Bash with the '--posix' command-line option or executing -'set -o posix' while Bash is running will cause Bash to conform more + Starting Bash with the ‘--posix’ command-line option or executing +‘set -o posix’ while Bash is running will cause Bash to conform more closely to the POSIX standard by changing the behavior to match that specified by POSIX in areas where the Bash default differs. - When invoked as 'sh', Bash enters POSIX mode after reading the + 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: - 1. Bash ensures that the 'POSIXLY_CORRECT' variable is set. + 1. Bash ensures that the ‘POSIXLY_CORRECT’ variable is set. 2. When a command in the hash table no longer exists, Bash will - re-search '$PATH' to find the new location. This is also available - with 'shopt -s checkhash'. + re-search ‘$PATH’ to find the new location. This is also available + with ‘shopt -s checkhash’. 3. Bash will not insert a command without the execute bit set into the command hash table, even if it returns it as a (last-ditch) result - from a '$PATH' search. + from a ‘$PATH’ search. 4. The message printed by the job control code and builtins when a job exits with a non-zero status is 'Done(status)'. 5. The message printed by the job control code and builtins when a job is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example, - 'SIGTSTP'. + ‘SIGTSTP’. 6. Alias expansion is always enabled, even in non-interactive shells. @@ -7332,19 +7339,19 @@ startup files. the command substitution is initially parsed (e.g., as part of a function definition). - 9. The POSIX 'PS1' and 'PS2' expansions of '!' to the history number - and '!!' to '!' are enabled, and parameter expansion is performed - on the values of 'PS1' and 'PS2' regardless of the setting of the - 'promptvars' option. + 9. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number + and ‘!!’ to ‘!’ are enabled, and parameter expansion is performed + on the values of ‘PS1’ and ‘PS2’ regardless of the setting of the + ‘promptvars’ option. - 10. The POSIX startup files are executed ('$ENV') rather than the + 10. The POSIX startup files are executed (‘$ENV’) rather than the normal Bash files. 11. Tilde expansion is only performed on assignments preceding a command name, rather than on all assignment statements on the line. - 12. The default history file is '~/.sh_history' (this is the default - value the shell assigns to '$HISTFILE'). + 12. The default history file is ‘~/.sh_history’ (this is the default + value the shell assigns to ‘$HISTFILE’). 13. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. @@ -7352,7 +7359,7 @@ startup files. 14. Redirection operators do not perform word splitting on the word in the redirection. - 15. Function names must be valid shell 'name's. That is, they may not + 15. Function names must be valid shell ‘name’s. That is, they may not contain characters other than letters, digits, and underscores, and may not start with a digit. Declaring a function with an invalid name causes a fatal syntax error in non-interactive shells. @@ -7365,19 +7372,19 @@ startup files. whose name contains one or more slashes. 18. POSIX special builtins are found before shell functions during - command lookup, including output printed by the 'type' and - 'command' builtins. + command lookup, including output printed by the ‘type’ and + ‘command’ builtins. - 19. When printing shell function definitions (e.g., by 'type'), Bash - does not print the 'function' keyword. + 19. When printing shell function definitions (e.g., by ‘type’), Bash + does not print the ‘function’ keyword. 20. Literal tildes that appear as the first character in elements of - the 'PATH' variable are not expanded as described above under *note + the ‘PATH’ variable are not expanded as described above under *note Tilde Expansion::. - 21. The 'time' reserved word may be used by itself as a command. When + 21. The ‘time’ reserved word may be used by itself as a command. When used in this way, it displays timing statistics for the shell and - its completed children. The 'TIMEFORMAT' variable controls the + its completed children. The ‘TIMEFORMAT’ variable controls the format of the timing information. 22. When parsing and expanding a ${...} expansion that appears within @@ -7386,11 +7393,11 @@ startup files. the operator is one of those defined to perform pattern removal. In this case, they do not have to appear as matched pairs. - 23. The parser does not recognize 'time' as a reserved word if the - next token begins with a '-'. + 23. The parser does not recognize ‘time’ as a reserved word if the + next token begins with a ‘-’. - 24. The '!' character does not introduce history expansion within a - double-quoted string, even if the 'histexpand' option is enabled. + 24. The ‘!’ character does not introduce history expansion within a + double-quoted string, even if the ‘histexpand’ option is enabled. 25. If a POSIX special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in @@ -7398,13 +7405,13 @@ startup files. options, redirection errors, variable assignment errors for assignments preceding the command name, and so on. - 26. The 'unset' builtin with the '-v' option specified returns a fatal - error if it attempts to unset a 'readonly' or 'non-unsettable' + 26. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal + error if it attempts to unset a ‘readonly’ or ‘non-unsettable’ variable, or encounters a variable name argument that is an invalid identifier, which causes a non-interactive shell to exit. 27. When asked to unset a variable that appears in an assignment - statement preceding the command, the 'unset' builtin attempts to + statement preceding the command, the ‘unset’ builtin attempts to unset a variable of the same name in the current or previous scope as well. This implements the required "if an assigned variable is further modified by the utility, the modifications made by the @@ -7424,11 +7431,11 @@ startup files. occurred"). 30. A non-interactive shell exits with an error status if the - iteration variable in a 'for' statement or the selection variable - in a 'select' statement is a readonly variable or has an invalid + iteration variable in a ‘for’ statement or the selection variable + in a ‘select’ statement is a readonly variable or has an invalid name. - 31. Non-interactive shells exit if FILENAME in '.' FILENAME is not + 31. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not found. 32. Non-interactive shells exit if a syntax error in an arithmetic @@ -7437,151 +7444,151 @@ startup files. 33. Non-interactive shells exit if a parameter expansion error occurs. 34. Non-interactive shells exit if there is a syntax error in a script - read with the '.' or 'source' builtins, or in a string processed by - the 'eval' builtin. + read with the ‘.’ or ‘source’ builtins, or in a string processed by + the ‘eval’ builtin. 35. While variable indirection is available, it may not be applied to - the '#' and '?' special parameters. + the ‘#’ and ‘?’ special parameters. - 36. Expanding the '*' special parameter in a pattern context where the - expansion is double-quoted does not treat the '$*' as if it were + 36. Expanding the ‘*’ special parameter in a pattern context where the + expansion is double-quoted does not treat the ‘$*’ as if it were double-quoted. 37. Assignment statements preceding POSIX special builtins persist in the shell environment after the builtin completes. - 38. The 'command' builtin does not prevent builtins that take + 38. The ‘command’ builtin does not prevent builtins that take assignment statements as arguments from expanding them as assignment statements; when not in POSIX mode, assignment builtins lose their assignment statement expansion properties when preceded - by 'command'. + by ‘command’. - 39. The 'bg' builtin uses the required format to describe each job + 39. The ‘bg’ builtin uses the required format to describe each job placed in the background, which does not include an indication of whether the job is the current or previous job. - 40. The output of 'kill -l' prints all the signal names on a single - line, separated by spaces, without the 'SIG' prefix. + 40. The output of ‘kill -l’ prints all the signal names on a single + line, separated by spaces, without the ‘SIG’ prefix. - 41. The 'kill' builtin does not accept signal names with a 'SIG' + 41. The ‘kill’ builtin does not accept signal names with a ‘SIG’ prefix. - 42. The 'export' and 'readonly' builtin commands display their output + 42. The ‘export’ and ‘readonly’ builtin commands display their output in the format required by POSIX. - 43. If the 'export' and 'readonly' builtin commands get an argument + 43. If the ‘export’ and ‘readonly’ builtin commands get an argument that is not a valid identifier, and they are not operating on shell functions, they return an error. This will cause a non-interactive shell to exit because these are special builtins. - 44. The 'trap' builtin displays signal names without the leading - 'SIG'. + 44. The ‘trap’ builtin displays signal names without the leading + ‘SIG’. - 45. The 'trap' builtin doesn't check the first argument for a possible + 45. The ‘trap’ builtin doesn't check the first argument for a possible signal specification and revert the signal handling to the original disposition if it is, unless that argument consists solely of digits and is a valid signal number. If users want to reset the handler for a given signal to the original disposition, they should - use '-' as the first argument. + use ‘-’ as the first argument. - 46. 'trap -p' without arguments displays signals whose dispositions + 46. ‘trap -p’ without arguments displays signals whose dispositions are set to SIG_DFL and those that were ignored when the shell started, not just trapped signals. - 47. The '.' and 'source' builtins do not search the current directory - for the filename argument if it is not found by searching 'PATH'. + 47. The ‘.’ and ‘source’ builtins do not search the current directory + for the filename argument if it is not found by searching ‘PATH’. 48. Enabling POSIX mode has the effect of setting the - 'inherit_errexit' option, so subshells spawned to execute command - substitutions inherit the value of the '-e' option from the parent - shell. When the 'inherit_errexit' option is not enabled, Bash - clears the '-e' option in such subshells. + ‘inherit_errexit’ option, so subshells spawned to execute command + substitutions inherit the value of the ‘-e’ option from the parent + shell. When the ‘inherit_errexit’ option is not enabled, Bash + clears the ‘-e’ option in such subshells. - 49. Enabling POSIX mode has the effect of setting the 'shift_verbose' - option, so numeric arguments to 'shift' that exceed the number of + 49. Enabling POSIX mode has the effect of setting the ‘shift_verbose’ + option, so numeric arguments to ‘shift’ that exceed the number of positional parameters will result in an error message. - 50. When the 'alias' builtin displays alias definitions, it does not - display them with a leading 'alias ' unless the '-p' option is + 50. When the ‘alias’ builtin displays alias definitions, it does not + display them with a leading ‘alias ’ unless the ‘-p’ option is supplied. - 51. When the 'set' builtin is invoked without options, it does not + 51. When the ‘set’ builtin is invoked without options, it does not display shell function names and definitions. - 52. When the 'set' builtin is invoked without options, it displays + 52. When the ‘set’ builtin is invoked without options, it displays variable values without quotes, unless they contain shell metacharacters, even if the result contains nonprinting characters. - 53. When the 'cd' builtin is invoked in logical mode, and the pathname - constructed from '$PWD' and the directory name supplied as an - argument does not refer to an existing directory, 'cd' will fail + 53. When the ‘cd’ builtin is invoked in logical mode, and the pathname + constructed from ‘$PWD’ and the directory name supplied as an + argument does not refer to an existing directory, ‘cd’ will fail instead of falling back to physical mode. - 54. When the 'cd' builtin cannot change a directory because the length - of the pathname constructed from '$PWD' and the directory name - supplied as an argument exceeds 'PATH_MAX' when all symbolic links - are expanded, 'cd' will fail instead of attempting to use only the + 54. When the ‘cd’ builtin cannot change a directory because the length + of the pathname constructed from ‘$PWD’ and the directory name + supplied as an argument exceeds ‘PATH_MAX’ when all symbolic links + are expanded, ‘cd’ will fail instead of attempting to use only the supplied directory name. - 55. The 'pwd' builtin verifies that the value it prints is the same as + 55. The ‘pwd’ builtin verifies that the value it prints is the same as the current directory, even if it is not asked to check the file - system with the '-P' option. + system with the ‘-P’ option. - 56. When listing the history, the 'fc' builtin does not include an + 56. When listing the history, the ‘fc’ builtin does not include an indication of whether or not a history entry has been modified. - 57. The default editor used by 'fc' is 'ed'. + 57. The default editor used by ‘fc’ is ‘ed’. - 58. If there are too many arguments supplied to 'fc -s', 'fc' prints + 58. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints an error message and returns failure. - 59. The 'type' and 'command' builtins will not report a non-executable + 59. The ‘type’ and ‘command’ builtins will not report a non-executable file as having been found, though the shell will attempt to execute - such a file if it is the only so-named file found in '$PATH'. + such a file if it is the only so-named file found in ‘$PATH’. - 60. The 'vi' editing mode will invoke the 'vi' editor directly when - the 'v' command is run, instead of checking '$VISUAL' and - '$EDITOR'. + 60. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when + the ‘v’ command is run, instead of checking ‘$VISUAL’ and + ‘$EDITOR’. - 61. When the 'xpg_echo' option is enabled, Bash does not attempt to - interpret any arguments to 'echo' as options. Each argument is + 61. When the ‘xpg_echo’ option is enabled, Bash does not attempt to + interpret any arguments to ‘echo’ as options. Each argument is displayed, after escape characters are converted. - 62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' - and '-f' options. + 62. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’ + and ‘-f’ options. - 63. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not - interrupt the 'wait' builtin and cause it to return immediately. + 63. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not + interrupt the ‘wait’ builtin and cause it to return immediately. The trap command is run once for each child that exits. - 64. The 'read' builtin may be interrupted by a signal for which a trap + 64. The ‘read’ builtin may be interrupted by a signal for which a trap has been set. If Bash receives a trapped signal while executing - 'read', the trap handler executes and 'read' returns an exit status + ‘read’, the trap handler executes and ‘read’ returns an exit status greater than 128. - 65. The 'printf' builtin uses 'double' (via 'strtod') to convert + 65. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert arguments corresponding to floating point conversion specifiers, - instead of 'long double' if it's available. The 'L' length - modifier forces 'printf' to use 'long double' if it's available. + instead of ‘long double’ if it's available. The ‘L’ length + modifier forces ‘printf’ to use ‘long double’ if it's available. 66. Bash removes an exited background process's status from the list - of such statuses after the 'wait' builtin is used to obtain it. + of such statuses after the ‘wait’ builtin is used to obtain it. - 67. A double quote character ('"') is treated specially when it + 67. A double quote character (‘"’) is treated specially when it appears in a backquoted command substitution in the body of a here-document that undergoes expansion. That means, for example, that a backslash preceding a double quote character will escape it and the backslash will be removed. - 68. The 'test' builtin compares strings using the current locale when - processing the '<' and '>' binary operators. + 68. The ‘test’ builtin compares strings using the current locale when + processing the ‘<’ and ‘>’ binary operators. - 69. The 'test' builtin's '-t' unary primary requires an argument. - Historical versions of 'test' made the argument optional in certain + 69. The ‘test’ builtin's ‘-t’ unary primary requires an argument. + Historical versions of ‘test’ made the argument optional in certain cases, and Bash attempts to accommodate those for backwards compatibility. - 70. Command substitutions don't set the '?' special parameter. The + 70. Command substitutions don't set the ‘?’ special parameter. The exit status of a simple command without a command word is still the exit status of the last command substitution that occurred while evaluating the variable assignments and redirections in that @@ -7591,19 +7598,19 @@ startup files. There is other POSIX behavior that Bash does not implement by default even when in POSIX mode. Specifically: - 1. The 'fc' builtin checks '$EDITOR' as a program to edit history - entries if 'FCEDIT' is unset, rather than defaulting directly to - 'ed'. 'fc' uses 'ed' if 'EDITOR' is unset. + 1. The ‘fc’ builtin checks ‘$EDITOR’ as a program to edit history + entries if ‘FCEDIT’ is unset, rather than defaulting directly to + ‘ed’. ‘fc’ uses ‘ed’ if ‘EDITOR’ is unset. 2. A non-interactive shell does not exit if a variable assignment - preceding the 'command' builtin or another non-special builtin + preceding the ‘command’ builtin or another non-special builtin fails. - 3. As noted above, Bash requires the 'xpg_echo' option to be enabled - for the 'echo' builtin to be fully conformant. + 3. As noted above, Bash requires the ‘xpg_echo’ option to be enabled + for the ‘echo’ builtin to be fully conformant. Bash can be configured to be POSIX-conformant by default, by -specifying the '--enable-strict-posix-default' to 'configure' when +specifying the ‘--enable-strict-posix-default’ to ‘configure’ when building (*note Optional Features::).  @@ -7612,9 +7619,9 @@ File: bash.info, Node: Shell Compatibility Mode, Prev: Bash POSIX Mode, Up: B 6.12 Shell Compatibility Mode ============================= -Bash-4.0 introduced the concept of a "shell compatibility level", -specified as a set of options to the shopt builtin ('compat31', -'compat32', 'compat40', 'compat41', and so on). There is only one +Bash-4.0 introduced the concept of a “shell compatibility level”, +specified as a set of options to the shopt builtin (‘compat31’, +‘compat32’, ‘compat40’, ‘compat41’, 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 @@ -7622,138 +7629,138 @@ migrate scripts to use current features and behavior. It's intended to be a temporary solution. This section does not mention behavior that is standard for a -particular version (e.g., setting 'compat32' means that quoting the rhs +particular version (e.g., setting ‘compat32’ means that quoting the rhs of the regexp matching operator quotes special regexp characters in the word, which is default behavior in bash-3.2 and subsequent versions). - If a user enables, say, 'compat32', it may affect the behavior of + If a user enables, say, ‘compat32’, 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 Bash, 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 'compat32' will enable +comparisons with the ‘[[’ command came in bash-4.1, and earlier versions +used ASCII-based comparisons, so enabling ‘compat32’ will enable ASCII-based comparisons as well. That granularity may not be sufficient 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: 'BASH_COMPAT'. The value + Bash-4.3 introduced a new shell variable: ‘BASH_COMPAT’. The value assigned to this variable (a decimal version number like 4.2, or an -integer corresponding to the 'compat'NN option, like 42) determines the +integer corresponding to the ‘compat’NN option, like 42) determines the compatibility level. Starting with bash-4.4, Bash has begun deprecating older compatibility levels. Eventually, the options will be removed in favor -of 'BASH_COMPAT'. +of ‘BASH_COMPAT’. Bash-5.0 was the final version for which there will be an individual shopt option for the previous version. Users should control the -compatibility level with 'BASH_COMPAT'. +compatibility level with ‘BASH_COMPAT’. The following table describes the behavior changes controlled by each -compatibility level setting. The 'compat'NN tag is used as shorthand +compatibility level setting. The ‘compat’NN tag is used as shorthand for setting the compatibility level to NN using one of the following mechanisms. For versions prior to bash-5.0, the compatibility level may -be set using the corresponding 'compat'NN shopt option. For bash-4.3 -and later versions, the 'BASH_COMPAT' variable is preferred, and it is +be set using the corresponding ‘compat’NN shopt option. For bash-4.3 +and later versions, the ‘BASH_COMPAT’ variable is preferred, and it is required for bash-5.1 and later versions. -'compat31' - * quoting the rhs of the '[[' command's regexp matching operator +‘compat31’ + • quoting the rhs of the ‘[[’ command's regexp matching operator (=~) has no special effect -'compat40' - * the '<' and '>' operators to the '[[' command do not consider +‘compat40’ + • the ‘<’ and ‘>’ operators to the ‘[[’ command do not consider the current locale when comparing strings; they use ASCII ordering. Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); bash-4.1 and later use the current locale's collation sequence and strcoll(3). -'compat41' - * in posix mode, 'time' may be followed by options and still be +‘compat41’ + • 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 (this is POSIX interpretation 221) -'compat42' - * the replacement string in double-quoted pattern substitution +‘compat42’ + • 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); in later versions, single quotes are not special within double-quoted word expansions -'compat43' - * the shell does not print a warning message if an attempt is +‘compat43’ + • the shell does not print a warning message if an attempt is made to use a quoted compound assignment as an argument to declare (e.g., declare -a foo='(1 2)'). Later versions warn that this usage is deprecated - * word expansion errors are considered non-fatal errors that + • 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) - * when executing a shell function, the loop state - (while/until/etc.) is not reset, so 'break' or 'continue' in + • when executing a shell function, the loop state + (while/until/etc.) is not reset, so ‘break’ or ‘continue’ in that function will break or continue loops in the calling context. Bash-4.4 and later reset the loop state to prevent this -'compat44' - * the shell sets up the values used by 'BASH_ARGV' and - 'BASH_ARGC' so they can expand to the shell's positional +‘compat44’ + • the shell sets up the values used by ‘BASH_ARGV’ and + ‘BASH_ARGC’ so they can expand to the shell's positional parameters even if extended debugging mode is not enabled - * a subshell inherits loops from its parent context, so 'break' - or 'continue' will cause the subshell to exit. Bash-5.0 and + • a subshell inherits loops from its parent context, so ‘break’ + or ‘continue’ will cause the subshell to exit. Bash-5.0 and later reset the loop state to prevent the exit - * variable assignments preceding builtins like 'export' and - 'readonly' that set attributes continue to affect variables + • 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 -'compat50 (set using BASH_COMPAT)' - * Bash-5.1 changed the way '$RANDOM' is generated to introduce +‘compat50 (set using BASH_COMPAT)’ + • Bash-5.1 changed the way ‘$RANDOM’ is generated to introduce slightly more randomness. If the shell compatibility level is set to 50 or lower, it reverts to the method from bash-5.0 and previous versions, so seeding the random number generator by - assigning a value to 'RANDOM' will produce the same sequence + assigning a value to ‘RANDOM’ will produce the same sequence as in bash-5.0 - * If the command hash table is empty, Bash versions prior to + • If the command hash table is empty, Bash versions prior to bash-5.1 printed an informational message to that effect, even when producing output that can be reused as input. Bash-5.1 - suppresses that message when the '-l' option is supplied. + suppresses that message when the ‘-l’ option is supplied. -'compat51 (set using BASH_COMPAT)' - * The 'unset' builtin will unset the array 'a' given an argument - like 'a[@]'. Bash-5.2 will unset an element with key '@' +‘compat51 (set using BASH_COMPAT)’ + • The ‘unset’ builtin will unset the array ‘a’ given an argument + like ‘a[@]’. Bash-5.2 will unset an element with key ‘@’ (associative arrays) or remove all the elements without unsetting the array (indexed arrays) - * arithmetic commands ( ((...)) ) and the expressions in an + • arithmetic commands ( ((...)) ) and the expressions in an arithmetic for statement can be expanded more than once - * expressions used as arguments to arithmetic operators in the - '[[' conditional command can be expanded more than once - * the expressions in substring parameter brace expansion can be + • expressions used as arguments to arithmetic operators in the + ‘[[’ conditional command can be expanded more than once + • the expressions in substring parameter brace expansion can be expanded more than once - * the expressions in the $(( ... )) word expansion can be + • the expressions in the $(( ... )) word expansion can be expanded more than once - * arithmetic expressions used as indexed array subscripts can be + • arithmetic expressions used as indexed array subscripts can be expanded more than once - * 'test -v', when given an argument of 'A[@]', where A is an + • ‘test -v’, when given an argument of ‘A[@]’, where A is an existing associative array, will return true if the array has any set elements. Bash-5.2 will look for and report on a key - named '@' - * the ${PARAMETER[:]=VALUE} word expansion will return VALUE, + named ‘@’ + • the ${PARAMETER[:]=VALUE} word expansion will return VALUE, 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. - * Parsing command substitutions will behave as if extended + • Parsing command substitutions will behave as if extended globbing (*note The Shopt Builtin::) is enabled, so that parsing a command substitution containing an extglob pattern (say, as part of a shell function) will not fail. This @@ -7792,7 +7799,7 @@ interface supplied jointly by the operating system kernel's terminal driver and Bash. The shell associates a JOB with each pipeline. It keeps a table of -currently executing jobs, which may be listed with the 'jobs' command. +currently executing jobs, which may be listed with the ‘jobs’ command. When Bash starts a job asynchronously, it prints a line that looks like: [1] 25647 indicating that this job is job number 1 and that the process ID of the @@ -7804,71 +7811,71 @@ uses the JOB abstraction as the basis for job control. control, the operating system maintains the notion of a current terminal process group ID. Members of this process group (processes whose process group ID is equal to the current terminal process group ID) -receive keyboard-generated signals such as 'SIGINT'. These processes +receive keyboard-generated signals such as ‘SIGINT’. These processes are said to be in the foreground. Background processes are those whose process group ID differs from the terminal's; such processes are immune to keyboard-generated signals. Only foreground processes are allowed to -read from or, if the user so specifies with 'stty tostop', write to the +read from or, if the user so specifies with ‘stty tostop’, write to the terminal. Background processes which attempt to read from (write to -when 'stty tostop' is in effect) the terminal are sent a 'SIGTTIN' -('SIGTTOU') signal by the kernel's terminal driver, which, unless +when ‘tostop’ is in effect) the terminal are sent a ‘SIGTTIN’ +(‘SIGTTOU’) signal by the kernel's terminal driver, which, unless caught, suspends the process. If the operating system on which Bash is running supports job -control, Bash contains facilities to use it. Typing the "suspend" -character (typically '^Z', Control-Z) while a process is running causes +control, Bash contains facilities to use it. Typing the “suspend” +character (typically ‘^Z’, Control-Z) while a process is running causes that process to be stopped and returns control to Bash. Typing the -"delayed suspend" character (typically '^Y', Control-Y) causes the +“delayed suspend” character (typically ‘^Y’, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to be returned to Bash. The user then manipulates the state -of this job, using the 'bg' command to continue it in the background, -the 'fg' command to continue it in the foreground, or the 'kill' command -to kill it. A '^Z' takes effect immediately, and has the additional +of this job, using the ‘bg’ command to continue it in the background, +the ‘fg’ command to continue it in the foreground, or the ‘kill’ command +to kill it. A ‘^Z’ takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded. There are a number of ways to refer to a job in the shell. The -character '%' introduces a job specification ("jobspec"). +character ‘%’ introduces a job specification (“jobspec”). - Job number 'n' may be referred to as '%n'. The symbols '%%' and '%+' + Job number ‘n’ may be referred to as ‘%n’. The symbols ‘%%’ and ‘%+’ refer to the shell's notion of the current job, which is the last job stopped while it was in the foreground or started in the background. A -single '%' (with no accompanying job specification) also refers to the -current job. The previous job may be referenced using '%-'. If there -is only a single job, '%+' and '%-' can both be used to refer to that -job. In output pertaining to jobs (e.g., the output of the 'jobs' -command), the current job is always flagged with a '+', and the previous -job with a '-'. +single ‘%’ (with no accompanying job specification) also refers to the +current job. The previous job may be referenced using ‘%-’. If there +is only a single job, ‘%+’ and ‘%-’ can both be used to refer to that +job. In output pertaining to jobs (e.g., the output of the ‘jobs’ +command), the current job is always flagged with a ‘+’, and the previous +job with a ‘-’. A job may also be referred to using a prefix of the name used to start it, or using a substring that appears in its command line. For -example, '%ce' refers to a stopped job whose command name begins with -'ce'. Using '%?ce', on the other hand, refers to any job containing the -string 'ce' in its command line. If the prefix or substring matches +example, ‘%ce’ refers to a stopped job whose command name begins with +‘ce’. Using ‘%?ce’, on the other hand, refers to any job containing the +string ‘ce’ in its command line. If the prefix or substring matches more than one job, Bash reports an error. - Simply naming a job can be used to bring it into the foreground: '%1' -is a synonym for 'fg %1', bringing job 1 from the background into the -foreground. Similarly, '%1 &' resumes job 1 in the background, -equivalent to 'bg %1' + Simply naming a job can be used to bring it into the foreground: ‘%1’ +is a synonym for ‘fg %1’, bringing job 1 from the background into the +foreground. Similarly, ‘%1 &’ resumes job 1 in the background, +equivalent to ‘bg %1’ The shell learns immediately whenever a job changes state. Normally, Bash waits until it is about to print a prompt before reporting changes -in a job's status so as to not interrupt any other output. If the '-b' -option to the 'set' builtin is enabled, Bash reports such changes -immediately (*note The Set Builtin::). Any trap on 'SIGCHLD' is +in a job's status so as to not interrupt any other output. If the ‘-b’ +option to the ‘set’ builtin is enabled, Bash reports such changes +immediately (*note The Set Builtin::). Any trap on ‘SIGCHLD’ is executed for each child process that exits. If an attempt to exit Bash is made while jobs are stopped, (or -running, if the 'checkjobs' option is enabled - see *note The Shopt -Builtin::), the shell prints a warning message, and if the 'checkjobs' -option is enabled, lists the jobs and their statuses. The 'jobs' +running, if the ‘checkjobs’ option is enabled - see *note The Shopt +Builtin::), the shell prints a warning message, and if the ‘checkjobs’ +option is enabled, lists the jobs and their statuses. The ‘jobs’ command may then be used to inspect their status. If a second attempt to exit is made without an intervening command, Bash does not print another warning, and any stopped jobs are terminated. - When the shell is waiting for a job or process using the 'wait' -builtin, and job control is enabled, 'wait' will return when the job -changes state. The '-f' option causes 'wait' to wait until the job or + When the shell is waiting for a job or process using the ‘wait’ +builtin, and job control is enabled, ‘wait’ will return when the job +changes state. The ‘-f’ option causes ‘wait’ to wait until the job or process terminates before returning.  @@ -7877,17 +7884,17 @@ File: bash.info, Node: Job Control Builtins, Next: Job Control Variables, Pre 7.2 Job Control Builtins ======================== -'bg' +‘bg’ bg [JOBSPEC ...] Resume each suspended job JOBSPEC in the background, as if it had - been started with '&'. If JOBSPEC is not supplied, the current job + been started with ‘&’. If JOBSPEC is not supplied, the current job is used. The return status is zero unless it is run when job control is not enabled, or, when run with job control enabled, any JOBSPEC was not found or specifies a job that was started without job control. -'fg' +‘fg’ fg [JOBSPEC] Resume the job JOBSPEC in the foreground and make it the current @@ -7897,106 +7904,106 @@ File: bash.info, Node: Job Control Builtins, Next: Job Control Variables, Pre control enabled, JOBSPEC does not specify a valid job or JOBSPEC specifies a job that was started without job control. -'jobs' +‘jobs’ jobs [-lnprs] [JOBSPEC] jobs -x COMMAND [ARGUMENTS] The first form lists the active jobs. The options have the following meanings: - '-l' + ‘-l’ List process IDs in addition to the normal information. - '-n' + ‘-n’ Display information only about jobs that have changed status since the user was last notified of their status. - '-p' + ‘-p’ List only the process ID of the job's process group leader. - '-r' + ‘-r’ Display only running jobs. - '-s' + ‘-s’ Display only stopped jobs. If JOBSPEC is given, output is restricted to information about that job. If JOBSPEC is not supplied, the status of all jobs is listed. - If the '-x' option is supplied, 'jobs' replaces any JOBSPEC found + If the ‘-x’ option is supplied, ‘jobs’ replaces any JOBSPEC found in COMMAND or ARGUMENTS with the corresponding process group ID, and executes COMMAND, passing it ARGUMENTs, returning its exit status. -'kill' +‘kill’ kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC or PID kill -l|-L [EXIT_STATUS] Send a signal specified by SIGSPEC or SIGNUM to the process named by job specification JOBSPEC or process ID PID. SIGSPEC is either - a case-insensitive signal name such as 'SIGINT' (with or without - the 'SIG' prefix) or a signal number; SIGNUM is a signal number. - If SIGSPEC and SIGNUM are not present, 'SIGTERM' is used. The '-l' + a case-insensitive signal name such as ‘SIGINT’ (with or without + the ‘SIG’ prefix) or a signal number; SIGNUM is a signal number. + If SIGSPEC and SIGNUM are not present, ‘SIGTERM’ is used. The ‘-l’ option lists the signal names. If any arguments are supplied when - '-l' is given, the names of the signals corresponding to the + ‘-l’ is given, the names of the signals corresponding to the arguments are listed, and the return status is zero. EXIT_STATUS is a number specifying a signal number or the exit status of a - process terminated by a signal. The '-L' option is equivalent to - '-l'. The return status is zero if at least one signal was + process terminated by a signal. The ‘-L’ option is equivalent to + ‘-l’. The return status is zero if at least one signal was successfully sent, or non-zero if an error occurs or an invalid option is encountered. -'wait' +‘wait’ wait [-fn] [-p VARNAME] [JOBSPEC or PID ...] Wait until the child process specified by each process ID PID or job specification JOBSPEC exits and return the exit status of the last command waited for. If a job spec is given, all processes in - the job are waited for. If no arguments are given, 'wait' waits + the job are waited for. If no arguments are given, ‘wait’ 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 '-n' option is supplied, 'wait' waits for a + status is zero. If the ‘-n’ option is supplied, ‘wait’ waits for a single job from the list of PIDs or JOBSPECs or, if no arguments are supplied, any job, to complete and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the shell has no unwaited-for children, - the exit status is 127. If the '-p' option is supplied, the + the exit status is 127. If the ‘-p’ option is supplied, the process or job identifier of the job for which the exit status is returned is assigned to the variable VARNAME named by the option argument. The variable will be unset initially, before any - assignment. This is useful only when the '-n' option is supplied. - Supplying the '-f' option, when job control is enabled, forces - 'wait' to wait for each PID or JOBSPEC to terminate before + assignment. This is useful only when the ‘-n’ option is supplied. + Supplying the ‘-f’ option, when job control is enabled, forces + ‘wait’ to wait for each PID or JOBSPEC to terminate before returning its status, instead of returning when it changes status. If neither JOBSPEC nor PID specifies an active child process of the - shell, the return status is 127. If 'wait' is interrupted by a + shell, the return status is 127. If ‘wait’ is interrupted by a signal, the return status will be greater than 128, as described above (*note Signals::). Otherwise, the return status is the exit status of the last process or job waited for. -'disown' +‘disown’ disown [-ar] [-h] [JOBSPEC ... | PID ... ] Without options, remove each JOBSPEC from the table of active jobs. - If the '-h' option is given, the job is not removed from the table, - but is marked so that 'SIGHUP' is not sent to the job if the shell - receives a 'SIGHUP'. If JOBSPEC is not present, and neither the - '-a' nor the '-r' option is supplied, the current job is used. If - no JOBSPEC is supplied, the '-a' option means to remove or mark all - jobs; the '-r' option without a JOBSPEC argument restricts + If the ‘-h’ option is given, the job is not removed from the table, + but is marked so that ‘SIGHUP’ is not sent to the job if the shell + receives a ‘SIGHUP’. If JOBSPEC is not present, and neither the + ‘-a’ nor the ‘-r’ option is supplied, the current job is used. If + no JOBSPEC is supplied, the ‘-a’ option means to remove or mark all + jobs; the ‘-r’ option without a JOBSPEC argument restricts operation to running jobs. -'suspend' +‘suspend’ suspend [-f] - Suspend the execution of this shell until it receives a 'SIGCONT' + Suspend the execution of this shell until it receives a ‘SIGCONT’ signal. A login shell, or a shell without job control enabled, - cannot be suspended; the '-f' option can be used to override this + cannot be suspended; the ‘-f’ option can be used to 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 '-f' is not + is a login shell or job control is not enabled and ‘-f’ is not supplied. - When job control is not active, the 'kill' and 'wait' builtins do not + When job control is not active, the ‘kill’ and ‘wait’ builtins do not accept JOBSPEC arguments. They must be supplied process IDs.  @@ -8005,7 +8012,7 @@ File: bash.info, Node: Job Control Variables, Prev: Job Control Builtins, Up: 7.3 Job Control Variables ========================= -'auto_resume' +‘auto_resume’ This variable controls how the shell interacts with the user and job control. If this variable exists then single word simple commands without redirections are treated as candidates for @@ -8013,14 +8020,14 @@ File: bash.info, Node: Job Control Variables, Prev: Job Control Builtins, Up: there is more than one job beginning with the string typed, then the most recently accessed job will be selected. The name of a stopped job, in this context, is the command line used to start it. - If this variable is set to the value 'exact', the string supplied + If this variable is set to the value ‘exact’, the string supplied must match the name of a stopped job exactly; if set to - 'substring', the string supplied needs to match a substring of the - name of a stopped job. The 'substring' value provides - functionality analogous to the '%?' job ID (*note Job Control + ‘substring’, the string supplied needs to match a substring of the + name of a stopped job. The ‘substring’ value provides + functionality analogous to the ‘%?’ job ID (*note Job Control Basics::). If set to any other value, the supplied string must be a prefix of a stopped job's name; this provides functionality - analogous to the '%' job ID. + analogous to the ‘%’ job ID.  File: bash.info, Node: Command Line Editing, Next: Using History Interactively, Prev: Job Control, Up: Top @@ -8032,14 +8039,14 @@ This chapter describes the basic features of the GNU command line editing interface. Command line editing is provided by the Readline library, which is used by several different programs, including Bash. Command line editing is enabled by default when using an interactive -shell, unless the '--noediting' option is supplied at shell invocation. -Line editing is also used when using the '-e' option to the 'read' +shell, unless the ‘--noediting’ option is supplied at shell invocation. +Line editing is also used when using the ‘-e’ option to the ‘read’ builtin command (*note Bash Builtins::). By default, the line editing commands are similar to those of Emacs. A vi-style line editing interface is also available. Line editing can be enabled at any time -using the '-o emacs' or '-o vi' options to the 'set' builtin command -(*note The Set Builtin::), or disabled using the '+o emacs' or '+o vi' -options to 'set'. +using the ‘-o emacs’ or ‘-o vi’ options to the ‘set’ builtin command +(*note The Set Builtin::), or disabled using the ‘+o emacs’ or ‘+o vi’ +options to ‘set’. * Menu: @@ -8066,10 +8073,10 @@ File: bash.info, Node: Introduction and Notation, Next: Readline Interaction, The following paragraphs describe the notation used to represent keystrokes. - The text 'C-k' is read as 'Control-K' and describes the character + The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. - The text 'M-k' is read as 'Meta-K' and describes the character + The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the key is pressed. The Meta key is labeled on many keyboards. On keyboards with two keys labeled (usually to either side of the @@ -8080,11 +8087,11 @@ Compose key for typing accented characters. If you do not have a Meta or key, or another key working as a Meta key, the identical keystroke can be generated by typing -_first_, and then typing . Either process is known as "metafying" +_first_, and then typing . Either process is known as “metafying” the key. - The text 'M-C-k' is read as 'Meta-Control-k' and describes the -character produced by "metafying" 'C-k'. + The text ‘M-C-k’ is read as 'Meta-Control-k' and describes the +character produced by “metafying” ‘C-k’. In addition, several keys have their own names. Specifically, , , , , , and all stand for themselves when seen @@ -8131,8 +8138,8 @@ character to back up and delete the mistyped character. Sometimes you may mistype a character, and not notice the error until you have typed several other characters. In that case, you can type -'C-b' to move the cursor to the left, and then correct your mistake. -Afterwards, you can move the cursor to the right with 'C-f'. +‘C-b’ to move the cursor to the left, and then correct your mistake. +Afterwards, you can move the cursor to the right with ‘C-f’. When you add text in the middle of a line, you will notice that characters to the right of the cursor are 'pushed over' to make room for @@ -8141,23 +8148,23 @@ the cursor, characters to the right of the cursor are 'pulled back' to fill in the blank space created by the removal of the text. A list of the bare essentials for editing the text of an input line follows. -'C-b' +‘C-b’ Move back one character. -'C-f' +‘C-f’ Move forward one character. or Delete the character to the left of the cursor. -'C-d' +‘C-d’ Delete the character underneath the cursor. Printing characters Insert the character into the line at the cursor. -'C-_' or 'C-x C-u' +‘C-_’ or ‘C-x C-u’ Undo the last editing command. You can undo all the way back to an empty line. (Depending on your configuration, the key might be set to delete the character to the left of the cursor and the key set to -delete the character underneath the cursor, like 'C-d', rather than the +delete the character underneath the cursor, like ‘C-d’, rather than the character to the left of the cursor.)  @@ -8168,22 +8175,22 @@ File: bash.info, Node: Readline Movement Commands, Next: Readline Killing Comm The above table describes the most basic keystrokes that you need in order to do editing of the input line. For your convenience, many other -commands have been added in addition to 'C-b', 'C-f', 'C-d', and . +commands have been added in addition to ‘C-b’, ‘C-f’, ‘C-d’, and . Here are some commands for moving more rapidly about the line. -'C-a' +‘C-a’ Move to the start of the line. -'C-e' +‘C-e’ Move to the end of the line. -'M-f' +‘M-f’ Move forward a word, where a word is composed of letters and digits. -'M-b' +‘M-b’ Move backward a word. -'C-l' +‘C-l’ Clear the screen, reprinting the current line at the top. - Notice how 'C-f' moves forward a character, while 'M-f' moves forward + Notice how ‘C-f’ moves forward a character, while ‘M-f’ moves forward a word. It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words. @@ -8193,15 +8200,15 @@ File: bash.info, Node: Readline Killing Commands, Next: Readline Arguments, P 8.2.3 Readline Killing Commands ------------------------------- -"Killing" text means to delete the text from the line, but to save it -away for later use, usually by "yanking" (re-inserting) it back into the +“Killing” text means to delete the text from the line, but to save it +away for later use, usually by “yanking” (re-inserting) it back into the line. ('Cut' and 'paste' are more recent jargon for 'kill' and 'yank'.) If the description for a command says that it 'kills' text, then you can be sure that you can get the text back in a different (or the same) place later. - When you use a kill command, the text is saved in a "kill-ring". Any + When you use a kill command, the text is saved in a “kill-ring”. Any number of consecutive kills save all of the killed text together, so that when you yank it back, you get it all. The kill ring is not line specific; the text that you killed on a previously typed line is @@ -8209,34 +8216,34 @@ available to be yanked back later, when you are typing another line. Here is the list of commands for killing text. -'C-k' +‘C-k’ Kill the text from the current cursor position to the end of the line. -'M-d' +‘M-d’ Kill from the cursor 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 'M-f'. + as those used by ‘M-f’. -'M-' +‘M-’ Kill from the cursor to the start of the current word, or, if between words, to the start of the previous word. Word boundaries - are the same as those used by 'M-b'. + are the same as those used by ‘M-b’. -'C-w' +‘C-w’ Kill from the cursor to the previous whitespace. This is different - than 'M-' because the word boundaries differ. + than ‘M-’ because the word boundaries differ. - Here is how to "yank" the text back into the line. Yanking means to + Here is how to “yank” the text back into the line. Yanking means to copy the most-recently-killed text from the kill buffer. -'C-y' +‘C-y’ Yank the most recently killed text back into the buffer at the cursor. -'M-y' +‘M-y’ Rotate the kill-ring, and yank the new top. You can only do this - if the prior command is 'C-y' or 'M-y'. + if the prior command is ‘C-y’ or ‘M-y’.  File: bash.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction @@ -8249,14 +8256,14 @@ argument acts as a repeat count, other times it is the sign of the argument that is significant. If you pass a negative argument to a command which normally acts in a forward direction, that command will act in a backward direction. For example, to kill text back to the -start of the line, you might type 'M-- C-k'. +start of the line, you might type ‘M-- C-k’. The general way to pass numeric arguments to a command is to type meta digits before the command. If the first 'digit' typed is a minus -sign ('-'), then the sign of the argument will be negative. Once you +sign (‘-’), then the sign of the argument will be negative. Once you have typed one meta digit to get the argument started, you can type the remainder of the digits, and then the command. For example, to give the -'C-d' command an argument of 10, you could type 'M-1 0 C-d', which will +‘C-d’ command an argument of 10, you could type ‘M-1 0 C-d’, which will delete the next ten characters on the input line.  @@ -8267,25 +8274,25 @@ File: bash.info, Node: Searching, Prev: Readline Arguments, Up: Readline Inte Readline provides commands for searching through the command history (*note Bash History Facilities::) for lines containing a specified -string. There are two search modes: "incremental" and -"non-incremental". +string. There are two search modes: “incremental” and +“non-incremental”. Incremental searches begin before the user has finished typing the search string. As each character of the search string is typed, Readline 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. To search backward in the -history for a particular string, type 'C-r'. Typing 'C-s' searches +history for a particular string, type ‘C-r’. Typing ‘C-s’ searches forward through the history. The characters present in the value of the -'isearch-terminators' variable are used to terminate an incremental +‘isearch-terminators’ variable are used to terminate an incremental search. If that variable has not been assigned a value, the and -'C-J' characters will terminate an incremental search. 'C-g' will abort +‘C-J’ characters will terminate an incremental search. ‘C-g’ will abort an incremental search and restore 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 'C-r' or -'C-s' as appropriate. This will search backward or forward in the + To find other matching entries in the history list, type ‘C-r’ or +‘C-s’ as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. Any other key sequence bound to a Readline command will terminate the search and execute that command. For instance, a will terminate the @@ -8293,9 +8300,9 @@ search and accept the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing. - Readline remembers the last incremental search string. If two 'C-r's + Readline remembers the last incremental search string. If two ‘C-r’s are typed without any intervening characters defining a new search -string, any remembered search string is used. +string, Readline uses any remembered search string. Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be @@ -8310,18 +8317,18 @@ File: bash.info, Node: Readline Init File, Next: Bindable Readline Commands, Although the Readline library comes with a set of Emacs-like keybindings installed by default, it is possible to use a different set of keybindings. Any user can customize programs that use Readline by -putting commands in an "inputrc" file, conventionally in their home +putting commands in an “inputrc” file, conventionally in their home directory. The name of this file is taken from the value of the shell -variable 'INPUTRC'. If that variable is unset, the default is -'~/.inputrc'. If that file does not exist or cannot be read, the -ultimate default is '/etc/inputrc'. The 'bind' builtin command can also +variable ‘INPUTRC’. If that variable is unset, the default is +‘~/.inputrc’. If that file does not exist or cannot be read, the +ultimate default is ‘/etc/inputrc’. The ‘bind’ builtin command can also be used to set Readline keybindings and variables. *Note Bash Builtins::. When a program which uses the Readline library starts up, the init file is read, and the key bindings are set. - In addition, the 'C-x C-r' command re-reads this init file, thus + In addition, the ‘C-x C-r’ command re-reads this init file, thus incorporating any changes that you might have made to it. * Menu: @@ -8339,20 +8346,20 @@ File: bash.info, Node: Readline Init File Syntax, Next: Conditional Init Const ------------------------------- There are only a few basic constructs allowed in the Readline init file. -Blank lines are ignored. Lines beginning with a '#' are comments. -Lines beginning with a '$' indicate conditional constructs (*note +Blank lines are ignored. Lines beginning with a ‘#’ are comments. +Lines beginning with a ‘$’ indicate conditional constructs (*note Conditional Init Constructs::). Other lines denote variable settings and key bindings. Variable Settings You can modify the run-time behavior of Readline by altering the - values of variables in Readline using the 'set' command within the + values of variables in Readline using the ‘set’ command within the init file. The syntax is simple: set VARIABLE VALUE Here, for example, is how to change from the default Emacs-like key - binding to use 'vi' line editing commands: + binding to use ‘vi’ line editing commands: set editing-mode vi @@ -8363,16 +8370,16 @@ Variable Settings on if the value is null or empty, ON (case-insensitive), or 1. Any other value results in the variable being set to off. - The 'bind -V' command lists the current Readline variable names and + The ‘bind -V’ command lists the current Readline variable names and values. *Note Bash Builtins::. A great deal of run-time behavior is changeable with the following variables. - 'active-region-start-color' + ‘active-region-start-color’ A string variable that controls the text color and background when displaying the text in the active region (see the - description of 'enable-active-region' below). This string + description of ‘enable-active-region’ below). This string must not take up any physical character positions on the display, so it should consist only of terminal escape sequences. It is output to the terminal before displaying the @@ -8380,11 +8387,11 @@ Variable Settings default value whenever the terminal type changes. The default value is the string that puts the terminal in standout mode, as obtained from the terminal's terminfo description. A - sample value might be '\e[01;33m'. + sample value might be ‘\e[01;33m’. - 'active-region-end-color' + ‘active-region-end-color’ A string variable that "undoes" the effects of - 'active-region-start-color' and restores "normal" terminal + ‘active-region-start-color’ and restores "normal" terminal display appearance after displaying text in the active region. This string must not take up any physical character positions on the display, so it should consist only of terminal escape @@ -8393,75 +8400,75 @@ Variable Settings default value whenever the terminal type changes. The default value is the string that restores the terminal from standout mode, as obtained from the terminal's terminfo description. A - sample value might be '\e[0m'. + sample value might be ‘\e[0m’. - 'bell-style' + ‘bell-style’ Controls what happens when Readline wants to ring the terminal - bell. If set to 'none', Readline never rings the bell. If - set to 'visible', Readline uses a visible bell if one is - available. If set to 'audible' (the default), Readline + bell. If set to ‘none’, Readline never rings the bell. If + set to ‘visible’, Readline uses a visible bell if one is + available. If set to ‘audible’ (the default), Readline attempts to ring the terminal's bell. - 'bind-tty-special-chars' - If set to 'on' (the default), Readline attempts to bind the + ‘bind-tty-special-chars’ + If set to ‘on’ (the default), Readline attempts to bind the control characters that are treated specially by the kernel's terminal driver to their Readline equivalents. These override - the default Readline bindings described here. Type 'stty -a' + the default Readline bindings described here. Type ‘stty -a’ at a Bash prompt to see your current terminal settings, - including the special control characters (usually 'cchars'). + including the special control characters (usually ‘cchars’). - 'blink-matching-paren' - If set to 'on', Readline attempts to briefly move the cursor + ‘blink-matching-paren’ + If set to ‘on’, Readline attempts to briefly move the cursor to an opening parenthesis when a closing parenthesis is - inserted. The default is 'off'. + inserted. The default is ‘off’. - 'colored-completion-prefix' - If set to 'on', when listing completions, Readline displays + ‘colored-completion-prefix’ + If set to ‘on’, when listing completions, Readline displays the common prefix of the set of possible completions using a different color. The color definitions are taken from the - value of the 'LS_COLORS' environment variable. If there is a - color definition in 'LS_COLORS' for the custom suffix - 'readline-colored-completion-prefix', Readline uses this color + value of the ‘LS_COLORS’ environment variable. If there is a + color definition in ‘LS_COLORS’ for the custom suffix + ‘readline-colored-completion-prefix’, Readline uses this color for the common prefix instead of its default. The default is - 'off'. + ‘off’. - 'colored-stats' - If set to 'on', Readline displays possible completions using + ‘colored-stats’ + If set to ‘on’, Readline displays possible completions using different colors to indicate their file type. The color - definitions are taken from the value of the 'LS_COLORS' - environment variable. The default is 'off'. + definitions are taken from the value of the ‘LS_COLORS’ + environment variable. The default is ‘off’. - 'comment-begin' + ‘comment-begin’ The string to insert at the beginning of the line when the - 'insert-comment' command is executed. The default value is - '"#"'. + ‘insert-comment’ command is executed. The default value is + ‘"#"’. - 'completion-display-width' + ‘completion-display-width’ The number of screen columns used to display possible matches when performing completion. The value is ignored if it is less than 0 or greater than the terminal screen width. A value of 0 will cause matches to be displayed one per line. The default value is -1. - 'completion-ignore-case' - If set to 'on', Readline performs filename matching and + ‘completion-ignore-case’ + If set to ‘on’, Readline performs filename matching and completion in a case-insensitive fashion. The default value - is 'off'. + is ‘off’. - 'completion-map-case' - If set to 'on', and COMPLETION-IGNORE-CASE is enabled, - Readline treats hyphens ('-') and underscores ('_') as + ‘completion-map-case’ + If set to ‘on’, and COMPLETION-IGNORE-CASE is enabled, + Readline treats hyphens (‘-’) and underscores (‘_’) as equivalent when performing case-insensitive filename matching - and completion. The default value is 'off'. + and completion. The default value is ‘off’. - 'completion-prefix-display-length' + ‘completion-prefix-display-length’ The length in characters of the common prefix of a list of possible completions that is displayed without modification. When set to a value greater than zero, common prefixes longer than this value are replaced with an ellipsis when displaying possible completions. - 'completion-query-items' + ‘completion-query-items’ The number of possible completions that determines when the user is asked whether the list of possibilities should be displayed. If the number of possible completions is greater @@ -8470,88 +8477,88 @@ Variable Settings listed. This variable must be set to an integer value greater than or equal to zero. A zero value means Readline should never ask; negative values are treated as zero. The default - limit is '100'. + limit is ‘100’. - 'convert-meta' - If set to 'on', Readline will convert characters with the + ‘convert-meta’ + If set to ‘on’, Readline will convert characters with the eighth bit set to an ASCII key sequence by stripping the eighth bit and prefixing an character, converting them - to a meta-prefixed key sequence. The default value is 'on', - but will be set to 'off' if the locale is one that contains + to a meta-prefixed key sequence. The default value is ‘on’, + but will be set to ‘off’ if the locale is one that contains eight-bit characters. This variable is dependent on the - 'LC_CTYPE' locale category, and may change if the locale is + ‘LC_CTYPE’ locale category, and may change if the locale is changed. - 'disable-completion' - If set to 'On', Readline will inhibit word completion. + ‘disable-completion’ + If set to ‘On’, Readline will inhibit word completion. Completion characters will be inserted into the line as if - they had been mapped to 'self-insert'. The default is 'off'. + they had been mapped to ‘self-insert’. The default is ‘off’. - 'echo-control-characters' - When set to 'on', on operating systems that indicate they + ‘echo-control-characters’ + When set to ‘on’, on operating systems that indicate they support it, Readline echoes a character corresponding to a - signal generated from the keyboard. The default is 'on'. + signal generated from the keyboard. The default is ‘on’. - 'editing-mode' - The 'editing-mode' variable controls which default set of key + ‘editing-mode’ + The ‘editing-mode’ variable controls which default set of key bindings is used. By default, Readline starts up in Emacs editing mode, where the keystrokes are most similar to Emacs. - This variable can be set to either 'emacs' or 'vi'. + This variable can be set to either ‘emacs’ or ‘vi’. - 'emacs-mode-string' + ‘emacs-mode-string’ If the SHOW-MODE-IN-PROMPT variable is enabled, this string is displayed immediately before the last line of the primary prompt when emacs editing mode is active. The value is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences is available. - Use the '\1' and '\2' escapes to begin and end sequences of + Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal - control sequence into the mode string. The default is '@'. + control sequence into the mode string. The default is ‘@’. - 'enable-active-region' - The "point" is the current cursor position, and "mark" refers + ‘enable-active-region’ + The “point” is the current cursor position, and “mark” refers to a saved cursor position (*note Commands For Moving::). The text between the point and mark is referred to as the - "region". When this variable is set to 'On', Readline allows - certain commands to designate the region as "active". When + “region”. When this variable is set to ‘On’, Readline allows + certain commands to designate the region as “active”. When the region is active, Readline highlights the text in the - region using the value of the 'active-region-start-color', + region using the value of the ‘active-region-start-color’, which defaults to the string that enables the terminal's standout mode. The active region shows the text inserted by bracketed-paste and any matching text found by incremental and - non-incremental history searches. The default is 'On'. + non-incremental history searches. The default is ‘On’. - 'enable-bracketed-paste' - When set to 'On', Readline configures the terminal to insert + ‘enable-bracketed-paste’ + When set to ‘On’, Readline configures the terminal to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard. This is called putting the - terminal into "bracketed paste mode"; it prevents Readline + terminal into “bracketed paste mode”; it prevents Readline from executing any editing commands bound to key sequences - appearing in the pasted text. The default is 'On'. + appearing in the pasted text. The default is ‘On’. - 'enable-keypad' - When set to 'on', Readline will try to enable the application + ‘enable-keypad’ + When set to ‘on’, Readline will try to enable the application keypad when it is called. Some systems need this to enable - the arrow keys. The default is 'off'. + the arrow keys. The default is ‘off’. - 'enable-meta-key' - When set to 'on', Readline will try to enable any meta + ‘enable-meta-key’ + When set to ‘on’, Readline will try to enable any meta modifier key the terminal claims to support when it is called. On many terminals, the meta key is used to send eight-bit - characters. The default is 'on'. + characters. The default is ‘on’. - 'expand-tilde' - If set to 'on', tilde expansion is performed when Readline - attempts word completion. The default is 'off'. + ‘expand-tilde’ + If set to ‘on’, tilde expansion is performed when Readline + attempts word completion. The default is ‘off’. - 'history-preserve-point' - If set to 'on', the history code attempts to place the point + ‘history-preserve-point’ + If set to ‘on’, the history code attempts to place the point (the current cursor position) at the same location on each - history line retrieved with 'previous-history' or - 'next-history'. The default is 'off'. + history line retrieved with ‘previous-history’ or + ‘next-history’. The default is ‘off’. - 'history-size' + ‘history-size’ Set the maximum number of history entries saved in the history list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less @@ -8560,43 +8567,43 @@ Variable Settings attempt is made to set HISTORY-SIZE to a non-numeric value, the maximum number of history entries will be set to 500. - 'horizontal-scroll-mode' - This variable can be set to either 'on' or 'off'. Setting it - to 'on' means that the text of the lines being edited will + ‘horizontal-scroll-mode’ + This variable can be set to either ‘on’ or ‘off’. Setting it + to ‘on’ means that the text of the lines being edited will scroll horizontally on a single screen line when they are longer than the width of the screen, instead of wrapping onto - a new screen line. This variable is automatically set to 'on' + a new screen line. This variable is automatically set to ‘on’ for terminals of height 1. By default, this variable is set - to 'off'. + to ‘off’. - 'input-meta' - If set to 'on', Readline will enable eight-bit input (it will + ‘input-meta’ + If set to ‘on’, Readline will enable eight-bit input (it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The - default value is 'off', but Readline will set it to 'on' if + default value is ‘off’, but Readline will set it to ‘on’ if the locale contains eight-bit characters. The name - 'meta-flag' is a synonym for this variable. This variable is - dependent on the 'LC_CTYPE' locale category, and may change if + ‘meta-flag’ is a synonym for this variable. This variable is + dependent on the ‘LC_CTYPE’ locale category, and may change if the locale is changed. - 'isearch-terminators' + ‘isearch-terminators’ The string of characters that should terminate an incremental search without subsequently executing the character as a command (*note Searching::). If this variable has not been - given a value, the characters and 'C-J' will terminate + given a value, the characters and ‘C-J’ will terminate an incremental search. - 'keymap' + ‘keymap’ Sets Readline's idea of the current keymap for key binding - commands. Built-in 'keymap' names are 'emacs', - 'emacs-standard', 'emacs-meta', 'emacs-ctlx', 'vi', 'vi-move', - 'vi-command', and 'vi-insert'. 'vi' is equivalent to - 'vi-command' ('vi-move' is also a synonym); 'emacs' is - equivalent to 'emacs-standard'. Applications may add - additional names. The default value is 'emacs'. The value of - the 'editing-mode' variable also affects the default keymap. - - 'keyseq-timeout' + commands. Built-in ‘keymap’ names are ‘emacs’, + ‘emacs-standard’, ‘emacs-meta’, ‘emacs-ctlx’, ‘vi’, ‘vi-move’, + ‘vi-command’, and ‘vi-insert’. ‘vi’ is equivalent to + ‘vi-command’ (‘vi-move’ is also a synonym); ‘emacs’ is + equivalent to ‘emacs-standard’. Applications may add + additional names. The default value is ‘emacs’. The value of + the ‘editing-mode’ variable also affects the default keymap. + + ‘keyseq-timeout’ Specifies the duration Readline 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 @@ -8604,130 +8611,130 @@ Variable Settings input is received within the timeout, Readline will use the shorter but complete key sequence. Readline uses this value to determine whether or not input is available on the current - input source ('rl_instream' by default). The value is + input source (‘rl_instream’ by default). The value is specified in milliseconds, so a value of 1000 means that Readline 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, Readline will wait until another key is pressed to decide which key sequence to complete. The default - value is '500'. + value is ‘500’. - 'mark-directories' - If set to 'on', completed directory names have a slash - appended. The default is 'on'. + ‘mark-directories’ + If set to ‘on’, completed directory names have a slash + appended. The default is ‘on’. - 'mark-modified-lines' - This variable, when set to 'on', causes Readline to display an - asterisk ('*') at the start of history lines which have been - modified. This variable is 'off' by default. + ‘mark-modified-lines’ + This variable, when set to ‘on’, causes Readline to display an + asterisk (‘*’) at the start of history lines which have been + modified. This variable is ‘off’ by default. - 'mark-symlinked-directories' - If set to 'on', completed names which are symbolic links to + ‘mark-symlinked-directories’ + If set to ‘on’, completed names which are symbolic links to directories have a slash appended (subject to the value of - 'mark-directories'). The default is 'off'. + ‘mark-directories’). The default is ‘off’. - 'match-hidden-files' - This variable, when set to 'on', causes Readline to match - files whose names begin with a '.' (hidden files) when - performing filename completion. If set to 'off', the leading - '.' must be supplied by the user in the filename to be - completed. This variable is 'on' by default. + ‘match-hidden-files’ + This variable, when set to ‘on’, forces Readline to match + files whose names begin with a ‘.’ (hidden files) when + performing filename completion. If set to ‘off’, the user + must include the leading ‘.’ in the filename to be completed. + This variable is ‘on’ by default. - 'menu-complete-display-prefix' - If set to 'on', menu completion displays the common prefix of + ‘menu-complete-display-prefix’ + If set to ‘on’, menu completion displays the common prefix of the list of possible completions (which may be empty) before - cycling through the list. The default is 'off'. + cycling through the list. The default is ‘off’. - 'output-meta' - If set to 'on', Readline will display characters with the + ‘output-meta’ + If set to ‘on’, Readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape - sequence. The default is 'off', but Readline will set it to - 'on' if the locale contains eight-bit characters. This - variable is dependent on the 'LC_CTYPE' locale category, and + sequence. The default is ‘off’, but Readline will set it to + ‘on’ if the locale contains eight-bit characters. This + variable is dependent on the ‘LC_CTYPE’ locale category, and may change if the locale is changed. - 'page-completions' - If set to 'on', Readline uses an internal 'more'-like pager to + ‘page-completions’ + If set to ‘on’, Readline uses an internal ‘more’-like pager to display a screenful of possible completions at a time. This - variable is 'on' by default. + variable is ‘on’ by default. - 'print-completions-horizontally' - If set to 'on', Readline will display completions with matches + ‘print-completions-horizontally’ + If set to ‘on’, Readline will display completions with matches sorted horizontally in alphabetical order, rather than down - the screen. The default is 'off'. + the screen. The default is ‘off’. - 'revert-all-at-newline' - If set to 'on', Readline will undo all changes to history - lines before returning when 'accept-line' is executed. By + ‘revert-all-at-newline’ + If set to ‘on’, Readline will undo all changes to history + lines before returning when ‘accept-line’ is executed. By default, history lines may be modified and retain individual - undo lists across calls to 'readline()'. The default is - 'off'. + undo lists across calls to ‘readline()’. The default is + ‘off’. - 'search-ignore-case' - If set to 'on', Readline performs incremental and + ‘search-ignore-case’ + If set to ‘on’, Readline performs incremental and non-incremental history list searches in a case-insensitive - fashion. The default value is 'off'. + fashion. The default value is ‘off’. - 'show-all-if-ambiguous' + ‘show-all-if-ambiguous’ This alters the default behavior of the completion functions. - If set to 'on', words which have more than one possible + If set to ‘on’, words which have more than one possible completion cause the matches to be listed immediately instead - of ringing the bell. The default value is 'off'. + of ringing the bell. The default value is ‘off’. - 'show-all-if-unmodified' + ‘show-all-if-unmodified’ This alters the default behavior of the completion functions in a fashion similar to SHOW-ALL-IF-AMBIGUOUS. If set to - 'on', words which have more than one possible completion + ‘on’, words which have more than one possible completion without any possible partial completion (the possible completions don't share a common prefix) cause the matches to be listed immediately instead of ringing the bell. The - default value is 'off'. + default value is ‘off’. - 'show-mode-in-prompt' - If set to 'on', add a string to the beginning of the prompt + ‘show-mode-in-prompt’ + If set to ‘on’, add a string to the beginning of the prompt indicating the editing mode: emacs, vi command, or vi insertion. The mode strings are user-settable (e.g., - EMACS-MODE-STRING). The default value is 'off'. + EMACS-MODE-STRING). The default value is ‘off’. - 'skip-completed-text' - If set to 'on', this alters the default completion behavior + ‘skip-completed-text’ + If set to ‘on’, 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, Readline 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. For instance, if this is enabled, attempting - completion when the cursor is after the 'e' in 'Makefile' will - result in 'Makefile' rather than 'Makefilefile', assuming + completion when the cursor is after the ‘e’ in ‘Makefile’ will + result in ‘Makefile’ rather than ‘Makefilefile’, assuming there is a single possible completion. The default value is - 'off'. + ‘off’. - 'vi-cmd-mode-string' + ‘vi-cmd-mode-string’ If the SHOW-MODE-IN-PROMPT 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 is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences - is available. Use the '\1' and '\2' escapes to begin and end + is available. Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The - default is '(cmd)'. + default is ‘(cmd)’. - 'vi-ins-mode-string' + ‘vi-ins-mode-string’ If the SHOW-MODE-IN-PROMPT 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. Use the '\1' and '\2' escapes to begin and end + is available. Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The - default is '(ins)'. + default is ‘(ins)’. - 'visible-stats' - If set to 'on', a character denoting a file's type is appended + ‘visible-stats’ + If set to ‘on’, a character denoting a file's type is appended to the filename when listing possible completions. The - default is 'off'. + default is ‘off’. Key Bindings The syntax for controlling key bindings in the init file is simple. @@ -8746,7 +8753,7 @@ Key Bindings In addition to command names, Readline allows keys to be bound to a string that is inserted when the key is pressed (a MACRO). - The 'bind -p' command displays Readline function names and bindings + The ‘bind -p’ command displays Readline function names and bindings in a format that can be put directly into an initialization file. *Note Bash Builtins::. @@ -8757,11 +8764,11 @@ Key Bindings Meta-Rubout: backward-kill-word Control-o: "> output" - In the example above, 'C-u' is bound to the function - 'universal-argument', 'M-DEL' is bound to the function - 'backward-kill-word', and 'C-o' is bound to run the macro + In the example above, ‘C-u’ is bound to the function + ‘universal-argument’, ‘M-DEL’ is bound to the function + ‘backward-kill-word’, and ‘C-o’ is bound to run the macro expressed on the right hand side (that is, to insert the text - '> output' into the line). + ‘> output’ into the line). A number of symbolic character names are recognized while processing this key binding syntax: DEL, ESC, ESCAPE, LFD, @@ -8778,51 +8785,51 @@ Key Bindings "\C-x\C-r": re-read-init-file "\e[11~": "Function Key 1" - In the above example, 'C-u' is again bound to the function - 'universal-argument' (just as it was in the first example), - ''C-x' 'C-r'' is bound to the function 're-read-init-file', - and ' <[> <1> <1> <~>' is bound to insert the text - 'Function Key 1'. + In the above example, ‘C-u’ is again bound to the function + ‘universal-argument’ (just as it was in the first example), + ‘‘C-x’ ‘C-r’’ is bound to the function ‘re-read-init-file’, + and ‘ <[> <1> <1> <~>’ is bound to insert the text + ‘Function Key 1’. The following GNU Emacs style escape sequences are available when specifying key sequences: - '\C-' + ‘\C-’ control prefix - '\M-' + ‘\M-’ meta prefix - '\e' + ‘\e’ an escape character - '\\' + ‘\\’ backslash - '\"' + ‘\"’ <">, a double quotation mark - '\'' + ‘\'’ <'>, a single quote or apostrophe In addition to the GNU Emacs style escape sequences, a second set of backslash escapes is available: - '\a' + ‘\a’ alert (bell) - '\b' + ‘\b’ backspace - '\d' + ‘\d’ delete - '\f' + ‘\f’ form feed - '\n' + ‘\n’ newline - '\r' + ‘\r’ carriage return - '\t' + ‘\t’ horizontal tab - '\v' + ‘\v’ vertical tab - '\NNN' + ‘\NNN’ the eight-bit character whose value is the octal value NNN (one to three digits) - '\xHH' + ‘\xHH’ the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) @@ -8830,8 +8837,8 @@ Key Bindings used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. 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 + character in the macro text, including ‘"’ and ‘'’. For example, + the following binding will make ‘‘C-x’ \’ insert a single ‘\’ into the line: "\C-x\\": "\\" @@ -8846,45 +8853,45 @@ 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 used. -'$if' - The '$if' construct allows bindings to be made based on the editing +‘$if’ + The ‘$if’ construct allows bindings to be made based on the editing mode, the terminal being used, or the application using Readline. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it. - 'mode' - The 'mode=' form of the '$if' directive is used to test - whether Readline is in 'emacs' or 'vi' mode. This may be used - in conjunction with the 'set keymap' command, for instance, to - set bindings in the 'emacs-standard' and 'emacs-ctlx' keymaps - only if Readline is starting out in 'emacs' mode. + ‘mode’ + The ‘mode=’ form of the ‘$if’ directive is used to test + whether Readline is in ‘emacs’ or ‘vi’ mode. This may be used + in conjunction with the ‘set keymap’ command, for instance, to + set bindings in the ‘emacs-standard’ and ‘emacs-ctlx’ keymaps + only if Readline is starting out in ‘emacs’ mode. - 'term' - The 'term=' form may be used to include terminal-specific key + ‘term’ + The ‘term=’ 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 terminal and - the portion of the terminal name before the first '-'. This - allows 'sun' to match both 'sun' and 'sun-cmd', for instance. + ‘=’ is tested against both the full name of the terminal and + the portion of the terminal name before the first ‘-’. This + allows ‘sun’ to match both ‘sun’ and ‘sun-cmd’, for instance. - 'version' - The 'version' test may be used to perform comparisons against - specific Readline versions. The 'version' expands to the + ‘version’ + The ‘version’ test may be used to perform comparisons against + specific Readline versions. The ‘version’ expands to the current Readline version. The set of comparison operators - includes '=' (and '=='), '!=', '<=', '>=', '<', and '>'. The + includes ‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, and ‘>’. The version number supplied on the right side of the operator consists of a major version number, an optional decimal point, - and an optional minor version (e.g., '7.1'). If the minor - version is omitted, it is assumed to be '0'. The operator may - be separated from the string 'version' and from the version + and an optional minor version (e.g., ‘7.1’). If the minor + version is omitted, it is assumed to be ‘0’. The operator may + be separated from the string ‘version’ and from the version number argument by whitespace. The following example sets a variable if the Readline version being used is 7.0 or newer: $if version >= 7.0 set show-mode-in-prompt on $endif - 'application' + ‘application’ The APPLICATION construct is used to include application-specific settings. Each program using the Readline library sets the APPLICATION NAME, and you can test @@ -8897,32 +8904,32 @@ four parser directives used. "\C-xq": "\eb\"\ef\"" $endif - 'variable' + ‘variable’ The VARIABLE construct provides simple equality tests for Readline variables and values. The permitted comparison - operators are '=', '==', and '!='. The variable name must be + 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. Both string and boolean variables may be tested. Boolean variables must be tested against the values ON and OFF. The following example is equivalent to the - 'mode=emacs' test described above: + ‘mode=emacs’ test described above: $if editing-mode == emacs set show-mode-in-prompt on $endif -'$endif' - This command, as seen in the previous example, terminates an '$if' +‘$endif’ + This command, as seen in the previous example, terminates an ‘$if’ command. -'$else' - Commands in this branch of the '$if' directive are executed if the +‘$else’ + Commands in this branch of the ‘$if’ directive are executed if the test fails. -'$include' +‘$include’ This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following - directive reads from '/etc/inputrc': + directive reads from ‘/etc/inputrc’: $include /etc/inputrc  @@ -9052,15 +9059,15 @@ File: bash.info, Node: Bindable Readline Commands, Next: Readline vi Mode, Pr * Miscellaneous Commands:: Other miscellaneous commands. This section describes Readline commands that may be bound to key -sequences. You can list your key bindings by executing 'bind -P' or, -for a more terse format, suitable for an INPUTRC file, 'bind -p'. +sequences. You can list your key bindings by executing ‘bind -P’ or, +for a more terse format, suitable for an INPUTRC file, ‘bind -p’. (*Note Bash Builtins::.) Command names without an accompanying key sequence are unbound by default. - In the following descriptions, "point" refers to the current cursor -position, and "mark" refers to a cursor position saved by the 'set-mark' + In the following descriptions, “point” refers to the current cursor +position, and “mark” refers to a cursor position saved by the ‘set-mark’ command. The text between the point and mark is referred to as the -"region". +“region”.  File: bash.info, Node: Commands For Moving, Next: Commands For History, Up: Bindable Readline Commands @@ -9068,58 +9075,58 @@ File: bash.info, Node: Commands For Moving, Next: Commands For History, Up: B 8.4.1 Commands For Moving ------------------------- -'beginning-of-line (C-a)' +‘beginning-of-line (C-a)’ Move to the start of the current line. -'end-of-line (C-e)' +‘end-of-line (C-e)’ Move to the end of the line. -'forward-char (C-f)' +‘forward-char (C-f)’ Move forward a character. -'backward-char (C-b)' +‘backward-char (C-b)’ Move back a character. -'forward-word (M-f)' +‘forward-word (M-f)’ Move forward to the end of the next word. Words are composed of letters and digits. -'backward-word (M-b)' +‘backward-word (M-b)’ Move back to the start of the current or previous word. Words are composed of letters and digits. -'shell-forward-word (M-C-f)' +‘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 (M-C-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. -'previous-screen-line ()' +‘previous-screen-line ()’ 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 Readline 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. -'next-screen-line ()' +‘next-screen-line ()’ Attempt to move point to the same physical screen column on the next physical screen line. This will not have the desired effect if the current Readline line does not take up more than one physical line or if the length of the current Readline line is not greater than the length of the prompt plus the screen width. -'clear-display (M-C-l)' +‘clear-display (M-C-l)’ 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. -'clear-screen (C-l)' +‘clear-screen (C-l)’ Clear the screen, then redraw the current line, leaving the current line at the top of the screen. -'redraw-current-line ()' +‘redraw-current-line ()’ Refresh the current line. By default, this is unbound.  @@ -9128,104 +9135,104 @@ File: bash.info, Node: Commands For History, Next: Commands For Text, Prev: C 8.4.2 Commands For Manipulating The History ------------------------------------------- -'accept-line (Newline or Return)' +‘accept-line (Newline or Return)’ Accept the line regardless of where the cursor is. If this line is non-empty, add it to the history list according to the setting of - the 'HISTCONTROL' and 'HISTIGNORE' variables. If this line is a + the ‘HISTCONTROL’ and ‘HISTIGNORE’ variables. If this line is a modified history line, then restore the history line to its original state. -'previous-history (C-p)' +‘previous-history (C-p)’ Move 'back' through the history list, fetching the previous command. -'next-history (C-n)' +‘next-history (C-n)’ Move 'forward' through the history list, fetching the next command. -'beginning-of-history (M-<)' +‘beginning-of-history (M-<)’ Move to the first line in the history. -'end-of-history (M->)' +‘end-of-history (M->)’ Move to the end of the input history, i.e., the line currently being entered. -'reverse-search-history (C-r)' +‘reverse-search-history (C-r)’ Search backward starting at the current line and moving 'up' through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the mark. -'forward-search-history (C-s)' +‘forward-search-history (C-s)’ Search forward starting at the current line and moving 'down' through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the mark. -'non-incremental-reverse-search-history (M-p)' +‘non-incremental-reverse-search-history (M-p)’ Search backward starting at the current line and moving 'up' through the history as necessary using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. -'non-incremental-forward-search-history (M-n)' +‘non-incremental-forward-search-history (M-n)’ Search forward starting at the current line and moving 'down' through the history as necessary using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. -'history-search-forward ()' +‘history-search-forward ()’ 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. By default, this command is unbound. -'history-search-backward ()' +‘history-search-backward ()’ Search backward 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. By default, this command is unbound. -'history-substring-search-forward ()' +‘history-substring-search-forward ()’ 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-incremental search. By default, this command is unbound. -'history-substring-search-backward ()' +‘history-substring-search-backward ()’ 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-incremental search. By default, this command is unbound. -'yank-nth-arg (M-C-y)' +‘yank-nth-arg (M-C-y)’ 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 inserts the Nth word from the end of the previous command. Once the - argument N is computed, the argument is extracted as if the '!N' + argument N is computed, the argument is extracted as if the ‘!N’ history expansion had been specified. -'yank-last-arg (M-. or M-_)' +‘yank-last-arg (M-. or M-_)’ Insert last argument to the previous command (the last word of the previous history entry). With a numeric argument, behave exactly - like 'yank-nth-arg'. Successive calls to 'yank-last-arg' move back + like ‘yank-nth-arg’. Successive calls to ‘yank-last-arg’ 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). The history expansion facilities are used to extract the last argument, - as if the '!$' history expansion had been specified. + as if the ‘!$’ history expansion had been specified. -'operate-and-get-next (C-o)' +‘operate-and-get-next (C-o)’ Accept the current line for return to the calling application 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. -'fetch-history ()' +‘fetch-history ()’ 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. @@ -9236,40 +9243,40 @@ File: bash.info, Node: Commands For Text, Next: Commands For Killing, Prev: C 8.4.3 Commands For Changing Text -------------------------------- -'end-of-file (usually C-d)' +‘end-of-file (usually C-d)’ The character indicating end-of-file as set, for example, by - 'stty'. If this character is read when there are no characters on + ‘stty’. If this character is read when there are no characters on the line, and point is at the beginning of the line, Readline interprets it as the end of input and returns EOF. -'delete-char (C-d)' +‘delete-char (C-d)’ Delete the character at point. If this function is bound to the - same character as the tty EOF character, as 'C-d' commonly is, see + same character as the tty EOF character, as ‘C-d’ commonly is, see above for the effects. -'backward-delete-char (Rubout)' +‘backward-delete-char (Rubout)’ Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them. -'forward-backward-delete-char ()' +‘forward-backward-delete-char ()’ Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is deleted. By default, this is not bound to a key. -'quoted-insert (C-q or C-v)' +‘quoted-insert (C-q or C-v)’ Add the next character typed to the line verbatim. This is how to - insert key sequences like 'C-q', for example. + insert key sequences like ‘C-q’, for example. -'self-insert (a, b, A, 1, !, ...)' +‘self-insert (a, b, A, 1, !, ...)’ Insert yourself. -'bracketed-paste-begin ()' +‘bracketed-paste-begin ()’ 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 Readline to insert the pasted text as a single unit without treating each character as if it had been read from the keyboard. The characters are inserted as if each one - was bound to 'self-insert' instead of executing any editing + was bound to ‘self-insert’ instead of executing any editing commands. Bracketed paste sets the region (the characters between point and @@ -9277,46 +9284,46 @@ File: bash.info, Node: Commands For Text, Next: Commands For Killing, Prev: C mark_: when the mark is active, Readline redisplay uses the terminal's standout mode to denote the region. -'transpose-chars (C-t)' +‘transpose-chars (C-t)’ Drag the character before the cursor forward over the character at the cursor, moving the cursor forward as well. If the insertion point is at the end of the line, then this transposes the last two characters of the line. Negative arguments have no effect. -'transpose-words (M-t)' +‘transpose-words (M-t)’ 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. -'shell-transpose-words (M-C-t)' +‘shell-transpose-words (M-C-t)’ 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 'shell-forward-word' and - 'shell-backward-word'. + boundaries are the same as ‘shell-forward-word’ and + ‘shell-backward-word’. -'upcase-word (M-u)' +‘upcase-word (M-u)’ Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but do not move the cursor. -'downcase-word (M-l)' +‘downcase-word (M-l)’ Lowercase the current (or following) word. With a negative argument, lowercase the previous word, but do not move the cursor. -'capitalize-word (M-c)' +‘capitalize-word (M-c)’ Capitalize the current (or following) word. With a negative argument, capitalize the previous word, but do not move the cursor. -'overwrite-mode ()' +‘overwrite-mode ()’ Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only - 'emacs' mode; 'vi' mode does overwrite differently. Each call to - 'readline()' starts in insert mode. + ‘emacs’ mode; ‘vi’ mode does overwrite differently. Each call to + ‘readline()’ starts in insert mode. - In overwrite mode, characters bound to 'self-insert' replace the + In overwrite mode, characters bound to ‘self-insert’ replace the text at point rather than pushing the text to the right. - Characters bound to 'backward-delete-char' replace the character + Characters bound to ‘backward-delete-char’ replace the character before point with a space. By default, this command is unbound. @@ -9327,78 +9334,78 @@ File: bash.info, Node: Commands For Killing, Next: Numeric Arguments, Prev: C 8.4.4 Killing And Yanking ------------------------- -'kill-line (C-k)' +‘kill-line (C-k)’ Kill the text from point to the end of the line. With a negative numeric argument, kill backward from the cursor to the beginning of the current line. -'backward-kill-line (C-x Rubout)' +‘backward-kill-line (C-x Rubout)’ Kill backward from the cursor to the beginning of the current line. With a negative numeric argument, kill forward from the cursor to the end of the current line. -'unix-line-discard (C-u)' +‘unix-line-discard (C-u)’ Kill backward from the cursor to the beginning of the current line. -'kill-whole-line ()' +‘kill-whole-line ()’ Kill all characters on the current line, no matter where point is. By default, this is unbound. -'kill-word (M-d)' +‘kill-word (M-d)’ 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 'forward-word'. + as ‘forward-word’. -'backward-kill-word (M-)' +‘backward-kill-word (M-)’ Kill the word behind point. Word boundaries are the same as - 'backward-word'. + ‘backward-word’. -'shell-kill-word (M-C-d)' +‘shell-kill-word (M-C-d)’ 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 'shell-forward-word'. + as ‘shell-forward-word’. -'shell-backward-kill-word ()' +‘shell-backward-kill-word ()’ Kill the word behind point. Word boundaries are the same as - 'shell-backward-word'. + ‘shell-backward-word’. -'unix-word-rubout (C-w)' +‘unix-word-rubout (C-w)’ Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring. -'unix-filename-rubout ()' +‘unix-filename-rubout ()’ Kill the word behind point, using white space and the slash character as the word boundaries. The killed text is saved on the kill-ring. -'delete-horizontal-space ()' +‘delete-horizontal-space ()’ Delete all spaces and tabs around point. By default, this is unbound. -'kill-region ()' +‘kill-region ()’ Kill the text in the current region. By default, this command is unbound. -'copy-region-as-kill ()' +‘copy-region-as-kill ()’ Copy the text in the region to the kill buffer, so it can be yanked right away. By default, this command is unbound. -'copy-backward-word ()' +‘copy-backward-word ()’ Copy the word before point to the kill buffer. The word boundaries - are the same as 'backward-word'. By default, this command is + are the same as ‘backward-word’. By default, this command is unbound. -'copy-forward-word ()' +‘copy-forward-word ()’ Copy the word following point to the kill buffer. The word - boundaries are the same as 'forward-word'. By default, this + boundaries are the same as ‘forward-word’. By default, this command is unbound. -'yank (C-y)' +‘yank (C-y)’ Yank the top of the kill ring into the buffer at point. -'yank-pop (M-y)' +‘yank-pop (M-y)’ Rotate the kill-ring, and yank the new top. You can only do this - if the prior command is 'yank' or 'yank-pop'. + if the prior command is ‘yank’ or ‘yank-pop’.  File: bash.info, Node: Numeric Arguments, Next: Commands For Completion, Prev: Commands For Killing, Up: Bindable Readline Commands @@ -9406,15 +9413,15 @@ File: bash.info, Node: Numeric Arguments, Next: Commands For Completion, Prev 8.4.5 Specifying Numeric Arguments ---------------------------------- -'digit-argument (M-0, M-1, ... M--)' +‘digit-argument (M-0, M-1, ... M--)’ Add this digit to the argument already accumulating, or start a new - argument. 'M--' starts a negative argument. + argument. ‘M--’ starts a negative argument. -'universal-argument ()' +‘universal-argument ()’ 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 followed - by digits, executing 'universal-argument' again ends the numeric + by digits, executing ‘universal-argument’ again ends the numeric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is neither a digit nor minus sign, the argument count for the next command is @@ -9429,101 +9436,101 @@ File: bash.info, Node: Commands For Completion, Next: Keyboard Macros, Prev: 8.4.6 Letting Readline Type For You ----------------------------------- -'complete ()' +‘complete ()’ Attempt to perform completion on the text before point. The actual completion performed is application-specific. Bash attempts completion treating the text as a variable (if the text begins with - '$'), username (if the text begins with '~'), hostname (if the text - begins with '@'), or command (including aliases and functions) in + ‘$’), username (if the text begins with ‘~’), hostname (if the text + begins with ‘@’), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted. -'possible-completions (M-?)' +‘possible-completions (M-?)’ List the possible completions of the text before point. When displaying completions, Readline sets the number of columns used - for display to the value of 'completion-display-width', the value - of the environment variable 'COLUMNS', or the screen width, in that + for display to the value of ‘completion-display-width’, the value + of the environment variable ‘COLUMNS’, or the screen width, in that order. -'insert-completions (M-*)' +‘insert-completions (M-*)’ Insert all completions of the text before point that would have - been generated by 'possible-completions'. + been generated by ‘possible-completions’. -'menu-complete ()' - Similar to 'complete', but replaces the word to be completed with a +‘menu-complete ()’ + Similar to ‘complete’, but replaces the word to be completed with a single match from the list of possible completions. Repeated - execution of 'menu-complete' steps through the list of possible + execution of ‘menu-complete’ steps through the list of possible completions, inserting each match in turn. At the end of the list of completions, the bell is rung (subject to the setting of - 'bell-style') and the original text is restored. An argument of N + ‘bell-style’) and the original text is restored. An argument of N moves N positions forward in the list of matches; a negative argument may be used to move backward through the list. This command is intended to be bound to , but is unbound by default. -'menu-complete-backward ()' - Identical to 'menu-complete', but moves backward through the list - of possible completions, as if 'menu-complete' had been given a +‘menu-complete-backward ()’ + Identical to ‘menu-complete’, but moves backward through the list + of possible completions, as if ‘menu-complete’ had been given a negative argument. -'delete-char-or-list ()' +‘delete-char-or-list ()’ Deletes the character under the cursor if not at the beginning or - end of the line (like 'delete-char'). If at the end of the line, - behaves identically to 'possible-completions'. This command is + end of the line (like ‘delete-char’). If at the end of the line, + behaves identically to ‘possible-completions’. This command is unbound by default. -'complete-filename (M-/)' +‘complete-filename (M-/)’ Attempt filename completion on the text before point. -'possible-filename-completions (C-x /)' +‘possible-filename-completions (C-x /)’ List the possible completions of the text before point, treating it as a filename. -'complete-username (M-~)' +‘complete-username (M-~)’ Attempt completion on the text before point, treating it as a username. -'possible-username-completions (C-x ~)' +‘possible-username-completions (C-x ~)’ List the possible completions of the text before point, treating it as a username. -'complete-variable (M-$)' +‘complete-variable (M-$)’ Attempt completion on the text before point, treating it as a shell variable. -'possible-variable-completions (C-x $)' +‘possible-variable-completions (C-x $)’ List the possible completions of the text before point, treating it as a shell variable. -'complete-hostname (M-@)' +‘complete-hostname (M-@)’ Attempt completion on the text before point, treating it as a hostname. -'possible-hostname-completions (C-x @)' +‘possible-hostname-completions (C-x @)’ List the possible completions of the text before point, treating it as a hostname. -'complete-command (M-!)' +‘complete-command (M-!)’ 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. -'possible-command-completions (C-x !)' +‘possible-command-completions (C-x !)’ List the possible completions of the text before point, treating it as a command name. -'dynamic-complete-history (M-)' +‘dynamic-complete-history (M-)’ Attempt completion on the text before point, comparing the text against lines from the history list for possible completion matches. -'dabbrev-expand ()' +‘dabbrev-expand ()’ Attempt menu completion on the text before point, comparing the text against lines from the history list for possible completion matches. -'complete-into-braces (M-{)' +‘complete-into-braces (M-{)’ Perform filename completion and insert the list of possible completions enclosed within braces so the list is available to the shell (*note Brace Expansion::). @@ -9534,18 +9541,18 @@ File: bash.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev: C 8.4.7 Keyboard Macros --------------------- -'start-kbd-macro (C-x ()' +‘start-kbd-macro (C-x ()’ Begin saving the characters typed into the current keyboard macro. -'end-kbd-macro (C-x ))' +‘end-kbd-macro (C-x ))’ Stop saving the characters typed into the current keyboard macro and save the definition. -'call-last-kbd-macro (C-x e)' +‘call-last-kbd-macro (C-x e)’ Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard. -'print-last-kbd-macro ()' +‘print-last-kbd-macro ()’ Print the last keyboard macro defined in a format suitable for the INPUTRC file. @@ -9555,53 +9562,53 @@ File: bash.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bin 8.4.8 Some Miscellaneous Commands --------------------------------- -'re-read-init-file (C-x C-r)' +‘re-read-init-file (C-x C-r)’ Read in the contents of the INPUTRC file, and incorporate any bindings or variable assignments found there. -'abort (C-g)' +‘abort (C-g)’ Abort the current editing command and ring the terminal's bell - (subject to the setting of 'bell-style'). + (subject to the setting of ‘bell-style’). -'do-lowercase-version (M-A, M-B, M-X, ...)' +‘do-lowercase-version (M-A, M-B, M-X, ...)’ If the metafied character X is upper case, run the command that is bound to the corresponding metafied lower case character. The behavior is undefined if X is already lower case. -'prefix-meta ()' +‘prefix-meta ()’ Metafy the next character typed. This is for keyboards without a - meta key. Typing ' f' is equivalent to typing 'M-f'. + meta key. Typing ‘ f’ is equivalent to typing ‘M-f’. -'undo (C-_ or C-x C-u)' +‘undo (C-_ or C-x C-u)’ Incremental undo, separately remembered for each line. -'revert-line (M-r)' +‘revert-line (M-r)’ Undo all changes made to this line. This is like executing the - 'undo' command enough times to get back to the beginning. + ‘undo’ command enough times to get back to the beginning. -'tilde-expand (M-&)' +‘tilde-expand (M-&)’ Perform tilde expansion on the current word. -'set-mark (C-@)' +‘set-mark (C-@)’ Set the mark to the point. If a numeric argument is supplied, the mark is set to that position. -'exchange-point-and-mark (C-x C-x)' +‘exchange-point-and-mark (C-x C-x)’ Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark. -'character-search (C-])' +‘character-search (C-])’ A character is read and point is moved to the next occurrence of that character. A negative argument searches for previous occurrences. -'character-search-backward (M-C-])' +‘character-search-backward (M-C-])’ A character is read and point is moved to the previous occurrence of that character. A negative argument searches for subsequent occurrences. -'skip-csi-sequence ()' +‘skip-csi-sequence ()’ Read enough characters to consume a multi-key sequence such as those defined for keys like Home and End. Such sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this @@ -9610,92 +9617,93 @@ File: bash.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: Bin inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[. -'insert-comment (M-#)' - Without a numeric argument, the value of the 'comment-begin' +‘insert-comment (M-#)’ + Without a numeric argument, the value of the ‘comment-begin’ variable is inserted 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 - 'comment-begin', the value is inserted, otherwise the characters in - 'comment-begin' are deleted from the beginning of the line. In + ‘comment-begin’, the value is inserted, otherwise the characters in + ‘comment-begin’ are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed. - The default value of 'comment-begin' causes this command to make + The default value of ‘comment-begin’ 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 executed by the shell. -'dump-functions ()' +‘dump-functions ()’ Print all of the functions and their key bindings to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. -'dump-variables ()' +‘dump-variables ()’ Print all of the settable variables and their values to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. -'dump-macros ()' +‘dump-macros ()’ Print all of the Readline key sequences bound to macros and the strings they output. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. -'spell-correct-word (C-x s)' +‘spell-correct-word (C-x s)’ Perform spelling correction on the current word, treating it as a - directory or filename, in the same way as the 'cdspell' shell + directory or filename, in the same way as the ‘cdspell’ shell option. Word boundaries are the same as those used by - 'shell-forward-word'. + ‘shell-forward-word’. -'glob-complete-word (M-g)' +‘glob-complete-word (M-g)’ The word before point is treated as a pattern for pathname expansion, with an asterisk implicitly appended. This pattern is used to generate a list of matching file names for possible completions. -'glob-expand-word (C-x *)' +‘glob-expand-word (C-x *)’ The word before point is treated as a pattern for pathname expansion, and the list of matching file names is inserted, - replacing the word. If a numeric argument is supplied, a '*' is + replacing the word. If a numeric argument is supplied, a ‘*’ is appended before pathname expansion. -'glob-list-expansions (C-x g)' +‘glob-list-expansions (C-x g)’ The list of expansions that would have been generated by - 'glob-expand-word' is displayed, and the line is redrawn. If a - numeric argument is supplied, a '*' is appended before pathname + ‘glob-expand-word’ is displayed, and the line is redrawn. If a + numeric argument is supplied, a ‘*’ is appended before pathname expansion. -'display-shell-version (C-x C-v)' +‘display-shell-version (C-x C-v)’ Display version information about the current instance of Bash. -'shell-expand-line (M-C-e)' +‘shell-expand-line (M-C-e)’ 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, - word splitting, and quote removal. + command and proces substitution, word splitting, and quote removal. + An explicit argument suppresses command and process substitution. -'history-expand-line (M-^)' +‘history-expand-line (M-^)’ Perform history expansion on the current line. -'magic-space ()' +‘magic-space ()’ Perform history expansion on the current line and insert a space (*note History Interaction::). -'alias-expand-line ()' +‘alias-expand-line ()’ Perform alias expansion on the current line (*note Aliases::). -'history-and-alias-expand-line ()' +‘history-and-alias-expand-line ()’ Perform history and alias expansion on the current line. -'insert-last-argument (M-. or M-_)' - A synonym for 'yank-last-arg'. +‘insert-last-argument (M-. or M-_)’ + A synonym for ‘yank-last-arg’. -'edit-and-execute-command (C-x C-e)' +‘edit-and-execute-command (C-x C-e)’ Invoke an editor on the current command line, and execute the - result as shell commands. Bash attempts to invoke '$VISUAL', - '$EDITOR', and 'emacs' as the editor, in that order. + result as shell commands. Bash attempts to invoke ‘$VISUAL’, + ‘$EDITOR’, and ‘emacs’ as the editor, in that order. -'execute-named-command (M-x)' +‘execute-named-command (M-x)’ Read a bindable readline 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 supplied @@ -9708,19 +9716,19 @@ File: bash.info, Node: Readline vi Mode, Next: Programmable Completion, Prev: 8.5 Readline vi Mode ==================== -While the Readline library does not have a full set of 'vi' editing +While the Readline library does not have a full set of ‘vi’ editing functions, it does contain enough to allow simple editing of the line. -The Readline 'vi' mode behaves as specified in the POSIX standard. +The Readline ‘vi’ mode behaves as specified in the POSIX standard. - In order to switch interactively between 'emacs' and 'vi' editing -modes, use the 'set -o emacs' and 'set -o vi' commands (*note The Set -Builtin::). The Readline default is 'emacs' mode. + In order to switch interactively between ‘emacs’ and ‘vi’ editing +modes, use the ‘set -o emacs’ and ‘set -o vi’ commands (*note The Set +Builtin::). The Readline default is ‘emacs’ mode. - When you enter a line in 'vi' mode, you are already placed in -'insertion' mode, as if you had typed an 'i'. Pressing switches + When you enter a line in ‘vi’ mode, you are already placed in +'insertion' mode, as if you had typed an ‘i’. Pressing switches you into 'command' mode, where you can edit the text of the line with -the standard 'vi' movement keys, move to previous history lines with 'k' -and subsequent lines with 'j', and so forth. +the standard ‘vi’ movement keys, move to previous history lines with ‘k’ +and subsequent lines with ‘j’, and so forth.  File: bash.info, Node: Programmable Completion, Next: Programmable Completion Builtins, Prev: Readline vi Mode, Up: Command Line Editing @@ -9730,19 +9738,19 @@ File: bash.info, Node: Programmable Completion, Next: Programmable Completion When word completion is attempted for an argument to a command for which a completion specification (a COMPSPEC) has been defined using the -'complete' builtin (*note Programmable Completion Builtins::), the +‘complete’ builtin (*note Programmable Completion Builtins::), the programmable completion facilities are invoked. First, the command name is identified. If a compspec has been defined 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), any -compspec defined with the '-E' option to 'complete' is used. If the +compspec defined with the ‘-E’ option to ‘complete’ is used. If the command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. If those searches do not result in a compspec, any compspec -defined with the '-D' option to 'complete' is used as the default. If +defined with the ‘-D’ option to ‘complete’ is used as the default. If there is no default compspec, Bash attempts alias expansion on the command word as a final resort, and attempts to find a compspec for the command word from any successful expansion @@ -9753,20 +9761,20 @@ described above (*note Commands For Completion::) is performed. First, the actions specified by the compspec are used. Only matches which are prefixed by the word being completed are returned. When the -'-f' or '-d' option is used for filename or directory name completion, -the shell variable 'FIGNORE' is used to filter the matches. *Note Bash -Variables::, for a description of 'FIGNORE'. +‘-f’ or ‘-d’ option is used for filename or directory name completion, +the shell variable ‘FIGNORE’ is used to filter the matches. *Note Bash +Variables::, for a description of ‘FIGNORE’. - Any completions specified by a filename expansion pattern to the '-G' + Any completions specified by a filename expansion pattern to the ‘-G’ option are generated next. The words generated by the pattern need not -match the word being completed. The 'GLOBIGNORE' shell variable is not -used to filter the matches, but the 'FIGNORE' shell variable is used. +match the word being completed. The ‘GLOBIGNORE’ shell variable is not +used to filter the matches, but the ‘FIGNORE’ shell variable is used. - Next, the string specified as the argument to the '-W' option is -considered. The string is first split using the characters in the 'IFS' + Next, the string specified as the argument to the ‘-W’ option is +considered. The string is first split using the characters in the ‘IFS’ special variable as delimiters. Shell quoting is honored within the string, in order to provide a mechanism for the words to contain shell -metacharacters or characters in the value of 'IFS'. Each word is then +metacharacters or characters in the value of ‘IFS’. Each word is then expanded using brace expansion, tilde expansion, parameter and variable expansion, command substitution, and arithmetic expansion, as described above (*note Shell Expansions::). The results are split using the rules @@ -9775,11 +9783,11 @@ are prefix-matched against the word being completed, and the matching words become the possible completions. After these matches have been generated, any shell function or -command specified with the '-F' and '-C' options is invoked. When the -command or function is invoked, the 'COMP_LINE', 'COMP_POINT', -'COMP_KEY', and 'COMP_TYPE' variables are assigned values as described +command specified with the ‘-F’ and ‘-C’ options is invoked. When the +command or function is invoked, the ‘COMP_LINE’, ‘COMP_POINT’, +‘COMP_KEY’, and ‘COMP_TYPE’ variables are assigned values as described above (*note Bash Variables::). If a shell function is being invoked, -the 'COMP_WORDS' and 'COMP_CWORD' variables are also set. When the +the ‘COMP_WORDS’ and ‘COMP_CWORD’ variables are also set. When the function or command is invoked, the first argument ($1) is the name of the command whose arguments are being completed, the second argument ($2) is the word being completed, and the third argument ($3) is the @@ -9788,49 +9796,49 @@ filtering of the generated completions against the word being completed is performed; the function or command has complete freedom in generating the matches. - Any function specified with '-F' is invoked first. The function may -use any of the shell facilities, including the 'compgen' and 'compopt' + Any function specified with ‘-F’ is invoked first. The function may +use any of the shell facilities, including the ‘compgen’ and ‘compopt’ builtins described below (*note Programmable Completion Builtins::), to generate the matches. It must put the possible completions in the -'COMPREPLY' array variable, one per array element. +‘COMPREPLY’ array variable, one per array element. - Next, any command specified with the '-C' option is invoked in an + Next, any command specified with the ‘-C’ option is invoked in an environment equivalent to command substitution. It should print a list of completions, one per line, to the standard output. Backslash may be used to escape a newline, if necessary. After all of the possible completions are generated, any filter -specified with the '-X' option is applied to 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 +specified with the ‘-X’ option is applied to 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 will be removed from the list. -A leading '!' negates the pattern; in this case any completion not -matching the pattern will be removed. If the 'nocasematch' shell option -(see the description of 'shopt' in *note The Shopt Builtin::) is +A leading ‘!’ negates the pattern; in this case any completion not +matching the pattern will be removed. If the ‘nocasematch’ shell option +(see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed without regard to the case of alphabetic characters. - Finally, any prefix and suffix specified with the '-P' and '-S' + Finally, any prefix and suffix specified with the ‘-P’ and ‘-S’ options are added to each member of the completion list, and the result is returned to the Readline completion code as the list of possible completions. If the previously-applied actions do not generate any matches, and -the '-o dirnames' option was supplied to 'complete' when the compspec +the ‘-o dirnames’ option was supplied to ‘complete’ when the compspec was defined, directory name completion is attempted. - If the '-o plusdirs' option was supplied to 'complete' when the + If the ‘-o plusdirs’ option was supplied to ‘complete’ when the compspec was defined, directory name completion is attempted and any matches are added to the results of the other actions. 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 Bash completions are not attempted, and the Readline default of -filename completion is disabled. If the '-o bashdefault' option was -supplied to 'complete' when the compspec was defined, the default Bash +filename completion is disabled. If the ‘-o bashdefault’ option was +supplied to ‘complete’ when the compspec was defined, the default Bash completions are attempted if the compspec generates no matches. If the -'-o default' option was supplied to 'complete' when the compspec was +‘-o default’ option was supplied to ‘complete’ when the compspec was defined, Readline's default completion will be performed if the compspec (and, if attempted, the default Bash completions) generate no matches. @@ -9842,7 +9850,7 @@ setting of the MARK-SYMLINKED-DIRECTORIES Readline variable. There is some support for dynamically modifying completions. This is most useful when used in combination with a default completion specified -with '-D'. It's possible for shell functions executed as completion +with ‘-D’. It's possible for shell functions executed as completion handlers 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 @@ -9873,19 +9881,19 @@ completion facilities: one to specify how the arguments to a particular command are to be completed, and two to modify the completion as it is happening. -'compgen' +‘compgen’ compgen [-V VARNAME] [OPTION] [WORD] Generate possible completion matches for WORD according to the - OPTIONs, which may be any option accepted by the 'complete' builtin - with the exceptions of '-p', '-r', '-D', '-E', and '-I', and write + OPTIONs, which may be any option accepted by the ‘complete’ builtin + with the exceptions of ‘-p’, ‘-r’, ‘-D’, ‘-E’, and ‘-I’, and write the matches to the standard output. - If the '-V' option is supplied, 'compgen' stores the generated + If the ‘-V’ option is supplied, ‘compgen’ stores the generated completions into the indexed array variable VARNAME instead of writing them to the standard output. - When using the '-F' or '-C' options, the various shell variables + When using the ‘-F’ or ‘-C’ options, the various shell variables set by the programmable completion facilities, while available, will not have useful values. @@ -9897,29 +9905,29 @@ happening. The return value is true unless an invalid option is supplied, or no matches were generated. -'complete' +‘complete’ complete [-abcdefgjksuv] [-o COMP-OPTION] [-DEI] [-A ACTION] [-G GLOBPAT] [-W WORDLIST] [-F FUNCTION] [-C COMMAND] [-X FILTERPAT] [-P PREFIX] [-S SUFFIX] NAME [NAME ...] complete -pr [-DEI] [NAME ...] Specify how arguments to each NAME should be completed. If the - '-p' option is supplied, or if no options are supplied, existing - completion specifications are printed in a way that allows them to - be reused as input. The '-r' option removes a completion + ‘-p’ option is supplied, or if no options or NAMEs are supplied, + existing completion specifications are printed in a way that allows + them to be reused as input. The ‘-r’ option removes a completion specification for each NAME, or, if no NAMEs are supplied, all - completion specifications. The '-D' option indicates that other + completion specifications. The ‘-D’ option indicates that other supplied options and actions should apply to the "default" command completion; that is, completion attempted on a command for which no - completion has previously been defined. The '-E' option indicates + completion has previously been defined. The ‘-E’ option indicates that other supplied options and actions should apply to "empty" command completion; that is, completion attempted on a blank line. - The '-I' option indicates that other supplied options and actions + The ‘-I’ 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 + the line, or after a command delimiter such as ‘;’ or ‘|’, which is usually command name completion. If multiple options are supplied, - the '-D' option takes precedence over '-E', and both take - precedence over '-I'. If any of '-D', '-E', or '-I' are supplied, + the ‘-D’ option takes precedence over ‘-E’, and both take + precedence over ‘-I’. If any of ‘-D’, ‘-E’, or ‘-I’ are supplied, any other NAME arguments are ignored; these completions only apply to the case specified by the option. @@ -9928,206 +9936,206 @@ happening. Completion::). Other options, if specified, have the following meanings. The - arguments to the '-G', '-W', and '-X' options (and, if necessary, - the '-P' and '-S' options) should be quoted to protect them from - expansion before the 'complete' builtin is invoked. + arguments to the ‘-G’, ‘-W’, and ‘-X’ options (and, if necessary, + the ‘-P’ and ‘-S’ options) should be quoted to protect them from + expansion before the ‘complete’ builtin is invoked. - '-o COMP-OPTION' + ‘-o COMP-OPTION’ The COMP-OPTION controls several aspects of the compspec's behavior beyond the simple generation of completions. COMP-OPTION may be one of: - 'bashdefault' + ‘bashdefault’ Perform the rest of the default Bash completions if the compspec generates no matches. - 'default' + ‘default’ Use Readline's default filename completion if the compspec generates no matches. - 'dirnames' + ‘dirnames’ Perform directory name completion if the compspec generates no matches. - 'filenames' + ‘filenames’ Tell Readline that the compspec generates filenames, so it can perform any filename-specific processing (like adding a slash to directory names, quoting special characters, or suppressing trailing spaces). This option is intended to be used with shell functions specified - with '-F'. + with ‘-F’. - 'fullquote' + ‘fullquote’ Tell Readline to quote all the completed words even if they are not filenames. - 'noquote' + ‘noquote’ Tell Readline not to quote the completed words if they are filenames (quoting filenames is the default). - 'nosort' + ‘nosort’ Tell Readline not to sort the list of possible completions alphabetically. - 'nospace' + ‘nospace’ Tell Readline not to append a space (the default) to words completed at the end of the line. - 'plusdirs' + ‘plusdirs’ After any matches defined by the compspec are generated, directory name completion is attempted and any matches are added to the results of the other actions. - '-A ACTION' + ‘-A ACTION’ The ACTION may be one of the following to generate a list of possible completions: - 'alias' - Alias names. May also be specified as '-a'. + ‘alias’ + Alias names. May also be specified as ‘-a’. - 'arrayvar' + ‘arrayvar’ Array variable names. - 'binding' + ‘binding’ Readline key binding names (*note Bindable Readline Commands::). - 'builtin' + ‘builtin’ Names of shell builtin commands. May also be specified - as '-b'. + as ‘-b’. - 'command' - Command names. May also be specified as '-c'. + ‘command’ + Command names. May also be specified as ‘-c’. - 'directory' - Directory names. May also be specified as '-d'. + ‘directory’ + Directory names. May also be specified as ‘-d’. - 'disabled' + ‘disabled’ Names of disabled shell builtins. - 'enabled' + ‘enabled’ Names of enabled shell builtins. - 'export' + ‘export’ Names of exported shell variables. May also be specified - as '-e'. + as ‘-e’. - 'file' - File names. May also be specified as '-f'. + ‘file’ + File names. May also be specified as ‘-f’. - 'function' + ‘function’ Names of shell functions. - 'group' - Group names. May also be specified as '-g'. + ‘group’ + Group names. May also be specified as ‘-g’. - 'helptopic' - Help topics as accepted by the 'help' builtin (*note Bash + ‘helptopic’ + Help topics as accepted by the ‘help’ builtin (*note Bash Builtins::). - 'hostname' + ‘hostname’ Hostnames, as taken from the file specified by the - 'HOSTFILE' shell variable (*note Bash Variables::). + ‘HOSTFILE’ shell variable (*note Bash Variables::). - 'job' + ‘job’ Job names, if job control is active. May also be - specified as '-j'. + specified as ‘-j’. - 'keyword' - Shell reserved words. May also be specified as '-k'. + ‘keyword’ + Shell reserved words. May also be specified as ‘-k’. - 'running' + ‘running’ Names of running jobs, if job control is active. - 'service' - Service names. May also be specified as '-s'. + ‘service’ + Service names. May also be specified as ‘-s’. - 'setopt' - Valid arguments for the '-o' option to the 'set' builtin + ‘setopt’ + Valid arguments for the ‘-o’ option to the ‘set’ builtin (*note The Set Builtin::). - 'shopt' - Shell option names as accepted by the 'shopt' builtin + ‘shopt’ + Shell option names as accepted by the ‘shopt’ builtin (*note Bash Builtins::). - 'signal' + ‘signal’ Signal names. - 'stopped' + ‘stopped’ Names of stopped jobs, if job control is active. - 'user' - User names. May also be specified as '-u'. + ‘user’ + User names. May also be specified as ‘-u’. - 'variable' + ‘variable’ Names of all shell variables. May also be specified as - '-v'. + ‘-v’. - '-C COMMAND' + ‘-C COMMAND’ COMMAND is executed in a subshell environment, and its output is used as the possible completions. Arguments are passed as - with the '-F' option. + with the ‘-F’ option. - '-F FUNCTION' + ‘-F FUNCTION’ The shell function FUNCTION is executed in the current shell environment. When it is executed, $1 is the name of the command whose arguments are being completed, $2 is the word being completed, and $3 is the word preceding the word being completed, as described above (*note Programmable Completion::). When it finishes, the possible completions are - retrieved from the value of the 'COMPREPLY' array variable. + retrieved from the value of the ‘COMPREPLY’ array variable. - '-G GLOBPAT' + ‘-G GLOBPAT’ The filename expansion pattern GLOBPAT is expanded to generate the possible completions. - '-P PREFIX' + ‘-P PREFIX’ PREFIX is added at the beginning of each possible completion after all other options have been applied. - '-S SUFFIX' + ‘-S SUFFIX’ SUFFIX is appended to each possible completion after all other options have been applied. - '-W WORDLIST' - The WORDLIST is split using the characters in the 'IFS' + ‘-W WORDLIST’ + The WORDLIST is split using the characters in the ‘IFS’ special variable as delimiters, and each resultant word is expanded. The possible completions are the members of the resultant list which match the word being completed. - '-X FILTERPAT' + ‘-X FILTERPAT’ FILTERPAT is a pattern as used for filename expansion. It is applied to the list of possible completions generated by the preceding options and arguments, and each completion matching - FILTERPAT is removed from the list. A leading '!' in + FILTERPAT is removed from the list. A leading ‘!’ in FILTERPAT negates the pattern; in this case, any completion not matching FILTERPAT is removed. The return value is true unless an invalid option is supplied, an - option other than '-p', '-r', '-D', '-E', or '-I' is supplied + option other than ‘-p’, ‘-r’, ‘-D’, ‘-E’, or ‘-I’ is supplied without a NAME argument, an attempt is made to remove a completion specification for a NAME for which no specification exists, or an error occurs adding a completion specification. -'compopt' +‘compopt’ compopt [-o OPTION] [-DEI] [+o OPTION] [NAME] Modify completion options for each NAME according to the OPTIONs, or for the currently-executing completion if no NAMEs are supplied. If no OPTIONs are given, display the completion options for each NAME or the current completion. The possible values of OPTION are - those valid for the 'complete' builtin described above. The '-D' + those valid for the ‘complete’ builtin described above. The ‘-D’ option indicates that other supplied options should apply to the "default" command completion; that is, completion attempted on a command for which no completion has previously been defined. The - '-E' option indicates that other supplied options should apply to + ‘-E’ option indicates that other supplied options should apply to "empty" command completion; that is, completion attempted on a - blank line. The '-I' option indicates that other supplied options + blank line. The ‘-I’ option indicates that other supplied options should apply to completion on the initial non-assignment word on - the line, or after a command delimiter such as ';' or '|', which is + the line, or after a command delimiter such as ‘;’ or ‘|’, which is usually command name completion. - If multiple options are supplied, the '-D' option takes precedence - over '-E', and both take precedence over '-I' + If multiple options are supplied, the ‘-D’ option takes precedence + over ‘-E’, and both take precedence over ‘-I’ The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a NAME for which no @@ -10140,23 +10148,23 @@ File: bash.info, Node: A Programmable Completion Example, Prev: Programmable C ===================================== The most common way to obtain additional completion functionality beyond -the default actions 'complete' and 'compgen' provide is to use a shell -function and bind it to a particular command using 'complete -F'. +the default actions ‘complete’ and ‘compgen’ provide is to use a shell +function and bind it to a particular command using ‘complete -F’. - The following function provides completions for the 'cd' builtin. It + The following function provides completions for the ‘cd’ builtin. It is a reasonably good example of what shell functions must do when used -for completion. This function uses the word passed as '$2' to determine -the directory name to complete. You can also use the 'COMP_WORDS' array -variable; the current word is indexed by the 'COMP_CWORD' variable. +for completion. This function uses the word passed as ‘$2’ to determine +the directory name to complete. You can also use the ‘COMP_WORDS’ array +variable; the current word is indexed by the ‘COMP_CWORD’ variable. - The function relies on the 'complete' and 'compgen' builtins to do -much of the work, adding only the things that the Bash 'cd' does beyond + The function relies on the ‘complete’ and ‘compgen’ builtins to do +much of the work, adding only the things that the Bash ‘cd’ does beyond accepting basic directory names: tilde expansion (*note Tilde Expansion::), searching directories in $CDPATH, which is described above -(*note Bourne Shell Builtins::), and basic support for the 'cdable_vars' -shell option (*note The Shopt Builtin::). '_comp_cd' modifies the value +(*note Bourne Shell Builtins::), and basic support for the ‘cdable_vars’ +shell option (*note The Shopt Builtin::). ‘_comp_cd’ modifies the value of IFS so that it contains only a newline to accommodate file names -containing spaces and tabs - 'compgen' prints the possible completions +containing spaces and tabs - ‘compgen’ prints the possible completions it generates one per line. Possible completions go into the COMPREPLY array variable, one @@ -10210,8 +10218,8 @@ retrieves the completions from there when the function returns. return 0 } - We install the completion function using the '-F' option to -'complete': + We install the completion function using the ‘-F’ option to +‘complete’: # Tell readline to quote appropriate and append slashes to directories; # use the bash default completion for other arguments @@ -10219,22 +10227,22 @@ retrieves the completions from there when the function returns. Since we'd like Bash and Readline to take care of some of the other details for us, we use several other options to tell Bash and Readline -what to do. The '-o filenames' option tells Readline that the possible +what to do. The ‘-o filenames’ option tells Readline that the possible completions should be treated as filenames, and quoted appropriately. That option will also cause Readline to append a slash to filenames it can determine are directories (which is why we might want to extend -'_comp_cd' to append a slash if we're using directories found via -CDPATH: Readline can't tell those completions are directories). The '-o -nospace' option tells Readline to not append a space character to the -directory name, in case we want to append to it. The '-o bashdefault' +‘_comp_cd’ to append a slash if we're using directories found via +CDPATH: Readline can't tell those completions are directories). The ‘-o +nospace’ option tells Readline to not append a space character to the +directory name, in case we want to append to it. The ‘-o bashdefault’ option brings in the rest of the "Bash default" completions - possible completions that Bash adds to the default Readline set. These include things like command name completion, variable completion for words -beginning with '$' or '${', completions containing pathname expansion +beginning with ‘$’ or ‘${’, completions containing pathname expansion patterns (*note Filename Expansion::), and so on. - Once installed using 'complete', '_comp_cd' will be called every time -we attempt word completion for a 'cd' command. + Once installed using ‘complete’, ‘_comp_cd’ will be called every time +we attempt word completion for a ‘cd’ command. Many more examples - an extensive collection of completions for most of the common GNU, Unix, and Linux commands - are available as part of @@ -10244,7 +10252,7 @@ project now lives at . There are ports for other systems such as Solaris and Mac OS X. An older version of the bash_completion package is distributed with -bash in the 'examples/complete' subdirectory. +bash in the ‘examples/complete’ subdirectory.  File: bash.info, Node: Using History Interactively, Next: Installing Bash, Prev: Command Line Editing, Up: Top @@ -10271,52 +10279,52 @@ File: bash.info, Node: Bash History Facilities, Next: Bash History Builtins, 9.1 Bash History Facilities =========================== -When the '-o history' option to the 'set' builtin is enabled (*note The -Set Builtin::), the shell provides access to the "command history", the -list of commands previously typed. The value of the 'HISTSIZE' shell +When the ‘-o history’ option to the ‘set’ builtin is enabled (*note The +Set Builtin::), the shell provides access to the “command history”, the +list of commands previously typed. The value of the ‘HISTSIZE’ shell variable is used as the number of commands to save in a history list. -The text of the last '$HISTSIZE' commands (default 500) is saved. The +The text of the last ‘$HISTSIZE’ commands (default 500) is saved. The shell stores each command in the history list prior to parameter and variable expansion but after history expansion is performed, subject to -the values of the shell variables 'HISTIGNORE' and 'HISTCONTROL'. +the values of the shell variables ‘HISTIGNORE’ and ‘HISTCONTROL’. When the shell starts up, the history is initialized from the file -named by the 'HISTFILE' variable (default '~/.bash_history'). The file -named by the value of 'HISTFILE' is truncated, if necessary, to contain +named by the ‘HISTFILE’ variable (default ‘~/.bash_history’). The file +named by the value of ‘HISTFILE’ is truncated, if necessary, to contain no more than the number of lines specified by the value of the -'HISTFILESIZE' variable. When a shell with history enabled exits, the -last '$HISTSIZE' lines are copied from the history list to the file -named by '$HISTFILE'. If the 'histappend' shell option is set (*note +‘HISTFILESIZE’ variable. When a shell with history enabled exits, the +last ‘$HISTSIZE’ lines are copied from the history list to the file +named by ‘$HISTFILE’. If the ‘histappend’ shell option is set (*note Bash Builtins::), the lines are appended to the history file, otherwise -the history file is overwritten. If 'HISTFILE' is unset or null, or if +the history file is overwritten. If ‘HISTFILE’ is unset or null, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than -'$HISTFILESIZE' lines. If 'HISTFILESIZE' is unset, or set to null, a +‘$HISTFILESIZE’ lines. If ‘HISTFILESIZE’ is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated. - If the 'HISTTIMEFORMAT' is set, the time stamp information associated + If the ‘HISTTIMEFORMAT’ is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character. When the history file is read, lines beginning with the history comment character followed immediately by a digit are interpreted as timestamps for the following history entry. - The 'fc' builtin command may be used to list or edit and re-execute a -portion of the history list. The 'history' builtin may be used to + The ‘fc’ builtin command may be used to list or edit and re-execute a +portion of the history list. The ‘history’ builtin may be used to display or modify the history list and manipulate the history file. When using command-line editing, search commands are available in each editing mode that provide access to the history list (*note Commands For History::). The shell allows control over which commands are saved on the history -list. The 'HISTCONTROL' and 'HISTIGNORE' variables are used to cause -the shell to save only a subset of the commands entered. The 'cmdhist' +list. The ‘HISTCONTROL’ and ‘HISTIGNORE’ variables are used to cause +the shell to save only a subset of the commands entered. The ‘cmdhist’ shell option, if enabled, causes the shell to attempt to save each line of a multi-line command in the same history entry, adding semicolons -where necessary to preserve syntactic correctness. The 'lithist' shell +where necessary to preserve syntactic correctness. The ‘lithist’ shell option causes the shell to save the command with embedded newlines -instead of semicolons. The 'shopt' builtin is used to set these -options. *Note The Shopt Builtin::, for a description of 'shopt'. +instead of semicolons. The ‘shopt’ builtin is used to set these +options. *Note The Shopt Builtin::, for a description of ‘shopt’.  File: bash.info, Node: Bash History Builtins, Next: History Interaction, Prev: Bash History Facilities, Up: Using History Interactively @@ -10327,7 +10335,7 @@ File: bash.info, Node: Bash History Builtins, Next: History Interaction, Prev Bash provides two builtin commands which manipulate the history list and history file. -'fc' +‘fc’ fc [-e ENAME] [-lnr] [FIRST] [LAST] fc -s [PAT=REP] [COMMAND] @@ -10339,19 +10347,19 @@ history file. from the current command number). When listing, a FIRST or LAST of 0 is equivalent to -1 and -0 is - equivalent to the current command (usually the 'fc' command); + equivalent to the current command (usually the ‘fc’ command); otherwise 0 is equivalent to -1 and -0 is invalid. If LAST is not specified, it is set to FIRST. If FIRST is not - specified, it is set to the previous command for editing and -16 - for listing. If the '-l' flag is given, the commands are listed on - standard output. The '-n' flag suppresses the command numbers when - listing. The '-r' flag reverses the order of the listing. + specified, it is set to the previous command for editing and −16 + for listing. If the ‘-l’ flag is given, the commands are listed on + standard output. The ‘-n’ flag suppresses the command numbers when + listing. The ‘-r’ flag reverses the order of the listing. Otherwise, the editor given by ENAME is invoked on a file containing those commands. If ENAME is not given, the value of the - following variable expansion is used: '${FCEDIT:-${EDITOR:-vi}}'. - This says to use the value of the 'FCEDIT' variable if set, or the - value of the 'EDITOR' variable if that is set, or 'vi' if neither + following variable expansion is used: ‘${FCEDIT:-${EDITOR:-vi}}’. + This says to use the value of the ‘FCEDIT’ variable if set, or the + value of the ‘EDITOR’ variable if that is set, or ‘vi’ if neither is set. When editing is complete, the edited commands are echoed and executed. @@ -10359,11 +10367,11 @@ history file. PAT in the selected command is replaced by REP. COMMAND is interpreted the same as FIRST above. - A useful alias to use with the 'fc' command is 'r='fc -s'', so that - typing 'r cc' runs the last command beginning with 'cc' and typing - 'r' re-executes the last command (*note Aliases::). + A useful alias to use with the ‘fc’ command is ‘r='fc -s'’, so that + typing ‘r cc’ runs the last command beginning with ‘cc’ and typing + ‘r’ re-executes the last command (*note Aliases::). -'history' +‘history’ history [N] history -c history -d OFFSET @@ -10372,69 +10380,69 @@ history file. history -ps ARG With no options, display the history list with line numbers. Lines - prefixed with a '*' have been modified. An argument of N lists - only the last N lines. If the shell variable 'HISTTIMEFORMAT' is - set and not null, it is used as a format string for STRFTIME to - display the time stamp associated with each displayed history + prefixed with a ‘*’ have been modified. An argument of N lists + only the last N lines. If the shell variable ‘HISTTIMEFORMAT’ is + set and not null, it is used as a format string for ‘strftime’(3) + to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp and the history line. Options, if supplied, have the following meanings: - '-c' + ‘-c’ Clear the history list. This may be combined with the other options to replace the history list completely. - '-d OFFSET' + ‘-d OFFSET’ Delete the history entry at position OFFSET. If OFFSET is positive, it should be specified as it appears when the history is displayed. If OFFSET is negative, it is interpreted as relative to one greater than the last history position, so negative indices count back from the end of the - history, and an index of '-1' refers to the current 'history - -d' command. + history, and an index of ‘-1’ refers to the current ‘history + -d’ command. - '-d START-END' + ‘-d START-END’ Delete the range of history entries between positions START and END, inclusive. Positive and negative values for START and END are interpreted as described above. - '-a' + ‘-a’ Append the new history lines to the history file. These are history lines entered since the beginning of the current Bash session, but not already appended to the history file. - '-n' + ‘-n’ Append the history lines not already read from the history file to the current history list. These are lines appended to the history file since the beginning of the current Bash session. - '-r' + ‘-r’ Read the history file and append its contents to the history list. - '-w' + ‘-w’ Write out the current history list to the history file. - '-p' + ‘-p’ Perform history substitution on the ARGs and display the result on the standard output, without storing the results in the history list. - '-s' + ‘-s’ The ARGs are added to the end of the history list as a single entry. - If a FILENAME argument is supplied when any of the '-w', '-r', - '-a', or '-n' options is used, Bash uses FILENAME as the history - file. If not, then the value of the 'HISTFILE' variable is used. - If 'HISTFILE' is unset or null, these options have no effect. + If a FILENAME argument is supplied when any of the ‘-w’, ‘-r’, + ‘-a’, or ‘-n’ options is used, Bash uses FILENAME as the history + file. If not, then the value of the ‘HISTFILE’ variable is used. + If ‘HISTFILE’ is unset or null, these options have no effect. The return value is 0 unless an invalid option is encountered, an error occurs while reading or writing the history file, an invalid - OFFSET or range is supplied as an argument to '-d', or the history - expansion supplied as an argument to '-p' fails. + OFFSET or range is supplied as an argument to ‘-d’, or the history + expansion supplied as an argument to ‘-p’ fails.  File: bash.info, Node: History Interaction, Prev: Bash History Builtins, Up: Using History Interactively @@ -10443,7 +10451,7 @@ File: bash.info, Node: History Interaction, Prev: Bash History Builtins, Up: ===================== The History library provides a history expansion feature that is similar -to the history expansion provided by 'csh'. This section describes the +to the history expansion provided by ‘csh’. This section describes the syntax used to manipulate the history information. History expansions introduce words from the history list into the @@ -10461,16 +10469,16 @@ determine which line from the history list should be used during substitution. The second is to select portions of that line for inclusion into the current one. - The line selected from the history is called the "event", and the -portions of that line that are acted upon are called "words". The line + The line selected from the history is called the “event”, and the +portions of that line that are acted upon are called “words”. The line is broken into words in the same fashion that Bash does, so that several -words surrounded by quotes are considered one word. The "event -designator" selects the event, the optional "word designator" selects -words from the event, and various optional "modifiers" are available to +words surrounded by quotes are considered one word. The “event +designator” selects the event, the optional “word designator” selects +words from the event, and various optional “modifiers” are available to manipulate the selected words. History expansions are introduced by the appearance of the history -expansion character, which is '!' by default. History expansions may +expansion character, which is ‘!’ by default. History expansions may appear anywhere in the input, but do not nest. History expansion implements shell-like quoting conventions: a @@ -10481,35 +10489,35 @@ double quotes may be subject to history expansion, since backslash can escape the history expansion character, but single quotes may not, since they are not treated specially within double quotes. - When using the shell, only '\' and ''' may be used to escape the + When using the shell, only ‘\’ and ‘'’ may be used to escape 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. There is a special abbreviation for substitution, active when the -QUICK SUBSTITUTION character (default '^') is the first character on the +QUICK SUBSTITUTION character (default ‘^’) is the first character on the line. It selects the previous history list entry, using an event -designator equivalent to '!!', and substitutes one string for another in +designator equivalent to ‘!!’, and substitutes one string for another in that line. It is described below (*note Event Designators::). This is the only history expansion that does not begin with the history expansion character. - Several shell options settable with the 'shopt' builtin (*note The + Several shell options settable with the ‘shopt’ builtin (*note The Shopt Builtin::) may be used to tailor the behavior of history -expansion. If the 'histverify' shell option is enabled, and Readline is +expansion. If the ‘histverify’ shell option is enabled, and Readline is being used, history substitutions are not immediately passed to the shell parser. Instead, the expanded line is reloaded into the Readline editing buffer for further modification. If Readline is being used, and -the 'histreedit' shell option is enabled, a failed history expansion +the ‘histreedit’ shell option is enabled, a failed history expansion will be reloaded into the Readline editing buffer for correction. The -'-p' option to the 'history' builtin command may be used to see what a -history expansion will do before using it. The '-s' option to the -'history' builtin may be used to add commands to the end of the history +‘-p’ option to the ‘history’ builtin command may be used to see what a +history expansion will do before using it. The ‘-s’ option to the +‘history’ builtin may be used to add commands to the end of the history list without actually executing them, so that they are available for subsequent recall. This is most useful in conjunction with Readline. The shell allows control of the various characters used by the -history expansion mechanism with the 'histchars' variable, as explained +history expansion mechanism with the ‘histchars’ variable, as explained above (*note Bash Variables::). The shell uses the history comment character to mark history timestamps when writing the history file. @@ -10532,36 +10540,36 @@ of the portion of the word beginning with the history expansion character, and ending with the word designator if one is present, or the end of the word. -'!' +‘!’ Start a history substitution, except when followed by a space, tab, - the end of the line, '=', or the rest of the shell metacharacters + the end of the line, ‘=’, or the rest of the shell metacharacters defined above (*note Definitions::). -'!N' +‘!N’ Refer to command line N. -'!-N' +‘!-N’ Refer to the command N lines back. -'!!' - Refer to the previous command. This is a synonym for '!-1'. +‘!!’ + Refer to the previous command. This is a synonym for ‘!-1’. -'!STRING' +‘!STRING’ Refer to the most recent command preceding the current position in the history list starting with STRING. -'!?STRING[?]' +‘!?STRING[?]’ Refer to the most recent command preceding the current position in - the history list containing STRING. The trailing '?' may be + the history list containing STRING. The trailing ‘?’ may be omitted if the STRING is followed immediately by a newline. If STRING is missing, the string from the most recent search is used; it is an error if there is no previous search string. -'^STRING1^STRING2^' +‘^STRING1^STRING2^’ Quick Substitution. Repeat the last command, replacing STRING1 - with STRING2. Equivalent to '!!:s^STRING1^STRING2^'. + with STRING2. Equivalent to ‘!!:s^STRING1^STRING2^’. -'!#' +‘!#’ The entire command line typed so far.  @@ -10572,58 +10580,58 @@ File: bash.info, Node: Word Designators, Next: Modifiers, Prev: Event Designa Word designators are used to select desired words from the event. They are optional; if the word designator isn't supplied, the history -expansion uses the entire event. A ':' separates the event +expansion 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 +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 inserted into the current line separated by single spaces. For example, -'!!' +‘!!’ designates the preceding command. When you type this, the preceding command is repeated in toto. -'!!:$' +‘!!:$’ designates the last argument of the preceding command. This may be - shortened to '!$'. + shortened to ‘!$’. -'!fi:2' +‘!fi:2’ designates the second argument of the most recent command starting - with the letters 'fi'. + with the letters ‘fi’. Here are the word designators: -'0 (zero)' - The '0'th word. For many applications, this is the command word. +‘0 (zero)’ + The ‘0’th word. For many applications, this is the command word. -'N' +‘N’ The Nth word. -'^' +‘^’ The first argument; that is, word 1. -'$' +‘$’ The last argument. -'%' - The first word matched by the most recent '?STRING?' search, if the +‘%’ + The first word matched by the most recent ‘?STRING?’ search, if the search string begins with a character that is part of a word. -'X-Y' - A range of words; '-Y' abbreviates '0-Y'. +‘X-Y’ + A range of words; ‘-Y’ abbreviates ‘0-Y’. -'*' - All of the words, except the '0'th. 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, except the ‘0’th. This is a synonym for ‘1-$’. + It is not an error to use ‘*’ if there is just one word in the event; the empty string is returned in that case. -'X*' - Abbreviates 'X-$' +‘X*’ + Abbreviates ‘X-$’ -'X-' - Abbreviates 'X-$' like 'X*', but omits the last word. If 'x' is +‘X-’ + Abbreviates ‘X-$’ like ‘X*’, but omits the last word. If ‘x’ is missing, it defaults to 0. If a word designator is supplied without an event specification, the @@ -10636,54 +10644,54 @@ File: bash.info, Node: Modifiers, Prev: Word Designators, Up: History Interac --------------- After the optional word designator, you can add a sequence of one or -more of the following modifiers, each preceded by a ':'. These modify, +more of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event. -'h' +‘h’ Remove a trailing pathname component, leaving only the head. -'t' +‘t’ Remove all leading pathname components, leaving the tail. -'r' - Remove a trailing suffix of the form '.SUFFIX', leaving the +‘r’ + Remove a trailing suffix of the form ‘.SUFFIX’, leaving the basename. -'e' +‘e’ Remove all but the trailing suffix. -'p' +‘p’ Print the new command but do not execute it. -'q' +‘q’ Quote the substituted words, escaping further substitutions. -'x' - Quote the substituted words as with 'q', but break into words at - spaces, tabs, and newlines. The 'q' and 'x' modifiers are mutually +‘x’ + Quote the substituted words as with ‘q’, but break into words at + spaces, tabs, and newlines. The ‘q’ and ‘x’ modifiers are mutually exclusive; the last one supplied is used. -'s/OLD/NEW/' +‘s/OLD/NEW/’ Substitute NEW for the first occurrence of OLD in the event line. - Any character may be used as the delimiter in place of '/'. The + Any character may be used as the delimiter in place of ‘/’. The delimiter may be quoted in OLD and NEW with a single backslash. If - '&' appears in NEW, it is replaced by OLD. A single backslash will - quote the '&'. If OLD is null, it is set to the last OLD + ‘&’ appears in NEW, it is replaced by OLD. A single backslash will + quote the ‘&’. If OLD is null, it is set to the last OLD substituted, or, if no previous history substitutions took place, - the last STRING in a !?STRING'[?]' search. If NEW is null, each + the last STRING in a !?STRING‘[?]’ search. If NEW is null, each matching OLD is deleted. The final delimiter is optional if it is the last character on the input line. -'&' +‘&’ Repeat the previous substitution. -'g' -'a' +‘g’ +‘a’ Cause changes to be applied over the entire event line. Used in - conjunction with 's', as in 'gs/OLD/NEW/', or with '&'. + conjunction with ‘s’, as in ‘gs/OLD/NEW/’, or with ‘&’. -'G' - Apply the following 's' or '&' modifier once to each word in the +‘G’ + Apply the following ‘s’ or ‘&’ modifier once to each word in the event.  @@ -10724,45 +10732,45 @@ These are installation instructions for Bash. The simplest way to compile Bash is: - 1. 'cd' to the directory containing the source code and type - './configure' to configure Bash for your system. If you're using - 'csh' on an old version of System V, you might need to type 'sh - ./configure' instead to prevent 'csh' from trying to execute - 'configure' itself. + 1. ‘cd’ to the directory containing the source code and type + ‘./configure’ to configure Bash for your system. If you're using + ‘csh’ on an old version of System V, you might need to type ‘sh + ./configure’ instead to prevent ‘csh’ from trying to execute + ‘configure’ itself. - Running 'configure' takes some time. While running, it prints + Running ‘configure’ takes some time. While running, it prints messages telling which features it is checking for. - 2. Type 'make' to compile Bash and build the 'bashbug' bug reporting + 2. Type ‘make’ to compile Bash and build the ‘bashbug’ bug reporting script. - 3. Optionally, type 'make tests' to run the Bash test suite. + 3. Optionally, type ‘make tests’ to run the Bash test suite. - 4. Type 'make install' to install 'bash' and 'bashbug'. This will + 4. Type ‘make install’ to install ‘bash’ and ‘bashbug’. This will also install the manual pages and Info file, message translation files, some supplemental documentation, a number of example loadable builtin commands, and a set of header files for developing loadable builtins. You may need additional privileges to install - 'bash' to your desired destination, so 'sudo make install' might be + ‘bash’ to your desired destination, so ‘sudo make install’ might be required. More information about controlling the locations where - 'bash' and other files are installed is below (*note Installation + ‘bash’ and other files are installed is below (*note Installation Names::). - The 'configure' shell script attempts to guess correct values for + The ‘configure’ shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a 'Makefile' in each directory of the package -(the top directory, the 'builtins', 'doc', 'po', and 'support' -directories, each directory under 'lib', and several others). It also -creates a 'config.h' file containing system-dependent definitions. -Finally, it creates a shell script named 'config.status' that you can +those values to create a ‘Makefile’ in each directory of the package +(the top directory, the ‘builtins’, ‘doc’, ‘po’, and ‘support’ +directories, each directory under ‘lib’, and several others). It also +creates a ‘config.h’ file containing system-dependent definitions. +Finally, it creates a shell script named ‘config.status’ that you can run in the future to recreate the current configuration, a file -'config.cache' that saves the results of its tests to speed up -reconfiguring, and a file 'config.log' containing compiler output -(useful mainly for debugging 'configure'). If at some point -'config.cache' contains results you don't want to keep, you may remove +‘config.cache’ that saves the results of its tests to speed up +reconfiguring, and a file ‘config.log’ containing compiler output +(useful mainly for debugging ‘configure’). If at some point +‘config.cache’ contains results you don't want to keep, you may remove or edit it. - To find out more about the options and arguments that the 'configure' + To find out more about the options and arguments that the ‘configure’ script understands, type bash-4.2$ ./configure --help @@ -10772,8 +10780,8 @@ at the Bash prompt in your Bash source directory. If you want to build Bash in a directory separate from the source directory - to build for multiple architectures, for example - just use the full path to the configure script. The following commands will -build Bash in a directory under '/usr/local/build' from the source code -in '/usr/local/src/bash-4.4': +build Bash in a directory under ‘/usr/local/build’ from the source code +in ‘/usr/local/src/bash-4.4’: mkdir /usr/local/build/bash-4.4 cd /usr/local/build/bash-4.4 @@ -10784,19 +10792,19 @@ in '/usr/local/src/bash-4.4': about building in a directory separate from the source. If you need to do unusual things to compile Bash, please try to -figure out how 'configure' could check whether or not to do them, and +figure out how ‘configure’ could check whether or not to do them, and mail diffs or instructions to so they can be considered for the next release. - The file 'configure.ac' is used to create 'configure' by a program -called Autoconf. You only need 'configure.ac' if you want to change it -or regenerate 'configure' using a newer version of Autoconf. If you do + The file ‘configure.ac’ is used to create ‘configure’ by a program +called Autoconf. You only need ‘configure.ac’ if you want to change it +or regenerate ‘configure’ using a newer version of Autoconf. If you do this, make sure you are using Autoconf version 2.69 or newer. You can remove the program binaries and object files from the source -code directory by typing 'make clean'. To also remove the files that -'configure' created (so you can compile Bash for a different kind of -computer), type 'make distclean'. +code directory by typing ‘make clean’. To also remove the files that +‘configure’ created (so you can compile Bash for a different kind of +computer), type ‘make distclean’.  File: bash.info, Node: Compilers and Options, Next: Compiling For Multiple Architectures, Prev: Basic Installation, Up: Installing Bash @@ -10805,14 +10813,14 @@ File: bash.info, Node: Compilers and Options, Next: Compiling For Multiple Arc ========================== Some systems require unusual options for compilation or linking that the -'configure' script does not know about. You can give 'configure' +‘configure’ script does not know about. You can give ‘configure’ initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - On systems that have the 'env' program, you can do it like this: + On systems that have the ‘env’ program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure @@ -10826,29 +10834,29 @@ File: bash.info, Node: Compiling For Multiple Architectures, Next: Installatio You can compile Bash for more than one kind of computer at the same time, by placing the object files for each architecture in their own -directory. To do this, you must use a version of 'make' that supports -the 'VPATH' variable, such as GNU 'make'. 'cd' to the directory where -you want the object files and executables to go and run the 'configure' +directory. To do this, you must use a version of ‘make’ that supports +the ‘VPATH’ variable, such as GNU ‘make’. ‘cd’ to the directory where +you want the object files and executables to go and run the ‘configure’ script from the source directory (*note Basic Installation::). You may -need to supply the '--srcdir=PATH' argument to tell 'configure' where -the source files are. 'configure' automatically checks for the source -code in the directory that 'configure' is in and in '..'. +need to supply the ‘--srcdir=PATH’ argument to tell ‘configure’ where +the source files are. ‘configure’ automatically checks for the source +code in the directory that ‘configure’ is in and in '..'. - If you have to use a 'make' that does not support the 'VPATH' + If you have to use a ‘make’ that does not support the ‘VPATH’ variable, you can compile Bash for one architecture at a time in the source code directory. After you have installed Bash for one -architecture, use 'make distclean' before reconfiguring for another +architecture, use ‘make distclean’ before reconfiguring for another architecture. Alternatively, if your system supports symbolic links, you can use -the 'support/mkclone' script to create a build tree which has symbolic +the ‘support/mkclone’ script to create a build tree which has symbolic links back to each file in the source directory. Here's an example that creates a build directory in the current directory from a source -directory '/usr/gnu/src/bash-2.0': +directory ‘/usr/gnu/src/bash-2.0’: bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . -The 'mkclone' script requires Bash, so you must have already built Bash +The ‘mkclone’ script requires Bash, so you must have already built Bash for at least one architecture before you can create build directories for other architectures. @@ -10858,41 +10866,41 @@ File: bash.info, Node: Installation Names, Next: Specifying the System Type, 10.4 Installation Names ======================= -By default, 'make install' will install into '/usr/local/bin', -'/usr/local/man', etc.; that is, the "installation prefix" defaults to -'/usr/local'. You can specify an installation prefix other than -'/usr/local' by giving 'configure' the option '--prefix=PATH', or by -specifying a value for the 'prefix' 'make' variable when running 'make -install' (e.g., 'make install prefix=PATH'). The 'prefix' variable -provides a default for 'exec_prefix' and other variables used when +By default, ‘make install’ will install into ‘/usr/local/bin’, +‘/usr/local/man’, etc.; that is, the “installation prefix” defaults to +‘/usr/local’. You can specify an installation prefix other than +‘/usr/local’ by giving ‘configure’ the option ‘--prefix=PATH’, or by +specifying a value for the ‘prefix’ ‘make’ variable when running ‘make +install’ (e.g., ‘make install prefix=PATH’). The ‘prefix’ variable +provides a default for ‘exec_prefix’ and other variables used when installing Bash. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give 'configure' the option '--exec-prefix=PATH', 'make install' will +give ‘configure’ the option ‘--exec-prefix=PATH’, ‘make install’ will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. If you would like to change the installation locations for a single -run, you can specify these variables as arguments to 'make': 'make -install exec_prefix=/' will install 'bash' and 'bashbug' into '/bin' -instead of the default '/usr/local/bin'. +run, you can specify these variables as arguments to ‘make’: ‘make +install exec_prefix=/’ will install ‘bash’ and ‘bashbug’ into ‘/bin’ +instead of the default ‘/usr/local/bin’. If you want to see the files Bash will install and where it will install them without changing anything on your system, specify the -variable 'DESTDIR' as an argument to 'make'. Its value should be the +variable ‘DESTDIR’ as an argument to ‘make’. Its value should be the absolute directory path you'd like to use as the root of your sample installation tree. For example, mkdir /fs1/bash-install make install DESTDIR=/fs1/bash-install -will install 'bash' into '/fs1/bash-install/usr/local/bin/bash', the +will install ‘bash’ into ‘/fs1/bash-install/usr/local/bin/bash’, the documentation into directories within -'/fs1/bash-install/usr/local/share', the example loadable builtins into -'/fs1/bash-install/usr/local/lib/bash', and so on. You can use the -usual 'exec_prefix' and 'prefix' variables to alter the directory paths -beneath the value of 'DESTDIR'. +‘/fs1/bash-install/usr/local/share’, the example loadable builtins into +‘/fs1/bash-install/usr/local/lib/bash’, and so on. You can use the +usual ‘exec_prefix’ and ‘prefix’ variables to alter the directory paths +beneath the value of ‘DESTDIR’. The GNU Makefile standards provide a more complete description of these variables and their effects. @@ -10903,15 +10911,15 @@ File: bash.info, Node: Specifying the System Type, Next: Sharing Defaults, Pr 10.5 Specifying the System Type =============================== -There may be some features 'configure' can not figure out automatically, +There may be some features ‘configure’ can not figure out automatically, but needs to determine by the type of host Bash will run on. Usually -'configure' can figure that out, but if it prints a message saying it -can not guess the host type, give it the '--host=TYPE' option. 'TYPE' -can either be a short name for the system type, such as 'sun4', or a -canonical name with three fields: 'CPU-COMPANY-SYSTEM' (e.g., -'i386-unknown-freebsd4.2'). +‘configure’ can figure that out, but if it prints a message saying it +can not guess the host type, give it the ‘--host=TYPE’ option. ‘TYPE’ +can either be a short name for the system type, such as ‘sun4’, or a +canonical name with three fields: ‘CPU-COMPANY-SYSTEM’ (e.g., +‘i386-unknown-freebsd4.2’). - See the file 'support/config.sub' for the possible values of each + See the file ‘support/config.sub’ for the possible values of each field.  @@ -10920,14 +10928,14 @@ File: bash.info, Node: Sharing Defaults, Next: Operation Controls, Prev: Spec 10.6 Sharing Defaults ===================== -If you want to set default values for 'configure' scripts to share, you -can create a site shell script called 'config.site' that gives default -values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' -looks for 'PREFIX/share/config.site' if it exists, then -'PREFIX/etc/config.site' if it exists. Or, you can set the -'CONFIG_SITE' environment variable to the location of the site script. -A warning: the Bash 'configure' looks for a site script, but not all -'configure' scripts do. +If you want to set default values for ‘configure’ scripts to share, you +can create a site shell script called ‘config.site’ that gives default +values for variables like ‘CC’, ‘cache_file’, and ‘prefix’. ‘configure’ +looks for ‘PREFIX/share/config.site’ if it exists, then +‘PREFIX/etc/config.site’ if it exists. Or, you can set the +‘CONFIG_SITE’ environment variable to the location of the site script. +A warning: the Bash ‘configure’ looks for a site script, but not all +‘configure’ scripts do.  File: bash.info, Node: Operation Controls, Next: Optional Features, Prev: Sharing Defaults, Up: Installing Bash @@ -10935,31 +10943,31 @@ File: bash.info, Node: Operation Controls, Next: Optional Features, Prev: Sha 10.7 Operation Controls ======================= -'configure' recognizes the following options to control how it operates. +‘configure’ recognizes the following options to control how it operates. -'--cache-file=FILE' +‘--cache-file=FILE’ Use and save the results of the tests in FILE instead of - './config.cache'. Set FILE to '/dev/null' to disable caching, for - debugging 'configure'. + ‘./config.cache’. Set FILE to ‘/dev/null’ to disable caching, for + debugging ‘configure’. -'--help' - Print a summary of the options to 'configure', and exit. +‘--help’ + Print a summary of the options to ‘configure’, and exit. -'--quiet' -'--silent' -'-q' +‘--quiet’ +‘--silent’ +‘-q’ Do not print messages saying which checks are being made. -'--srcdir=DIR' +‘--srcdir=DIR’ Look for the Bash source code in directory DIR. Usually - 'configure' can determine that directory automatically. + ‘configure’ can determine that directory automatically. -'--version' - Print the version of Autoconf used to generate the 'configure' +‘--version’ + Print the version of Autoconf used to generate the ‘configure’ script, and exit. - 'configure' also accepts some other, not widely used, boilerplate -options. 'configure --help' prints the complete list. + ‘configure’ also accepts some other, not widely used, boilerplate +options. ‘configure --help’ prints the complete list.  File: bash.info, Node: Optional Features, Prev: Operation Controls, Up: Installing Bash @@ -10967,271 +10975,271 @@ File: bash.info, Node: Optional Features, Prev: Operation Controls, Up: Insta 10.8 Optional Features ====================== -The Bash 'configure' has a number of '--enable-FEATURE' options, where +The Bash ‘configure’ has a number of ‘--enable-FEATURE’ options, where FEATURE indicates an optional part of Bash. There are also several -'--with-PACKAGE' options, where PACKAGE is something like 'bash-malloc' -or 'purify'. To turn off the default use of a package, use -'--without-PACKAGE'. To configure Bash without a feature that is -enabled by default, use '--disable-FEATURE'. +‘--with-PACKAGE’ options, where PACKAGE is something like ‘bash-malloc’ +or ‘purify’. To turn off the default use of a package, use +‘--without-PACKAGE’. To configure Bash without a feature that is +enabled by default, use ‘--disable-FEATURE’. - Here is a complete list of the '--enable-' and '--with-' options that -the Bash 'configure' recognizes. + Here is a complete list of the ‘--enable-’ and ‘--with-’ options that +the Bash ‘configure’ recognizes. -'--with-afs' +‘--with-afs’ Define if you are using the Andrew File System from Transarc. -'--with-bash-malloc' - Use the Bash version of 'malloc' in the directory 'lib/malloc'. - This is not the same 'malloc' that appears in GNU libc, but an - older version originally derived from the 4.2 BSD 'malloc'. This - 'malloc' is very fast, but wastes some space on each allocation. - This option is enabled by default. The 'NOTES' file contains a +‘--with-bash-malloc’ + Use the Bash version of ‘malloc’ in the directory ‘lib/malloc’. + This is not the same ‘malloc’ that appears in GNU libc, but an + older version originally derived from the 4.2 BSD ‘malloc’. This + ‘malloc’ is very fast, but wastes some space on each allocation. + This option is enabled by default. The ‘NOTES’ file contains a list of systems for which this should be turned off, and - 'configure' disables this option automatically for a number of + ‘configure’ disables this option automatically for a number of systems. -'--with-curses' +‘--with-curses’ Use the curses library instead of the termcap library. This should be supplied if your system has an inadequate or incomplete termcap database. -'--with-gnu-malloc' - A synonym for '--with-bash-malloc'. +‘--with-gnu-malloc’ + A synonym for ‘--with-bash-malloc’. -'--with-installed-readline[=PREFIX]' +‘--with-installed-readline[=PREFIX]’ Define this to make Bash link with a locally-installed version of - Readline rather than the version in 'lib/readline'. This works - only with Readline 5.0 and later versions. If PREFIX is 'yes' or - not supplied, 'configure' uses the values of the make variables - 'includedir' and 'libdir', which are subdirectories of 'prefix' by + Readline rather than the version in ‘lib/readline’. This works + only with Readline 5.0 and later versions. If PREFIX is ‘yes’ or + not supplied, ‘configure’ uses the values of the make variables + ‘includedir’ and ‘libdir’, which are subdirectories of ‘prefix’ by default, to find the installed version of Readline if it is not in the standard system include and library directories. If PREFIX is - 'no', Bash links with the version in 'lib/readline'. If PREFIX is - set to any other value, 'configure' treats it as a directory + ‘no’, Bash links with the version in ‘lib/readline’. If PREFIX is + set to any other value, ‘configure’ treats it as a directory pathname and looks for the installed version of Readline in - subdirectories of that directory (include files in PREFIX/'include' - and the library in PREFIX/'lib'). + subdirectories of that directory (include files in PREFIX/‘include’ + and the library in PREFIX/‘lib’). -'--with-libintl-prefix[=PREFIX]' +‘--with-libintl-prefix[=PREFIX]’ Define this to make Bash link with a locally-installed version of - the libintl library instead of the version in 'lib/intl'. + the libintl library instead of the version in ‘lib/intl’. -'--with-libiconv-prefix[=PREFIX]' +‘--with-libiconv-prefix[=PREFIX]’ Define this to make Bash look for libiconv in PREFIX instead of the standard system locations. There is no version included with Bash. -'--enable-minimal-config' +‘--enable-minimal-config’ This produces a shell with minimal features, close to the historical Bourne shell. - There are several '--enable-' options that alter how Bash is + There are several ‘--enable-’ options that alter how Bash is compiled, linked, and installed, rather than changing run-time features. -'--enable-largefile' +‘--enable-largefile’ Enable support for large files (http://www.unix.org/version2/whatsnew/lfs20mar.html) if the operating system requires special compiler options to build programs which can access large files. This is enabled by default, if the operating system provides large file support. -'--enable-profiling' +‘--enable-profiling’ This builds a Bash binary that produces profiling information to be - processed by 'gprof' each time it is executed. + processed by ‘gprof’ each time it is executed. -'--enable-separate-helpfiles' - Use external files for the documentation displayed by the 'help' +‘--enable-separate-helpfiles’ + Use external files for the documentation displayed by the ‘help’ builtin instead of storing the text internally. -'--enable-static-link' - This causes Bash to be linked statically, if 'gcc' is being used. +‘--enable-static-link’ + This causes Bash to be linked statically, if ‘gcc’ is being used. This could be used to build a version to use as root's shell. - The 'minimal-config' option can be used to disable all of the + The ‘minimal-config’ option can be used to disable all of the following options, but it is processed first, so individual options may -be enabled using 'enable-FEATURE'. +be enabled using ‘enable-FEATURE’. - All of the following options except for 'alt-array-implementation', -'disabled-builtins', 'direxpand-default', 'strict-posix-default', and -'xpg-echo-default' are enabled by default, unless the operating system + All of the following options except for ‘alt-array-implementation’, +‘disabled-builtins’, ‘direxpand-default’, ‘strict-posix-default’, and +‘xpg-echo-default’ are enabled by default, unless the operating system does not provide the necessary support. -'--enable-alias' - Allow alias expansion and include the 'alias' and 'unalias' +‘--enable-alias’ + Allow alias expansion and include the ‘alias’ and ‘unalias’ builtins (*note Aliases::). -'--enable-alt-array-implementation' +‘--enable-alt-array-implementation’ This builds Bash using an alternate implementation of arrays (*note Arrays::) that provides faster access at the expense of using more memory (sometimes many times more, depending on how sparse an array is). -'--enable-arith-for-command' - Include support for the alternate form of the 'for' command that - behaves like the C language 'for' statement (*note Looping +‘--enable-arith-for-command’ + Include support for the alternate form of the ‘for’ command that + behaves like the C language ‘for’ statement (*note Looping Constructs::). -'--enable-array-variables' +‘--enable-array-variables’ Include support for one-dimensional array shell variables (*note Arrays::). -'--enable-bang-history' - Include support for 'csh'-like history substitution (*note History +‘--enable-bang-history’ + Include support for ‘csh’-like history substitution (*note History Interaction::). -'--enable-brace-expansion' - Include 'csh'-like brace expansion ( 'b{a,b}c' ==> 'bac bbc' ). - See *note Brace Expansion::, for a complete description. +‘--enable-brace-expansion’ + Include ‘csh’-like brace expansion ( ‘b{a,b}c’ ↦ ‘bac bbc’ ). See + *note Brace Expansion::, for a complete description. -'--enable-casemod-attributes' - Include support for case-modifying attributes in the 'declare' - builtin and assignment statements. Variables with the 'uppercase' +‘--enable-casemod-attributes’ + Include support for case-modifying attributes in the ‘declare’ + builtin and assignment statements. Variables with the ‘uppercase’ attribute, for example, will have their values converted to uppercase upon assignment. -'--enable-casemod-expansion' +‘--enable-casemod-expansion’ Include support for case-modifying word expansions. -'--enable-command-timing' - Include support for recognizing 'time' as a reserved word and for - displaying timing statistics for the pipeline following 'time' +‘--enable-command-timing’ + Include support for recognizing ‘time’ as a reserved word and for + displaying timing statistics for the pipeline following ‘time’ (*note Pipelines::). This allows pipelines as well as shell builtins and functions to be timed. -'--enable-cond-command' - Include support for the '[[' conditional command. (*note +‘--enable-cond-command’ + Include support for the ‘[[’ conditional command. (*note Conditional Constructs::). -'--enable-cond-regexp' +‘--enable-cond-regexp’ Include support for matching POSIX regular expressions using the - '=~' binary operator in the '[[' conditional command. (*note + ‘=~’ binary operator in the ‘[[’ conditional command. (*note Conditional Constructs::). -'--enable-coprocesses' - Include support for coprocesses and the 'coproc' reserved word +‘--enable-coprocesses’ + Include support for coprocesses and the ‘coproc’ reserved word (*note Pipelines::). -'--enable-debugger' +‘--enable-debugger’ Include support for the Bash debugger (distributed separately). -'--enable-dev-fd-stat-broken' - If calling 'stat' on /dev/fd/N returns different results than - calling 'fstat' on file descriptor N, supply this option to enable +‘--enable-dev-fd-stat-broken’ + If calling ‘stat’ on /dev/fd/N returns different results than + calling ‘fstat’ on file descriptor N, supply this option to enable a workaround. This has implications for conditional commands that test file attributes. -'--enable-direxpand-default' - Cause the 'direxpand' shell option (*note The Shopt Builtin::) to +‘--enable-direxpand-default’ + Cause the ‘direxpand’ shell option (*note The Shopt Builtin::) to be enabled by default when the shell starts. It is normally disabled by default. -'--enable-directory-stack' - Include support for a 'csh'-like directory stack and the 'pushd', - 'popd', and 'dirs' builtins (*note The Directory Stack::). +‘--enable-directory-stack’ + Include support for a ‘csh’-like directory stack and the ‘pushd’, + ‘popd’, and ‘dirs’ builtins (*note The Directory Stack::). -'--enable-disabled-builtins' - Allow builtin commands to be invoked via 'builtin xxx' even after - 'xxx' has been disabled using 'enable -n xxx'. See *note Bash - Builtins::, for details of the 'builtin' and 'enable' builtin +‘--enable-disabled-builtins’ + Allow builtin commands to be invoked via ‘builtin xxx’ even after + ‘xxx’ has been disabled using ‘enable -n xxx’. See *note Bash + Builtins::, for details of the ‘builtin’ and ‘enable’ builtin commands. -'--enable-dparen-arithmetic' - Include support for the '((...))' command (*note Conditional +‘--enable-dparen-arithmetic’ + Include support for the ‘((...))’ command (*note Conditional Constructs::). -'--enable-extended-glob' +‘--enable-extended-glob’ Include support for the extended pattern matching features described above under *note Pattern Matching::. -'--enable-extended-glob-default' - Set the default value of the 'extglob' shell option described above +‘--enable-extended-glob-default’ + Set the default value of the ‘extglob’ shell option described above under *note The Shopt Builtin:: to be enabled. -'--enable-function-import' +‘--enable-function-import’ Include support for importing function definitions exported by another instance of the shell from the environment. This option is enabled by default. -'--enable-glob-asciiranges-default' - Set the default value of the 'globasciiranges' shell option +‘--enable-glob-asciiranges-default’ + Set the default value of the ‘globasciiranges’ shell option described above under *note The Shopt Builtin:: to be enabled. This controls the behavior of character ranges when used in pattern matching bracket expressions. -'--enable-help-builtin' - Include the 'help' builtin, which displays help on shell builtins +‘--enable-help-builtin’ + Include the ‘help’ builtin, which displays help on shell builtins and variables (*note Bash Builtins::). -'--enable-history' - Include command history and the 'fc' and 'history' builtin commands +‘--enable-history’ + Include command history and the ‘fc’ and ‘history’ builtin commands (*note Bash History Facilities::). -'--enable-job-control' +‘--enable-job-control’ This enables the job control features (*note Job Control::), if the operating system supports them. -'--enable-multibyte' +‘--enable-multibyte’ This enables support for multibyte characters if the operating system provides the necessary support. -'--enable-net-redirections' +‘--enable-net-redirections’ This enables the special handling of filenames of the form - '/dev/tcp/HOST/PORT' and '/dev/udp/HOST/PORT' when used in + ‘/dev/tcp/HOST/PORT’ and ‘/dev/udp/HOST/PORT’ when used in redirections (*note Redirections::). -'--enable-process-substitution' +‘--enable-process-substitution’ This enables process substitution (*note Process Substitution::) if the operating system provides the necessary support. -'--enable-progcomp' +‘--enable-progcomp’ Enable the programmable completion facilities (*note Programmable Completion::). If Readline is not enabled, this option has no effect. -'--enable-prompt-string-decoding' +‘--enable-prompt-string-decoding’ Turn on the interpretation of a number of backslash-escaped - characters in the '$PS0', '$PS1', '$PS2', and '$PS4' prompt + characters in the ‘$PS0’, ‘$PS1’, ‘$PS2’, and ‘$PS4’ prompt strings. See *note Controlling the Prompt::, for a complete list of prompt string escape sequences. -'--enable-readline' +‘--enable-readline’ Include support for command-line editing and history with the Bash version of the Readline library (*note Command Line Editing::). -'--enable-restricted' - Include support for a "restricted shell". If this is enabled, - Bash, when called as 'rbash', enters a restricted mode. See *note +‘--enable-restricted’ + Include support for a “restricted shell”. If this is enabled, + Bash, when called as ‘rbash’, enters a restricted mode. See *note The Restricted Shell::, for a description of restricted mode. -'--enable-select' - Include the 'select' compound command, which allows the generation +‘--enable-select’ + Include the ‘select’ compound command, which allows the generation of simple menus (*note Conditional Constructs::). -'--enable-single-help-strings' - Store the text displayed by the 'help' builtin as a single string +‘--enable-single-help-strings’ + Store the text displayed by the ‘help’ builtin as a single string for each help topic. This aids in translating the text to different languages. You may need to disable this if your compiler cannot handle very long string literals. -'--enable-strict-posix-default' +‘--enable-strict-posix-default’ Make Bash POSIX-conformant by default (*note Bash POSIX Mode::). -'--enable-translatable-strings' - Enable support for '$"STRING"' translatable strings (*note Locale +‘--enable-translatable-strings’ + Enable support for ‘$"STRING"’ translatable strings (*note Locale Translation::). -'--enable-usg-echo-default' - A synonym for '--enable-xpg-echo-default'. +‘--enable-usg-echo-default’ + A synonym for ‘--enable-xpg-echo-default’. -'--enable-xpg-echo-default' - Make the 'echo' builtin expand backslash-escaped characters by - default, without requiring the '-e' option. This sets the default - value of the 'xpg_echo' shell option to 'on', which makes the Bash - 'echo' behave more like the version specified in the Single Unix +‘--enable-xpg-echo-default’ + Make the ‘echo’ builtin expand backslash-escaped characters by + default, without requiring the ‘-e’ option. This sets the default + value of the ‘xpg_echo’ shell option to ‘on’, which makes the Bash + ‘echo’ behave more like the version specified in the Single Unix Specification, version 3. *Note Bash Builtins::, for a description - of the escape sequences that 'echo' recognizes. + of the escape sequences that ‘echo’ recognizes. - The file 'config-top.h' contains C Preprocessor '#define' statements -for options which are not settable from 'configure'. Some of these are + The file ‘config-top.h’ contains C Preprocessor ‘#define’ statements +for options which are not settable from ‘configure’. Some of these are not meant to be changed; beware of the consequences if you do. Read the comments associated with each definition for more information about its effect. @@ -11249,21 +11257,21 @@ of Bash. The latest version of Bash is always available for FTP from . Once you have determined that a bug actually exists, use the -'bashbug' command to submit a bug report or use the form at the Bash +‘bashbug’ command to submit a bug report or use the form at the Bash project page (https://savannah.gnu.org/projects/bash/). If you have a fix, you are encouraged to submit that as well! Suggestions and 'philosophical' bug reports may be mailed to or . All bug reports should include: - * The version number of Bash. - * The hardware and operating system. - * The compiler used to compile Bash. - * A description of the bug behaviour. - * A short script or 'recipe' which exercises the bug and may be used + • The version number of Bash. + • The hardware and operating system. + • The compiler used to compile Bash. + • A description of the bug behaviour. + • A short script or 'recipe' which exercises the bug and may be used to reproduce it. -'bashbug' inserts the first three items automatically into the template +‘bashbug’ inserts the first three items automatically into the template it provides for filing a bug report. Please send all reports concerning this manual to . @@ -11280,314 +11288,314 @@ POSIX standard as the specification of how these features are to be implemented. There are some differences between the traditional Bourne shell and Bash; this section quickly details the differences of significance. A number of these differences are explained in greater -depth in previous sections. This section uses the version of 'sh' +depth in previous sections. This section uses the version of ‘sh’ included in SVR4.2 (the last version of the historical Bourne shell) as the baseline reference. - * Bash is POSIX-conformant, even where the POSIX specification - differs from traditional 'sh' behavior (*note Bash POSIX Mode::). + • Bash is POSIX-conformant, even where the POSIX specification + differs from traditional ‘sh’ behavior (*note Bash POSIX Mode::). - * Bash has multi-character invocation options (*note Invoking + • Bash has multi-character invocation options (*note Invoking Bash::). - * Bash has command-line editing (*note Command Line Editing::) and - the 'bind' builtin. + • Bash has command-line editing (*note Command Line Editing::) and + the ‘bind’ builtin. - * Bash provides a programmable word completion mechanism (*note - Programmable Completion::), and builtin commands 'complete', - 'compgen', and 'compopt', to manipulate it. + • Bash provides a programmable word completion mechanism (*note + Programmable Completion::), and builtin commands ‘complete’, + ‘compgen’, and ‘compopt’, to manipulate it. - * Bash has command history (*note Bash History Facilities::) and the - 'history' and 'fc' builtins to manipulate it. The Bash history + • Bash has command history (*note Bash History Facilities::) and the + ‘history’ and ‘fc’ builtins to manipulate it. The Bash history list maintains timestamp information and uses the value of the - 'HISTTIMEFORMAT' variable to display it. + ‘HISTTIMEFORMAT’ variable to display it. - * Bash implements 'csh'-like history expansion (*note History + • Bash implements ‘csh’-like history expansion (*note History Interaction::). - * Bash has one-dimensional array variables (*note Arrays::), and the + • Bash has one-dimensional array variables (*note Arrays::), and the appropriate variable expansions and assignment syntax to use them. Several of the Bash builtins take options to act on arrays. Bash provides a number of built-in array variables. - * The '$'...'' quoting syntax, which expands ANSI-C backslash-escaped + • The ‘$'...'’ quoting syntax, which expands ANSI-C backslash-escaped characters in the text between the single quotes, is supported (*note ANSI-C Quoting::). - * Bash supports the '$"..."' quoting syntax to do locale-specific - translation of the characters between the double quotes. The '-D', - '--dump-strings', and '--dump-po-strings' invocation options list + • Bash supports the ‘$"..."’ quoting syntax to do locale-specific + translation of the characters between the double quotes. The ‘-D’, + ‘--dump-strings’, and ‘--dump-po-strings’ invocation options list the translatable strings found in a script (*note Locale Translation::). - * Bash implements the '!' keyword to negate the return value of a - pipeline (*note Pipelines::). Very useful when an 'if' statement - needs to act only if a test fails. The Bash '-o pipefail' option - to 'set' will cause a pipeline to return a failure status if any + • Bash implements the ‘!’ keyword to negate the return value of a + pipeline (*note Pipelines::). Very useful when an ‘if’ statement + needs to act only if a test fails. The Bash ‘-o pipefail’ option + to ‘set’ will cause a pipeline to return a failure status if any command fails. - * Bash has the 'time' reserved word and command timing (*note + • Bash has the ‘time’ reserved word and command timing (*note Pipelines::). The display of the timing statistics may be - controlled with the 'TIMEFORMAT' variable. + controlled with the ‘TIMEFORMAT’ variable. - * Bash implements the 'for (( EXPR1 ; EXPR2 ; EXPR3 ))' arithmetic + • Bash implements the ‘for (( EXPR1 ; EXPR2 ; EXPR3 ))’ arithmetic for command, similar to the C language (*note Looping Constructs::). - * Bash includes the 'select' compound command, which allows the + • Bash includes the ‘select’ compound command, which allows the generation of simple menus (*note Conditional Constructs::). - * Bash includes the '[[' compound command, which makes conditional + • Bash includes the ‘[[’ compound command, which makes conditional testing part of the shell grammar (*note Conditional Constructs::), including optional regular expression matching. - * Bash provides optional case-insensitive matching for the 'case' and - '[[' constructs. + • Bash provides optional case-insensitive matching for the ‘case’ and + ‘[[’ constructs. - * Bash includes brace expansion (*note Brace Expansion::) and tilde + • Bash includes brace expansion (*note Brace Expansion::) and tilde expansion (*note Tilde Expansion::). - * Bash implements command aliases and the 'alias' and 'unalias' + • Bash implements command aliases and the ‘alias’ and ‘unalias’ builtins (*note Aliases::). - * Bash provides shell arithmetic, the '((' compound command (*note + • Bash provides shell arithmetic, the ‘((’ compound command (*note Conditional Constructs::), and arithmetic expansion (*note Shell Arithmetic::). - * Variables present in the shell's initial environment are + • Variables present in the shell's initial environment are automatically exported to child processes. The Bourne shell does not normally do this unless the variables are explicitly marked - using the 'export' command. + using the ‘export’ command. - * Bash supports the '+=' assignment operator, which appends to the + • Bash supports the ‘+=’ assignment operator, which appends to the value of the variable named on the left hand side. - * Bash includes the POSIX pattern removal '%', '#', '%%' and '##' + • Bash includes the POSIX pattern removal ‘%’, ‘#’, ‘%%’ and ‘##’ expansions to remove leading or trailing substrings from variable values (*note Shell Parameter Expansion::). - * The expansion '${#xx}', which returns the length of '${xx}', is + • The expansion ‘${#xx}’, which returns the length of ‘${xx}’, is supported (*note Shell Parameter Expansion::). - * The expansion '${var:'OFFSET'[:'LENGTH']}', which expands to the - substring of 'var''s value of length LENGTH, beginning at OFFSET, + • The expansion ‘${var:’OFFSET‘[:’LENGTH‘]}’, which expands to the + substring of ‘var’'s value of length LENGTH, beginning at OFFSET, is present (*note Shell Parameter Expansion::). - * The expansion '${VAR/[/]'PATTERN'[/'REPLACEMENT']}', which matches + • The expansion ‘${VAR/[/]’PATTERN‘[/’REPLACEMENT‘]}’, which matches PATTERN and replaces it with REPLACEMENT in the value of VAR, is available (*note Shell Parameter Expansion::). - * The expansion '${!PREFIX*}' expansion, which expands to the names + • The expansion ‘${!PREFIX*}’ expansion, which expands to the names of all shell variables whose names begin with PREFIX, is available (*note Shell Parameter Expansion::). - * Bash has indirect variable expansion using '${!word}' (*note Shell + • Bash has indirect variable expansion using ‘${!word}’ (*note Shell Parameter Expansion::). - * Bash can expand positional parameters beyond '$9' using '${NUM}'. + • Bash can expand positional parameters beyond ‘$9’ using ‘${NUM}’. - * The POSIX '$()' form of command substitution is implemented (*note - Command Substitution::), and preferred to the Bourne shell's '``' + • The POSIX ‘$()’ form of command substitution is implemented (*note + Command Substitution::), and preferred to the Bourne shell's ‘``’ (which is also implemented for backwards compatibility). - * Bash has process substitution (*note Process Substitution::). + • Bash has process substitution (*note Process Substitution::). - * Bash automatically assigns variables that provide information about - the current user ('UID', 'EUID', and 'GROUPS'), the current host - ('HOSTTYPE', 'OSTYPE', 'MACHTYPE', and 'HOSTNAME'), and the - instance of Bash that is running ('BASH', 'BASH_VERSION', and - 'BASH_VERSINFO'). *Note Bash Variables::, for details. + • Bash automatically assigns variables that provide information about + the current user (‘UID’, ‘EUID’, and ‘GROUPS’), the current host + (‘HOSTTYPE’, ‘OSTYPE’, ‘MACHTYPE’, and ‘HOSTNAME’), and the + instance of Bash that is running (‘BASH’, ‘BASH_VERSION’, and + ‘BASH_VERSINFO’). *Note Bash Variables::, for details. - * The 'IFS' variable is used to split only the results of expansion, + • The ‘IFS’ variable is used to split only the results of expansion, not all words (*note Word Splitting::). This closes a longstanding shell security hole. - * The filename expansion bracket expression code uses '!' and '^' to + • The filename expansion bracket expression code uses ‘!’ and ‘^’ to negate the set of characters between the brackets. The Bourne - shell uses only '!'. + shell uses only ‘!’. - * Bash implements the full set of POSIX filename expansion operators, + • Bash implements the full set of POSIX filename expansion operators, including character classes, equivalence classes, and collating symbols (*note Filename Expansion::). - * Bash implements extended pattern matching features when the - 'extglob' shell option is enabled (*note Pattern Matching::). + • Bash implements extended pattern matching features when the + ‘extglob’ shell option is enabled (*note Pattern Matching::). - * It is possible to have a variable and a function with the same - name; 'sh' does not separate the two name spaces. + • It is possible to have a variable and a function with the same + name; ‘sh’ does not separate the two name spaces. - * Bash functions are permitted to have local variables using the - 'local' builtin, and thus useful recursive functions may be written + • Bash functions are permitted to have local variables using the + ‘local’ builtin, and thus useful recursive functions may be written (*note Bash Builtins::). - * Variable assignments preceding commands affect only that command, - even builtins and functions (*note Environment::). In 'sh', all + • Variable assignments preceding commands affect only that command, + even builtins and functions (*note Environment::). In ‘sh’, all variable assignments preceding commands are global unless the command is executed from the file system. - * Bash performs filename expansion on filenames specified as operands + • Bash performs filename expansion on filenames specified as operands to input and output redirection operators (*note Redirections::). - * Bash contains the '<>' redirection operator, allowing a file to be - opened for both reading and writing, and the '&>' redirection + • Bash contains the ‘<>’ redirection operator, allowing a file to be + opened for both reading and writing, and the ‘&>’ redirection operator, for directing standard output and standard error to the same file (*note Redirections::). - * Bash includes the '<<<' redirection operator, allowing a string to + • Bash includes the ‘<<<’ redirection operator, allowing a string to be used as the standard input to a command. - * Bash implements the '[n]<&WORD' and '[n]>&WORD' redirection + • Bash implements the ‘[n]<&WORD’ and ‘[n]>&WORD’ redirection operators, which move one file descriptor to another. - * Bash treats a number of filenames specially when they are used in + • Bash treats a number of filenames specially when they are used in redirection operators (*note Redirections::). - * Bash can open network connections to arbitrary machines and + • Bash can open network connections to arbitrary machines and services with the redirection operators (*note Redirections::). - * The 'noclobber' option is available to avoid overwriting existing - files with output redirection (*note The Set Builtin::). The '>|' - redirection operator may be used to override 'noclobber'. + • The ‘noclobber’ option is available to avoid overwriting existing + files with output redirection (*note The Set Builtin::). The ‘>|’ + redirection operator may be used to override ‘noclobber’. - * The Bash 'cd' and 'pwd' builtins (*note Bourne Shell Builtins::) - each take '-L' and '-P' options to switch between logical and + • The Bash ‘cd’ and ‘pwd’ builtins (*note Bourne Shell Builtins::) + each take ‘-L’ and ‘-P’ options to switch between logical and physical modes. - * Bash allows a function to override a builtin with the same name, + • Bash allows a function to override a builtin with the same name, and provides access to that builtin's functionality within the - function via the 'builtin' and 'command' builtins (*note Bash + function via the ‘builtin’ and ‘command’ builtins (*note Bash Builtins::). - * The 'command' builtin allows selective disabling of functions when + • The ‘command’ builtin allows selective disabling of functions when command lookup is performed (*note Bash Builtins::). - * Individual builtins may be enabled or disabled using the 'enable' + • Individual builtins may be enabled or disabled using the ‘enable’ builtin (*note Bash Builtins::). - * The Bash 'exec' builtin takes additional options that allow users + • The Bash ‘exec’ builtin takes additional options that allow users to control the contents of the environment passed to the executed command, and what the zeroth argument to the command is to be (*note Bourne Shell Builtins::). - * Shell functions may be exported to children via the environment - using 'export -f' (*note Shell Functions::). + • Shell functions may be exported to children via the environment + using ‘export -f’ (*note Shell Functions::). - * The Bash 'export', 'readonly', and 'declare' builtins can take a - '-f' option to act on shell functions, a '-p' option to display + • The Bash ‘export’, ‘readonly’, and ‘declare’ builtins can take a + ‘-f’ option to act on shell functions, a ‘-p’ option to display variables with various attributes set in a format that can be used - as shell input, a '-n' option to remove various variable - attributes, and 'name=value' arguments to set variable attributes + as shell input, a ‘-n’ option to remove various variable + attributes, and ‘name=value’ arguments to set variable attributes and values simultaneously. - * The Bash 'hash' builtin allows a name to be associated with an + • The Bash ‘hash’ builtin allows a name to be associated with an arbitrary filename, even when that filename cannot be found by - searching the '$PATH', using 'hash -p' (*note Bourne Shell + searching the ‘$PATH’, using ‘hash -p’ (*note Bourne Shell Builtins::). - * Bash includes a 'help' builtin for quick reference to shell + • Bash includes a ‘help’ builtin for quick reference to shell facilities (*note Bash Builtins::). - * The 'printf' builtin is available to display formatted output + • The ‘printf’ builtin is available to display formatted output (*note Bash Builtins::). - * The Bash 'read' builtin (*note Bash Builtins::) will read a line - ending in '\' with the '-r' option, and will use the 'REPLY' + • The Bash ‘read’ builtin (*note Bash Builtins::) will read a line + ending in ‘\’ with the ‘-r’ option, and will use the ‘REPLY’ variable as a default if no non-option arguments are supplied. The - Bash 'read' builtin also accepts a prompt string with the '-p' - option and will use Readline to obtain the line when given the '-e' - or '-E' options. The 'read' builtin also has additional options to - control input: the '-s' option will turn off echoing of input - characters as they are read, the '-t' option will allow 'read' to + Bash ‘read’ builtin also accepts a prompt string with the ‘-p’ + option and will use Readline to obtain the line when given the ‘-e’ + or ‘-E’ options. The ‘read’ builtin also has additional options to + control input: the ‘-s’ option will turn off echoing of input + characters as they are read, the ‘-t’ option will allow ‘read’ to time out if input does not arrive within a specified number of - seconds, the '-n' option will allow reading only a specified number - of characters rather than a full line, and the '-d' option will + seconds, the ‘-n’ option will allow reading only a specified number + of characters rather than a full line, and the ‘-d’ option will read until a particular character rather than newline. - * The 'return' builtin may be used to abort execution of scripts - executed with the '.' or 'source' builtins (*note Bourne Shell + • The ‘return’ builtin may be used to abort execution of scripts + executed with the ‘.’ or ‘source’ builtins (*note Bourne Shell Builtins::). - * Bash includes the 'shopt' builtin, for finer control of shell + • Bash includes the ‘shopt’ builtin, for finer control of shell optional capabilities (*note The Shopt Builtin::), and allows these options to be set and unset at shell invocation (*note Invoking Bash::). - * Bash has much more optional behavior controllable with the 'set' + • Bash has much more optional behavior controllable with the ‘set’ builtin (*note The Set Builtin::). - * The '-x' ('xtrace') option displays commands other than simple + • The ‘-x’ (‘xtrace’) option displays commands other than simple commands when performing an execution trace (*note The Set Builtin::). - * The 'test' builtin (*note Bourne Shell Builtins::) is slightly + • The ‘test’ builtin (*note Bourne Shell Builtins::) is slightly different, as it implements the POSIX algorithm, which specifies the behavior based on the number of arguments. - * Bash includes the 'caller' builtin, which displays the context of + • Bash includes the ‘caller’ builtin, which displays the context of any active subroutine call (a shell function or a script executed - with the '.' or 'source' builtins). This supports the Bash + with the ‘.’ or ‘source’ builtins). This supports the Bash debugger. - * The 'trap' builtin (*note Bourne Shell Builtins::) allows a 'DEBUG' - pseudo-signal specification, similar to 'EXIT'. Commands specified - with a 'DEBUG' trap are executed before every simple command, 'for' - command, 'case' command, 'select' command, every arithmetic 'for' + • The ‘trap’ builtin (*note Bourne Shell Builtins::) allows a ‘DEBUG’ + pseudo-signal specification, similar to ‘EXIT’. Commands specified + with a ‘DEBUG’ trap are executed before every simple command, ‘for’ + command, ‘case’ command, ‘select’ command, every arithmetic ‘for’ command, and before the first command executes in a shell function. - The 'DEBUG' trap is not inherited by shell functions unless the - function has been given the 'trace' attribute or the 'functrace' - option has been enabled using the 'shopt' builtin. The 'extdebug' - shell option has additional effects on the 'DEBUG' trap. - - The 'trap' builtin (*note Bourne Shell Builtins::) allows an 'ERR' - pseudo-signal specification, similar to 'EXIT' and 'DEBUG'. - Commands specified with an 'ERR' trap are executed after a simple - command fails, with a few exceptions. The 'ERR' trap is not - inherited by shell functions unless the '-o errtrace' option to the - 'set' builtin is enabled. - - The 'trap' builtin (*note Bourne Shell Builtins::) allows a - 'RETURN' pseudo-signal specification, similar to 'EXIT' and - 'DEBUG'. Commands specified with a 'RETURN' trap are executed + The ‘DEBUG’ trap is not inherited by shell functions unless the + function has been given the ‘trace’ attribute or the ‘functrace’ + option has been enabled using the ‘shopt’ builtin. The ‘extdebug’ + shell option has additional effects on the ‘DEBUG’ trap. + + The ‘trap’ builtin (*note Bourne Shell Builtins::) allows an ‘ERR’ + pseudo-signal specification, similar to ‘EXIT’ and ‘DEBUG’. + Commands specified with an ‘ERR’ trap are executed after a simple + command fails, with a few exceptions. The ‘ERR’ trap is not + inherited by shell functions unless the ‘-o errtrace’ option to the + ‘set’ builtin is enabled. + + The ‘trap’ builtin (*note Bourne Shell Builtins::) allows a + ‘RETURN’ pseudo-signal specification, similar to ‘EXIT’ and + ‘DEBUG’. Commands specified with a ‘RETURN’ trap are executed before execution resumes after a shell function or a shell script - executed with '.' or 'source' returns. The 'RETURN' trap is not + executed with ‘.’ or ‘source’ returns. The ‘RETURN’ trap is not inherited by shell functions unless the function has been given the - 'trace' attribute or the 'functrace' option has been enabled using - the 'shopt' builtin. + ‘trace’ attribute or the ‘functrace’ option has been enabled using + the ‘shopt’ builtin. - * The Bash 'type' builtin is more extensive and gives more + • The Bash ‘type’ builtin is more extensive and gives more information about the names it finds (*note Bash Builtins::). - * The Bash 'umask' builtin permits a '-p' option to cause the output - to be displayed in the form of a 'umask' command that may be reused + • The Bash ‘umask’ builtin permits a ‘-p’ option to cause the output + to be displayed in the form of a ‘umask’ command that may be reused as input (*note Bourne Shell Builtins::). - * Bash implements a 'csh'-like directory stack, and provides the - 'pushd', 'popd', and 'dirs' builtins to manipulate it (*note The + • Bash implements a ‘csh’-like directory stack, and provides the + ‘pushd’, ‘popd’, and ‘dirs’ builtins to manipulate it (*note The Directory Stack::). Bash also makes the directory stack visible as - the value of the 'DIRSTACK' shell variable. + the value of the ‘DIRSTACK’ shell variable. - * Bash interprets special backslash-escaped characters in the prompt + • Bash interprets special backslash-escaped characters in the prompt strings when interactive (*note Controlling the Prompt::). - * The Bash restricted mode is more useful (*note The Restricted + • The Bash restricted mode is more useful (*note The Restricted Shell::); the SVR4.2 shell restricted mode is too limited. - * The 'disown' builtin can remove a job from the internal shell job + • The ‘disown’ builtin can remove a job from the internal shell job table (*note Job Control Builtins::) or suppress the sending of - 'SIGHUP' to a job when the shell exits as the result of a 'SIGHUP'. + ‘SIGHUP’ to a job when the shell exits as the result of a ‘SIGHUP’. - * Bash includes a number of features to support a separate debugger + • Bash includes a number of features to support a separate debugger for shell scripts. - * The SVR4.2 shell has two privilege-related builtins ('mldmode' and - 'priv') not present in Bash. + • The SVR4.2 shell has two privilege-related builtins (‘mldmode’ and + ‘priv’) not present in Bash. - * Bash does not have the 'stop' or 'newgrp' builtins. + • Bash does not have the ‘stop’ or ‘newgrp’ builtins. - * Bash does not use the 'SHACCT' variable or perform shell + • Bash does not use the ‘SHACCT’ variable or perform shell accounting. - * The SVR4.2 'sh' uses a 'TIMEOUT' variable like Bash uses 'TMOUT'. + • The SVR4.2 ‘sh’ uses a ‘TIMEOUT’ variable like Bash uses ‘TMOUT’. More features unique to Bash may be found in *note Bash Features::. @@ -11597,41 +11605,41 @@ B.1 Implementation Differences From The SVR4.2 Shell Since Bash is a completely new implementation, it does not suffer from many of the limitations of the SVR4.2 shell. For instance: - * Bash does not fork a subshell when redirecting into or out of a - shell control structure such as an 'if' or 'while' statement. + • Bash does not fork a subshell when redirecting into or out of a + shell control structure such as an ‘if’ or ‘while’ statement. - * Bash does not allow unbalanced quotes. The SVR4.2 shell will - silently insert a needed closing quote at 'EOF' under certain + • Bash does not allow unbalanced quotes. The SVR4.2 shell will + silently insert a needed closing quote at ‘EOF’ under certain circumstances. This can be the cause of some hard-to-find errors. - * The SVR4.2 shell uses a baroque memory management scheme based on - trapping 'SIGSEGV'. If the shell is started from a process with - 'SIGSEGV' blocked (e.g., by using the 'system()' C library function + • The SVR4.2 shell uses a baroque memory management scheme based on + trapping ‘SIGSEGV’. If the shell is started from a process with + ‘SIGSEGV’ blocked (e.g., by using the ‘system()’ C library function call), it misbehaves badly. - * In a questionable attempt at security, the SVR4.2 shell, when - invoked without the '-p' option, will alter its real and effective + • In a questionable attempt at security, the SVR4.2 shell, when + invoked without the ‘-p’ option, will alter its real and effective UID and GID if they are less than some magic threshold value, commonly 100. This can lead to unexpected results. - * The SVR4.2 shell does not allow users to trap 'SIGSEGV', 'SIGALRM', - or 'SIGCHLD'. + • The SVR4.2 shell does not allow users to trap ‘SIGSEGV’, ‘SIGALRM’, + or ‘SIGCHLD’. - * The SVR4.2 shell does not allow the 'IFS', 'MAILCHECK', 'PATH', - 'PS1', or 'PS2' variables to be unset. + • The SVR4.2 shell does not allow the ‘IFS’, ‘MAILCHECK’, ‘PATH’, + ‘PS1’, or ‘PS2’ variables to be unset. - * The SVR4.2 shell treats '^' as the undocumented equivalent of '|'. + • The SVR4.2 shell treats ‘^’ as the undocumented equivalent of ‘|’. - * Bash allows multiple option arguments when it is invoked ('-x -v'); - the SVR4.2 shell allows only one option argument ('-xv'). In fact, + • Bash allows multiple option arguments when it is invoked (‘-x -v’); + the SVR4.2 shell allows only one option argument (‘-xv’). In fact, some versions of the shell dump core if the second argument begins - with a '-'. + with a ‘-’. - * The SVR4.2 shell exits a script if any builtin fails; Bash exits a + • The SVR4.2 shell exits a script if any builtin fails; Bash exits a script only if one of the POSIX special builtins fails, and only for certain failures, as enumerated in the POSIX standard. - * The SVR4.2 shell behaves differently when invoked as 'jsh' (it + • The SVR4.2 shell behaves differently when invoked as ‘jsh’ (it turns on job control).  @@ -11642,7 +11650,7 @@ Appendix C GNU Free Documentation License Version 1.3, 3 November 2008 - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -11651,7 +11659,7 @@ Appendix C GNU Free Documentation License 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other - functional and useful document "free" in the sense of freedom: to + functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the @@ -12141,10 +12149,10 @@ D.1 Index of Shell Builtin Commands [index] * Menu: -* .: Bourne Shell Builtins. - (line 17) * :: Bourne Shell Builtins. (line 11) +* .: Bourne Shell Builtins. + (line 17) * [: Bourne Shell Builtins. (line 285) * alias: Bash Builtins. (line 11) @@ -12210,7 +12218,7 @@ D.1 Index of Shell Builtin Commands * pwd: Bourne Shell Builtins. (line 222) * read: Bash Builtins. (line 518) -* readarray: Bash Builtins. (line 621) +* readarray: Bash Builtins. (line 624) * readonly: Bourne Shell Builtins. (line 232) * return: Bourne Shell Builtins. @@ -12219,7 +12227,7 @@ D.1 Index of Shell Builtin Commands * shift: Bourne Shell Builtins. (line 272) * shopt: The Shopt Builtin. (line 9) -* source: Bash Builtins. (line 630) +* source: Bash Builtins. (line 633) * suspend: Job Control Builtins. (line 116) * test: Bourne Shell Builtins. @@ -12230,12 +12238,12 @@ D.1 Index of Shell Builtin Commands (line 393) * true: Bourne Shell Builtins. (line 455) -* type: Bash Builtins. (line 635) -* typeset: Bash Builtins. (line 673) -* ulimit: Bash Builtins. (line 679) +* type: Bash Builtins. (line 638) +* typeset: Bash Builtins. (line 676) +* ulimit: Bash Builtins. (line 682) * umask: Bourne Shell Builtins. (line 460) -* unalias: Bash Builtins. (line 785) +* unalias: Bash Builtins. (line 788) * unset: Bourne Shell Builtins. (line 478) * wait: Job Control Builtins. @@ -12252,9 +12260,9 @@ D.2 Index of Shell Reserved Words * !: Pipelines. (line 9) * [[: Conditional Constructs. - (line 126) + (line 125) * ]]: Conditional Constructs. - (line 126) + (line 125) * {: Command Grouping. (line 21) * }: Command Grouping. (line 21) * case: Conditional Constructs. @@ -12276,7 +12284,7 @@ D.2 Index of Shell Reserved Words * in: Conditional Constructs. (line 28) * select: Conditional Constructs. - (line 84) + (line 83) * then: Conditional Constructs. (line 7) * time: Pipelines. (line 9) @@ -12292,24 +12300,24 @@ D.3 Parameter and Variable Index [index] * Menu: +* _: Bash Variables. (line 13) +* -: Special Parameters. (line 46) * !: Special Parameters. (line 55) +* ?: Special Parameters. (line 42) +* @: Special Parameters. (line 22) +* *: Special Parameters. (line 9) * #: Special Parameters. (line 39) * $: Special Parameters. (line 51) +* $_: Bash Variables. (line 14) +* $-: Special Parameters. (line 47) * $!: Special Parameters. (line 56) +* $?: Special Parameters. (line 43) +* $@: Special Parameters. (line 23) +* $*: Special Parameters. (line 10) * $#: Special Parameters. (line 40) * $$: Special Parameters. (line 52) -* $*: Special Parameters. (line 10) -* $-: Special Parameters. (line 47) * $0: Special Parameters. (line 61) -* $?: Special Parameters. (line 43) -* $@: Special Parameters. (line 23) -* $_: Bash Variables. (line 14) -* *: Special Parameters. (line 9) -* -: Special Parameters. (line 46) * 0: Special Parameters. (line 60) -* ?: Special Parameters. (line 42) -* @: Special Parameters. (line 22) -* _: Bash Variables. (line 13) * active-region-end-color: Readline Init File Syntax. (line 51) * active-region-start-color: Readline Init File Syntax. @@ -12317,8 +12325,6 @@ D.3 Parameter and Variable Index * auto_resume: Job Control Variables. (line 6) * BASH: Bash Variables. (line 23) -* BASHOPTS: Bash Variables. (line 26) -* BASHPID: Bash Variables. (line 35) * BASH_ALIASES: Bash Variables. (line 42) * BASH_ARGC: Bash Variables. (line 51) * BASH_ARGV: Bash Variables. (line 65) @@ -12338,6 +12344,8 @@ D.3 Parameter and Variable Index * BASH_VERSINFO: Bash Variables. (line 176) * BASH_VERSION: Bash Variables. (line 199) * BASH_XTRACEFD: Bash Variables. (line 202) +* BASHOPTS: Bash Variables. (line 26) +* BASHPID: Bash Variables. (line 35) * bell-style: Readline Init File Syntax. (line 64) * bind-tty-special-chars: Readline Init File Syntax. @@ -12354,6 +12362,13 @@ D.3 Parameter and Variable Index * COLUMNS: Bash Variables. (line 220) * comment-begin: Readline Init File Syntax. (line 100) +* COMP_CWORD: Bash Variables. (line 226) +* COMP_KEY: Bash Variables. (line 255) +* COMP_LINE: Bash Variables. (line 232) +* COMP_POINT: Bash Variables. (line 237) +* COMP_TYPE: Bash Variables. (line 245) +* COMP_WORDBREAKS: Bash Variables. (line 259) +* COMP_WORDS: Bash Variables. (line 265) * completion-display-width: Readline Init File Syntax. (line 105) * completion-ignore-case: Readline Init File Syntax. @@ -12365,13 +12380,6 @@ D.3 Parameter and Variable Index * completion-query-items: Readline Init File Syntax. (line 130) * COMPREPLY: Bash Variables. (line 272) -* COMP_CWORD: Bash Variables. (line 226) -* COMP_KEY: Bash Variables. (line 255) -* COMP_LINE: Bash Variables. (line 232) -* COMP_POINT: Bash Variables. (line 237) -* COMP_TYPE: Bash Variables. (line 245) -* COMP_WORDBREAKS: Bash Variables. (line 259) -* COMP_WORDS: Bash Variables. (line 265) * convert-meta: Readline Init File Syntax. (line 141) * COPROC: Bash Variables. (line 278) @@ -12421,40 +12429,40 @@ D.3 Parameter and Variable Index (line 13) * horizontal-scroll-mode: Readline Init File Syntax. (line 229) -* HOSTFILE: Bash Variables. (line 493) -* HOSTNAME: Bash Variables. (line 504) -* HOSTTYPE: Bash Variables. (line 507) +* HOSTFILE: Bash Variables. (line 494) +* HOSTNAME: Bash Variables. (line 505) +* HOSTTYPE: Bash Variables. (line 508) * IFS: Bourne Shell Variables. (line 18) -* IGNOREEOF: Bash Variables. (line 510) +* IGNOREEOF: Bash Variables. (line 511) * input-meta: Readline Init File Syntax. (line 238) -* INPUTRC: Bash Variables. (line 520) -* INSIDE_EMACS: Bash Variables. (line 524) +* INPUTRC: Bash Variables. (line 521) +* INSIDE_EMACS: Bash Variables. (line 525) * isearch-terminators: Readline Init File Syntax. (line 248) * keymap: Readline Init File Syntax. (line 255) * LANG: Creating Internationalized Scripts. (line 51) -* LANG <1>: Bash Variables. (line 530) -* LC_ALL: Bash Variables. (line 534) -* LC_COLLATE: Bash Variables. (line 538) -* LC_CTYPE: Bash Variables. (line 545) +* LANG <1>: Bash Variables. (line 531) +* LC_ALL: Bash Variables. (line 535) +* LC_COLLATE: Bash Variables. (line 539) +* LC_CTYPE: Bash Variables. (line 546) * LC_MESSAGES: Creating Internationalized Scripts. (line 51) -* LC_MESSAGES <1>: Bash Variables. (line 550) -* LC_NUMERIC: Bash Variables. (line 554) -* LC_TIME: Bash Variables. (line 558) -* LINENO: Bash Variables. (line 562) -* LINES: Bash Variables. (line 567) -* MACHTYPE: Bash Variables. (line 573) +* LC_MESSAGES <1>: Bash Variables. (line 551) +* LC_NUMERIC: Bash Variables. (line 555) +* LC_TIME: Bash Variables. (line 559) +* LINENO: Bash Variables. (line 563) +* LINES: Bash Variables. (line 568) +* MACHTYPE: Bash Variables. (line 574) * MAIL: Bourne Shell Variables. (line 22) -* MAILCHECK: Bash Variables. (line 577) +* MAILCHECK: Bash Variables. (line 578) * MAILPATH: Bourne Shell Variables. (line 27) -* MAPFILE: Bash Variables. (line 585) +* MAPFILE: Bash Variables. (line 586) * mark-modified-lines: Readline Init File Syntax. (line 285) * mark-symlinked-directories: Readline Init File Syntax. @@ -12465,46 +12473,46 @@ D.3 Parameter and Variable Index (line 302) * meta-flag: Readline Init File Syntax. (line 238) -* OLDPWD: Bash Variables. (line 589) +* OLDPWD: Bash Variables. (line 590) * OPTARG: Bourne Shell Variables. (line 34) -* OPTERR: Bash Variables. (line 592) +* OPTERR: Bash Variables. (line 593) * OPTIND: Bourne Shell Variables. (line 38) -* OSTYPE: Bash Variables. (line 596) +* OSTYPE: Bash Variables. (line 597) * output-meta: Readline Init File Syntax. (line 307) * page-completions: Readline Init File Syntax. (line 315) * PATH: Bourne Shell Variables. (line 42) -* PIPESTATUS: Bash Variables. (line 599) -* POSIXLY_CORRECT: Bash Variables. (line 604) -* PPID: Bash Variables. (line 614) -* PROMPT_COMMAND: Bash Variables. (line 618) -* PROMPT_DIRTRIM: Bash Variables. (line 624) -* PS0: Bash Variables. (line 630) +* PIPESTATUS: Bash Variables. (line 600) +* POSIXLY_CORRECT: Bash Variables. (line 605) +* PPID: Bash Variables. (line 615) +* PROMPT_COMMAND: Bash Variables. (line 619) +* PROMPT_DIRTRIM: Bash Variables. (line 625) +* PS0: Bash Variables. (line 631) * PS1: Bourne Shell Variables. (line 48) * PS2: Bourne Shell Variables. (line 53) -* PS3: Bash Variables. (line 635) -* PS4: Bash Variables. (line 640) -* PWD: Bash Variables. (line 648) -* RANDOM: Bash Variables. (line 651) -* READLINE_ARGUMENT: Bash Variables. (line 657) -* READLINE_LINE: Bash Variables. (line 661) -* READLINE_MARK: Bash Variables. (line 665) -* READLINE_POINT: Bash Variables. (line 671) -* REPLY: Bash Variables. (line 675) +* PS3: Bash Variables. (line 636) +* PS4: Bash Variables. (line 641) +* PWD: Bash Variables. (line 649) +* RANDOM: Bash Variables. (line 652) +* READLINE_ARGUMENT: Bash Variables. (line 658) +* READLINE_LINE: Bash Variables. (line 662) +* READLINE_MARK: Bash Variables. (line 666) +* READLINE_POINT: Bash Variables. (line 672) +* REPLY: Bash Variables. (line 676) * revert-all-at-newline: Readline Init File Syntax. (line 325) * search-ignore-case: Readline Init File Syntax. (line 332) -* SECONDS: Bash Variables. (line 678) -* SHELL: Bash Variables. (line 687) -* SHELLOPTS: Bash Variables. (line 692) -* SHLVL: Bash Variables. (line 701) +* SECONDS: Bash Variables. (line 679) +* SHELL: Bash Variables. (line 688) +* SHELLOPTS: Bash Variables. (line 693) +* SHLVL: Bash Variables. (line 702) * show-all-if-ambiguous: Readline Init File Syntax. (line 337) * show-all-if-unmodified: Readline Init File Syntax. @@ -12513,15 +12521,15 @@ D.3 Parameter and Variable Index (line 352) * skip-completed-text: Readline Init File Syntax. (line 358) -* SRANDOM: Bash Variables. (line 706) +* SRANDOM: Bash Variables. (line 707) * TEXTDOMAIN: Creating Internationalized Scripts. (line 51) * TEXTDOMAINDIR: Creating Internationalized Scripts. (line 51) -* TIMEFORMAT: Bash Variables. (line 715) -* TMOUT: Bash Variables. (line 753) -* TMPDIR: Bash Variables. (line 765) -* UID: Bash Variables. (line 769) +* TIMEFORMAT: Bash Variables. (line 716) +* TMOUT: Bash Variables. (line 754) +* TMPDIR: Bash Variables. (line 766) +* UID: Bash Variables. (line 770) * vi-cmd-mode-string: Readline Init File Syntax. (line 371) * vi-ins-mode-string: Readline Init File Syntax. @@ -12543,7 +12551,7 @@ D.4 Function Index * accept-line (Newline or Return): Commands For History. (line 6) * alias-expand-line (): Miscellaneous Commands. - (line 132) + (line 133) * backward-char (C-b): Commands For Moving. (line 15) * backward-delete-char (Rubout): Commands For Text. (line 17) * backward-kill-line (C-x Rubout): Commands For Killing. @@ -12605,7 +12613,7 @@ D.4 Function Index * dynamic-complete-history (M-): Commands For Completion. (line 90) * edit-and-execute-command (C-x C-e): Miscellaneous Commands. - (line 141) + (line 142) * 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. @@ -12614,7 +12622,7 @@ D.4 Function Index * exchange-point-and-mark (C-x C-x): Miscellaneous Commands. (line 37) * execute-named-command (M-x): Miscellaneous Commands. - (line 146) + (line 147) * fetch-history (): Commands For History. (line 103) * forward-backward-delete-char (): Commands For Text. (line 21) @@ -12629,9 +12637,9 @@ D.4 Function Index * glob-list-expansions (C-x g): Miscellaneous Commands. (line 110) * history-and-alias-expand-line (): Miscellaneous Commands. - (line 135) + (line 136) * history-expand-line (M-^): Miscellaneous Commands. - (line 125) + (line 126) * history-search-backward (): Commands For History. (line 57) * history-search-forward (): Commands For History. @@ -12645,7 +12653,7 @@ D.4 Function Index * insert-completions (M-*): Commands For Completion. (line 22) * insert-last-argument (M-. or M-_): Miscellaneous Commands. - (line 138) + (line 139) * kill-line (C-k): Commands For Killing. (line 6) * kill-region (): Commands For Killing. @@ -12655,7 +12663,7 @@ D.4 Function Index * kill-word (M-d): Commands For Killing. (line 23) * magic-space (): Miscellaneous Commands. - (line 128) + (line 129) * menu-complete (): Commands For Completion. (line 26) * menu-complete-backward (): Commands For Completion. @@ -12913,138 +12921,138 @@ D.5 Concept Index  Tag Table: -Node: Top894 -Node: Introduction2811 -Node: What is Bash?3024 -Node: What is a shell?4135 -Node: Definitions6670 -Node: Basic Shell Features9618 -Node: Shell Syntax10834 -Node: Shell Operation11857 -Node: Quoting13147 -Node: Escape Character14448 -Node: Single Quotes14930 -Node: Double Quotes15275 -Node: ANSI-C Quoting16550 -Node: Locale Translation17859 -Node: Creating Internationalized Scripts19167 -Node: Comments23281 -Node: Shell Commands23896 -Node: Reserved Words24831 -Node: Simple Commands25584 -Node: Pipelines26235 -Node: Lists29218 -Node: Compound Commands31010 -Node: Looping Constructs32019 -Node: Conditional Constructs34511 -Node: Command Grouping48996 -Node: Coprocesses50471 -Node: GNU Parallel53131 -Node: Shell Functions54045 -Node: Shell Parameters61927 -Node: Positional Parameters66312 -Node: Special Parameters67211 -Node: Shell Expansions70422 -Node: Brace Expansion72507 -Node: Tilde Expansion75238 -Node: Shell Parameter Expansion77856 -Node: Command Substitution96446 -Node: Arithmetic Expansion99907 -Node: Process Substitution100872 -Node: Word Splitting101989 -Node: Filename Expansion104034 -Node: Pattern Matching106964 -Node: Quote Removal111963 -Node: Redirections112255 -Node: Executing Commands121946 -Node: Simple Command Expansion122613 -Node: Command Search and Execution124720 -Node: Command Execution Environment127104 -Node: Environment130136 -Node: Exit Status131796 -Node: Signals133577 -Node: Shell Scripts137023 -Node: Shell Builtin Commands140047 -Node: Bourne Shell Builtins142082 -Node: Bash Builtins165471 -Node: Modifying Shell Behavior198688 -Node: The Set Builtin199030 -Node: The Shopt Builtin210001 -Node: Special Builtins226193 -Node: Shell Variables227182 -Node: Bourne Shell Variables227616 -Node: Bash Variables229717 -Node: Bash Features264783 -Node: Invoking Bash265793 -Node: Bash Startup Files271924 -Node: Interactive Shells277052 -Node: What is an Interactive Shell?277460 -Node: Is this Shell Interactive?278106 -Node: Interactive Shell Behavior278918 -Node: Bash Conditional Expressions282544 -Node: Shell Arithmetic287454 -Node: Aliases290412 -Node: Arrays293303 -Node: The Directory Stack299934 -Node: Directory Stack Builtins300715 -Node: Controlling the Prompt304972 -Node: The Restricted Shell307934 -Node: Bash POSIX Mode310541 -Node: Shell Compatibility Mode327455 -Node: Job Control335703 -Node: Job Control Basics336160 -Node: Job Control Builtins341159 -Node: Job Control Variables346951 -Node: Command Line Editing348104 -Node: Introduction and Notation349772 -Node: Readline Interaction351392 -Node: Readline Bare Essentials352580 -Node: Readline Movement Commands354366 -Node: Readline Killing Commands355323 -Node: Readline Arguments357241 -Node: Searching358282 -Node: Readline Init File360465 -Node: Readline Init File Syntax361723 -Node: Conditional Init Constructs385745 -Node: Sample Init File389938 -Node: Bindable Readline Commands393059 -Node: Commands For Moving394260 -Node: Commands For History396308 -Node: Commands For Text401299 -Node: Commands For Killing405274 -Node: Numeric Arguments407975 -Node: Commands For Completion409111 -Node: Keyboard Macros413299 -Node: Miscellaneous Commands413984 -Node: Readline vi Mode420350 -Node: Programmable Completion421254 -Node: Programmable Completion Builtins429031 -Node: A Programmable Completion Example440148 -Node: Using History Interactively445393 -Node: Bash History Facilities446074 -Node: Bash History Builtins449082 -Node: History Interaction454170 -Node: Event Designators458419 -Node: Word Designators459954 -Node: Modifiers461816 -Node: Installing Bash463621 -Node: Basic Installation464755 -Node: Compilers and Options468474 -Node: Compiling For Multiple Architectures469212 -Node: Installation Names470901 -Node: Specifying the System Type473007 -Node: Sharing Defaults473721 -Node: Operation Controls474391 -Node: Optional Features475346 -Node: Reporting Bugs486563 -Node: Major Differences From The Bourne Shell487894 -Node: GNU Free Documentation License504749 -Node: Indexes529923 -Node: Builtin Index530374 -Node: Reserved Word Index537472 -Node: Variable Index539917 -Node: Function Index557048 -Node: Concept Index570904 +Node: Top899 +Node: Introduction2838 +Node: What is Bash?3051 +Node: What is a shell?4192 +Node: Definitions6771 +Node: Basic Shell Features9947 +Node: Shell Syntax11167 +Node: Shell Operation12194 +Node: Quoting13492 +Node: Escape Character14805 +Node: Single Quotes15303 +Node: Double Quotes15652 +Node: ANSI-C Quoting16995 +Node: Locale Translation18380 +Node: Creating Internationalized Scripts19724 +Node: Comments23922 +Node: Shell Commands24557 +Node: Reserved Words25496 +Node: Simple Commands26361 +Node: Pipelines27020 +Node: Lists30083 +Node: Compound Commands31955 +Node: Looping Constructs32964 +Node: Conditional Constructs35508 +Node: Command Grouping50412 +Node: Coprocesses51899 +Node: GNU Parallel54595 +Node: Shell Functions55513 +Node: Shell Parameters63619 +Node: Positional Parameters68152 +Node: Special Parameters69087 +Node: Shell Expansions72394 +Node: Brace Expansion74583 +Node: Tilde Expansion77246 +Node: Shell Parameter Expansion80012 +Node: Command Substitution99036 +Node: Arithmetic Expansion102569 +Node: Process Substitution103534 +Node: Word Splitting104671 +Node: Filename Expansion106812 +Node: Pattern Matching109908 +Node: Quote Removal115141 +Node: Redirections115445 +Node: Executing Commands125254 +Node: Simple Command Expansion125921 +Node: Command Search and Execution128032 +Node: Command Execution Environment130440 +Node: Environment133749 +Node: Exit Status135453 +Node: Signals137238 +Node: Shell Scripts140852 +Node: Shell Builtin Commands143944 +Node: Bourne Shell Builtins146055 +Node: Bash Builtins170459 +Node: Modifying Shell Behavior205064 +Node: The Set Builtin205406 +Node: The Shopt Builtin216921 +Node: Special Builtins233657 +Node: Shell Variables234646 +Node: Bourne Shell Variables235080 +Node: Bash Variables237273 +Node: Bash Features273695 +Node: Invoking Bash274709 +Node: Bash Startup Files281108 +Node: Interactive Shells286420 +Node: What is an Interactive Shell?286828 +Node: Is this Shell Interactive?287494 +Node: Interactive Shell Behavior288318 +Node: Bash Conditional Expressions292072 +Node: Shell Arithmetic297246 +Node: Aliases300328 +Node: Arrays303283 +Node: The Directory Stack310082 +Node: Directory Stack Builtins310879 +Node: Controlling the Prompt315328 +Node: The Restricted Shell318466 +Node: Bash POSIX Mode321253 +Node: Shell Compatibility Mode338734 +Node: Job Control347220 +Node: Job Control Basics347677 +Node: Job Control Builtins352851 +Node: Job Control Variables358811 +Node: Command Line Editing359988 +Node: Introduction and Notation361692 +Node: Readline Interaction363336 +Node: Readline Bare Essentials364524 +Node: Readline Movement Commands366342 +Node: Readline Killing Commands367339 +Node: Readline Arguments369317 +Node: Searching370374 +Node: Readline Init File372603 +Node: Readline Init File Syntax373885 +Node: Conditional Init Constructs398823 +Node: Sample Init File403188 +Node: Bindable Readline Commands406309 +Node: Commands For Moving407534 +Node: Commands For History409634 +Node: Commands For Text414717 +Node: Commands For Killing418792 +Node: Numeric Arguments421593 +Node: Commands For Completion422745 +Node: Keyboard Macros427061 +Node: Miscellaneous Commands427762 +Node: Readline vi Mode434416 +Node: Programmable Completion435368 +Node: Programmable Completion Builtins443325 +Node: A Programmable Completion Example454891 +Node: Using History Interactively460236 +Node: Bash History Facilities460917 +Node: Bash History Builtins464029 +Node: History Interaction469272 +Node: Event Designators473597 +Node: Word Designators475180 +Node: Modifiers477166 +Node: Installing Bash479075 +Node: Basic Installation480209 +Node: Compilers and Options484088 +Node: Compiling For Multiple Architectures484838 +Node: Installation Names486587 +Node: Specifying the System Type488821 +Node: Sharing Defaults489567 +Node: Operation Controls490281 +Node: Optional Features491300 +Node: Reporting Bugs503102 +Node: Major Differences From The Bourne Shell504451 +Node: GNU Free Documentation License522260 +Node: Indexes547437 +Node: Builtin Index547888 +Node: Reserved Word Index554986 +Node: Variable Index557431 +Node: Function Index574562 +Node: Concept Index588418  End Tag Table diff --git a/doc/bash.pdf b/doc/bash.pdf index ec604f94..a03bf85a 100644 Binary files a/doc/bash.pdf and b/doc/bash.pdf differ diff --git a/doc/bashref.html b/doc/bashref.html index 7d409545..eeddd0d0 100644 --- a/doc/bashref.html +++ b/doc/bashref.html @@ -1,16 +1,16 @@ - + - + @@ -57,7 +58,6 @@ ul.no-bullet {list-style: none} -

Bash Reference Manual

@@ -69,26 +69,26 @@ ul.no-bullet {list-style: none} -
-
+
+ -

Bash Features

+

Bash Features

This text is a brief description of the features that are present in -the Bash shell (version 5.3, 14 December 2023). -The Bash home page is http://www.gnu.org/software/bash/. +the Bash shell (version 5.3, 2 February 2024). +The Bash home page is http://www.gnu.org/software/bash/.

-

This is Edition 5.3, last updated 14 December 2023, -of The GNU Bash Reference Manual, -for Bash, Version 5.3. +

This is Edition 5.3, last updated 2 February 2024, +of The GNU Bash Reference Manual, +for Bash, Version 5.3.

Bash contains features that appear in other popular shells, and some features that only appear in Bash. Some of the shells that Bash has -borrowed concepts from are the Bourne Shell (sh), the Korn Shell -(ksh), and the C-shell (csh and its successor, -tcsh). The following menu breaks the features up into +borrowed concepts from are the Bourne Shell (sh), the Korn Shell +(ksh), and the C-shell (csh and its successor, +tcsh). The following menu breaks the features up into categories, noting which features were inspired by other shells and which are specific to Bash.

@@ -97,25 +97,25 @@ Bash. The Bash manual page should be used as the definitive reference on shell behavior.

-
+

Table of Contents

-

-
-
+
+ -

1 Introduction

+

1 Introduction

-
    +
    -
    -
    +
    + -

    1.1 What is Bash?

    +

    1.1 What is Bash?

    Bash is the shell, or command language interpreter, -for the GNU operating system. -The name is an acronym for the ‘Bourne-Again SHell’, +for the GNU operating system. +The name is an acronym for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of -the current Unix shell sh, +the current Unix shell sh, which appeared in the Seventh Edition Bell Labs Research version of Unix.

    -

    Bash is largely compatible with sh and incorporates useful -features from the Korn shell ksh and the C shell csh. -It is intended to be a conformant implementation of the IEEE -POSIX Shell and Tools portion of the IEEE POSIX -specification (IEEE Standard 1003.1). -It offers functional improvements over sh for both interactive and +

    Bash is largely compatible with sh and incorporates useful +features from the Korn shell ksh and the C shell csh. +It is intended to be a conformant implementation of the IEEE +POSIX Shell and Tools portion of the IEEE POSIX +specification (IEEE Standard 1003.1). +It offers functional improvements over sh for both interactive and programming use.

    -

    While the GNU operating system provides other shells, including -a version of csh, Bash is the default shell. -Like other GNU software, Bash is quite portable. It currently runs -on nearly every version of Unix and a few other operating systems - -independently-supported ports exist for MS-DOS, OS/2, +

    While the GNU operating system provides other shells, including +a version of csh, Bash is the default shell. +Like other GNU software, Bash is quite portable. It currently runs +on nearly every version of Unix and a few other operating systems − +independently-supported ports exist for MS-DOS, OS/2, and Windows platforms.


    -
    -
    +
    + -

    1.2 What is a shell?

    +

    1.2 What is a shell?

    At its base, a shell is simply a macro processor that executes commands. The term macro processor means functionality where text @@ -363,11 +363,11 @@ and symbols are expanded to create larger expressions.

    A Unix shell is both a command interpreter and a programming language. As a command interpreter, the shell provides the user -interface to the rich set of GNU utilities. The programming +interface to the rich set of GNU utilities. The programming language features allow these utilities to be combined. Files containing commands can be created, and become commands themselves. These new commands have the same status as -system commands in directories such as /bin, allowing users +system commands in directories such as /bin, allowing users or groups to establish custom environments to automate their common tasks.

    @@ -376,23 +376,23 @@ interactive mode, they accept input typed from the keyboard. When executing non-interactively, shells execute commands read from a file.

    -

    A shell allows execution of GNU commands, both synchronously and +

    A shell allows execution of GNU commands, both synchronously and asynchronously. The shell waits for synchronous commands to complete before accepting more input; asynchronous commands continue to execute in parallel with the shell while it reads and executes additional commands. -The redirection constructs permit +The redirection constructs permit fine-grained control of the input and output of those commands. Moreover, the shell allows control over the contents of commands’ environments.

    Shells also provide a small set of built-in -commands (builtins) implementing functionality impossible +commands (builtins) implementing functionality impossible or inconvenient to obtain via separate utilities. -For example, cd, break, continue, and -exec cannot be implemented outside of the shell because +For example, cd, break, continue, and +exec cannot be implemented outside of the shell because they directly manipulate the shell itself. -The history, getopts, kill, or pwd +The history, getopts, kill, or pwd builtins, among others, could be implemented in separate utilities, but they are more convenient to use as builtin commands. All of the shell builtins are described in @@ -412,149 +412,149 @@ described in this manual.


    -
    -
    +
    + -

    2 Definitions

    +

    2 Definitions

    These definitions are used throughout the remainder of this manual.

    -
    -
    POSIX
    +
    +
    POSIX

    A family of open system standards based on Unix. Bash is primarily concerned with the Shell and Utilities portion of the -POSIX 1003.1 standard. +POSIX 1003.1 standard.

    -
    blank
    +
    blank

    A space or tab character.

    -
    builtin
    +
    builtin

    A command that is implemented internally by the shell itself, rather than by an executable program somewhere in the file system.

    -
    control operator
    -

    A token that performs a control function. It is a newline +

    control operator
    +

    A token that performs a control function. It is a newline or one of the following: -‘||’, ‘&&’, ‘&’, ‘;’, ‘;;’, ‘;&’, ‘;;&’, -‘|’, ‘|&’, ‘(’, or ‘)’. +‘||’, ‘&&’, ‘&’, ‘;’, ‘;;’, ‘;&’, ‘;;&’, +‘|’, ‘|&’, ‘(’, or ‘)’.

    -
    exit status
    +
    exit status

    The value returned by a command to its caller. The value is restricted to eight bits, so the maximum value is 255.

    -
    field
    +
    field

    A unit of text that is the result of one of the shell expansions. After expansion, when executing a command, the resulting fields are used as the command name and arguments.

    -
    filename
    +
    filename

    A string of characters used to identify a file.

    -
    job
    +
    job

    A set of processes comprising a pipeline, and any processes descended from it, that are all in the same process group.

    -
    job control
    +
    job control

    A mechanism by which users can selectively stop (suspend) and restart (resume) execution of processes.

    -
    metacharacter
    +
    metacharacter

    A character that, when unquoted, separates words. A metacharacter is -a space, tab, newline, or one of the following characters: -‘|’, ‘&’, ‘;’, ‘(’, ‘)’, ‘<’, or -‘>’. +a space, tab, newline, or one of the following characters: +‘|’, ‘&’, ‘;’, ‘(’, ‘)’, ‘<’, or +‘>’.

    -
    name
    -
    -

    A word consisting solely of letters, numbers, and underscores, -and beginning with a letter or underscore. Names are used as +

    +name
    +

    A word consisting solely of letters, numbers, and underscores, +and beginning with a letter or underscore. Names are used as shell variable and function names. -Also referred to as an identifier. +Also referred to as an identifier.

    -
    operator
    -

    A control operator or a redirection operator. -See Redirections, for a list of redirection operators. -Operators contain at least one unquoted metacharacter. +

    operator
    +

    A control operator or a redirection operator. +See Redirections, for a list of redirection operators. +Operators contain at least one unquoted metacharacter.

    -
    process group
    +
    process group

    A collection of related processes each having the same process -group ID. +group ID.

    -
    process group ID
    -

    A unique identifier that represents a process group +

    process group ID
    +

    A unique identifier that represents a process group during its lifetime.

    -
    reserved word
    -

    A word that has a special meaning to the shell. Most reserved -words introduce shell flow control constructs, such as for and -while. +

    reserved word
    +

    A word that has a special meaning to the shell. Most reserved +words introduce shell flow control constructs, such as for and +while.

    -
    return status
    -

    A synonym for exit status. +

    return status
    +

    A synonym for exit status.

    -
    signal
    +
    signal

    A mechanism by which a process may be notified by the kernel of an event occurring in the system.

    -
    special builtin
    +
    special builtin

    A shell builtin command that has been classified as special by the -POSIX standard. +POSIX standard.

    -
    token
    +
    token

    A sequence of characters considered a single unit by the shell. -It is either a word or an operator. +It is either a word or an operator.

    -
    word
    +
    word

    A sequence of characters treated as a unit by the shell. -Words may not include unquoted metacharacters. +Words may not include unquoted metacharacters.


    -
    -
    +
    + -

    3 Basic Shell Features

    - +

    3 Basic Shell Features

    + -

    Bash is an acronym for ‘Bourne-Again SHell’. +

    Bash is an acronym for ‘Bourne-Again SHell’. The Bourne shell is the traditional Unix shell originally written by Stephen Bourne. All of the Bourne shell builtin commands are available in Bash, -The rules for evaluation and quoting are taken from the POSIX +The rules for evaluation and quoting are taken from the POSIX specification for the ‘standard’ Unix shell.

    This chapter briefly summarizes the shell’s ‘building blocks’: -commands, control structures, shell functions, shell parameters, +commands, control structures, shell functions, shell parameters, shell expansions, -redirections, which are a way to direct input and output from +redirections, which are a way to direct input and output from and to named files, and how the shell executes commands.

    -
      +
      -
      -
      +
      + -

      3.1 Shell Syntax

      +

      3.1 Shell Syntax

      When the shell reads input, it proceeds through a sequence of operations. If the input indicates the beginning of a -comment, the shell ignores the comment symbol (‘#’), and the rest +comment, the shell ignores the comment symbol (‘#’), and the rest of that line.

      Otherwise, roughly speaking, the shell reads its input and @@ -587,59 +587,59 @@ others, redirects input and output as needed, executes the specified command, waits for the command’s exit status, and makes that exit status available for further inspection or processing.

      -
        +
        -
        -
        +
        + -

        3.1.1 Shell Operation

        +

        3.1.1 Shell Operation

        The following is a brief description of the shell’s operation when it reads and executes a command. Basically, the shell does the following:

        -
          -
        1. Reads its input from a file (see Shell Scripts), from a string -supplied as an argument to the -c invocation option -(see Invoking Bash), or from the user’s terminal. +
            +
          1. Reads its input from a file (see Shell Scripts), from a string +supplied as an argument to the -c invocation option +(see Invoking Bash), or from the user’s terminal.
          2. Breaks the input into words and operators, obeying the quoting rules -described in Quoting. These tokens are separated by -metacharacters. Alias expansion is performed by this step -(see Aliases). +described in Quoting. These tokens are separated by +metacharacters. Alias expansion is performed by this step +(see Aliases).
          3. Parses the tokens into simple and compound commands -(see Shell Commands). +(see Shell Commands). -
          4. Performs the various shell expansions (see Shell Expansions), breaking -the expanded tokens into lists of filenames (see Filename Expansion) +
          5. Performs the various shell expansions (see Shell Expansions), breaking +the expanded tokens into lists of filenames (see Filename Expansion) and commands and arguments. -
          6. Performs any necessary redirections (see Redirections) and removes +
          7. Performs any necessary redirections (see Redirections) and removes the redirection operators and their operands from the argument list. -
          8. Executes the command (see Executing Commands). +
          9. Executes the command (see Executing Commands).
          10. Optionally waits for the command to complete and collects its exit -status (see Exit Status). +status (see Exit Status).

        -
        -
        +
        + -

        3.1.2 Quoting

        - +

        3.1.2 Quoting

        +

        Quoting is used to remove the special meaning of certain characters or words to the shell. Quoting can be used to @@ -647,19 +647,19 @@ disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion.

        -

        Each of the shell metacharacters (see Definitions) +

        Each of the shell metacharacters (see Definitions) 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 History Expansion), the -history expansion character, usually ‘!’, must be quoted -to prevent history expansion. See Bash History Facilities, for +(see History Expansion), the +history expansion character, usually ‘!’, must be quoted +to prevent history expansion. See Bash History Facilities, for more details concerning history expansion.

        There are three quoting mechanisms: the -escape character, single quotes, and double quotes. +escape character, single quotes, and double quotes.

        -
          +
          -
          -
          +
          + -

          3.1.2.1 Escape Character

          -

          A non-quoted backslash ‘\’ is the Bash escape character. +

          3.1.2.1 Escape Character

          +

          A non-quoted backslash ‘\’ is the Bash escape character. It preserves the literal value of the next character that follows, -with the exception of newline. If a \newline pair -appears, and the backslash itself is not quoted, the \newline +with the exception of newline. If a \newline pair +appears, and the backslash itself is not quoted, the \newline is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).


          -
          -
          +
          + -

          3.1.2.2 Single Quotes

          +

          3.1.2.2 Single Quotes

          -

          Enclosing characters in single quotes (‘'’) preserves the literal value +

          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.


          -
          -
          +
          + -

          3.1.2.3 Double Quotes

          +

          3.1.2.3 Double Quotes

          -

          Enclosing characters in double quotes (‘"’) preserves the literal value +

          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, ‘!’. +‘$’, ‘`’, ‘\’, +and, when history expansion is enabled, ‘!’. When the shell is in -POSIX mode (see Bash and POSIX), -the ‘!’ has no special meaning +POSIX mode (see Bash and POSIX), +the ‘!’ has no special meaning within double quotes, even when history expansion is enabled. -The characters ‘$’ and ‘`’ -retain their special meaning within double quotes (see Shell Expansions). +The characters ‘$’ and ‘`’ +retain their special meaning within double quotes (see Shell Expansions). The backslash retains its special meaning only when followed by one of the following characters: -‘$’, ‘`’, ‘"’, ‘\’, or newline. +‘$’, ‘`’, ‘"’, ‘\’, or newline. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash. -If enabled, history expansion will be performed unless an ‘!’ +If enabled, history expansion will be performed unless an ‘!’ appearing in double quotes is escaped using a backslash. -The backslash preceding the ‘!’ is not removed. +The backslash preceding the ‘!’ is not removed.

          -

          The special parameters ‘*’ and ‘@’ have special meaning -when in double quotes (see Shell Parameter Expansion). +

          The special parameters ‘*’ and ‘@’ have special meaning +when in double quotes (see Shell Parameter Expansion).


          -
          -
          +
          + -

          3.1.2.4 ANSI-C Quoting

          - +

          3.1.2.4 ANSI-C Quoting

          + -

          Character sequences of the form $'string' are treated as +

          Character sequences of the form $'string' are treated as a special kind of single quotes. -The sequence expands to string, with backslash-escaped characters -in string replaced as specified by the ANSI C standard. +The sequence expands to string, with backslash-escaped characters +in string replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows:

          -
          -
          \a
          +
          +
          \a

          alert (bell)

          -
          \b
          +
          \b

          backspace

          -
          \e
          -
          \E
          +
          \e
          +
          \E

          an escape character (not ANSI C)

          -
          \f
          +
          \f

          form feed

          -
          \n
          +
          \n

          newline

          -
          \r
          +
          \r

          carriage return

          -
          \t
          +
          \t

          horizontal tab

          -
          \v
          +
          \v

          vertical tab

          -
          \\
          +
          \\

          backslash

          -
          \'
          +
          \'

          single quote

          -
          \"
          +
          \"

          double quote

          -
          \?
          +
          \?

          question mark

          -
          \nnn
          -

          the eight-bit character whose value is the octal value nnn +

          \nnn
          +

          the eight-bit character whose value is the octal value nnn (one to three octal digits)

          -
          \xHH
          -

          the eight-bit character whose value is the hexadecimal value HH +

          \xHH
          +

          the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)

          -
          \uHHHH
          +
          \uHHHH

          the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value -HHHH (one to four hex digits) +HHHH (one to four hex digits)

          -
          \UHHHHHHHH
          +
          \UHHHHHHHH

          the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value -HHHHHHHH (one to eight hex digits) +HHHHHHHH (one to eight hex digits)

          -
          \cx
          -

          a control-x character +

          \cx
          +

          a control-x character

          @@ -807,78 +807,78 @@ been present.


          -
          -
          +
          + -

          3.1.2.5 Locale-Specific Translation

          - - - - +

          3.1.2.5 Locale-Specific Translation

          + + + + -

          Prefixing a double-quoted string with a dollar sign (‘$’), such -as $"hello, world", +

          Prefixing a double-quoted string with a dollar sign (‘$’), such +as $"hello, world", will cause the string to be translated according to the current locale. -The gettext infrastructure performs the lookup and -translation, using the LC_MESSAGES, TEXTDOMAINDIR, -and TEXTDOMAIN shell variables, as explained below. +The gettext infrastructure performs the lookup and +translation, using the LC_MESSAGES, TEXTDOMAINDIR, +and TEXTDOMAIN shell variables, as explained below. See the gettext documentation for additional details not covered here. -If the current locale is C or POSIX, +If the current locale is C or POSIX, if there are no translations available, of if the string is not translated, the dollar sign is ignored. Since this is a form of double quoting, the string remains double-quoted by default, whether or not it is translated and replaced. -If the noexpand_translation option is enabled -using the shopt builtin (see The Shopt Builtin), +If the noexpand_translation option is enabled +using the shopt builtin (see The Shopt Builtin), translated strings are single-quoted instead of double-quoted.

          The rest of this section is a brief overview of how you use gettext to -create translations for strings in a shell script named scriptname. +create translations for strings in a shell script named scriptname. There are more details in the gettext documentation.


          -
          + -

          Creating Internationalized Scripts

          - - +

          Creating Internationalized Scripts

          + +

          Once you’ve marked the strings in your script that you want to translate using $"...", you create a gettext "template" file using the command

          -
          bash --dump-po-strings scriptname > domain.pot
          +
          bash --dump-po-strings scriptname > domain.pot
           
          -

          The domain is your message domain. +

          The domain is your message domain. It’s just an arbitrary string that’s used to identify the files gettext needs, like a package or script name. It needs to be unique among all the message domains on systems where you install the translations, so gettext knows which translations correspond to your script. You’ll use the template file to create translations for each target language. -The template file conventionally has the suffix ‘.pot’. +The template file conventionally has the suffix ‘.pot’.

          You copy this template file to a separate file for each target language -you want to support (called "PO" files, which use the suffix ‘.po’). +you want to support (called "PO" files, which use the suffix ‘.po’). PO files use various naming conventions, but when you are working to translate a template file into a particular language, you first copy the template file to a file whose name is the -language you want to target, with the ‘.po’ suffix. +language you want to target, with the ‘.po’ suffix. For instance, the Spanish translations of your strings would be -in a file named ‘es.po’, and to get started using a message +in a file named ‘es.po’, and to get started using a message domain named "example," you would run

          -
          cp example.pot es.po
          +
          cp example.pot es.po
           
          -

          Ultimately, PO files are often named domain.po and installed in +

          Ultimately, PO files are often named domain.po and installed in directories that contain multiple translation files for a particular language.

          Whichever naming convention you choose, you will need to translate the @@ -890,53 +890,53 @@ gettext tools to produce what are called "MO" files, which are compile versions of the PO files the gettext tools use to look up translations efficiently. MO files are also called "message catalog" files. -You use the msgfmt program to do this. +You use the msgfmt program to do this. For instance, if you had a file with Spanish translations, you could run

          -
          msgfmt -o es.mo es.po
          +
          msgfmt -o es.mo es.po
           

          to produce the corresponding MO file.

          Once you have the MO files, you decide where to install them and use the -TEXTDOMAINDIR shell variable to tell the gettext tools where they are. +TEXTDOMAINDIR shell variable to tell the gettext tools where they are. Make sure to use the same message domain to name the MO files as you did for the PO files when you install them.

          - - - - -

          Your users will use the LANG or LC_MESSAGES shell variables to + + + + +

          Your users will use the LANG or LC_MESSAGES shell variables to select the desired language.

          -

          You set the TEXTDOMAIN variable to the script’s message domain. +

          You set the TEXTDOMAIN variable to the script’s message domain. As above, you use the message domain to name your translation files.

          -

          You, or possibly your users, set the TEXTDOMAINDIR variable to the +

          You, or possibly your users, set the TEXTDOMAINDIR variable to the name of a directory where the message catalog files are stored. If you install the message files into the system’s standard message catalog directory, you don’t need to worry about this variable.

          The directory where the message catalog files are stored varies between systems. -Some use the message catalog selected by the LC_MESSAGES +Some use the message catalog selected by the LC_MESSAGES shell variable. Others create the name of the message catalog from the value of the -TEXTDOMAIN shell variable, possibly adding the ‘.mo’ suffix. -If you use the TEXTDOMAIN variable, you may need to set the -TEXTDOMAINDIR variable to the location of the message catalog files, +TEXTDOMAIN shell variable, possibly adding the ‘.mo’ suffix. +If you use the TEXTDOMAIN variable, you may need to set the +TEXTDOMAINDIR variable to the location of the message catalog files, as above. It’s common to use both variables in this fashion: -$TEXTDOMAINDIR/$LC_MESSAGES/LC_MESSAGES/$TEXTDOMAIN.mo. +$TEXTDOMAINDIR/$LC_MESSAGES/LC_MESSAGES/$TEXTDOMAIN.mo.

          If you used that last convention, and you wanted to store the message catalog files with Spanish (es) and Esperanto (eo) translations into a local directory you use for custom translation files, you could run

          -
          TEXTDOMAIN=example
          +
          TEXTDOMAIN=example
           TEXTDOMAINDIR=/usr/local/share/locale
           
           cp es.mo ${TEXTDOMAINDIR}/es/LC_MESSAGES/${TEXTDOMAIN}.mo
          @@ -946,43 +946,43 @@ cp eo.mo ${TEXTDOMAINDIR}/eo/LC_MESSAGES/${TEXTDOMAIN}.mo
           

          When all of this is done, and the message catalog files containing the compiled translations are installed in the correct location, your users will be able to see translated strings -in any of the supported languages by setting the LANG or -LC_MESSAGES environment variables before running your script. +in any of the supported languages by setting the LANG or +LC_MESSAGES environment variables before running your script.


          -
          -
          +
          + -

          3.1.3 Comments

          - +

          3.1.3 Comments

          +

          In a non-interactive shell, or an interactive shell in which the -interactive_comments option to the shopt -builtin is enabled (see The Shopt Builtin), -a word beginning with ‘#’ +interactive_comments option to the shopt +builtin is enabled (see The Shopt Builtin), +a word beginning with ‘#’ causes that word and all remaining characters on that line to -be ignored. An interactive shell without the interactive_comments -option enabled does not allow comments. The interactive_comments +be ignored. An interactive shell without the interactive_comments +option enabled does not allow comments. The interactive_comments option is on by default in interactive shells. -See Interactive Shells, for a description of what makes +See Interactive Shells, for a description of what makes a shell interactive.


          -
          -
          +
          + -

          3.2 Shell Commands

          - +

          3.2 Shell Commands

          + -

          A simple shell command such as echo a b c consists of the command +

          A simple shell command such as echo a b c consists of the command itself followed by arguments, separated by spaces.

          More complex shell commands are composed of simple commands arranged together @@ -991,7 +991,7 @@ becomes the input of a second, in a loop or conditional construct, or in some other grouping.

          -
            +
            -
            -
            +
            + -

            3.2.1 Reserved Words

            - +

            3.2.1 Reserved Words

            +

            Reserved words are words that have special meaning to the shell. They are used to begin and end the shell’s compound commands. @@ -1015,115 +1015,116 @@ They are used to begin and end the shell’s compound commands.

            The following words are recognized as reserved when unquoted and the first word of a command (see below for exceptions):

            - - - - - +
            ifthenelifelsefitime
            forinuntilwhiledodone
            caseesaccoprocselectfunction
            {}[[]]!
            + + + + +
            ifthenelifelsefitime
            forinuntilwhiledodone
            caseesaccoprocselectfunction
            {}[[]]!
            -

            in is recognized as a reserved word if it is the third word of a -case or select command. -in and do are recognized as reserved -words if they are the third word in a for command. +

            in is recognized as a reserved word if it is the third word of a +case or select command. +in and do are recognized as reserved +words if they are the third word in a for command.


            -
            -
            +
            + -

            3.2.2 Simple Commands

            - +

            3.2.2 Simple Commands

            +

            A simple command is the kind of command encountered most often. -It’s just a sequence of words separated by blanks, terminated -by one of the shell’s control operators (see Definitions). The +It’s just a sequence of words separated by blanks, terminated +by one of the shell’s control operators (see Definitions). The first word generally specifies a command to be executed, with the rest of the words being that command’s arguments.

            -

            The return status (see Exit Status) of a simple command is +

            The return status (see Exit Status) of a simple command is its exit status as provided -by the POSIX 1003.1 waitpid function, or 128+n if -the command was terminated by signal n. +by the POSIX 1003.1 waitpid function, or 128+n if +the command was terminated by signal n.


            -
            -
            +
            + -

            3.2.3 Pipelines

            - - +

            3.2.3 Pipelines

            + + -

            A pipeline is a sequence of one or more commands separated by -one of the control operators ‘|’ or ‘|&’. +

            A pipeline is a sequence of one or more commands separated by +one of the control operators ‘|’ or ‘|&’.

            - - - + + +

            The format for a pipeline is

            -
            [time [-p]] [!] command1 [ | or |& command2 ] …
            +
            [time [-p]] [!] command1 [ | or |& command2 ] ...
             

            The output of each command in the pipeline is connected via a pipe to the input of the next command. That is, each command reads the previous command’s output. This connection is performed before any redirections specified by -command1. +command1.

            -

            If ‘|&’ is used, command1’s standard error, in addition to +

            If ‘|&’ is used, command1’s standard error, in addition to its standard output, is connected to -command2’s standard input through the pipe; -it is shorthand for 2>&1 |. +command2’s standard input through the pipe; +it is shorthand for 2>&1 |. This implicit redirection of the standard error to the standard output is -performed after any redirections specified by command1. +performed after any redirections specified by command1.

            -

            The reserved word time causes timing statistics +

            The reserved word time causes timing statistics to be printed for the pipeline once it finishes. The statistics currently consist of elapsed (wall-clock) time and user and system time consumed by the command’s execution. -The -p option changes the output format to that specified -by POSIX. -When the shell is in POSIX mode (see Bash and POSIX), -it does not recognize time as a reserved word if the next -token begins with a ‘-’. -The TIMEFORMAT variable may be set to a format string that +The -p option changes the output format to that specified +by POSIX. +When the shell is in POSIX mode (see Bash and POSIX), +it does not recognize time as a reserved word if the next +token begins with a ‘-’. +The TIMEFORMAT variable may be set to a format string that specifies how the timing information should be displayed. -See Bash Variables, for a description of the available formats. -The use of time as a reserved word permits the timing of +See Bash Variables, for a description of the available formats. +The use of time as a reserved word permits the timing of shell builtins, shell functions, and pipelines. An external -time command cannot time these easily. +time command cannot time these easily.

            -

            When the shell is in POSIX mode (see Bash and POSIX), time +

            When the shell is in POSIX mode (see Bash and POSIX), time may be followed by a newline. In this case, the shell displays the total user and system time consumed by the shell and its children. -The TIMEFORMAT variable specifies the format of the time information. +The TIMEFORMAT variable specifies the format of the time information.

            -

            If the pipeline is not executed asynchronously (see Lists of Commands), the +

            If the pipeline is not executed asynchronously (see Lists of Commands), the shell waits for all commands in the pipeline to complete.

            Each command in a multi-command pipeline, where pipes are created, -is executed in its own subshell, which is a -separate process (see Command Execution Environment). -If the lastpipe option is enabled using the shopt builtin -(see The Shopt Builtin), +is executed in its own subshell, which is a +separate process (see Command Execution Environment). +If the lastpipe option is enabled using the shopt builtin +(see The Shopt Builtin), the last element of a pipeline may be run by the shell process when job control is not active.

            The exit status of a pipeline is the exit status of the last command in the -pipeline, unless the pipefail option is enabled -(see The Set Builtin). -If pipefail is enabled, the pipeline’s return status is the +pipeline, unless the pipefail option is enabled +(see The Set Builtin). +If pipefail 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 successfully. -If the reserved word ‘!’ precedes the pipeline, the +If the reserved word ‘!’ precedes the pipeline, the exit status is the logical negation of the exit status as described above. The shell waits for all commands in the pipeline to terminate before @@ -1131,80 +1132,80 @@ returning a value.


            -
            -
            +
            + -

            3.2.4 Lists of Commands

            - +

            3.2.4 Lists of Commands

            + -

            A list is a sequence of one or more pipelines separated by one -of the operators ‘;’, ‘&’, ‘&&’, or ‘||’, -and optionally terminated by one of ‘;’, ‘&’, or a -newline. +

            A list is a sequence of one or more pipelines separated by one +of the operators ‘;’, ‘&’, ‘&&’, or ‘||’, +and optionally terminated by one of ‘;’, ‘&’, or a +newline.

            -

            Of these list operators, ‘&&’ and ‘||’ -have equal precedence, followed by ‘;’ and ‘&’, +

            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 list +

            A sequence of one or more newlines may appear in a list to delimit commands, equivalent to a semicolon.

            -

            If a command is terminated by the control operator ‘&’, +

            If a command is terminated by the control operator ‘&’, the shell executes the command asynchronously in a subshell. -This is known as executing the command in the background, -and these are referred to as asynchronous commands. +This is known as executing the command in the background, +and these are referred to as asynchronous commands. The shell does not wait for the command to finish, and the return status is 0 (true). -When job control is not active (see Job Control), +When job control is not active (see Job Control), the standard input for asynchronous commands, in the absence of any -explicit redirections, is redirected from /dev/null. +explicit redirections, is redirected from /dev/null.

            -

            Commands separated by a ‘;’ are executed sequentially; the shell +

            Commands separated by a ‘;’ are executed sequentially; the shell waits for each command to terminate in turn. The return status is the exit status of the last command executed.

            -

            AND and OR lists are sequences of one or more pipelines -separated by the control operators ‘&&’ and ‘||’, -respectively. AND and OR lists are executed with left +

            AND and OR lists are sequences of one or more pipelines +separated by the control operators ‘&&’ and ‘||’, +respectively. AND and OR lists are executed with left associativity.

            -

            An AND list has the form +

            An AND list has the form

            -
            command1 && command2
            +
            command1 && command2
             
            -

            command2 is executed if, and only if, command1 +

            command2 is executed if, and only if, command1 returns an exit status of zero (success).

            -

            An OR list has the form +

            An OR list has the form

            -
            command1 || command2
            +
            command1 || command2
             
            -

            command2 is executed if, and only if, command1 +

            command2 is executed if, and only if, command1 returns a non-zero exit status.

            The return status of -AND and OR lists is the exit status of the last command +AND and OR lists is the exit status of the last command executed in the list.


            -
            -
            +
            + -

            3.2.5 Compound Commands

            - +

            3.2.5 Compound Commands

            +

            Compound commands are the shell programming language constructs. Each construct begins with a reserved word or control operator and is terminated by a corresponding reserved word or operator. -Any redirections (see Redirections) associated with a compound command +Any redirections (see Redirections) associated with a compound command apply to all commands within that compound command unless explicitly overridden.

            In most cases a list of commands in a compound command’s description may be @@ -1214,179 +1215,179 @@ followed by a newline in place of a semicolon.

            Bash provides looping constructs, conditional commands, and mechanisms to group commands and execute them as a unit.

            -
              +
              -
              -
              +
              + -

              3.2.5.1 Looping Constructs

              - +

              3.2.5.1 Looping Constructs

              +

              Bash supports the following looping constructs.

              -

              Note that wherever a ‘;’ appears in the description of a +

              Note that wherever a ‘;’ appears in the description of a command’s syntax, it may be replaced with one or more newlines.

              -
              -
              until
              -
              - -

              The syntax of the until command is: +

              +
              + +until
              +

              The syntax of the until command is:

              -
              until test-commands; do consequent-commands; done
              +
              until test-commands; do consequent-commands; done
               
              -

              Execute consequent-commands as long as -test-commands has an exit status which is not zero. +

              Execute consequent-commands as long as +test-commands has an exit status which is not zero. The return status is the exit status of the last command executed -in consequent-commands, or zero if none was executed. +in consequent-commands, or zero if none was executed.

              -
              while
              -

              The syntax of the while command is: +

              while
              +

              The syntax of the while command is:

              -
              while test-commands; do consequent-commands; done
              +
              while test-commands; do consequent-commands; done
               
              -

              Execute consequent-commands as long as -test-commands has an exit status of zero. +

              Execute consequent-commands as long as +test-commands has an exit status of zero. The return status is the exit status of the last command executed -in consequent-commands, or zero if none was executed. +in consequent-commands, or zero if none was executed.

              -
              for
              -

              The syntax of the for command is: +

              for
              +

              The syntax of the for command is:

              -
              for name [ [in [words …] ] ; ] do commands; done
              +
              for name [ [in [words ...] ] ; ] do commands; done
               
              -

              Expand words (see Shell Expansions), and execute commands +

              Expand words (see Shell Expansions), and execute commands once for each member -in the resultant list, with name bound to the current member. -If ‘in words’ is not present, the for command -executes the commands once for each positional parameter that is -set, as if ‘in "$@"’ had been specified -(see Special Parameters). +in the resultant list, with name bound to the current member. +If ‘in words’ is not present, the for command +executes the commands once for each positional parameter that is +set, as if ‘in "$@"’ had been specified +(see Special Parameters).

              The return status is the exit status of the last command that executes. -If there are no items in the expansion of words, no commands are +If there are no items in the expansion of words, no commands are executed, and the return status is zero.

              -

              An alternate form of the for command is also supported: +

              An alternate form of the for command is also supported:

              -
              for (( expr1 ; expr2 ; expr3 )) ; do commands ; done
              +
              for (( expr1 ; expr2 ; expr3 )) ; do commands ; done
               
              -

              First, the arithmetic expression expr1 is evaluated according -to the rules described below (see Shell Arithmetic). -The arithmetic expression expr2 is then evaluated repeatedly +

              First, the arithmetic expression expr1 is evaluated according +to the rules described below (see Shell Arithmetic). +The arithmetic expression expr2 is then evaluated repeatedly until it evaluates to zero. -Each time expr2 evaluates to a non-zero value, commands are -executed and the arithmetic expression expr3 is evaluated. +Each time expr2 evaluates to a non-zero value, commands are +executed and the arithmetic expression expr3 is evaluated. If any expression is omitted, it behaves as if it evaluates to 1. -The return value is the exit status of the last command in commands +The return value is the exit status of the last command in commands that is executed, or false if any of the expressions is invalid.

              -

              The break and continue builtins (see Bourne Shell Builtins) +

              The break and continue builtins (see Bourne Shell Builtins) may be used to control loop execution.


              -
              -
              +
              + -

              3.2.5.2 Conditional Constructs

              - +

              3.2.5.2 Conditional Constructs

              + -
              -
              if
              -
              - - - -

              The syntax of the if command is: +

              +
              + + + +if
              +

              The syntax of the if command is:

              -
              if test-commands; then
              -  consequent-commands;
              -[elif more-test-commands; then
              -  more-consequents;]
              -[else alternate-consequents;]
              +
              if test-commands; then
              +  consequent-commands;
              +[elif more-test-commands; then
              +  more-consequents;]
              +[else alternate-consequents;]
               fi
               
              -

              The test-commands list is executed, and if its return status is zero, -the consequent-commands list is executed. -If test-commands returns a non-zero status, each elif list +

              The test-commands list is executed, and if its return status is zero, +the consequent-commands list is executed. +If test-commands returns a non-zero status, each elif list is executed in turn, and if its exit status is zero, -the corresponding more-consequents is executed and the +the corresponding more-consequents is executed and the command completes. -If ‘else alternate-consequents’ is present, and -the final command in the final if or elif clause -has a non-zero exit status, then alternate-consequents is executed. +If ‘else alternate-consequents’ is present, and +the final command in the final if or elif clause +has a non-zero exit status, then alternate-consequents is executed. The return status is the exit status of the last command executed, or zero if no condition tested true.

              -
              case
              -
              - -

              The syntax of the case command is: +

              + +case
              +

              The syntax of the case command is:

              -
              case word in
              -    [ [(] pattern [| pattern]…) command-list ;;]…
              +
              case word in
              +    [ [(] pattern [| pattern]...) command-list ;;]...
               esac
               
              -

              case will selectively execute the command-list corresponding to -the first pattern that matches word. +

              case will selectively execute the command-list corresponding to +the first pattern that matches word. The match is performed according -to the rules described below in Pattern Matching. -If the nocasematch shell option -(see the description of shopt in The Shopt Builtin) +to the rules described below in Pattern Matching. +If the nocasematch shell option +(see the description of shopt in The Shopt Builtin) is enabled, the match is performed without regard to the case of alphabetic characters. -The ‘|’ is used to separate multiple patterns, and the ‘)’ +The ‘|’ is used to separate multiple patterns, and the ‘)’ operator terminates a pattern list. A list of patterns and an associated command-list is known -as a clause. +as a clause.

              -

              Each clause must be terminated with ‘;;’, ‘;&’, or ‘;;&’. -The word undergoes tilde expansion, parameter expansion, command +

              Each clause must be terminated with ‘;;’, ‘;&’, or ‘;;&’. +The word undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal -(see Shell Parameter Expansion) +(see Shell Parameter Expansion) before matching is attempted. -Each pattern undergoes tilde expansion, parameter expansion, +Each pattern undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, process substitution, and quote removal.

              -

              There may be an arbitrary number of case clauses, each terminated -by a ‘;;’, ‘;&’, or ‘;;&’. +

              There may be an arbitrary number of case clauses, each terminated +by a ‘;;’, ‘;&’, or ‘;;&’. The first pattern that matches determines the command-list that is executed. -It’s a common idiom to use ‘*’ as the final pattern to define the +It’s a common idiom to use ‘*’ as the final pattern to define the default case, since that pattern will always match.

              -

              Here is an example using case in a script that could be used to +

              Here is an example using case in a script that could be used to describe one interesting feature of an animal:

              -
              echo -n "Enter the name of an animal: "
              +
              echo -n "Enter the name of an animal: "
               read ANIMAL
               echo -n "The $ANIMAL has "
               case $ANIMAL in
              @@ -1398,52 +1399,52 @@ echo " legs."
               
              -

              If the ‘;;’ operator is used, no subsequent matches are attempted after +

              If the ‘;;’ operator is used, no subsequent matches are attempted after the first pattern match. -Using ‘;&’ in place of ‘;;’ causes execution to continue with -the command-list associated with the next clause, if any. -Using ‘;;&’ in place of ‘;;’ causes the shell to test the patterns -in the next clause, if any, and execute any associated command-list +Using ‘;&’ in place of ‘;;’ causes execution to continue with +the command-list associated with the next clause, if any. +Using ‘;;&’ in place of ‘;;’ causes the shell to test the patterns +in the next clause, if any, and execute any associated command-list on a successful match, continuing the case statement execution as if the pattern list had not matched.

              -

              The return status is zero if no pattern is matched. Otherwise, the -return status is the exit status of the command-list executed. +

              The return status is zero if no pattern is matched. Otherwise, the +return status is the exit status of the command-list executed.

              -
              select
              +
              select
              -

              The select construct allows the easy generation of menus. -It has almost the same syntax as the for command: +

              The select construct allows the easy generation of menus. +It has almost the same syntax as the for command:

              -
              select name [in words …]; do commands; done
              +
              select name [in words ...]; do commands; done
               
              -

              The list of words following in is expanded, generating a list +

              The list of words following in is expanded, generating a list of items, and the set of expanded words is printed on the standard error output stream, each preceded by a number. If the -‘in words’ is omitted, the positional parameters are printed, -as if ‘in "$@"’ had been specified. -select then displays the PS3 +‘in words’ is omitted, the positional parameters are printed, +as if ‘in "$@"’ had been specified. +select then displays the PS3 prompt and reads a line from the standard input. If the line consists of a number corresponding to one of the displayed -words, then the value of name is set to that word. +words, then the value of name is set to that word. If the line is empty, the words and prompt are displayed again. -If EOF is read, the select command completes and returns 1. -Any other value read causes name to be set to null. -The line read is saved in the variable REPLY. +If EOF is read, the select command completes and returns 1. +Any other value read causes name to be set to null. +The line read is saved in the variable REPLY.

              -

              The commands are executed after each selection until a -break command is executed, at which -point the select command completes. +

              The commands are executed after each selection until a +break command is executed, at which +point the select command completes.

              Here is an example that allows the user to pick a filename from the current directory, and displays the name and index of the file selected.

              -
              select fname in *;
              +
              select fname in *;
               do
               	echo you picked $fname \($REPLY\)
               	break;
              @@ -1451,55 +1452,55 @@ done
               
              -
              ((…))
              +
              ((…))
              -
              (( expression ))
              +
              (( expression ))
               
              -

              The arithmetic expression is evaluated according to the rules -described below (see Shell Arithmetic). -The expression undergoes the same expansions +

              The arithmetic expression is evaluated according to the rules +described below (see Shell Arithmetic). +The expression undergoes the same expansions as if it were within double quotes, -but double quote characters in expression are not treated specially +but double quote characters in expression are not treated specially are removed. If the value of the expression is non-zero, the return status is 0; otherwise the return status is 1.

              -
              [[…]]
              -
              -
              -
              [[ expression ]]
              +
              +[[…]]
              +
              +
              [[ expression ]]
               

              Return a status of 0 or 1 depending on the evaluation of -the conditional expression expression. +the conditional expression expression. Expressions are composed of the primaries described below in -Bash Conditional Expressions. -The words between the [[ and ]] do not undergo word splitting +Bash Conditional Expressions. +The words between the [[ and ]] do not undergo word splitting and filename expansion. The shell performs tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on those words (the expansions that would occur if the words were enclosed in double quotes). -Conditional operators such as ‘-f’ must be unquoted to be recognized +Conditional operators such as ‘-f’ must be unquoted to be recognized as primaries.

              -

              When used with [[, the ‘<’ and ‘>’ operators sort +

              When used with [[, the ‘<’ and ‘>’ operators sort lexicographically using the current locale.

              -

              When the ‘==’ and ‘!=’ operators are used, the string to the +

              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 in Pattern Matching, -as if the extglob shell option were enabled. -The ‘=’ operator is identical to ‘==’. -If the nocasematch shell option -(see the description of shopt in The Shopt Builtin) +to the rules described below in Pattern Matching, +as if the extglob shell option were enabled. +The ‘=’ operator is identical to ‘==’. +If the nocasematch shell option +(see the description of shopt in The Shopt Builtin) 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. +The return value is 0 if the string matches (‘==’) or does not +match (‘!=’) the pattern, and 1 otherwise.

              If you quote any part of the pattern, using any of the shell’s quoting mechanisms, @@ -1507,17 +1508,17 @@ the quoted portion is matched literally. This means 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 you use ‘=~’, the string to the right of the operator is considered -a POSIX extended regular expression pattern and matched accordingly -(using the POSIX regcomp and regexec interfaces -usually described in regex(3)). +

              An additional binary operator, ‘=~’, is available, with the same +precedence as ‘==’ and ‘!=’. +When you use ‘=~’, the string to the right of the operator is considered +a POSIX extended regular expression pattern and matched accordingly +(using the POSIX regcomp and regexec interfaces +usually described in regex(3)). The return value is 0 if the string matches the pattern, and 1 if it does not. If the regular expression is syntactically incorrect, the conditional expression returns 2. -If the nocasematch shell option -(see the description of shopt in The Shopt Builtin) +If the nocasematch shell option +(see the description of shopt in The Shopt Builtin) is enabled, the match is performed without regard to the case of alphabetic characters.

              @@ -1529,50 +1530,50 @@ expansion forces the entire pattern to be matched literally.

              The pattern will match if it matches any part of the string. If you want to force the pattern to match the entire string, -anchor the pattern using the ‘^’ and ‘$’ regular expression +anchor the pattern using the ‘^’ and ‘$’ regular expression operators.

              For example, the following will match a line -(stored in the shell variable line) +(stored in the shell variable line) if there is a sequence of characters anywhere in the value consisting of any number, including zero, of -characters in the space character class, -immediately followed by zero or one instances of ‘a’, -then a ‘b’: +characters in the space character class, +immediately followed by zero or one instances of ‘a’, +then a ‘b’:

              -
              [[ $line =~ [[:space:]]*(a)?b ]]
              +
              [[ $line =~ [[:space:]]*(a)?b ]]
               
              -

              That means values for line like -‘aab’, ‘ aaaaaab’, ‘xaby’, and ‘ ab’ +

              That means values for line like +‘aab’, ‘ aaaaaab’, ‘xaby’, and ‘ ab’ will all match, -as will a line containing a ‘b’ anywhere in its value. +as will a line containing a ‘b’ anywhere in its value.

              If you want to match a character that’s special to the regular expression -grammar (‘^$|[]()\.*+?’), it has to be quoted to remove its special +grammar (‘^$|[]()\.*+?’), it has to be quoted to remove its special meaning. -This means that in the pattern ‘xxx.txt’, the ‘.’ matches any +This means that in the pattern ‘xxx.txt’, the ‘.’ matches any character in the string (its usual regular expression meaning), but in the -pattern ‘"xxx.txt"’, it can only match a literal ‘.’. +pattern ‘"xxx.txt"’, it can only match a literal ‘.’.

              Likewise, if you want to include a character in your pattern that has a special meaning to the regular expression grammar, you must make sure it’s not quoted. If you want to anchor a pattern at the beginning or end of the string, -for instance, you cannot quote the ‘^’ or ‘$’ +for instance, you cannot quote the ‘^’ or ‘$’ characters using any form of shell quoting.

              -

              If you want to match ‘initial string’ at the start of a line, +

              If you want to match ‘initial string’ at the start of a line, the following will work:

              -
              [[ $line =~ ^"initial string" ]]
              +
              [[ $line =~ ^"initial string" ]]
               

              but this will not:

              -
              [[ $line =~ "^initial string" ]]
              +
              [[ $line =~ "^initial string" ]]
               
              -

              because in the second example the ‘^’ is quoted and doesn’t have its +

              because in the second example the ‘^’ is quoted and doesn’t have its usual special meaning.

              It is sometimes difficult to specify a regular expression properly @@ -1585,7 +1586,7 @@ shell. For example, the following is equivalent to the pattern used above:

              -
              pattern='[[:space:]]*(a)?b'
              +
              pattern='[[:space:]]*(a)?b'
               [[ $line =~ $pattern ]]
               
              @@ -1593,7 +1594,7 @@ For example, the following is equivalent to the pattern used above: backslashes are used by both the shell and regular expressions to remove the special meaning from the following character. This means that after the shell’s word expansions complete -(see Shell Expansions), +(see Shell Expansions), any backslashes remaining in parts of the pattern that were originally not quoted can remove the special meaning of pattern characters. @@ -1601,10 +1602,10 @@ If any part of the pattern is quoted, the shell does its best to ensure that the regular expression treats those remaining backslashes as literal, if they appeared in a quoted portion.

              -

              The following two sets of commands are not equivalent: +

              The following two sets of commands are not equivalent:

              -
              pattern='\.'
              +
              pattern='\.'
               
               [[ . =~ $pattern ]]
               [[ . =~ \. ]]
              @@ -1616,13 +1617,13 @@ if they appeared in a quoted portion.
               

              The first two matches will succeed, but the second two will not, because in the second two the backslash will be part of the pattern to be matched. In the first two examples, the pattern passed to the regular expression -parser is ‘\.’. The backslash removes the special meaning from -‘.’, so the literal ‘.’ matches. +parser is ‘\.’. The backslash removes the special meaning from +‘.’, so the literal ‘.’ matches. In the second two examples, the pattern passed to the regular expression -parser has the backslash quoted (e.g., ‘\\\.’), which will not match +parser has the backslash quoted (e.g., ‘\\\.’), which will not match the string, since it does not contain a backslash. -If the string in the first examples were anything other than ‘.’, say -‘a’, the pattern would not match, because the quoted ‘.’ in the +If the string in the first examples were anything other than ‘.’, say +‘a’, the pattern would not match, because the quoted ‘.’ in the pattern loses its special meaning of matching any single character.

              Bracket expressions in regular expressions can be sources of errors as well, @@ -1632,10 +1633,10 @@ However, you can use bracket expressions to match special pattern characters without quoting them, so they are sometimes useful for this purpose.

              Though it might seem like a strange way to write it, the following pattern -will match a ‘.’ in the string: +will match a ‘.’ in the string:

              -
              [[ . =~ [.] ]]
              +
              [[ . =~ [.] ]]
               

              The shell performs any word expansions before passing the pattern @@ -1648,187 +1649,187 @@ The intention is to avoid making shell programmers quote things twice as much as possible, so shell quoting should be sufficient to quote special pattern characters where that’s necessary.

              -

              The array variable BASH_REMATCH records which parts of the string +

              The array variable BASH_REMATCH records which parts of the string matched the pattern. -The element of BASH_REMATCH with index 0 contains the portion of +The element of BASH_REMATCH with index 0 contains the portion of the string matching the entire regular expression. Substrings matched by parenthesized subexpressions within the regular -expression are saved in the remaining BASH_REMATCH indices. -The element of BASH_REMATCH with index n is the portion of the -string matching the nth parenthesized subexpression. +expression are saved in the remaining BASH_REMATCH indices. +The element of BASH_REMATCH with index n is the portion of the +string matching the nth parenthesized subexpression.

              Bash sets -BASH_REMATCH +BASH_REMATCH in the global scope; declaring it as a local variable will lead to unexpected results.

              Expressions may be combined using the following operators, listed in decreasing order of precedence:

              -
              -
              ( expression )
              -

              Returns the value of expression. +

              +
              ( expression )
              +

              Returns the value of expression. This may be used to override the normal precedence of operators.

              -
              ! expression
              -

              True if expression is false. +

              ! expression
              +

              True if expression is false.

              -
              expression1 && expression2
              -

              True if both expression1 and expression2 are true. +

              expression1 && expression2
              +

              True if both expression1 and expression2 are true.

              -
              expression1 || expression2
              -

              True if either expression1 or expression2 is true. +

              expression1 || expression2
              +

              True if either expression1 or expression2 is true.

              -

              The && and || operators do not evaluate expression2 if the -value of expression1 is sufficient to determine the return +

              The && and || operators do not evaluate expression2 if the +value of expression1 is sufficient to determine the return value of the entire conditional expression.


              -
              -
              +
              + -

              3.2.5.3 Grouping Commands

              - +

              3.2.5.3 Grouping Commands

              +

              Bash provides two ways to group a list of commands to be executed as a unit. When commands are grouped, redirections may be applied to the entire command list. For example, the output of all the commands in the list may be redirected to a single stream.

              -
              -
              ()
              +
              +
              ()
              -
              ( list )
              +
              ( list )
               

              Placing a list of commands between parentheses forces the shell to create -a subshell (see Command Execution Environment), and each -of the commands in list is executed in that subshell environment. -Since the list is executed in a subshell, variable assignments do not +a subshell (see Command Execution Environment), and each +of the commands in list is executed in that subshell environment. +Since the list is executed in a subshell, variable assignments do not remain in effect after the subshell completes.

              -
              {}
              -
              -
              -
              { list; }
              +
              +{}
              +
              +
              { list; }
               

              Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. -The semicolon (or newline) following list is required. +The semicolon (or newline) following list is required.

              In addition to the creation of a subshell, there is a subtle difference between these two constructs due to historical reasons. The braces -are reserved words, so they must be separated from the list -by blanks or other shell metacharacters. +are reserved words, so they must be separated from the list +by blanks or other shell metacharacters. The parentheses are operators, and are recognized as separate tokens by the shell even if they are not separated -from the list by whitespace. +from the list by whitespace.

              The exit status of both of these constructs is the exit status of -list. +list.


              -
              -
              +
              + -

              3.2.6 Coprocesses

              - +

              3.2.6 Coprocesses

              + -

              A coprocess is a shell command preceded by the coproc +

              A coprocess is a shell command preceded by the coproc 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 +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:

              -
              coproc [NAME] command [redirections]
              +
              coproc [NAME] command [redirections]
               
              -

              This creates a coprocess named NAME. -command may be either a simple command (see Simple Commands) -or a compound command (see Compound Commands). -NAME is a shell variable name. -If NAME is not supplied, the default name is COPROC. +

              This creates a coprocess named NAME. +command may be either a simple command (see Simple Commands) +or a compound command (see Compound Commands). +NAME is a shell variable name. +If NAME is not supplied, the default name is COPROC.

              The recommended form to use for a coprocess is

              -
              coproc NAME { command; }
              +
              coproc NAME { command; }
               

              This form is recommended because simple commands result in the coprocess -always being named COPROC, and it is simpler to use and more complete +always being named COPROC, and it is simpler to use and more complete than the other compound commands.

              There are other forms of coprocesses:

              -
              coproc NAME compound-command
              -coproc compound-command
              -coproc simple-command
              +
              coproc NAME compound-command
              +coproc compound-command
              +coproc simple-command
               
              -

              If command is a compound command, NAME is optional. The -word following coproc determines whether that word is interpreted -as a variable name: it is interpreted as NAME if it is not a +

              If command is a compound command, NAME is optional. The +word following coproc determines whether that word is interpreted +as a variable name: it is interpreted as NAME if it is not a reserved word that introduces a compound command. -If command is a simple command, NAME is not allowed; this -is to avoid confusion between NAME and the first word of the simple +If command is a simple command, NAME is not allowed; this +is to avoid confusion between NAME and the first word of the simple command.

              When the coprocess is executed, the shell creates an array variable -(see Arrays) -named NAME in the context of the executing shell. -The standard output of command +(see Arrays) +named NAME in the context of the executing shell. +The standard output of command is connected via a pipe to a file descriptor in the executing shell, -and that file descriptor is assigned to NAME[0]. -The standard input of command +and that file descriptor is assigned to NAME[0]. +The standard input of command is connected via a pipe to a file descriptor in the executing shell, -and that file descriptor is assigned to NAME[1]. +and that file descriptor is assigned to NAME[1]. This pipe is established before any redirections specified by the -command (see Redirections). +command (see Redirections). The file descriptors can be utilized as arguments to shell commands and redirections using standard word expansions. Other than those created to execute command and process substitutions, the file descriptors are not available in subshells.

              The process ID of the shell spawned to execute the coprocess is -available as the value of the variable NAME_PID. -The wait +available as the value of the variable NAME_PID. +The wait builtin command may be used to wait for the coprocess to terminate.

              Since the coprocess is created as an asynchronous command, -the coproc command always returns success. -The return status of a coprocess is the exit status of command. +the coproc command always returns success. +The return status of a coprocess is the exit status of command.


              -
              -
              +
              + -

              3.2.7 GNU Parallel

              +

              3.2.7 GNU Parallel

              There are ways to run commands in parallel that are not built into Bash. GNU Parallel is a tool to do just that. @@ -1838,24 +1839,24 @@ in parallel. You may run the same command with different arguments, whether they are filenames, usernames, hostnames, or lines read from files. GNU Parallel provides shorthand references to many of the most common operations (input lines, various portions of the input line, different ways to specify -the input source, and so on). Parallel can replace xargs or feed +the input source, and so on). Parallel can replace xargs or feed commands from its input sources to several different instances of Bash.

              For a complete description, refer to the GNU Parallel documentation, which is available at -https://www.gnu.org/software/parallel/parallel_tutorial.html. +https://www.gnu.org/software/parallel/parallel_tutorial.html.


              -
              -
              +
              + -

              3.3 Shell Functions

              - - +

              3.3 Shell Functions

              + +

              Shell functions are a way to group commands for later execution using a single name for the group. They are executed just like @@ -1866,39 +1867,39 @@ Shell functions are executed in the current shell context; no new process is created to interpret them.

              Functions are declared using this syntax: - +

              -
              fname () compound-command [ redirections ]
              +
              fname () compound-command [ redirections ]
               

              or

              -
              function fname [()] compound-command [ redirections ]
              +
              function fname [()] compound-command [ redirections ]
               
              -

              This defines a shell function named fname. The reserved -word function is optional. -If the function reserved +

              This defines a shell function named fname. The reserved +word function is optional. +If the function reserved word is supplied, the parentheses are optional. -The body of the function is the compound command -compound-command (see Compound Commands). -That command is usually a list enclosed between { and }, but +The body of the function is the compound command +compound-command (see Compound Commands). +That command is usually a list enclosed between { and }, but may be any compound command listed above. -If the function reserved word is used, but the +If the function reserved word is used, but the parentheses are not supplied, the braces are recommended. -compound-command is executed whenever fname is specified as the +compound-command is executed whenever fname is specified as the name of a simple command. -When the shell is in POSIX mode (see Bash and POSIX), -fname must be a valid shell name and +When the shell is in POSIX mode (see Bash and POSIX), +fname must be a valid shell name and may not be the same as one of the special builtins -(see Special Builtins). +(see Special Builtins). In default mode, a function name can be any unquoted shell word that does -not contain ‘$’. -Any redirections (see Redirections) associated with the shell function +not contain ‘$’. +Any redirections (see Redirections) associated with the shell function are performed when the function is executed. -A function definition may be deleted using the -f option to the -unset builtin (see Bourne Shell Builtins). +A function definition may be deleted using the -f option to the +unset builtin (see Bourne Shell Builtins).

              The exit status of a function definition is zero unless a syntax error occurs or a readonly function with the same name already exists. @@ -1907,70 +1908,70 @@ last command executed in the body.

              Note that for historical reasons, in the most common usage the curly braces that surround the body of the function must be separated from the body by -blanks or newlines. +blanks or newlines. This is because the braces are reserved words and are only recognized as such when they are separated from the command list by whitespace or another shell metacharacter. -Also, when using the braces, the list must be terminated by a semicolon, -a ‘&’, or a newline. +Also, when using the braces, the list must be terminated by a semicolon, +a ‘&’, or a newline.

              When a function is executed, the arguments to the function become the positional parameters -during its execution (see Positional Parameters). -The special parameter ‘#’ that expands to the number of +during its execution (see Positional Parameters). +The special parameter ‘#’ that expands to the number of positional parameters is updated to reflect the change. -Special parameter 0 is unchanged. -The first element of the FUNCNAME variable is set to the +Special parameter 0 is unchanged. +The first element of the FUNCNAME variable is set to the name of the function while the function is executing.

              All other aspects of the shell execution environment are identical between a function and its caller with these exceptions: -the DEBUG and RETURN traps +the DEBUG and RETURN traps are not inherited unless the function has been given the -trace attribute using the declare builtin or -the -o functrace option has been enabled with -the set builtin, -(in which case all functions inherit the DEBUG and RETURN traps), -and the ERR trap is not inherited unless the -o errtrace +trace attribute using the declare builtin or +the -o functrace option has been enabled with +the set builtin, +(in which case all functions inherit the DEBUG and RETURN traps), +and the ERR trap is not inherited unless the -o errtrace shell option has been enabled. -See Bourne Shell Builtins, for the description of the -trap builtin. +See Bourne Shell Builtins, for the description of the +trap builtin.

              -

              The FUNCNEST variable, if set to a numeric value greater +

              The FUNCNEST variable, if set to a numeric value greater than 0, defines a maximum function nesting level. Function invocations that exceed the limit cause the entire command to abort.

              -

              If the builtin command return +

              If the builtin command return is executed in a function, the function completes and execution resumes with the next command after the function call. -Any command associated with the RETURN trap is executed +Any command associated with the RETURN trap is executed before execution resumes. When a function completes, the values of the -positional parameters and the special parameter ‘#’ +positional parameters and the special parameter ‘#’ are restored to the values they had prior to the function’s -execution. If a numeric argument is given to return, +execution. If a numeric argument is given to return, that is the function’s return status; otherwise the function’s return status is the exit status of the last command executed -before the return. +before the return.

              Variables local to the function may be declared with the -local builtin (local variables). +local builtin (local variables). Ordinarily, variables and their values are shared between a function and its caller. These variables are visible only to the function and the commands it invokes. This is particularly important when a shell function calls other functions.

              -

              In the following description, the current scope is a currently- +

              In the following description, the current scope is a currently- executing function. Previous scopes consist of that function’s caller and so on, back to the "global" scope, where the shell is not executing any shell function. Consequently, a local variable at the current local scope is a variable -declared using the local or declare builtins in the +declared using the local or declare builtins in the function that is currently executing.

              Local variables "shadow" variables with the same name declared at @@ -1979,33 +1980,33 @@ hides a global variable of the same name: references and assignments refer to the local variable, leaving the global variable unmodified. When the function returns, the global variable is once again visible.

              -

              The shell uses dynamic scoping to control a variable’s visibility +

              The shell uses dynamic scoping to control a variable’s visibility within functions. With dynamic scoping, visible variables and their values are a result of the sequence of function calls that caused execution to reach the current function. The value of a variable that a function sees depends on its value within its caller, if any, whether that caller is -the "global" scope or another shell function. +the global scope or another shell function. This is also the value that a local variable -declaration "shadows", and the value that is restored when the function +declaration shadows, and the value that is restored when the function returns.

              -

              For example, if a variable var is declared as local in function -func1, and func1 calls another function func2, -references to var made from within func2 will resolve to the -local variable var from func1, shadowing any global variable -named var. +

              For example, if a variable var is declared as local in function +func1, and func1 calls another function func2, +references to var made from within func2 will resolve to the +local variable var from func1, shadowing any global variable +named var.

              The following script demonstrates this behavior. When executed, the script displays

              -
              In func2, var = func1 local
              +
              In func2, var = func1 local
               
              -
              func1()
              +
              func1()
               {
                   local var='func1 local'
                   func2
              @@ -2020,8 +2021,8 @@ var=global
               func1
               
              -

              The unset builtin also acts using the same dynamic scope: if a -variable is local to the current scope, unset will unset it; +

              The unset builtin also acts using the same dynamic scope: if a +variable is local to the current scope, unset will unset it; otherwise the unset will refer to the variable found in any calling scope as described above. If a variable at the current local scope is unset, it will remain so @@ -2031,95 +2032,95 @@ Once the function returns, any instance of the variable at a previous scope will become 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 localvar_unsetshell option changes this behavior). +(see below how localvar_unsetshell option changes this behavior).

              Function names and definitions may be listed with the --f option to the declare (typeset) -builtin command (see Bash Builtin Commands). -The -F option to declare or typeset +-f option to the declare (typeset) +builtin command (see Bash Builtin Commands). +The -F option to declare or typeset will list the function names only -(and optionally the source file and line number, if the extdebug +(and optionally the source file and line number, if the extdebug shell option is enabled). Functions may be exported so that child shell processes (those created when executing a separate shell invocation) automatically have them defined with the --f option to the export builtin -(see Bourne Shell Builtins). +-f option to the export builtin +(see Bourne Shell Builtins).

              Functions may be recursive. -The FUNCNEST variable may be used to limit the depth of the +The FUNCNEST variable may be used to limit the depth of the function call stack and restrict the number of function invocations. By default, no limit is placed on the number of recursive calls.


              -
              -
              +
              + -

              3.4 Shell Parameters

              - - - +

              3.4 Shell Parameters

              + + + -

              A parameter is an entity that stores values. -It can be a name, a number, or one of the special characters +

              A parameter is an entity that stores values. +It can be a name, a number, or one of the special characters listed below. -A variable is a parameter denoted by a name. -A variable has a value and zero or more attributes. -Attributes are assigned using the declare builtin command -(see the description of the declare builtin in Bash Builtin Commands). +A variable is a parameter denoted by a name. +A variable has a value and zero or more attributes. +Attributes are assigned using the declare builtin command +(see the description of the declare builtin in Bash Builtin Commands).

              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 -the unset builtin command. +the unset builtin command.

              A variable may be assigned to by a statement of the form

              -
              name=[value]
              +
              name=[value]
               
              -

              If value +

              If value is not given, the variable is assigned the null string. All -values undergo tilde expansion, parameter and variable expansion, +values undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote -removal (see Shell Parameter Expansion). -If the variable has its integer -attribute set, then value -is evaluated as an arithmetic expression even if the $((…)) -expansion is not used (see Arithmetic Expansion). +removal (see Shell Parameter Expansion). +If the variable has its integer +attribute set, then value +is evaluated as an arithmetic expression even if the $((…)) +expansion is not used (see Arithmetic Expansion). Word splitting and filename expansion are not performed. Assignment statements may also appear as arguments to the -alias, -declare, typeset, export, readonly, -and local builtin commands (declaration commands). -When in POSIX mode (see Bash and POSIX), these builtins may appear -in a command after one or more instances of the command builtin +alias, +declare, typeset, export, readonly, +and local builtin commands (declaration commands). +When in POSIX mode (see Bash and POSIX), these builtins may appear +in a command after one or more instances of the command 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 (see Arrays), the ‘+=’ +to a shell variable or array index (see Arrays), the ‘+=’ operator can be used to append to or add to the variable’s previous value. -This includes arguments to builtin commands such as declare that +This includes arguments to builtin commands such as declare that accept assignment statements (declaration commands). -When ‘+=’ is applied to a variable for which the integer attribute -has been set, value is evaluated as an arithmetic expression and +When ‘+=’ is applied to a variable for which the integer attribute +has been set, value is evaluated as an arithmetic expression and added to the variable’s current value, which is also evaluated. -When ‘+=’ is applied to an array variable using compound assignment -(see Arrays), the -variable’s value is not unset (as it is when using ‘=’), and new +When ‘+=’ is applied to an array variable using compound assignment +(see Arrays), 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 +When applied to a string-valued variable, value is expanded and appended to the variable’s value.

              -

              A variable can be assigned the nameref attribute using the --n option to the declare or local builtin commands -(see Bash Builtin Commands) -to create a nameref, or a reference to another variable. +

              A variable can be assigned the nameref attribute using the +-n option to the declare or local builtin commands +(see Bash Builtin Commands) +to create a nameref, or a reference to another variable. This allows variables to be manipulated indirectly. Whenever the nameref variable is referenced, assigned to, unset, or has its attributes modified (other than using or changing the nameref @@ -2131,71 +2132,71 @@ whose name is passed as an argument to the function. For instance, if a variable name is passed to a shell function as its first argument, running

              -
              declare -n ref=$1
              +
              declare -n ref=$1
               
              -

              inside the function creates a nameref variable ref whose value is +

              inside the function creates a nameref variable ref whose value is the variable name passed as the first argument. -References and assignments to ref, and changes to its attributes, +References and assignments to ref, and changes to its attributes, are treated as references, assignments, and attribute modifications -to the variable whose name was passed as $1. +to the variable whose name was passed as $1.

              -

              If the control variable in a for loop has the nameref attribute, +

              If the control variable in a for loop has the nameref attribute, the list of words can be a list of shell variables, and a name reference will be established for each word in the list, in turn, when the loop is executed. Array variables cannot be given the nameref attribute. However, nameref variables can reference array variables and subscripted array variables. -Namerefs can be unset using the -n option to the unset builtin -(see Bourne Shell Builtins). -Otherwise, if unset is executed with the name of a nameref variable +Namerefs can be unset using the -n option to the unset builtin +(see Bourne Shell Builtins). +Otherwise, if unset is executed with the name of a nameref variable as an argument, the variable referenced by the nameref variable will be unset.

              -
                +
                -
                -
                +
                + -

                3.4.1 Positional Parameters

                - +

                3.4.1 Positional Parameters

                + -

                A positional parameter is a parameter denoted by one or more -digits, other than the single digit 0. Positional parameters are +

                A positional parameter is a parameter denoted by one or more +digits, other than the single digit 0. Positional parameters are assigned from the shell’s arguments when it is invoked, -and may be reassigned using the set builtin command. -Positional parameter N may be referenced as ${N}, or -as $N when N consists of a single digit. +and may be reassigned using the set builtin command. +Positional parameter N may be referenced as ${N}, or +as $N when N consists of a single digit. Positional parameters may not be assigned to with assignment statements. -The set and shift builtins are used to set and -unset them (see Shell Builtin Commands). +The set and shift builtins are used to set and +unset them (see Shell Builtin Commands). The positional parameters are temporarily replaced when a shell function is executed -(see Shell Functions). +(see Shell Functions).

                When a positional parameter consisting of more than a single digit is expanded, it must be enclosed in braces.


                -
                -
                +
                + -

                3.4.2 Special Parameters

                - +

                3.4.2 Special Parameters

                +

                The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.

                -
                -
                *
                -
                +
                +
                *
                +

                ($*) Expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a separate word. @@ -2203,17 +2204,17 @@ In contexts where it is performed, those words are subject to further word splitting and filename expansion. When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the -IFS special variable. That is, "$*" is equivalent -to "$1c$2c…", where c -is the first character of the value of the IFS +IFS special variable. That is, "$*" is equivalent +to "$1c$2c…", where c +is the first character of the value of the IFS variable. -If IFS is unset, the parameters are separated by spaces. -If IFS is null, the parameters are joined without intervening +If IFS is unset, the parameters are separated by spaces. +If IFS is null, the parameters are joined without intervening separators.

                -
                @
                -
                +
                @
                +

                ($@) Expands to the positional parameters, starting from one. In contexts where word splitting is performed, this expands each positional parameter to a separate word; if not within double @@ -2224,56 +2225,56 @@ with each positional parameter separated by a space. When the expansion occurs within double quotes, and word splitting is performed, each parameter expands to a -separate word. That is, "$@" is equivalent to -"$1" "$2" …. +separate word. That is, "$@" is equivalent to +"$1" "$2" …. If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. -When there are no positional parameters, "$@" and -$@ +When there are no positional parameters, "$@" and +$@ expand to nothing (i.e., they are removed).

                -
                #
                -
                +
                #
                +

                ($#) Expands to the number of positional parameters in decimal.

                -
                ?
                -
                +
                ?
                +

                ($?) Expands to the exit status of the most recently executed foreground pipeline.

                -
                -
                -
                +
                -
                +

                ($-, a hyphen.) Expands to the current option flags as specified upon -invocation, by the set +invocation, by the set builtin command, or those set by the shell itself -(such as the -i option). +(such as the -i option).

                -
                $
                -
                -

                ($$) Expands to the process ID of the shell. In a subshell, it -expands to the process ID of the invoking shell, not the subshell. +

                $
                +
                +

                ($$) Expands to the process ID of the shell. In a subshell, it +expands to the process ID of the invoking shell, not the subshell.

                -
                !
                -
                -

                ($!) Expands to the process ID of the job most recently placed into the +

                !
                +
                +

                ($!) Expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or using -the bg builtin (see Job Control Builtins). +the bg builtin (see Job Control Builtins).

                -
                0
                -
                +
                0
                +

                ($0) Expands to the name of the shell or shell script. This is set at shell initialization. If Bash is invoked with a file of commands -(see Shell Scripts), $0 is set to the name of that file. -If Bash is started with the -c option (see Invoking Bash), -then $0 is set to the first argument after the string to be +(see Shell Scripts), $0 is set to the name of that file. +If Bash is started with the -c option (see Invoking Bash), +then $0 is set to the first argument after the string to be executed, if one is present. Otherwise, it is set to the filename used to invoke Bash, as given by argument zero.

                @@ -2282,25 +2283,27 @@ to the filename used to invoke Bash, as given by argument zero.
                -
                -
                +
                + -

                3.5 Shell Expansions

                - +

                3.5 Shell Expansions

                +

                Expansion is performed on the command line after it has been split into -tokens. There are seven kinds of expansion performed: -

                -
                  -
                • brace expansion -
                • tilde expansion -
                • parameter and variable expansion -
                • command substitution -
                • arithmetic expansion -
                • word splitting -
                • filename expansion +tokens. +Bash performs these expansions: +

                  +
                    +
                  • brace expansion +
                  • tilde expansion +
                  • parameter and variable expansion +
                  • command substitution +
                  • arithmetic expansion +
                  • word splitting +
                  • filename expansion +
                  • quote removal
                  @@ -2309,27 +2312,30 @@ brace expansion; tilde expansion, parameter and variable expansion, arithmetic expansion, and command substitution (done in a left-to-right fashion); word splitting; -and filename expansion. +filename expansion; +and quote removal.

                  On systems that can support it, there is an additional expansion -available: process substitution. +available: process substitution. This is performed at the same time as tilde, parameter, variable, and arithmetic expansion and command substitution.

                  -

                  After these expansions are performed, quote characters present in the -original word are removed unless they have been quoted themselves -(quote removal). See Quote Removal for more details. +

                  Quote removal 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. +See Quote Removal for more details.

                  Only brace expansion, word splitting, and filename expansion can increase the number of words of the expansion; other expansions expand a single word to a single word. The only exceptions to this are the expansions of -"$@" and $* (see Special Parameters), and -"${name[@]}" and ${name[*]} -(see Arrays). +"$@" and $* (see Special Parameters), and +"${name[@]}" and ${name[*]} +(see Arrays).

                  -
                    +
                    -
                    -
                    +
                    + -

                    3.5.1 Brace Expansion

                    - - +

                    3.5.1 Brace Expansion

                    + +

                    Brace expansion is a mechanism by which arbitrary strings may be generated. This mechanism is similar to -filename expansion (see Filename Expansion), +filename expansion (see Filename Expansion), but the filenames generated need not exist. -Patterns to be brace expanded take the form of an optional preamble, +Patterns to be brace expanded take the form of 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 postscript. +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. @@ -2367,24 +2373,22 @@ The results of each expanded string are not sorted; left to right order is preserved. For example,

                    -
                    bash$ echo a{d,c,b}e
                    +
                    bash$ echo a{d,c,b}e
                     ade ace abe
                     
                    -

                    A sequence expression takes the form {x..y[..incr]}, -where x and y are either integers or letters, -and incr, an optional increment, is an integer. +

                    A sequence expression takes the form {x..y[..incr]}, +where x and y are either integers or letters, +and incr, an optional increment, is an integer. When integers are supplied, the expression expands to each number between -x and y, inclusive. -Supplied integers may be prefixed with ‘0’ to force each term to have the -same width. -When either x or y begins with a zero, the shell +x and y, inclusive. +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, +lexicographically between x and y, inclusive, using the default C locale. -Note that both x and y must be of the same type +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. @@ -2400,182 +2404,182 @@ and 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 +

                    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 ‘${’ +To avoid conflicts with parameter expansion, the string ‘${’ is not considered eligible for brace expansion, -and inhibits brace expansion until the closing ‘}’. +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}
                    +
                    mkdir /usr/local/src/bash/{old,new,dist,bugs}
                     

                    or

                    -
                    chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
                    +
                    chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}
                     

                    -
                    -
                    +
                    + -

                    3.5.2 Tilde Expansion

                    - - +

                    3.5.2 Tilde Expansion

                    + + -

                    If a word begins with an unquoted tilde character (‘~’), all of the +

                    If a word begins with an unquoted tilde character (‘~’), all of the characters up to the first unquoted slash (or all characters, -if there is no unquoted slash) are considered a tilde-prefix. +if there is no unquoted slash) are considered a tilde-prefix. If none of the characters in the tilde-prefix are quoted, the characters in the tilde-prefix following the tilde are treated as a -possible login name. +possible login name. If this login name is the null string, the tilde is replaced with the -value of the HOME shell variable. -If HOME is unset, the home directory of the user executing the +value of the HOME shell variable. +If HOME is unset, the home directory of the user executing the shell is substituted instead. Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name.

                    -

                    If the tilde-prefix is ‘~+’, the value of -the shell variable PWD replaces the tilde-prefix. -If the tilde-prefix is ‘~-’, the value of the shell variable -OLDPWD, if it is set, is substituted. +

                    If the tilde-prefix is ‘~+’, the value of +the shell variable PWD replaces the tilde-prefix. +If the tilde-prefix is ‘~-’, the value of the shell variable +OLDPWD, if it is set, is substituted.

                    If the characters following the tilde in the tilde-prefix consist of a -number N, optionally prefixed by a ‘+’ or a ‘-’, +number N, optionally prefixed by a ‘+’ or a ‘-’, the tilde-prefix is replaced with the corresponding element from the directory stack, as it would be displayed -by the dirs builtin invoked with the characters following tilde -in the tilde-prefix as an argument (see The Directory Stack). +by the dirs builtin invoked with the characters following tilde +in the tilde-prefix as an argument (see The Directory Stack). If the tilde-prefix, sans the tilde, consists of a number without a -leading ‘+’ or ‘-’, ‘+’ is assumed. +leading ‘+’ or ‘-’, ‘+’ is assumed.

                    If the login name is invalid, or the tilde expansion fails, the word is left unchanged.

                    Each variable assignment is checked for unquoted tilde-prefixes immediately -following a ‘:’ or the first ‘=’. +following a ‘:’ or the first ‘=’. In these cases, tilde expansion is also performed. Consequently, one may use filenames with tildes in assignments to -PATH, MAILPATH, and CDPATH, +PATH, MAILPATH, and CDPATH, and the shell assigns the expanded value.

                    The following table shows how Bash treats unquoted tilde-prefixes:

                    -
                    -
                    ~
                    -

                    The value of $HOME +

                    +
                    ~
                    +

                    The value of $HOME

                    -
                    ~/foo
                    -

                    $HOME/foo +

                    ~/foo
                    +

                    $HOME/foo

                    -
                    ~fred/foo
                    -

                    The subdirectory foo of the home directory of the user -fred +

                    ~fred/foo
                    +

                    The subdirectory foo of the home directory of the user +fred

                    -
                    ~+/foo
                    -

                    $PWD/foo +

                    ~+/foo
                    +

                    $PWD/foo

                    -
                    ~-/foo
                    -

                    ${OLDPWD-'~-'}/foo +

                    ~-/foo
                    +

                    ${OLDPWD-'~-'}/foo

                    -
                    ~N
                    -

                    The string that would be displayed by ‘dirs +N’ +

                    ~N
                    +

                    The string that would be displayed by ‘dirs +N

                    -
                    ~+N
                    -

                    The string that would be displayed by ‘dirs +N’ +

                    ~+N
                    +

                    The string that would be displayed by ‘dirs +N

                    -
                    ~-N
                    -

                    The string that would be displayed by ‘dirs -N’ +

                    ~-N
                    +

                    The string that would be displayed by ‘dirs -N

                    Bash also performs tilde expansion on words satisfying the conditions of -variable assignments (see Shell Parameters) +variable assignments (see Shell Parameters) when they appear as arguments to simple commands. Bash does not do this, except for the declaration commands listed -above, when in POSIX mode. +above, when in POSIX mode.


                    -
                    -
                    +
                    + -

                    3.5.3 Shell Parameter Expansion

                    - - +

                    3.5.3 Shell Parameter Expansion

                    + + -

                    The ‘$’ character introduces parameter expansion, +

                    The ‘$’ character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name.

                    -

                    When braces are used, the matching ending brace is the first ‘}’ +

                    When braces are used, the matching ending brace is the first ‘}’ not escaped by a backslash or within a quoted string, and not within an embedded arithmetic expansion, command substitution, or parameter expansion.

                    -

                    The basic form of parameter expansion is ${parameter}. -The value of parameter is substituted. -The parameter is a shell parameter as described above -(see Shell Parameters) or an array reference (see Arrays). -The braces are required when parameter +

                    The basic form of parameter expansion is ${parameter}. +The value of parameter is substituted. +The parameter is a shell parameter as described above +(see Shell Parameters) or an array reference (see Arrays). +The braces are required when parameter is a positional parameter with more than one digit, -or when parameter is followed by a character that is not to be +or when parameter is followed by a character that is not to be interpreted as part of its name.

                    -

                    If the first character of parameter is an exclamation point (!), -and parameter is not a nameref, +

                    If the first character of parameter is an exclamation point (!), +and parameter is not a nameref, it introduces a level of indirection. Bash uses the value formed by expanding the rest of -parameter as the new parameter; this is then +parameter as the new parameter; this is then expanded and that value is used in the rest of the expansion, rather -than the expansion of the original parameter. -This is known as indirect expansion. +than the expansion of the original parameter. +This is known as indirect expansion. The value is subject to tilde expansion, parameter expansion, command substitution, and arithmetic expansion. -If parameter is a nameref, this expands to the name of the -variable referenced by parameter instead of performing the +If parameter is a nameref, this expands to the name of the +variable referenced by parameter instead of performing the complete indirect expansion. -The exceptions to this are the expansions of ${!prefix*} -and ${!name[@]} +The exceptions to this are the expansions of ${!prefix*} +and ${!name[@]} described below. The exclamation point must immediately follow the left brace in order to introduce indirection.

                    -

                    In each of the cases below, word is subject to tilde expansion, +

                    In each of the cases below, word is subject to tilde expansion, parameter expansion, command substitution, and arithmetic expansion.

                    When not performing substring expansion, using the forms described -below (e.g., ‘:-’), Bash tests for a parameter that is unset or null. +below (e.g., ‘:-’), Bash tests for a parameter that is unset or null. Omitting the colon results in a test only for a parameter that is unset. Put another way, if the colon is included, -the operator tests for both parameter’s existence and that its value +the operator tests for both parameter’s existence and that its value is not null; if the colon is omitted, the operator tests only for existence.

                    -
                    -
                    ${parameter:-word}
                    -

                    If parameter is unset or null, the expansion of -word is substituted. Otherwise, the value of -parameter is substituted. +

                    +
                    ${parameter:−word}
                    +

                    If parameter is unset or null, the expansion of +word is substituted. Otherwise, the value of +parameter is substituted.

                    -
                    $ v=123
                    +
                    $ v=123
                     $ echo ${v-unset}
                     123
                     $ echo ${v:-unset-or-null}
                    @@ -2589,73 +2593,73 @@ unset-or-null
                     
                    -
                    ${parameter:=word}
                    -

                    If parameter -is unset or null, the expansion of word -is assigned to parameter. -The value of parameter is then substituted. +

                    ${parameter:=word}
                    +

                    If parameter +is unset or null, the expansion of word +is assigned to parameter. +The value of parameter is then substituted. Positional parameters and special parameters may not be assigned to in this way.

                    -
                    $ var=
                    +
                    $ var=
                     $ : ${var:=DEFAULT}
                     $ echo $var
                     DEFAULT
                     
                    -
                    ${parameter:?word}
                    -

                    If parameter -is null or unset, the expansion of word (or a message -to that effect if word +

                    ${parameter:?word}
                    +

                    If parameter +is null or unset, the expansion of word (or a message +to that effect if word is not present) is written to the standard error and the shell, if it -is not interactive, exits. Otherwise, the value of parameter is +is not interactive, exits. Otherwise, the value of parameter is substituted.

                    -
                    $ var=
                    +
                    $ var=
                     $ : ${var:?var is unset or null}
                     bash: var: var is unset or null
                     
                    -
                    ${parameter:+word}
                    -

                    If parameter +

                    ${parameter:+word}
                    +

                    If parameter is null or unset, nothing is substituted, otherwise the expansion of -word is substituted. +word is substituted.

                    -
                    $ var=123
                    +
                    $ var=123
                     $ echo ${var:+var is set and not null}
                     var is set and not null
                     
                    -
                    ${parameter:offset}
                    -
                    ${parameter:offset:length}
                    +
                    ${parameter:offset}
                    +
                    ${parameter:offset:length}

                    This is referred to as Substring Expansion. -It expands to up to length characters of the value of parameter -starting at the character specified by offset. -If parameter is ‘@’ or ‘*’, an indexed array subscripted by -‘@’ or ‘*’, or an associative array name, the results differ as +It expands to up to length characters of the value of parameter +starting at the character specified by offset. +If parameter is ‘@’ or ‘*’, an indexed array subscripted by +‘@’ or ‘*’, or an associative array name, the results differ as described below. -If length is omitted, it expands to the substring of the value of -parameter starting at the character specified by offset +If length is omitted, it expands to the substring of the value of +parameter starting at the character specified by offset and extending to the end of the value. -length and offset are arithmetic expressions -(see Shell Arithmetic). +length and offset are arithmetic expressions +(see Shell Arithmetic).

                    -

                    If offset evaluates to a number less than zero, the value +

                    If offset evaluates to a number less than zero, the value is used as an offset in characters -from the end of the value of parameter. -If length evaluates to a number less than zero, +from the end of the value of parameter. +If length evaluates to a number less than zero, it is interpreted as an offset in characters -from the end of the value of parameter rather than +from the end of the value of parameter rather than a number of characters, and the expansion is the characters between -offset and that result. +offset and that result. Note that a negative offset must be separated from the colon by at least -one space to avoid being confused with the ‘:-’ expansion. +one space to avoid being confused with the ‘:-’ expansion.

                    Here are some examples illustrating substring expansion on parameters and subscripted arrays: @@ -2712,12 +2716,12 @@ bc $ echo ${array[0]: -7:-2} bcdef

              -

              If parameter is ‘@’ or ‘*’, the result is length -positional parameters beginning at offset. -A negative offset is taken relative to one greater than the greatest +

              If parameter is ‘@’ or ‘*’, the result is length +positional parameters beginning at offset. +A negative offset is taken relative to one greater than the greatest positional parameter, so an offset of -1 evaluates to the last positional parameter (or 0 if there are no positional parameters). -It is an expansion error if length evaluates to a number less than zero. +It is an expansion error if length evaluates to a number less than zero.

              The following examples illustrate substring expansion using positional parameters: @@ -2740,12 +2744,12 @@ $ echo ${@:0:2} $ echo ${@: -7:0} -

              If parameter is an indexed array name subscripted -by ‘@’ or ‘*’, the result is the length -members of the array beginning with ${parameter[offset]}. -A negative offset is taken relative to one greater than the maximum +

              If parameter is an indexed array name subscripted +by ‘@’ or ‘*’, the result is the length +members of the array beginning with ${parameter[offset]}. +A negative offset is taken relative to one greater than the maximum index of the specified array. -It is an expansion error if length evaluates to a number less than zero. +It is an expansion error if length evaluates to a number less than zero.

              These examples show how you can use substring expansion with indexed arrays: @@ -2771,128 +2775,128 @@ results.

              Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1 by default. -If offset is 0, and the positional parameters are used, $0 is +If offset is 0, and the positional parameters are used, $0 is prefixed to the list.

              -
              ${!prefix*}
              -
              ${!prefix@}
              -

              Expands to the names of variables whose names begin with prefix, -separated by the first character of the IFS special variable. -When ‘@’ is used and the expansion appears within double quotes, each +

              ${!prefix*}
              +
              ${!prefix@}
              +

              Expands to the names of variables whose names begin with prefix, +separated by the first character of the IFS special variable. +When ‘@’ is used and the expansion appears within double quotes, each variable name expands to a separate word.

              -
              ${!name[@]}
              -
              ${!name[*]}
              -

              If name is an array variable, expands to the list of array indices -(keys) assigned in name. -If name is not an array, expands to 0 if name is set and null +

              ${!name[@]}
              +
              ${!name[*]}
              +

              If name is an array variable, expands to the list of array indices +(keys) assigned in name. +If name is not an array, expands to 0 if name is set and null otherwise. -When ‘@’ is used and the expansion appears within double quotes, each +When ‘@’ is used and the expansion appears within double quotes, each key expands to a separate word.

              -
              ${#parameter}
              -

              The length in characters of the expanded value of parameter is +

              ${#parameter}
              +

              The length in characters of the expanded value of parameter is substituted. -If parameter is ‘*’ or ‘@’, the value substituted +If parameter is ‘*’ or ‘@’, the value substituted is the number of positional parameters. -If parameter is an array name subscripted by ‘*’ or ‘@’, +If parameter is an array name subscripted by ‘*’ or ‘@’, the value substituted is the number of elements in the array. -If parameter +If parameter is an indexed array name subscripted by a negative number, that number is interpreted as relative to one greater than the maximum index of -parameter, so negative indices count back from the end of the +parameter, so negative indices count back from the end of the array, and an index of -1 references the last element.

              -
              ${parameter#word}
              -
              ${parameter##word}
              -

              The word +

              ${parameter#word}
              +
              ${parameter##word}
              +

              The word is expanded to produce a pattern and matched according to the rules -described below (see Pattern Matching). If the pattern matches -the beginning of the expanded value of parameter, -then the result of the expansion is the expanded value of parameter -with the shortest matching pattern (the ‘#’ case) or the -longest matching pattern (the ‘##’ case) deleted. -If parameter is ‘@’ or ‘*’, +described below (see Pattern Matching). If the pattern matches +the beginning of the expanded value of parameter, +then the result of the expansion is the expanded value of parameter +with the shortest matching pattern (the ‘#’ case) or the +longest matching pattern (the ‘##’ case) deleted. +If parameter is ‘@’ or ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. -If parameter is an array variable subscripted with -‘@’ or ‘*’, +If parameter is an array variable subscripted with +‘@’ or ‘*’, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.

              -
              ${parameter%word}
              -
              ${parameter%%word}
              -

              The word +

              ${parameter%word}
              +
              ${parameter%%word}
              +

              The word is expanded to produce a pattern and matched according to the rules -described below (see Pattern Matching). +described below (see Pattern Matching). If the pattern matches a trailing portion of the expanded value of -parameter, then the result of the expansion is the value of -parameter with the shortest matching pattern (the ‘%’ case) -or the longest matching pattern (the ‘%%’ case) deleted. -If parameter is ‘@’ or ‘*’, +parameter, then the result of the expansion is the value of +parameter with the shortest matching pattern (the ‘%’ case) +or the longest matching pattern (the ‘%%’ case) deleted. +If parameter is ‘@’ or ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. -If parameter -is an array variable subscripted with ‘@’ or ‘*’, +If parameter +is an array variable subscripted with ‘@’ or ‘*’, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.

              -
              ${parameter/pattern/string}
              -
              ${parameter//pattern/string}
              -
              ${parameter/#pattern/string}
              -
              ${parameter/%pattern/string}
              -

              The pattern is expanded to produce a pattern just as in +

              ${parameter/pattern/string}
              +
              ${parameter//pattern/string}
              +
              ${parameter/#pattern/string}
              +
              ${parameter/%pattern/string}
              +

              The pattern is expanded to produce a pattern just as in filename expansion. -Parameter is expanded and the longest match of pattern -against its value is replaced with string. -string undergoes tilde expansion, parameter and variable expansion, +Parameter is expanded and the longest match of pattern +against its value is replaced with string. +string undergoes tilde expansion, parameter and variable expansion, arithmetic expansion, command and process substitution, and quote removal. The match is performed according to the rules described below -(see Pattern Matching). +(see Pattern Matching).

              In the first form above, only the first match is replaced. -If there are two slashes separating parameter and pattern -(the second form above), all matches of pattern are -replaced with string. -If pattern is preceded by ‘#’ (the third form above), -it must match at the beginning of the expanded value of parameter. -If pattern is preceded by ‘%’ (the fourth form above), -it must match at the end of the expanded value of parameter. -If the expansion of string is null, -matches of pattern are deleted. -If string is null, -matches of pattern are deleted -and the ‘/’ following pattern may be omitted. -

              -

              If the patsub_replacement shell option is enabled using shopt, -any unquoted instances of ‘&’ in string are replaced with the -matching portion of pattern. -This is intended to duplicate a common sed idiom. -

              -

              Quoting any part of string inhibits replacement in the +If there are two slashes separating parameter and pattern +(the second form above), all matches of pattern are +replaced with string. +If pattern is preceded by ‘#’ (the third form above), +it must match at the beginning of the expanded value of parameter. +If pattern is preceded by ‘%’ (the fourth form above), +it must match at the end of the expanded value of parameter. +If the expansion of string is null, +matches of pattern are deleted. +If string is null, +matches of pattern are deleted +and the ‘/’ following pattern may be omitted. +

              +

              If the patsub_replacement shell option is enabled using shopt, +any unquoted instances of ‘&’ in string are replaced with the +matching portion of pattern. +This is intended to duplicate a common sed idiom. +

              +

              Quoting any part of string inhibits replacement in the expansion of the quoted portion, including replacement strings stored in shell variables. -Backslash will escape ‘&’ in string; the backslash is removed -in order to permit a literal ‘&’ in the replacement string. -Users should take care if string is double-quoted to avoid +Backslash will escape ‘&’ in string; the backslash is removed +in order to permit a literal ‘&’ in the replacement string. +Users should take care if string is double-quoted to avoid unwanted interactions between the backslash and double-quoting, since backslash has special meaning within double quotes. -Pattern substitution performs the check for unquoted ‘&’ after -expanding string, -so users should ensure to properly quote any occurrences of ‘&’ +Pattern substitution performs the check for unquoted ‘&’ after +expanding string, +so users should ensure to properly quote any occurrences of ‘&’ they want to be taken literally in the replacement -and ensure any instances of ‘&’ they want to be replaced are unquoted. +and ensure any instances of ‘&’ they want to be replaced are unquoted.

              For instance,

              -
              var=abcdef
              +
              var=abcdef
               rep='& '
               echo ${var/abc/& }
               echo "${var/abc/& }"
              @@ -2903,7 +2907,7 @@ echo "${var/abc/$rep}"
               

              will display four lines of "abc def", while

              -
              var=abcdef
              +
              var=abcdef
               rep='& '
               echo ${var/abc/\& }
               echo "${var/abc/\& }"
              @@ -2918,121 +2922,121 @@ enclosing the entire parameter substitution do not, since
               the expansion is performed in a
               context that doesn’t take any enclosing double quotes into account.
               

              -

              Since backslash can escape ‘&’, it can also escape a backslash in +

              Since backslash can escape ‘&’, it can also escape a backslash in the replacement string. -This means that ‘\\’ will insert a literal -backslash into the replacement, so these two echo commands +This means that ‘\\’ will insert a literal +backslash into the replacement, so these two echo commands

              -
              var=abcdef
              +
              var=abcdef
               rep='\\&xyz'
               echo ${var/abc/\\&xyz}
               echo ${var/abc/$rep}
               
              -

              will both output ‘\abcxyzdef’. +

              will both output ‘\abcxyzdef’.

              -

              It should rarely be necessary to enclose only string in double +

              It should rarely be necessary to enclose only string in double quotes.

              -

              If the nocasematch shell option -(see the description of shopt in The Shopt Builtin) +

              If the nocasematch shell option +(see the description of shopt in The Shopt Builtin) is enabled, the match is performed without regard to the case of alphabetic characters. -If parameter is ‘@’ or ‘*’, +If parameter is ‘@’ or ‘*’, the substitution operation is applied to each positional parameter in turn, and the expansion is the resultant list. -If parameter -is an array variable subscripted with ‘@’ or ‘*’, +If parameter +is an array variable subscripted with ‘@’ or ‘*’, the substitution operation is applied to each member of the array in turn, and the expansion is the resultant list.

              -
              ${parameter^pattern}
              -
              ${parameter^^pattern}
              -
              ${parameter,pattern}
              -
              ${parameter,,pattern}
              -

              This expansion modifies the case of alphabetic characters in parameter. -The pattern is expanded to produce a pattern just as in +

              ${parameter^pattern}
              +
              ${parameter^^pattern}
              +
              ${parameter,pattern}
              +
              ${parameter,,pattern}
              +

              This expansion modifies the case of alphabetic characters in parameter. +The pattern is expanded to produce a pattern just as in filename expansion. -Each character in the expanded value of parameter is tested against -pattern, and, if it matches the pattern, its case is converted. +Each character in the expanded value of parameter is tested against +pattern, and, if it matches the pattern, its case is converted. The pattern should not attempt to match more than one character.

              -

              The ‘^’ operator converts lowercase letters matching pattern -to uppercase; the ‘,’ operator converts matching uppercase letters +

              The ‘^’ operator converts lowercase letters matching pattern +to uppercase; the ‘,’ operator converts matching uppercase letters to lowercase. -The ‘^^’ and ‘,,’ expansions convert each matched character in the -expanded value; the ‘^’ and ‘,’ expansions match and convert only +The ‘^^’ and ‘,,’ expansions convert each matched character in the +expanded value; the ‘^’ and ‘,’ expansions match and convert only the first character in the expanded value. -If pattern is omitted, it is treated like a ‘?’, which matches +If pattern is omitted, it is treated like a ‘?’, which matches every character.

              -

              If parameter is ‘@’ or ‘*’, +

              If parameter is ‘@’ or ‘*’, the case modification operation is applied to each positional parameter in turn, and the expansion is the resultant list. -If parameter -is an array variable subscripted with ‘@’ or ‘*’, +If parameter +is an array variable subscripted with ‘@’ or ‘*’, the case modification operation is applied to each member of the array in turn, and the expansion is the resultant list.

              -
              ${parameter@operator}
              -

              The expansion is either a transformation of the value of parameter -or information about parameter itself, depending on the value of -operator. Each operator is a single letter: +

              ${parameter@operator}
              +

              The expansion is either a transformation of the value of parameter +or information about parameter itself, depending on the value of +operator. Each operator is a single letter:

              -
              -
              U
              -

              The expansion is a string that is the value of parameter with lowercase +

              +
              U
              +

              The expansion is a string that is the value of parameter with lowercase alphabetic characters converted to uppercase.

              -
              u
              -

              The expansion is a string that is the value of parameter with the first +

              u
              +

              The expansion is a string that is the value of parameter with the first character converted to uppercase, if it is alphabetic.

              -
              L
              -

              The expansion is a string that is the value of parameter with uppercase +

              L
              +

              The expansion is a string that is the value of parameter with uppercase alphabetic characters converted to lowercase.

              -
              Q
              -

              The expansion is a string that is the value of parameter quoted in a +

              Q
              +

              The expansion is a string that is the value of parameter quoted in a format that can be reused as input.

              -
              E
              -

              The expansion is a string that is the value of parameter with backslash -escape sequences expanded as with the $'…' quoting mechanism. +

              E
              +

              The expansion is a string that is the value of parameter with backslash +escape sequences expanded as with the $'…' quoting mechanism.

              -
              P
              +
              P

              The expansion is a string that is the result of expanding the value of -parameter as if it were a prompt string (see Controlling the Prompt). +parameter as if it were a prompt string (see Controlling the Prompt).

              -
              A
              +
              A

              The expansion is a string in the form of -an assignment statement or declare command that, if -evaluated, will recreate parameter with its attributes and value. +an assignment statement or declare command that, if +evaluated, will recreate parameter with its attributes and value.

              -
              K
              -

              Produces a possibly-quoted version of the value of parameter, +

              K
              +

              Produces a possibly-quoted version of the value of parameter, except that it prints the values of indexed and associative arrays as a sequence of quoted key-value pairs -(see Arrays). +(see Arrays).

              -
              a
              +
              a

              The expansion is a string consisting of flag values representing -parameter’s attributes. +parameter’s attributes.

              -
              k
              -

              Like the ‘K’ transformation, but expands the keys and values of +

              k
              +

              Like the ‘K’ transformation, but expands the keys and values of indexed and associative arrays to separate words after word splitting.

              -

              If parameter is ‘@’ or ‘*’, +

              If parameter is ‘@’ or ‘*’, the operation is applied to each positional parameter in turn, and the expansion is the resultant list. -If parameter -is an array variable subscripted with ‘@’ or ‘*’, +If parameter +is an array variable subscripted with ‘@’ or ‘*’, the operation is applied to each member of the array in turn, and the expansion is the resultant list.

              @@ -3043,101 +3047,101 @@ expansion as described below.
              -
              -
              +
              + -

              3.5.4 Command Substitution

              - +

              3.5.4 Command Substitution

              +

              Command substitution allows the output of a command to replace the command itself. The standard form of command substitution occurs when a command is enclosed as follows:

              -
              $(command)
              +
              $(command)
               

              or (deprecated)

              -
              `command`.
              +
              `command`.
               
              -

              Bash performs command substitution by executing command in a subshell +

              Bash performs command substitution by executing command in a subshell environment and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. -The command substitution $(cat file) can be -replaced by the equivalent but faster $(< file). +The command substitution $(cat file) can be +replaced by the equivalent but faster $(< file).

              With the old-style backquote form of substitution, backslash retains its literal meaning except when followed by -‘$’, ‘`’, or ‘\’. +‘$’, ‘`’, or ‘\’. The first backquote not preceded by a backslash terminates the command substitution. -When using the $(command) form, all characters between +When using the $(command) form, all characters between the parentheses make up the command; none are treated specially.

              There is an alternate form of command substitution:

              -
              ${c command; }
              +
              ${c command; }
               
              -

              which executes command in the current execution environment +

              which executes command in the current execution environment and captures its output, again with trailing newlines removed.

              -

              The character c following the open brace must be a space, tab, -newline, or ‘|’, and the close brace must be in a position +

              The character c following the open brace must be a space, tab, +newline, or ‘|’, and the close brace must be in a position where a reserved word may appear (i.e., preceded by a command terminator such as semicolon). Bash allows the close brace to be joined to the remaining characters in the word without being followed by a shell metacharacter as a reserved word would usually require.

              -

              Any side effects of command take effect immediately +

              Any side effects of command take effect immediately in the current execution environment and persist in the current -environment after the command completes (e.g., the exit builtin +environment after the command completes (e.g., the exit builtin will exit the shell).

              This type of command substitution superficially resembles executing an unnamed shell function: local variables are created as when a shell -function is executing, and the return builtin forces -command to complete; +function is executing, and the return builtin forces +command to complete; however, the rest of the execution environment, including the positional parameters, is shared with the caller.

              If the first character following the open brace -is a ‘|’, the construct expands to the -value of the REPLY shell variable after command executes, +is a ‘|’, the construct expands to the +value of the REPLY shell variable after command executes, without removing any trailing newlines, -and the standard output of command remains the same as in the +and the standard output of command remains the same as in the calling shell. -Bash creates REPLY as an initially-unset local variable when -command executes, and restores REPLY to the value it had -before the command substitution after command completes, +Bash creates REPLY as an initially-unset local variable when +command executes, and restores REPLY to the value it had +before the command substitution after command completes, as with any local variable.

              -

              For example, this construct expands to ‘12345’, and leaves the -shell variable X unchanged in the current execution environment: +

              For example, this construct expands to ‘12345’, and leaves the +shell variable X unchanged in the current execution environment:

              -
              +
               
               ${ local X=12345 ; echo $X; }
               
              -

              (not declaring X as local would modify its value in the current +

              (not declaring X as local would modify its value in the current environment, as with normal shell function execution), while this construct does not require any output to expand to -‘12345’: +‘12345’:

              -
              ${| REPLY=12345; }
              +
              ${| REPLY=12345; }
               
              -

              and restores REPLY to the value it had before the command substitution. +

              and restores REPLY to the value it had before the command substitution.

              Command substitutions may be nested. To nest when using the backquoted form, escape the inner backquotes with backslashes. @@ -3147,25 +3151,25 @@ word splitting and filename expansion on the results.


              -
              -
              +
              + -

              3.5.5 Arithmetic Expansion

              - - +

              3.5.5 Arithmetic Expansion

              + +

              Arithmetic expansion allows the evaluation of an arithmetic expression and the substitution of the result. The format for arithmetic expansion is:

              -
              $(( expression ))
              +
              $(( expression ))
               
              -

              The expression undergoes the same expansions +

              The expression undergoes the same expansions as if it were within double quotes, -but double quote characters in expression are not treated specially +but double quote characters in expression are not treated specially and are removed. All tokens in the expression undergo parameter and variable expansion, command substitution, and quote removal. @@ -3173,44 +3177,44 @@ The result is treated as the arithmetic expression to be evaluated. Arithmetic expansions may be nested.

              The evaluation is performed according to the rules listed below -(see Shell Arithmetic). +(see Shell Arithmetic). If the expression is invalid, Bash prints a message indicating failure to the standard error and no substitution occurs.


              -
              -
              +
              + -

              3.5.6 Process Substitution

              - +

              3.5.6 Process Substitution

              +

              Process substitution allows a process’s input or output to be referred to using a filename. It takes the form of

              -
              <(list)
              +
              <(list)
               

              or

              -
              >(list)
              +
              >(list)
               
              -

              The process list is run asynchronously, and its input or output +

              The process list is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current command as the result of the expansion. -If the >(list) form is used, writing to -the file will provide input for list. If the -<(list) form is used, the file passed as an -argument should be read to obtain the output of list. -Note that no space may appear between the < or > +If the >(list) form is used, writing to +the file will provide input for list. If the +<(list) form is used, the file passed as an +argument should be read to obtain the output of list. +Note that no space may appear between the < or > and the left parenthesis, otherwise the construct would be interpreted 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 simultaneously with parameter and variable expansion, command substitution, and arithmetic @@ -3218,43 +3222,43 @@ expansion.


              -
              -
              +
              + -

              3.5.7 Word Splitting

              - +

              3.5.7 Word Splitting

              +

              The shell scans the results of parameter expansion, command substitution, and arithmetic expansion that did not occur within double quotes for word splitting.

              -

              The shell treats each character of $IFS as a delimiter, and splits +

              The shell treats each character of $IFS as a delimiter, and splits the results of the other expansions into words using these characters as field terminators.

              -

              If IFS is unset, or its value is exactly <space><tab><newline>, +

              If IFS is unset, or its value is exactly <space><tab><newline>, the default, then sequences of -space, tab, and newline +space, tab, and newline at the beginning and end of the results of the previous -expansions are ignored, and any sequence of IFS +expansions are ignored, and any sequence of IFS characters not at the beginning or end serves to delimit words. -If IFS has a value other than the default, then sequences of -the whitespace characters space, tab, and newline +If IFS has a value other than the default, then sequences of +the whitespace characters space, tab, and newline are ignored at the beginning and end of the word, as long as the whitespace character is in the -value of IFS (an IFS whitespace character). -Any character in IFS that is not IFS -whitespace, along with any adjacent IFS -whitespace characters, delimits a field. A sequence of IFS +value of IFS (an IFS whitespace character). +Any character in IFS that is not IFS +whitespace, along with any adjacent IFS +whitespace characters, delimits a field. A sequence of IFS whitespace characters is also treated as a delimiter.

              -

              If the value of IFS is null, no word splitting occurs. -If IFS is unset, word splitting behaves as if it contained -the default value <space><tab><newline>. +

              If the value of IFS is null, no word splitting occurs. +If IFS is unset, word splitting behaves as if it contained +the default value <space><tab><newline>.

              -

              Explicit null arguments ("" or '') are retained +

              Explicit null arguments ("" or '') are retained and passed to commands as empty strings. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. @@ -3264,7 +3268,7 @@ and passed to a command as an empty string. When a quoted null argument appears as part of a word whose expansion is non-null, the null argument is removed. That is, the word --d'' becomes -d after word splitting and +-d'' becomes -d after word splitting and null argument removal.

              Note that if no expansion occurs, no splitting @@ -3272,209 +3276,209 @@ is performed.


              -
              -
              +
              + -

              3.5.8 Filename Expansion

              - - - - +

              3.5.8 Filename Expansion

              + + + + -

              After word splitting, unless the -f option has been set -(see The Set Builtin), Bash scans each word for the characters -‘*’, ‘?’, and ‘[’. +

              After word splitting, unless the -f option has been set +(see The Set Builtin), Bash scans each word for the characters +‘*’, ‘?’, and ‘[’. If one of these characters appears, and is not quoted, then the word is -regarded as a pattern, +regarded as a pattern, and replaced with an alphabetically sorted list of -filenames matching the pattern (see Pattern Matching). +filenames matching the pattern (see Pattern Matching). If no matching filenames are found, -and the shell option nullglob is disabled, the word is left +and the shell option nullglob is disabled, the word is left unchanged. -If the nullglob option is set, and no matches are found, the word +If the nullglob option is set, and no matches are found, the word is removed. -If the failglob shell option is set, and no matches are found, +If the failglob shell option is set, and no matches are found, an error message is printed and the command is not executed. -If the shell option nocaseglob is enabled, the match is performed +If the shell option nocaseglob is enabled, the match is performed without regard to the case of alphabetic characters.

              -

              When a pattern is used for filename expansion, the character ‘.’ +

              When a pattern is used for filename expansion, the character ‘.’ at the start of a filename or immediately following a slash -must be matched explicitly, unless the shell option dotglob is set. -In order to match the filenames ‘.’ and ‘..’, -the pattern must begin with ‘.’ (for example, ‘.?’), -even if dotglob is set. -If the globskipdots shell option is enabled, the filenames -‘.’ and ‘..’ are never matched, even if the pattern begins -with a ‘.’. -When not matching filenames, the ‘.’ character is not treated specially. +must be matched explicitly, unless the shell option dotglob is set. +In order to match the filenames ‘.’ and ‘..’, +the pattern must begin with ‘.’ (for example, ‘.?’), +even if dotglob is set. +If the globskipdots shell option is enabled, the filenames +‘.’ and ‘..’ never match, even if the pattern begins +with a ‘.’. +When not matching filenames, the ‘.’ character is not treated specially.

              When matching a filename, the slash character must always be matched explicitly by a slash in the pattern, but in other matching contexts it can be matched by a special pattern character as described -below (see Pattern Matching). +below (see Pattern Matching).

              -

              See the description of shopt in The Shopt Builtin, -for a description of the nocaseglob, nullglob, -globskipdots, -failglob, and dotglob options. +

              See the description of shopt in The Shopt Builtin, +for a description of the nocaseglob, nullglob, +globskipdots, +failglob, and dotglob options.

              -

              The GLOBIGNORE +

              The GLOBIGNORE shell variable may be used to restrict the set of file names matching a -pattern. If GLOBIGNORE +pattern. If GLOBIGNORE is set, each matching file name that also matches one of the patterns in -GLOBIGNORE is removed from the list of matches. -If the nocaseglob option is set, the matching against the patterns in -GLOBIGNORE is performed without regard to case. +GLOBIGNORE is removed from the list of matches. +If the nocaseglob option is set, the matching against the patterns in +GLOBIGNORE is performed without regard to case. The filenames -. and .. -are always ignored when GLOBIGNORE +. and .. +are always ignored when GLOBIGNORE is set and not null. -However, setting GLOBIGNORE to a non-null value has the effect of -enabling the dotglob +However, setting GLOBIGNORE to a non-null value has the effect of +enabling the dotglob shell option, so all other filenames beginning with a -‘.’ will match. +‘.’ will match. To get the old behavior of ignoring filenames beginning with a -‘.’, make ‘.*’ one of the patterns in GLOBIGNORE. -The dotglob option is disabled when GLOBIGNORE +‘.’, make ‘.*’ one of the patterns in GLOBIGNORE. +The dotglob option is disabled when GLOBIGNORE is unset.

              After the pattern is expanded and matched against filenames, the value of the -GLOBSORT variable controls how the results are sorted, as described -below (see Bash Variables). +GLOBSORT variable controls how the results are sorted, as described +below (see Bash Variables).

              -
                +
                -
                -
                +
                + -

                3.5.8.1 Pattern Matching

                - - +

                3.5.8.1 Pattern Matching

                + +

                Any character that appears in a pattern, other than the special pattern characters described below, matches itself. -The NUL character may not occur in a pattern. +The NUL character may not occur in a pattern. A backslash escapes the following character; the escaping backslash is discarded when matching. The special pattern characters must be quoted if they are to be matched literally.

                The special pattern characters have the following meanings: -

                -
                *
                +

                +
                *

                Matches any string, including the null string. -When the globstar shell option is enabled, and ‘*’ is used in -a filename expansion context, two adjacent ‘*’s used as a single +When the globstar shell option is enabled, and ‘*’ is used in +a filename expansion context, two adjacent ‘*’s used as a single pattern will match all files and zero or more directories and subdirectories. -If followed by a ‘/’, two adjacent ‘*’s will match only +If followed by a ‘/’, two adjacent ‘*’s will match only directories and subdirectories.

                -
                ?
                +
                ?

                Matches any single character.

                -
                […]
                -

                Matches any one of the enclosed characters. A pair of characters -separated by a hyphen denotes a range expression; +

                […]
                +

                Matches any one of the enclosed characters. +A pair of characters separated by a hyphen denotes a range expression; any character that falls between those two characters, inclusive, using the current locale’s collating sequence and character set, is matched. If the first character following the -‘[’ is a ‘!’ or a ‘^’ -then any character not enclosed is matched. A ‘-’ +‘[’ is a ‘!’ or a ‘^’ +then any character not enclosed is matched. A ‘’ may be matched by including it as the first or last character -in the set. A ‘]’ may be matched by including it as the first +in the set. A ‘]’ may be matched by including it as the first character in the set. The sorting order of characters in range expressions, and the characters included in the range, are determined by the current locale and the values of the -LC_COLLATE and LC_ALL shell variables, if set. +LC_COLLATE and LC_ALL shell variables, if set.

                -

                For example, in the default C locale, ‘[a-dx-z]’ is equivalent to -‘[abcdxyz]’. Many locales sort characters in dictionary order, and in -these locales ‘[a-dx-z]’ is typically not equivalent to ‘[abcdxyz]’; -it might be equivalent to ‘[aBbCcDdxYyZz]’, for example. To obtain +

                For example, in the default C locale, ‘[a-dx-z]’ is equivalent to +‘[abcdxyz]’. Many locales sort characters in dictionary order, and in +these locales ‘[a-dx-z]’ is typically not equivalent to ‘[abcdxyz]’; +it might be equivalent to ‘[aBbCcDdxYyZz]’, for example. To obtain the traditional interpretation of ranges in bracket expressions, you can -force the use of the C locale by setting the LC_COLLATE or -LC_ALL environment variable to the value ‘C’, or enable the -globasciiranges shell option. +force the use of the C locale by setting the LC_COLLATE or +LC_ALL environment variable to the value ‘C’, or enable the +globasciiranges shell option.

                -

                Within ‘[’ and ‘]’, character classes can be specified +

                Within ‘[’ and ‘]’, character classes can be specified using the syntax -[:class:], where class is one of the -following classes defined in the POSIX standard: +[:class:], where class is one of the +following classes defined in the POSIX standard:

                -
                alnum   alpha   ascii   blank   cntrl   digit   graph   lower
                +
                alnum   alpha   ascii   blank   cntrl   digit   graph   lower
                 print   punct   space   upper   word    xdigit
                 

                A character class matches any character belonging to that class. -The word character class matches letters, digits, and the character -‘_’. +The word character class matches letters, digits, and the character +‘_’.

                -

                Within ‘[’ and ‘]’, an equivalence class can be -specified using the syntax [=c=], which +

                Within ‘[’ and ‘]’, an equivalence class can be +specified using the syntax [=c=], which matches all characters with the same collation weight (as defined -by the current locale) as the character c. +by the current locale) as the character c.

                -

                Within ‘[’ and ‘]’, the syntax [.symbol.] -matches the collating symbol symbol. +

                Within ‘[’ and ‘]’, the syntax [.symbol.] +matches the collating symbol symbol.

                -

                If the extglob shell option is enabled using the shopt +

                If the extglob shell option is enabled using the shopt builtin, the shell recognizes several extended pattern matching operators. -In the following description, a pattern-list is a list of one -or more patterns separated by a ‘|’. -When matching filenames, the dotglob shell option determines +In the following description, a pattern-list is a list of one +or more patterns separated by a ‘|’. +When matching filenames, the dotglob shell option determines the set of filenames that are tested, as described above. Composite patterns may be formed using one or more of the following sub-patterns:

                -
                -
                ?(pattern-list)
                +
                +
                ?(pattern-list)

                Matches zero or one occurrence of the given patterns.

                -
                *(pattern-list)
                +
                *(pattern-list)

                Matches zero or more occurrences of the given patterns.

                -
                +(pattern-list)
                +
                +(pattern-list)

                Matches one or more occurrences of the given patterns.

                -
                @(pattern-list)
                +
                @(pattern-list)

                Matches one of the given patterns.

                -
                !(pattern-list)
                +
                !(pattern-list)

                Matches anything except one of the given patterns.

                -

                The extglob option changes the behavior of the parser, since the +

                The extglob option changes the behavior of the parser, since the parentheses are normally treated as operators with syntactic meaning. To ensure that extended matching patterns are parsed correctly, make sure -that extglob is enabled before parsing constructs containing the +that extglob is enabled before parsing constructs containing the patterns, including shell functions and command substitutions.

                -

                When matching filenames, the dotglob shell option determines +

                When matching filenames, the dotglob shell option determines the set of filenames that are tested: -when dotglob is enabled, the set of filenames includes all files -beginning with ‘.’, but the filenames -‘.’ and ‘..’ must be matched by a +when dotglob is enabled, the set of filenames includes all files +beginning with ‘.’, but the filenames +‘.’ and ‘..’ must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames beginning with “.” unless the pattern -or sub-pattern begins with a ‘.’. -As above, ‘.’ only has a special meaning when matching filenames. +or sub-pattern begins with a ‘.’. +As above, ‘.’ only has a special meaning when matching filenames.

                Complicated extended pattern matching against long strings is slow, especially when the patterns contain alternations and the strings @@ -3485,32 +3489,32 @@ strings instead of a single long string, may be faster.


                -
                -
                +
                + -

                3.5.9 Quote Removal

                +

                3.5.9 Quote Removal

                After the preceding expansions, all unquoted occurrences of the -characters ‘\’, ‘'’, and ‘"’ that did not +characters ‘\’, ‘'’, and ‘"’ that did not result from one of the above expansions are removed.


                -
                -
                +
                + -

                3.6 Redirections

                - +

                3.6 Redirections

                +

                Before a command is executed, its input and output -may be redirected +may be redirected using a special notation interpreted by the shell. -Redirection allows commands’ file handles to be +Redirection allows commands’ file handles to be duplicated, opened, closed, made to refer to different files, and can change the files the command reads from and writes to. @@ -3522,23 +3526,23 @@ Redirections are processed in the order they appear, from left to right.

                Each redirection that may be preceded by a file descriptor number -may instead be preceded by a word of the form {varname}. +may instead be preceded by a word of the form {varname}. In this case, for each redirection operator except >&- and <&-, the shell will allocate a file descriptor greater -than 10 and assign it to {varname}. If >&- or <&- is preceded -by {varname}, the value of varname defines the file +than 10 and assign it to {varname}. If >&- or <&- is preceded +by {varname}, the value of varname defines the file descriptor to close. -If {varname} is supplied, the redirection persists beyond +If {varname} is supplied, the redirection persists beyond the scope of the command, allowing the shell programmer to manage the file descriptor’s lifetime manually. -The varredir_close shell option manages this behavior -(see The Shopt Builtin). +The varredir_close shell option manages this behavior +(see The Shopt Builtin).

                In the following descriptions, if the file descriptor number is omitted, and the first character of the redirection operator is -‘<’, the redirection refers to the standard input (file +‘<’, the redirection refers to the standard input (file descriptor 0). If the first character of the redirection operator -is ‘>’, the redirection refers to the standard output (file +is ‘>’, the redirection refers to the standard output (file descriptor 1).

                The word following the redirection operator in the following @@ -3550,16 +3554,16 @@ If it expands to more than one word, Bash reports an error.

                Note that the order of redirections is significant. For example, the command

                -
                ls > dirlist 2>&1
                +
                ls > dirlist 2>&1
                 

                directs both standard output (file descriptor 1) and standard error -(file descriptor 2) to the file dirlist, while the command +(file descriptor 2) to the file dirlist, while the command

                -
                ls 2>&1 > dirlist
                +
                ls 2>&1 > dirlist
                 
                -

                directs only the standard output to file dirlist, +

                directs only the standard output to file dirlist, because the standard error was made a copy of the standard output -before the standard output was redirected to dirlist. +before the standard output was redirected to dirlist.

                Bash handles several filenames specially when they are used in redirections, as described in the following table. @@ -3567,31 +3571,31 @@ If the operating system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with the behavior described below.

                -
                -
                /dev/fd/fd
                -

                If fd is a valid integer, file descriptor fd is duplicated. +

                +
                /dev/fd/fd
                +

                If fd is a valid integer, file descriptor fd is duplicated.

                -
                /dev/stdin
                +
                /dev/stdin

                File descriptor 0 is duplicated.

                -
                /dev/stdout
                +
                /dev/stdout

                File descriptor 1 is duplicated.

                -
                /dev/stderr
                +
                /dev/stderr

                File descriptor 2 is duplicated.

                -
                /dev/tcp/host/port
                -

                If host is a valid hostname or Internet address, and port +

                /dev/tcp/host/port
                +

                If host is a valid hostname or Internet address, and port is an integer port number or service name, Bash attempts to open the corresponding TCP socket.

                -
                /dev/udp/host/port
                -

                If host is a valid hostname or Internet address, and port +

                /dev/udp/host/port
                +

                If host is a valid hostname or Internet address, and port is an integer port number or service name, Bash attempts to open the corresponding UDP socket.

                @@ -3603,7 +3607,7 @@ the corresponding UDP socket. care, as they may conflict with file descriptors the shell uses internally.

                -
                  + -
                  -

                  3.6.1 Redirecting Input

                  +
                  +

                  3.6.1 Redirecting Input

                  Redirection of input causes the file whose name results from -the expansion of word -to be opened for reading on file descriptor n, -or the standard input (file descriptor 0) if n +the expansion of word +to be opened for reading on file descriptor n, +or the standard input (file descriptor 0) if n is not specified.

                  The general format for redirecting input is:

                  -
                  [n]<word
                  +
                  [n]<word
                   
                  -
                  -

                  3.6.2 Redirecting Output

                  +
                  +

                  3.6.2 Redirecting Output

                  Redirection of output causes the file whose name results from -the expansion of word -to be opened for writing on file descriptor n, -or the standard output (file descriptor 1) if n +the expansion of word +to be opened for writing 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; if it does exist it is truncated to zero size.

                  The general format for redirecting output is:

                  -
                  [n]>[|]word
                  +
                  [n]>[|]word
                   
                  -

                  If the redirection operator is ‘>’, and the noclobber -option to the set builtin has been enabled, the redirection +

                  If the redirection operator is ‘>’, and the noclobber +option to the set builtin has been enabled, the redirection will fail 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, the redirection -is attempted even if the file named by word exists. +word exists and is a regular file. +If the redirection operator is ‘>|’, or the redirection operator is +‘>’ and the noclobber option is not enabled, the redirection +is attempted even if the file named by word exists.

                  -
                  -

                  3.6.3 Appending Redirected Output

                  +
                  +

                  3.6.3 Appending Redirected Output

                  Redirection of output in this fashion causes the file whose name results from -the expansion of word -to be opened for appending on file descriptor n, -or the standard output (file descriptor 1) if n +the expansion of word +to be opened 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.

                  The general format for appending output is:

                  -
                  [n]>>word
                  +
                  [n]>>word
                   
                  -
                  -

                  3.6.4 Redirecting Standard Output and Standard Error

                  +
                  +

                  3.6.4 Redirecting Standard Output and Standard Error

                  This construct allows both the standard output (file descriptor 1) and the standard error output (file descriptor 2) to be redirected to the file whose name is the -expansion of word. +expansion of word.

                  There are two formats for redirecting standard output and standard error:

                  -
                  &>word
                  +
                  &>word
                   

                  and

                  -
                  >&word
                  +
                  >&word
                   

                  Of the two forms, the first is preferred. This is semantically equivalent to

                  -
                  >word 2>&1
                  +
                  >word 2>&1
                   
                  -

                  When using the second form, word may not expand to a number or -‘-’. If it does, other redirection operators apply +

                  When using the second form, word may not expand to a number or +‘-’. If it does, other redirection operators apply (see Duplicating File Descriptors below) for compatibility reasons.

                  -
                  -

                  3.6.5 Appending Standard Output and Standard Error

                  +
                  +

                  3.6.5 Appending Standard Output and Standard Error

                  This construct allows both the standard output (file descriptor 1) and the standard error output (file descriptor 2) to be appended to the file whose name is the -expansion of word. +expansion of word.

                  The format for appending standard output and standard error is:

                  -
                  &>>word
                  +
                  &>>word
                   

                  This is semantically equivalent to

                  -
                  >>word 2>&1
                  +
                  >>word 2>&1
                   

                  (see Duplicating File Descriptors below).

                  -
                  -

                  3.6.6 Here Documents

                  +
                  +

                  3.6.6 Here Documents

                  This type of redirection instructs the shell to read input from the -current source until it reads a line containing only delimiter +current source until it reads a line containing only delimiter (with no trailing blanks). All of the lines read up to that point are then used as the standard -input (or file descriptor n if n is specified) for a command. +input (or file descriptor n if n is specified) for a command.

                  The format of here-documents is:

                  -
                  [n]<<[-]word
                  -        here-document
                  -delimiter
                  +
                  [n]<<[−]word
                  +        here-document
                  +delimiter
                   

                  No parameter and variable expansion, command substitution, arithmetic expansion, or filename expansion is performed on -word. +word.

                  -

                  If any part of word is quoted, the -delimiter is the result of quote removal on word, +

                  If any part of word is quoted, the +delimiter is the result of quote removal on word, and the lines in the here-document are not expanded. -If word is unquoted, -delimiter is word itself, +If word is unquoted, +delimiter is word itself, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion, -the character sequence \newline is ignored, and ‘\’ +the character sequence \newline is ignored, and ‘\’ must be used to quote the characters -‘\’, ‘$’, and ‘`’. +‘\’, ‘$’, and ‘`’.

                  -

                  If the redirection operator is ‘<<-’, +

                  If the redirection operator is ‘<<-’, then all leading tab characters are stripped from input lines and the -line containing delimiter. +line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.

                  -
                  -

                  3.6.7 Here Strings

                  +
                  +

                  3.6.7 Here Strings

                  A variant of here documents, the format is:

                  -
                  [n]<<< word
                  +
                  [n]<<< word
                   
                  -

                  The word undergoes +

                  The word undergoes tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal. Filename expansion and word splitting are not performed. The result is supplied as a single string, with a newline appended, to the command on its -standard input (or file descriptor n if n is specified). +standard input (or file descriptor n if n is specified).

                  -
                  -

                  3.6.8 Duplicating File Descriptors

                  +
                  +

                  3.6.8 Duplicating File Descriptors

                  The redirection operator

                  -
                  [n]<&word
                  +
                  [n]<&word
                   

                  is used to duplicate input file descriptors. -If word -expands to one or more digits, the file descriptor denoted by n +If word +expands to one or more digits, the file descriptor denoted by n is made to be a copy of that file descriptor. -If the digits in word do not specify a file descriptor open for +If the digits in word do not specify a file descriptor open for input, a redirection error occurs. -If word -evaluates to ‘-’, file descriptor n is closed. -If n is not specified, the standard input (file descriptor 0) is used. +If word +evaluates to ‘-’, file descriptor n is closed. +If n is not specified, the standard input (file descriptor 0) is used.

                  The operator

                  -
                  [n]>&word
                  +
                  [n]>&word
                   

                  is used similarly to duplicate output file descriptors. If -n is not specified, the standard output (file descriptor 1) is used. -If the digits in word do not specify a file descriptor open for +n is not specified, the standard output (file descriptor 1) is used. +If the digits in word do not specify a file descriptor open for output, a redirection error occurs. -If word -evaluates to ‘-’, file descriptor n is closed. -As a special case, if n is omitted, and word does not -expand to one or more digits or ‘-’, the standard output and standard +If word +evaluates to ‘-’, file descriptor n is closed. +As a special case, if n is omitted, and word does not +expand to one or more digits or ‘-’, the standard output and standard error are redirected as described previously.

                  -
                  -

                  3.6.9 Moving File Descriptors

                  +
                  +

                  3.6.9 Moving File Descriptors

                  The redirection operator

                  -
                  [n]<&digit-
                  +
                  [n]<&digit-
                   
                  -

                  moves the file descriptor digit to file descriptor n, -or the standard input (file descriptor 0) if n is not specified. -digit is closed after being duplicated to n. +

                  moves the file descriptor digit to file descriptor n, +or the standard input (file descriptor 0) if n is not specified. +digit is closed after being duplicated to n.

                  Similarly, the redirection operator

                  -
                  [n]>&digit-
                  +
                  [n]>&digit-
                   
                  -

                  moves the file descriptor digit to file descriptor n, -or the standard output (file descriptor 1) if n is not specified. +

                  moves the file descriptor digit to file descriptor n, +or the standard output (file descriptor 1) if n is not specified.

                  -
                  -

                  3.6.10 Opening File Descriptors for Reading and Writing

                  +
                  +

                  3.6.10 Opening File Descriptors for Reading and Writing

                  The redirection operator

                  -
                  [n]<>word
                  +
                  [n]<>word
                   
                  -

                  causes the file whose name is the expansion of word +

                  causes the file whose name is the expansion of word to be opened for both reading and writing on file descriptor -n, or on file descriptor 0 if n +n, or on file descriptor 0 if n is not specified. If the file does not exist, it is created.


                  -
                  -
                  +
                  + -

                  3.7 Executing Commands

                  +

                  3.7 Executing Commands

                  -
                    +
                    -
                    -
                    +
                    + -

                    3.7.1 Simple Command Expansion

                    - +

                    3.7.1 Simple Command Expansion

                    +

                    When a simple command is executed, the shell performs the following expansions, assignments, and redirections, from left to right, in the following order.

                    -
                      +
                      1. The words that the parser has marked as variable assignments (those preceding the command name) and redirections are saved for later processing.
                      2. The words that are not variable assignments or redirections are -expanded (see Shell Expansions). +expanded (see Shell Expansions). If any words remain after expansion, the first word is taken to be the name of the command and the remaining words are the arguments. -
                      3. Redirections are performed as described above (see Redirections). +
                      4. Redirections are performed as described above (see Redirections). -
                      5. The text after the ‘=’ in each variable assignment undergoes tilde +
                      6. The text after the ‘=’ in each variable assignment undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable.
                      @@ -3899,23 +3903,23 @@ were no command substitutions, the command exits with a status of zero.


                    -
                    -
                    +
                    + -

                    3.7.2 Command Search and Execution

                    - - +

                    3.7.2 Command Search and Execution

                    + +

                    After a command has been split into words, if it results in a simple command and an optional list of arguments, the shell performs the following actions.

                    -
                      +
                      1. If the command name contains no slashes, the shell attempts to locate it. If there exists a shell function by that name, that -function is invoked as described in Shell Functions. +function is invoked as described in Shell Functions.
                      2. If the name does not match a function, the shell searches for it in the list of shell builtins. If a match is found, that @@ -3923,14 +3927,14 @@ builtin is invoked.
                      3. If the name is neither a shell function nor a builtin, and contains no slashes, Bash searches each element of -$PATH for a directory containing an executable file +$PATH for a directory containing an executable file by that name. Bash uses a hash table to remember the full -pathnames of executable files to avoid multiple PATH searches -(see the description of hash in Bourne Shell Builtins). -A full search of the directories in $PATH +pathnames of executable files to avoid multiple PATH searches +(see the description of hash in Bourne Shell Builtins). +A full search of the directories in $PATH is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell searches for a defined shell -function named command_not_found_handle. +function named command_not_found_handle. If that function exists, it is invoked in a separate execution environment with the original command and the original command’s arguments as its arguments, and the function’s @@ -3946,8 +3950,8 @@ to the command are set to the arguments supplied, if any.
                      4. If this execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a -shell script and the shell executes it as described in -Shell Scripts. +shell script and the shell executes it as described in +Shell Scripts.
                      5. If the command was not begun asynchronously, the shell waits for the command to complete and collects its exit status. @@ -3956,45 +3960,45 @@ the command to complete and collects its exit status.
                    -
                    -
                    +
                    + -

                    3.7.3 Command Execution Environment

                    - +

                    3.7.3 Command Execution Environment

                    + -

                    The shell has an execution environment, which consists of the +

                    The shell has an execution environment, which consists of the following:

                    -
                      -
                    • open files inherited by the shell at invocation, as modified by -redirections supplied to the exec builtin +
                        +
                      • open files inherited by the shell at invocation, as modified by +redirections supplied to the exec builtin -
                      • the current working directory as set by cd, pushd, or -popd, or inherited by the shell at invocation +
                      • the current working directory as set by cd, pushd, or +popd, or inherited by the shell at invocation -
                      • the file creation mode mask as set by umask or inherited from +
                      • the file creation mode mask as set by umask or inherited from the shell’s parent -
                      • current traps set by trap +
                      • current traps set by trap -
                      • shell parameters that are set by variable assignment or with set +
                      • shell parameters that are set by variable assignment or with set or inherited from the shell’s parent in the environment -
                      • shell functions defined during execution or inherited from the shell’s +
                      • shell functions defined during execution or inherited from the shell’s parent in the environment -
                      • options enabled at invocation (either by default or with command-line -arguments) or by set +
                      • options enabled at invocation (either by default or with command-line +arguments) or by set -
                      • options enabled by shopt (see The Shopt Builtin) +
                      • options enabled by shopt (see The Shopt Builtin) -
                      • shell aliases defined with alias (see Aliases) +
                      • shell aliases defined with alias (see Aliases) -
                      • various process IDs, including those of background jobs -(see Lists of Commands), the value of $$, and the value of -$PPID +
                      • various process IDs, including those of background jobs +(see Lists of Commands), the value of $$, and the value of +$PPID
                      @@ -4004,18 +4008,18 @@ is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell.

                      -
                        -
                      • the shell’s open files, plus any modifications and additions specified +
                          +
                        • the shell’s open files, plus any modifications and additions specified by redirections to the command -
                        • the current working directory +
                        • the current working directory -
                        • the file creation mode mask +
                        • the file creation mode mask -
                        • shell variables and functions marked for export, along with variables -exported for the command, passed in the environment (see Environment) +
                        • shell variables and functions marked for export, along with variables +exported for the command, passed in the environment (see Environment) -
                        • traps caught by the shell are reset to the values inherited from the +
                        • traps caught by the shell are reset to the values inherited from the shell’s parent, and traps ignored by the shell are ignored
                        @@ -4023,7 +4027,7 @@ shell’s parent, and traps ignored by the shell are ignored

                        A command invoked in this separate environment cannot affect the shell’s execution environment.

                        -

                        A subshell is a copy of the shell process. +

                        A subshell is a copy of the shell process.

                        Command substitution, commands grouped with parentheses, and asynchronous commands are invoked in a @@ -4034,71 +4038,76 @@ commands that are invoked as part of a pipeline are also executed in a subshell environment. Changes made to the subshell environment cannot affect the shell’s execution environment.

                        -

                        Subshells spawned to execute command substitutions inherit the value of -the -e option from the parent shell. When not in POSIX mode, -Bash clears the -e option in such subshells. -

                        -

                        If a command is followed by a ‘&’ and job control is not active, the -default standard input for the command is the empty file /dev/null. +

                        When the shell is in POSIX mode, +subshells spawned to execute command substitutions inherit the value of +the -e option from the parent shell. +When not in POSIX mode, +Bash clears the -e option in such subshells +See the description of the inherit_errexit shell option +(see Bash Builtin Commands) for how to control this behavior when not +in POSIX mode. +

                        +

                        If a command is followed by a ‘&’ and job control is not active, the +default standard input for the command is the empty file /dev/null. Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections.


                    -
                    -
                    +
                    + -

                    3.7.4 Environment

                    - +

                    3.7.4 Environment

                    +

                    When a program is invoked it is given an array of strings -called the environment. -This is a list of name-value pairs, of the form name=value. +called the environment. +This is a list of name-value pairs, of the form name=value.

                    Bash provides several ways to manipulate the environment. On invocation, the shell scans its own environment and creates a parameter for each name found, automatically marking -it for export +it for export to child processes. Executed commands inherit the environment. -The export and ‘declare -x’ +The export and ‘declare -x’ commands allow parameters and functions to be added to and deleted from the environment. If the value of a parameter in the environment is modified, the new value becomes part of the environment, replacing the old. The environment inherited by any executed command consists of the shell’s initial environment, whose values may be modified in the shell, -less any pairs removed by the unset and ‘export -n’ -commands, plus any additions via the export and -‘declare -x’ commands. +less any pairs removed by the unset and ‘export -n’ +commands, plus any additions via the export and +‘declare -x’ commands.

                    The environment for any simple command or function may be augmented temporarily by prefixing it with -parameter assignments, as described in Shell Parameters. +parameter assignments, as described in Shell Parameters. These assignment statements affect only the environment seen by that command.

                    -

                    If the -k option is set (see The Set Builtin), then all +

                    If the -k option is set (see The Set Builtin), then all parameter assignments are placed in the environment for a command, not just those that precede the command name.

                    -

                    When Bash invokes an external command, the variable ‘$_’ +

                    When Bash invokes an external command, the variable ‘$_’ is set to the full pathname of the command and passed to that command in its environment.


                    -
                    -
                    +
                    + -

                    3.7.5 Exit Status

                    - +

                    3.7.5 Exit Status

                    +

                    The exit status of an executed command is the value returned by the -waitpid system call or equivalent function. Exit statuses +waitpid system call or equivalent function. Exit statuses fall between 0 and 255, though, as explained below, the shell may use values above 125 specially. Exit statuses from shell builtins and compound commands are also limited to this range. Under certain @@ -4111,8 +4120,8 @@ A non-zero exit status indicates failure. This seemingly counter-intuitive scheme is used so there is one well-defined way to indicate success and a variety of ways to indicate various failure modes. -When a command terminates on a fatal signal whose number is N, -Bash uses the value 128+N as the exit status. +When a command terminates on a fatal signal whose number is N, +Bash uses the value 128+N as the exit status.

                    If a command is not found, the child process created to execute it returns a status of 127. If a command is found @@ -4122,8 +4131,8 @@ but is not executable, the return status is 126. the exit status is greater than zero.

                    The exit status is used by the Bash conditional commands -(see Conditional Constructs) and some of the list -constructs (see Lists of Commands). +(see Conditional Constructs) and some of the list +constructs (see Lists of Commands).

                    All of the Bash builtins return an exit status of zero if they succeed and a non-zero status on failure, so they may be used by the @@ -4132,85 +4141,85 @@ All builtins return an exit status of 2 to indicate incorrect usage, generally invalid options or missing arguments.

                    The exit status of the last command is available in the special -parameter $? (see Special Parameters). +parameter $? (see Special Parameters).


                    -
                    -
                    +
                    + -

                    3.7.6 Signals

                    - +

                    3.7.6 Signals

                    +

                    When Bash is interactive, in the absence of any traps, it ignores -SIGTERM (so that ‘kill 0’ does not kill an interactive shell), -and SIGINT -is caught and handled (so that the wait builtin is interruptible). -When Bash receives a SIGINT, it breaks out of any executing loops. -In all cases, Bash ignores SIGQUIT. -If job control is in effect (see Job Control), Bash -ignores SIGTTIN, SIGTTOU, and SIGTSTP. +SIGTERM (so that ‘kill 0’ does not kill an interactive shell), +and SIGINT +is caught and handled (so that the wait builtin is interruptible). +When Bash receives a SIGINT, it breaks out of any executing loops. +In all cases, Bash ignores SIGQUIT. +If job control is in effect (see Job Control), Bash +ignores SIGTTIN, SIGTTOU, and SIGTSTP.

                    Non-builtin commands started by Bash have signal handlers set to the values inherited by the shell from its parent. When job control is not in effect, asynchronous commands -ignore SIGINT and SIGQUIT in addition to these inherited +ignore SIGINT and SIGQUIT in addition to these inherited handlers. Commands run as a result of command substitution ignore the keyboard-generated job control signals -SIGTTIN, SIGTTOU, and SIGTSTP. +SIGTTIN, SIGTTOU, and SIGTSTP.

                    -

                    The shell exits by default upon receipt of a SIGHUP. -Before exiting, an interactive shell resends the SIGHUP to +

                    The shell exits by default upon receipt of a SIGHUP. +Before exiting, an interactive shell resends the SIGHUP to all jobs, running or stopped. -Stopped jobs are sent SIGCONT to ensure that they receive -the SIGHUP. -To prevent the shell from sending the SIGHUP signal to a +Stopped jobs are sent SIGCONT to ensure that they receive +the SIGHUP. +To prevent the shell from sending the SIGHUP signal to a particular job, it should be removed -from the jobs table with the disown -builtin (see Job Control Builtins) or marked -to not receive SIGHUP using disown -h. +from the jobs table with the disown +builtin (see Job Control Builtins) or marked +to not receive SIGHUP using disown -h.

                    -

                    If the huponexit shell option has been set with shopt -(see The Shopt Builtin), Bash sends a SIGHUP to all jobs when +

                    If the huponexit shell option has been set with shopt +(see The Shopt Builtin), Bash sends a SIGHUP to all jobs when an interactive login shell exits.

                    If Bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes. When Bash is waiting for an asynchronous -command via the wait builtin, the reception of a signal for -which a trap has been set will cause the wait builtin to return +command via the wait builtin, the reception of a signal for +which a trap has been set will cause the wait builtin to return immediately with an exit status greater than 128, immediately after which the trap is executed.

                    When job control is not enabled, and Bash is waiting for a foreground command to complete, the shell receives keyboard-generated signals -such as SIGINT (usually generated by ‘^C’) that users +such as SIGINT (usually generated by ‘^C’) that users commonly intend to send to that command. This happens because the shell and the command are in the same process -group as the terminal, and ‘^C’ sends SIGINT to all processes +group as the terminal, and ‘^C’ sends SIGINT to all processes in that process group. -See Job Control, for a more in-depth discussion of process groups. +See Job Control, for a more in-depth discussion of process groups.

                    -

                    When Bash is running without job control enabled and receives SIGINT +

                    When Bash is running without job control enabled and receives SIGINT while waiting for a foreground command, it waits until that foreground -command terminates and then decides what to do about the SIGINT: +command terminates and then decides what to do about the SIGINT:

                    -
                      -
                    1. If the command terminates due to the SIGINT, Bash concludes +
                        +
                      1. If the command terminates due to the SIGINT, Bash concludes that the user meant to end the entire script, and acts on the -SIGINT (e.g., by running a SIGINT trap or exiting itself); +SIGINT (e.g., by running a SIGINT trap or exiting itself); -
                      2. If the pipeline does not terminate due to SIGINT, the program -handled the SIGINT itself and did not treat it as a fatal signal. -In that case, Bash does not treat SIGINT as a fatal signal, -either, instead assuming that the SIGINT was used as part of the -program’s normal operation (e.g., emacs uses it to abort editing +
                      3. If the pipeline does not terminate due to SIGINT, the program +handled the SIGINT itself and did not treat it as a fatal signal. +In that case, Bash does not treat SIGINT as a fatal signal, +either, instead assuming that the SIGINT was used as part of the +program’s normal operation (e.g., emacs uses it to abort editing commands) or deliberately discarded. However, Bash will run any -trap set on SIGINT, as it does with any other trapped signal it +trap set on SIGINT, as it does with any other trapped signal it receives while it is waiting for the foreground command to complete, for compatibility.
                      @@ -4218,57 +4227,57 @@ complete, for compatibility.
                    -
                    -
                    +
                    + -

                    3.8 Shell Scripts

                    - +

                    3.8 Shell Scripts

                    +

                    A shell script is a text file containing shell commands. When such a file is used as the first non-option argument when invoking Bash, -and neither the -c nor -s option is supplied -(see Invoking Bash), +and neither the -c nor -s option is supplied +(see Invoking Bash), Bash reads and executes commands from the file, then exits. This mode of operation creates a non-interactive shell. The shell first searches for the file in the current directory, and looks in the -directories in $PATH if not found there. +directories in $PATH if not found there.

                    When Bash runs -a shell script, it sets the special parameter 0 to the name +a shell script, it sets the special parameter 0 to the name of the file, rather than the name of the shell, and the positional parameters are set to the remaining arguments, if any are given. If no additional arguments are supplied, the positional parameters are unset.

                    -

                    A shell script may be made executable by using the chmod command +

                    A shell script may be made executable by using the chmod command to turn on the execute bit. When Bash finds such a file while -searching the $PATH for a command, it creates a +searching the $PATH for a command, it creates a new instance of itself to execute it. In other words, executing

                    -
                    filename arguments
                    +
                    filename arguments
                     

                    is equivalent to executing

                    -
                    bash filename arguments
                    +
                    bash filename arguments
                     
                    -

                    if filename is an executable shell script. +

                    if filename is an executable shell script. This subshell reinitializes itself, so that the effect is as if a new shell had been invoked to interpret the script, with the exception that the locations of commands remembered by the parent -(see the description of hash in Bourne Shell Builtins) +(see the description of hash in Bourne Shell Builtins) are retained by the child.

                    Most versions of Unix make this a part of the operating system’s command execution mechanism. If the first line of a script begins with -the two characters ‘#!’, the remainder of the line specifies +the two characters ‘#!’, the remainder of the line specifies an interpreter for the program and, depending on the operating system, one or more optional arguments for that interpreter. -Thus, you can specify Bash, awk, Perl, or some other +Thus, you can specify Bash, awk, Perl, or some other interpreter and write the rest of the script file in that language.

                    The arguments to the interpreter @@ -4284,28 +4293,28 @@ Note that some older versions of Unix limit the interpreter name and a single argument to a maximum of 32 characters, so it’s not portable to assume that using more than one argument will work.

                    -

                    Bash scripts often begin with #! /bin/bash (assuming that -Bash has been installed in /bin), since this ensures that +

                    Bash scripts often begin with #! /bin/bash (assuming that +Bash has been installed in /bin), since this ensures that Bash will be used to interpret the script, even if it is executed -under another shell. It’s a common idiom to use env to find -bash even if it’s been installed in another directory: -#!/usr/bin/env bash will find the first occurrence of bash -in $PATH. +under another shell. It’s a common idiom to use env to find +bash even if it’s been installed in another directory: +#!/usr/bin/env bash will find the first occurrence of bash +in $PATH.


                    -
                    -
                    +
                    + -

                    4 Shell Builtin Commands

                    +

                    4 Shell Builtin Commands

                    Builtin commands are contained within the shell itself. When the name of a builtin command is used as the first word of -a simple command (see Simple Commands), the shell executes +a simple command (see Simple Commands), the shell executes the command directly, without invoking another program. Builtin commands are necessary to implement functionality impossible or inconvenient to obtain with separate utilities. @@ -4316,607 +4325,611 @@ to or have been extended in Bash.

                    Several builtin commands are described in other chapters: builtin commands which provide the Bash interface to the job control -facilities (see Job Control Builtins), the directory stack -(see Directory Stack Builtins), the command history -(see Bash History Builtins), and the programmable completion -facilities (see Programmable Completion Builtins). +facilities (see Job Control Builtins), the directory stack +(see Directory Stack Builtins), the command history +(see Bash History Builtins), and the programmable completion +facilities (see Programmable Completion Builtins).

                    -

                    Many of the builtins have been extended by POSIX or Bash. +

                    Many of the builtins have been extended by POSIX or Bash.

                    Unless otherwise noted, each builtin command documented as accepting -options preceded by ‘-’ accepts ‘--’ +options preceded by ‘-’ accepts ‘--’ to signify the end of the options. -The :, true, false, and test/[ -builtins do not accept options and do not treat ‘--’ specially. -The exit, logout, return, -break, continue, let, -and shift builtins accept and process arguments beginning -with ‘-’ without requiring ‘--’. +The :, true, false, and test/[ +builtins do not accept options and do not treat ‘--’ specially. +The exit, logout, return, +break, continue, let, +and shift 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 interpretation. +options interpret arguments beginning with ‘-’ as invalid options and +require ‘--’ to prevent this interpretation.

                    -
                      +
                      -
                      -
                      +
                      + -

                      4.1 Bourne Shell Builtins

                      +

                      4.1 Bourne Shell Builtins

                      The following shell builtin commands are inherited from the Bourne Shell. -These commands are implemented as specified by the POSIX standard. +These commands are implemented as specified by the POSIX standard.

                      -
                      -
                      : (a colon)
                      +
                      +
                      : (a colon)
                      -
                      : [arguments]
                      +
                      : [arguments]
                       
                      -

                      Do nothing beyond expanding arguments and performing redirections. +

                      Do nothing beyond expanding arguments and performing redirections. The return status is zero.

                      -
                      . (a period)
                      +
                      . (a period)
                      -
                      . filename [arguments]
                      +
                      . filename [arguments]
                       
                      -

                      Read and execute commands from the filename argument in the -current shell context. If filename does not contain a slash, -the PATH variable is used to find filename, -but filename does not need to be executable. -When Bash is not in POSIX mode, it searches the current directory -if filename is not found in $PATH. -If any arguments are supplied, they become the positional -parameters when filename is executed. Otherwise the positional +

                      Read and execute commands from the filename argument in the +current shell context. If filename does not contain a slash, +the PATH variable is used to find filename, +but filename does not need to be executable. +When Bash is not in POSIX mode, it searches the current directory +if filename is not found in $PATH. +If any arguments are supplied, they become the positional +parameters when filename is executed. Otherwise the positional parameters are unchanged. -If the -T option is enabled, . inherits any trap on -DEBUG; if it is not, any DEBUG trap string is saved and -restored around the call to ., and . unsets the -DEBUG trap while it executes. -If -T is not set, and the sourced file changes -the DEBUG trap, the new value is retained when . completes. +If the -T option is enabled, . inherits any trap on +DEBUG; if it is not, any DEBUG trap string is saved and +restored around the call to ., and . unsets the +DEBUG trap while it executes. +If -T is not set, and the sourced file changes +the DEBUG trap, the new value is retained when . completes. The return status is the exit status of the last command executed, or -zero if no commands are executed. If filename is not found, or +zero if no commands are executed. If filename is not found, or cannot be read, the return status is non-zero. -This builtin is equivalent to source. +This builtin is equivalent to source.

                      -
                      break
                      +
                      break
                      -
                      break [n]
                      +
                      break [n]
                       
                      -

                      Exit from a for, while, until, or select loop. -If n is supplied, the nth enclosing loop is exited. -n must be greater than or equal to 1. -The return status is zero unless n is not greater than or equal to 1. +

                      Exit from a for, while, until, or select loop. +If n is supplied, the nth enclosing loop is exited. +n must be greater than or equal to 1. +The return status is zero unless n is not greater than or equal to 1.

                      -
                      cd
                      +
                      cd
                      -
                      cd [-L|[-P [-e]]] [-@] [directory]
                      +
                      cd [-L|[-P [-e]]] [-@] [directory]
                       
                      -

                      Change the current working directory to directory. -If directory is not supplied, the value of the HOME +

                      Change the current working directory to directory. +If directory is not supplied, the value of the HOME shell variable is used. If the shell variable -CDPATH exists, it is used as a search path: -each directory name in CDPATH is searched for -directory, with alternative directory names in CDPATH -separated by a colon (‘:’). -If directory begins with a slash, CDPATH is not used. +CDPATH exists, cd uses it as a search path: +cd searches each directory name in CDPATH for +directory, with alternative directory names in CDPATH +separated by a colon (‘:’). +If directory begins with a slash, CDPATH is not used.

                      -

                      The -P option means to not follow symbolic links: symbolic links -are resolved while cd is traversing directory and before -processing an instance of ‘..’ in directory. +

                      The -P option means to not follow symbolic links: symbolic links +are resolved while cd is traversing directory and before +processing an instance of ‘..’ in directory.

                      -

                      By default, or when the -L option is supplied, symbolic links -in directory are resolved after cd processes an instance -of ‘..’ in directory. +

                      By default, or when the -L option is supplied, symbolic links +in directory are resolved after cd processes an instance +of ‘..’ in directory.

                      -

                      If ‘..’ appears in directory, it is processed by removing the +

                      If ‘..’ appears in directory, it is processed by removing the immediately preceding pathname component, back to a slash or the beginning -of directory. +of directory.

                      -

                      If the -e option is supplied with -P +

                      If the -e option is supplied with -P and the current working directory cannot be successfully determined -after a successful directory change, cd will return an unsuccessful +after a successful directory change, cd will return an unsuccessful 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.

                      -

                      If directory is ‘-’, it is converted to $OLDPWD +

                      If directory is ‘-’, it is converted to $OLDPWD before the directory change is attempted.

                      -

                      If a non-empty directory name from CDPATH is used, or if -‘-’ is the first argument, and the directory change is +

                      If a non-empty directory name from CDPATH is used, or if +‘-’ is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output.

                      -

                      If the directory change is successful, cd sets the value of the -PWD environment variable to the new directory name, and sets the -OLDPWD environment variable to the value of the current working +

                      If the directory change is successful, cd sets the value of the +PWD environment variable to the new directory name, and sets the +OLDPWD environment variable to the value of the current working directory before the change.

                      The return status is zero if the directory is successfully changed, non-zero otherwise.

                      -
                      continue
                      +
                      continue
                      -
                      continue [n]
                      +
                      continue [n]
                       
                      -

                      Resume the next iteration of an enclosing for, while, -until, or select loop. -If n is supplied, the execution of the nth enclosing loop +

                      Resume the next iteration of an enclosing for, while, +until, or select loop. +If n is supplied, the execution of the nth enclosing loop is resumed. -n must be greater than or equal to 1. -The return status is zero unless n is not greater than or equal to 1. +n must be greater than or equal to 1. +The return status is zero unless n is not greater than or equal to 1.

                      -
                      eval
                      +
                      eval
                      -
                      eval [arguments]
                      +
                      eval [arguments]
                       

                      The arguments are concatenated together into a single command, which is then read and executed, and its exit status returned as the exit status -of eval. +of eval. If there are no arguments or only empty arguments, the return status is zero.

                      -
                      exec
                      +
                      exec
                      -
                      exec [-cl] [-a name] [command [arguments]]
                      +
                      exec [-cl] [-a name] [command [arguments]]
                       
                      -

                      If command +

                      If command is supplied, it replaces the shell without creating a new process. -If the -l option is supplied, the shell places a dash at the -beginning of the zeroth argument passed to command. -This is what the login program does. -The -c option causes command to be executed with an empty +If the -l option is supplied, the shell places a dash at the +beginning of the zeroth argument passed to command. +This is what the login program does. +The -c option causes command to be executed with an empty environment. -If -a is supplied, the shell passes name as the zeroth -argument to command. -If command +If -a is supplied, the shell passes name as the zeroth +argument to command. +If command cannot be executed for some reason, a non-interactive shell exits, -unless the execfail shell option +unless the execfail shell option is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed. -A subshell exits unconditionally if exec fails. -If no command is specified, redirections may be used to affect +A subshell exits unconditionally if exec fails. +If no command is specified, redirections may be used to affect the current shell environment. If there are no redirection errors, the return status is zero; otherwise the return status is non-zero.

                      -
                      exit
                      +
                      exit
                      -
                      exit [n]
                      +
                      exit [n]
                       
                      -

                      Exit the shell, returning a status of n to the shell’s parent. -If n is omitted, the exit status is that of the last command executed. -Any trap on EXIT is executed before the shell terminates. +

                      Exit the shell, returning a status of n to the shell’s parent. +If n is omitted, the exit status is that of the last command executed. +Any trap on EXIT is executed before the shell terminates.

                      -
                      export
                      +
                      export
                      -
                      export [-fn] [-p] [name[=value]]
                      +
                      export [-fn] [-p] [name[=value]]
                       
                      -

                      Mark each name to be passed to child processes -in the environment. If the -f option is supplied, the names +

                      Mark each name to be passed to child processes +in the environment. If the -f option is supplied, the names refer to shell functions; otherwise the names refer to shell variables. -The -n option means to no longer mark each name for export. -If no names are supplied, or if the -p option is given, a +The -n option means to no longer mark each name for export. +If no names are supplied, or if the -p option is given, a list of names of all exported variables is displayed. -The -p option displays output in a form that may be reused as input. -If a variable name is followed by =value, the value of -the variable is set to value. +The -p option displays output in a form that may be reused as input. +If a variable name is followed by =value, the value of +the variable is set to value.

                      The return status is zero unless an invalid option is supplied, one of -the names is not a valid shell variable name, or -f is supplied +the names is not a valid shell variable name, or -f is supplied with a name that is not a shell function.

                      -
                      false
                      +
                      false
                      -
                      false
                      +
                      false
                       

                      Does nothing, returns a non-zero status.

                      -
                      getopts
                      +
                      getopts
                      -
                      getopts optstring name [arg …]
                      +
                      getopts optstring name [arg ...]
                       
                      -

                      getopts is used by shell scripts to parse positional parameters. -optstring contains the option characters to be recognized; if a +

                      getopts is used by shell scripts to parse positional parameters. +optstring 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 whitespace. -The colon (‘:’) and question mark (‘?’) may not be +The colon (‘:’) and question mark (‘?’) may not be used as option characters. -Each time it is invoked, getopts -places the next option in the shell variable name, initializing -name if it does not exist, +Each time it is invoked, getopts +places the next option in the shell variable name, initializing +name if it does not exist, and the index of the next argument to be processed into the -variable OPTIND. -OPTIND is initialized to 1 each time the shell or a shell script +variable OPTIND. +OPTIND is initialized to 1 each time the shell or a shell script is invoked. When an option requires an argument, -getopts places that argument into the variable OPTARG. -The shell does not reset OPTIND automatically; it must be manually -reset between multiple calls to getopts within the same shell +getopts places that argument into the variable OPTARG. +The shell does not reset OPTIND automatically; it must be manually +reset between multiple calls to getopts within the same shell invocation if a new set of parameters is to be used.

                      -

                      When the end of options is encountered, getopts exits with a +

                      When the end of options is encountered, getopts exits with a return value greater than zero. -OPTIND is set to the index of the first non-option argument, -and name is set to ‘?’. +OPTIND is set to the index of the first non-option argument, +and name is set to ‘?’.

                      -

                      getopts +

                      getopts normally parses the positional parameters, but if more arguments are -supplied as arg values, getopts parses those instead. +supplied as arg values, getopts parses those instead.

                      -

                      getopts can report errors in two ways. If the first character of -optstring is a colon, silent +

                      getopts can report errors in two ways. If the first character of +optstring is a colon, silent error reporting is used. In normal operation, diagnostic messages are printed when invalid options or missing option arguments are encountered. -If the variable OPTERR +If the variable OPTERR is set to 0, no error messages will be displayed, even if the first -character of optstring is not a colon. +character of optstring is not a colon.

                      -

                      If an invalid option is seen, -getopts places ‘?’ into name and, if not silent, -prints an error message and unsets OPTARG. -If getopts is silent, the option character found is placed in -OPTARG and no diagnostic message is printed. +

                      If getopts detects an invalid option, it +places ‘?’ into name and, if not silent, +prints an error message and unsets OPTARG. +If getopts is silent, it assigns the option character found +to OPTARG and does not print a diagnostic message.

                      -

                      If a required argument is not found, and getopts -is not silent, a question mark (‘?’) is placed in name, -OPTARG is unset, and a diagnostic message is printed. -If getopts is silent, then a colon (‘:’) is placed in -name and OPTARG is set to the option character found. +

                      If a required argument is not found, +and getopts is not silent, +it sets the value of name to a question mark (‘?’), +unsets OPTARG, and prints a diagnostic message. +If getopts is silent, +it sets the value of name to a colon (‘:’), +and sets OPTARG to the option character found.

                      -
                      hash
                      +
                      hash
                      -
                      hash [-r] [-p filename] [-dt] [name]
                      +
                      hash [-r] [-p filename] [-dt] [name]
                       
                      -

                      Each time hash is invoked, it remembers the full filenames of the -commands specified as name arguments, +

                      Each time hash is invoked, it remembers the full filenames of the +commands specified as name arguments, so they need not be searched for on subsequent invocations. The commands are found by searching through the directories listed in -$PATH. +$PATH. Any previously-remembered filename is discarded. -The -p option inhibits the path search, and filename is -used as the location of name. -The -r option causes the shell to forget all remembered locations. -Assigning to the PATH variable also clears all hashed filenames. -The -d option causes the shell to forget the remembered location -of each name. -If the -t option is supplied, the full pathname to which each -name corresponds is printed. If multiple name arguments are -supplied with -t, the name is printed before the hashed +The -p option inhibits the path search, and filename is +used as the location of name. +The -r option causes the shell to forget all remembered locations. +Assigning to the PATH variable also clears all hashed filenames. +The -d option causes the shell to forget the remembered location +of each name. +If the -t option is supplied, the full pathname to which each +name corresponds is printed. If multiple name arguments are +supplied with -t, the name is printed before the hashed full pathname. -The -l option causes output to be displayed in a format +The -l option causes output to be displayed in a format that may be reused as input. -If no arguments are given, or if only -l is supplied, +If no arguments are given, or if only -l is supplied, information about remembered commands is printed. -The -t, -d, and -p options (the options that -act on the name arguments) are mutually exclusive. +The -t, -d, and -p options (the options that +act on the name arguments) are mutually exclusive. Only one will be active. -If more than one is supplied, -t has higher priority than --p, and both are higher priority than -d. -The return status is zero unless a name is not found or an invalid +If more than one is supplied, -t has higher priority than +-p, and both are higher priority than -d. +The return status is zero unless a name is not found or an invalid option is supplied.

                      -
                      pwd
                      +
                      pwd
                      -
                      pwd [-LP]
                      +
                      pwd [-LP]
                       

                      Print the absolute pathname of the current working directory. -If the -P option is supplied, the pathname printed will not +If the -P option is supplied, the pathname printed will not contain symbolic links. -If the -L option is supplied, the pathname printed may contain +If the -L option is supplied, the pathname printed may contain symbolic links. The return status is zero unless an error is encountered while determining the name of the current directory or an invalid option is supplied.

                      -
                      readonly
                      +
                      readonly
                      -
                      readonly [-aAf] [-p] [name[=value]] …
                      +
                      readonly [-aAf] [-p] [name[=value]] ...
                       
                      -

                      Mark each name as readonly. +

                      Mark each name as readonly. The values of these names may not be changed by subsequent assignment. -If the -f option is supplied, each name refers to a shell +If the -f option is supplied, each name refers to a shell function. -The -a option means each name refers to an indexed -array variable; the -A option means each name refers +The -a option means each name refers to an indexed +array variable; the -A option means each name refers to an associative array variable. -If both options are supplied, -A takes precedence. -If no name arguments are given, or if the -p +If both options are supplied, -A takes precedence. +If no name arguments are given, or if the -p option is supplied, a list of all readonly names is printed. The other options may be used to restrict the output to a subset of the set of readonly names. -The -p option causes output to be displayed in a format that +The -p option causes output to be displayed in a format that may be reused as input. -If a variable name is followed by =value, the value of -the variable is set to value. +If a variable name is followed by =value, the value of +the variable is set to value. The return status is zero unless an invalid option is supplied, one of -the name arguments is not a valid shell variable or function name, -or the -f option is supplied with a name that is not a shell function. +the name arguments is not a valid shell variable or function name, +or the -f option is supplied with a name that is not a shell function.

                      -
                      return
                      +
                      return
                      -
                      return [n]
                      +
                      return [n]
                       
                      -

                      Cause a shell function to stop executing and return the value n +

                      Cause a shell function to stop executing and return the value n to its caller. -If n is not supplied, the return value is the exit status of the +If n is not supplied, the return value is the exit status of the last command executed in the function. -If return is executed by a trap handler, the last command used to +If return is executed by a trap handler, the last command used to determine the status is the last command executed before the trap handler. -If return is executed during a DEBUG trap, the last command +If return is executed during a DEBUG trap, the last command used to determine the status is the last command executed by the trap -handler before return was invoked. -return may also be used to terminate execution of a script -being executed with the . (source) builtin, -returning either n or +handler before return was invoked. +return may also be used to terminate execution of a script +being executed with the . (source) builtin, +returning either n or the exit status of the last command executed within the script as the exit status of the script. -If n is supplied, the return value is its least significant +If n is supplied, the return value is its least significant 8 bits. -Any command associated with the RETURN trap is executed +Any command associated with the RETURN trap is executed before execution resumes after the function or script. -The return status is non-zero if return is supplied a non-numeric +The return status is non-zero if return is supplied a non-numeric argument or is used outside a function -and not during the execution of a script by . or source. +and not during the execution of a script by . or source.

                      -
                      shift
                      +
                      shift
                      -
                      shift [n]
                      +
                      shift [n]
                       
                      -

                      Shift the positional parameters to the left by n. -The positional parameters from n+1 … $# are -renamed to $1$#-n. -Parameters represented by the numbers $# down to $#-n+1 +

                      Shift the positional parameters to the left by n. +The positional parameters from n+1 … $# are +renamed to $1$#-n. +Parameters represented by the numbers $# down to $#-n+1 are unset. -n must be a non-negative number less than or equal to $#. -If n is zero or greater than $#, the positional parameters +n must be a non-negative number less than or equal to $#. +If n is zero or greater than $#, the positional parameters are not changed. -If n is not supplied, it is assumed to be 1. -The return status is zero unless n is greater than $# or +If n is not supplied, it is assumed to be 1. +The return status is zero unless n is greater than $# or less than zero, non-zero otherwise.

                      -
                      test
                      -
                      [
                      -
                      -
                      -
                      test expr
                      +
                      +test
                      +
                      [
                      +
                      +
                      test expr
                       
                      -

                      Evaluate a conditional expression expr and return a status of 0 +

                      Evaluate a conditional expression expr and return a status of 0 (true) or 1 (false). Each operator and operand must be a separate argument. Expressions are composed of the primaries described below in -Bash Conditional Expressions. -test does not accept any options, nor does it accept and ignore -an argument of -- as signifying the end of options. +Bash Conditional Expressions. +test does not accept any options, nor does it accept and ignore +an argument of -- as signifying the end of options.

                      -

                      When the [ form is used, the last argument to the command must -be a ]. +

                      When the [ form is used, the last argument to the command must +be a ].

                      Expressions may be combined using the following operators, listed in decreasing order of precedence. The evaluation depends on the number of arguments; see below. Operator precedence is used when there are five or more arguments.

                      -
                      -
                      ! expr
                      -

                      True if expr is false. +

                      +
                      ! expr
                      +

                      True if expr is false.

                      -
                      ( expr )
                      -

                      Returns the value of expr. +

                      ( expr )
                      +

                      Returns the value of expr. This may be used to override the normal precedence of operators.

                      -
                      expr1 -a expr2
                      -

                      True if both expr1 and expr2 are true. +

                      expr1 -a expr2
                      +

                      True if both expr1 and expr2 are true.

                      -
                      expr1 -o expr2
                      -

                      True if either expr1 or expr2 is true. +

                      expr1 -o expr2
                      +

                      True if either expr1 or expr2 is true.

                      -

                      The test and [ builtins evaluate conditional +

                      The test and [ builtins evaluate conditional expressions using a set of rules based on the number of arguments.

                      -
                      -
                      0 arguments
                      +
                      +
                      0 arguments

                      The expression is false.

                      -
                      1 argument
                      +
                      1 argument

                      The expression is true if, and only if, the argument is not null.

                      -
                      2 arguments
                      -

                      If the first argument is ‘!’, the expression is true if and +

                      2 arguments
                      +

                      If the first argument is ‘!’, the expression is true if and only if the second argument is null. If the first argument is one of the unary conditional operators -(see Bash Conditional Expressions), the expression +(see Bash Conditional Expressions), the expression is true if the unary test is true. If the first argument is not a valid unary operator, the expression is false.

                      -
                      3 arguments
                      +
                      3 arguments

                      The following conditions are applied in the order listed.

                      -
                        +
                        1. If the second argument is one of the binary conditional -operators (see Bash Conditional Expressions), the +operators (see Bash Conditional Expressions), the result of the expression is the result of the binary test using the first and third arguments as operands. -The ‘-a’ and ‘-o’ operators are considered binary operators +The ‘-a’ and ‘-o’ operators are considered binary operators when there are three arguments. -
                        2. If the first argument is ‘!’, the value is the negation of +
                        3. If the first argument is ‘!’, the value is the negation of the two-argument test using the second and third arguments. -
                        4. If the first argument is exactly ‘(’ and the third argument is -exactly ‘)’, the result is the one-argument test of the second +
                        5. If the first argument is exactly ‘(’ and the third argument is +exactly ‘)’, the result is the one-argument test of the second argument.
                        6. Otherwise, the expression is false.
                      -
                      4 arguments
                      +
                      4 arguments

                      The following conditions are applied in the order listed.

                      -
                        -
                      1. If the first argument is ‘!’, the result is the negation of +
                          +
                        1. If the first argument is ‘!’, the result is the negation of the three-argument expression composed of the remaining arguments. -
                        2. If the first argument is exactly ‘(’ and the fourth argument is -exactly ‘)’, the result is the two-argument test of the second +
                        3. If the first argument is exactly ‘(’ and the fourth argument is +exactly ‘)’, the result is the two-argument test of the second and third arguments.
                        4. Otherwise, the expression is parsed and evaluated according to precedence using the rules listed above.
                      -
                      5 or more arguments
                      +
                      5 or more arguments

                      The expression is parsed and evaluated according to precedence using the rules listed above.

                      -

                      If the shell is not in POSIX mode, -when used with test or ‘[’, the ‘<’ and ‘>’ -operators sort lexicographically using ASCII ordering. -If the shell is in POSIX mode, these operators use the current locale. +

                      If the shell is in POSIX mode, or if the expression is part +of the [[ command, +the ‘<’ and ‘>’ operators sort using the current locale. +If the shell is not in POSIX mode, +the test and ‘[’ 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 standard has deprecated the -a and -o +The POSIX standard has deprecated the -a and -o 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 -a and -o with the shell’s -&& and || list operators. For example, use +and to replace uses of -a and -o with the shell’s +&& and || list operators. For example, use

                      -
                      test -n string1 && test -n string2
                      +
                      test -n string1 && test -n string2
                       

                      instead of

                      -
                      test -n string1 -a -n string2
                      +
                      test -n string1 -a -n string2
                       
                      -
                      times
                      +
                      times
                      -
                      times
                      +
                      times
                       

                      Print out the user and system times used by the shell and its children. The return status is zero.

                      -
                      trap
                      +
                      trap
                      -
                      trap [-Plp] [action] [sigspec …]
                      +
                      trap [-Plp] [action] [sigspec ...]
                       
                      -

                      The action is a command that is read and executed when the -shell receives signal sigspec. If action is absent (and -there is a single sigspec) or -equal to ‘-’, each specified signal’s disposition is reset +

                      The action is a command that is read and executed when the +shell receives signal sigspec. If action is absent (and +there is a single sigspec) or +equal to ‘-’, each specified signal’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. +If action is the null string, then the signal specified by +each sigspec is ignored by the shell and commands it invokes.

                      -

                      If no arguments are supplied, trap prints the actions +

                      If no arguments are supplied, trap prints the actions associated with each trapped signal -as a set of trap commands that can be reused as shell input to +as a set of trap commands that can be reused as shell input to restore the current signal dispositions. -If action is not present and -p has been supplied, -trap displays the trap commands associated with each sigspec, -or, if no sigspecs are supplied, for all trapped signals, -as a set of trap commands that can be reused as shell input to +If action is not present and -p has been supplied, +trap displays the trap commands associated with each sigspec, +or, if no sigspecs are supplied, for all trapped signals, +as a set of trap commands that can be reused as shell input to restore the current signal dispositions. -The -P option behaves similarly, but displays only the actions -associated with each sigspec argument. --P requires at least one sigspec argument. -The -P or -p options to trap may be +The -P option behaves similarly, but displays only the actions +associated with each sigspec argument. +-P requires at least one sigspec argument. +The -P or -p options to trap may be used in a subshell environment (e.g., command substitution) and, -as long as they are used before trap is used to change a +as long as they are used before trap is used to change a signal’s handling, will display the state of its parent’s traps.

                      -

                      The -l option causes trap to print a list of signal names +

                      The -l option causes trap to print a list of signal names and their corresponding numbers. -Each sigspec is either a signal name or a signal number. -Signal names are case insensitive and the SIG prefix is optional. -

                      -

                      If a sigspec -is 0 or EXIT, action is executed when the shell exits. -If a sigspec is DEBUG, action is executed -before every simple command, for command, case command, -select command, (( arithmetic command, [[ conditional command, -arithmetic for command, +Each sigspec is either a signal name or a signal number. +Signal names are case insensitive and the SIG prefix is optional. +

                      +

                      If a sigspec +is 0 or EXIT, action is executed when the shell exits. +If a sigspec is DEBUG, action is executed +before every simple command, for command, case command, +select command, (( arithmetic command, [[ conditional command, +arithmetic for command, and before the first command executes in a shell function. -Refer to the description of the extdebug option to the -shopt builtin (see The Shopt Builtin) for details of its -effect on the DEBUG trap. -If a sigspec is RETURN, action is executed -each time a shell function or a script executed with the . or -source builtins finishes executing. -

                      -

                      If a sigspec is ERR, action +Refer to the description of the extdebug option to the +shopt builtin (see The Shopt Builtin) for details of its +effect on the DEBUG trap. +If a sigspec is RETURN, action is executed +each time a shell function or a script executed with the . or +source builtins finishes executing. +

                      +

                      If a sigspec is ERR, action 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 ERR trap is not executed if the failed command is part of the -command list immediately following an until or while keyword, -part of the test following the if or elif reserved words, -part of a command executed in a && or || list -except the command following the final && or ||, +The ERR trap is not executed if the failed command is part of the +command list immediately following an until or while keyword, +part of the test following the if or elif reserved words, +part of a command executed in a && or || list +except the command following the final && or ||, any command in a pipeline but the last, or if the command’s return -status is being inverted using !. -These are the same conditions obeyed by the errexit (-e) +status is being inverted using !. +These are the same conditions obeyed by the errexit (-e) option.

                      Signals ignored upon entry to a non-interactive shell cannot be trapped or @@ -4925,213 +4938,213 @@ 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 is zero unless a sigspec does not specify a +

                      The return status is zero unless a sigspec does not specify a valid signal.

                      -
                      true
                      +
                      true
                      -
                      true
                      +
                      true
                       

                      Does nothing, returns a 0 status.

                      -
                      umask
                      +
                      umask
                      -
                      umask [-p] [-S] [mode]
                      +
                      umask [-p] [-S] [mode]
                       
                      -

                      Set the shell process’s file creation mask to mode. If -mode begins with a digit, it is interpreted as an octal number; +

                      Set the shell process’s file creation mask to mode. If +mode begins with a digit, it is interpreted as an octal number; if not, it is interpreted as a symbolic mode mask similar -to that accepted by the chmod command. If mode is -omitted, the current value of the mask is printed. If the -S -option is supplied without a mode argument, the mask is printed +to that accepted by the chmod command. If mode is +omitted, the current value of the mask is printed. If the -S +option is supplied without a mode argument, the mask is printed in a symbolic format. -If the -p option is supplied, and mode +If the -p option is supplied, and mode is omitted, the output is in a form that may be reused as input. The return status is zero if the mode is successfully changed or if -no mode argument is supplied, and non-zero otherwise. +no mode argument is supplied, and non-zero otherwise.

                      Note that when the mode is interpreted as an octal number, each number -of the umask is subtracted from 7. Thus, a umask of 022 -results in permissions of 755. +of the umask is subtracted from 7. Thus, a umask of 022 +results in permissions of 755.

                      -
                      unset
                      +
                      unset
                      -
                      unset [-fnv] [name]
                      +
                      unset [-fnv] [name]
                       
                      -

                      Remove each variable or function name. -If the -v option is given, each -name refers to a shell variable and that variable is removed. -If the -f option is given, the names refer to shell +

                      Remove each variable or function name. +If the -v option is given, each +name refers to a shell variable and that variable is removed. +If the -f option is given, the names refer to shell functions, and the function definition is removed. -If the -n option is supplied, and name is a variable with -the nameref attribute, name will be unset rather than the +If the -n option is supplied, and name is a variable with +the nameref attribute, name will be unset rather than the variable it references. --n has no effect if the -f option is supplied. -If no options are supplied, each name refers to a variable; if +-n has no effect if the -f option is supplied. +If no options are supplied, each name refers to a variable; if there is no variable by that name, a function with that name, if any, is unset. Readonly variables and functions may not be unset. Some shell variables lose their special behavior if they are unset; such behavior is noted in the description of the individual variables. -The return status is zero unless a name is readonly or may not be unset. +The return status is zero unless a name is readonly or may not be unset.


                      -
                      -
                      +
                      + -

                      4.2 Bash Builtin Commands

                      +

                      4.2 Bash Builtin Commands

                      This section describes builtin commands which are unique to or have been extended in Bash. -Some of these commands are specified in the POSIX standard. +Some of these commands are specified in the POSIX standard.

                      -
                      -
                      alias
                      +
                      +
                      alias
                      -
                      alias [-p] [name[=value] …]
                      +
                      alias [-p] [name[=value] ...]
                       
                      -

                      Without arguments or with the -p option, alias prints +

                      Without arguments or with the -p option, alias prints the list of aliases on the standard output in a form that allows them to be reused as input. -If arguments are supplied, an alias is defined for each name -whose value is given. If no value is given, the name +If arguments are supplied, an alias is defined for each name +whose value is given. If no value is given, the name and value of the alias is printed. -Aliases are described in Aliases. +Aliases are described in Aliases.

                      -
                      bind
                      +
                      bind
                      -
                      bind [-m keymap] [-lpsvPSVX]
                      -bind [-m keymap] [-q function] [-u function] [-r keyseq]
                      -bind [-m keymap] -f filename
                      -bind [-m keymap] -x keyseq[: ]shell-command
                      -bind [-m keymap] keyseq:function-name
                      -bind [-m keymap] keyseq:readline-command
                      -bind readline-command-line
                      +
                      bind [-m keymap] [-lpsvPSVX]
                      +bind [-m keymap] [-q function] [-u function] [-r keyseq]
                      +bind [-m keymap] -f filename
                      +bind [-m keymap] -x keyseq[: ]shell-command
                      +bind [-m keymap] keyseq:function-name
                      +bind [-m keymap] keyseq:readline-command
                      +bind readline-command-line
                       
                      -

                      Display current Readline (see Command Line Editing) +

                      Display current Readline (see Command Line Editing) key and function bindings, bind a key sequence to a Readline function or macro, or set a Readline variable. Each non-option argument is a command as it would appear in a -Readline initialization file (see Readline Init File), +Readline initialization file (see Readline Init File), but each binding or command must be passed as a separate argument; e.g., -‘"\C-x\C-r":re-read-init-file’. +‘"\C-x\C-r":re-read-init-file’.

                      Options, if supplied, have the following meanings:

                      -
                      -
                      -m keymap
                      -

                      Use keymap as the keymap to be affected by -the subsequent bindings. Acceptable keymap +

                      +
                      -m keymap
                      +

                      Use keymap as the keymap to be affected by +the subsequent bindings. Acceptable keymap names are -emacs, -emacs-standard, -emacs-meta, -emacs-ctlx, -vi, -vi-move, -vi-command, and -vi-insert. -vi is equivalent to vi-command (vi-move is also a -synonym); emacs is equivalent to emacs-standard. -

                      -
                      -
                      -l
                      +emacs, +emacs-standard, +emacs-meta, +emacs-ctlx, +vi, +vi-move, +vi-command, and +vi-insert. +vi is equivalent to vi-command (vi-move is also a +synonym); emacs is equivalent to emacs-standard. +

                      +
                      +
                      -l

                      List the names of all Readline functions.

                      -
                      -p
                      +
                      -p

                      Display Readline function names and bindings in such a way that they can be used as -an argument to a subsequent bind command +an argument to a subsequent bind command or in a Readline initialization file.

                      -
                      -P
                      +
                      -P

                      List current Readline function names and bindings.

                      -
                      -v
                      +
                      -v

                      Display Readline variable names and values in such a way that they can be used as -an argument to a subsequent bind command +an argument to a subsequent bind command or in a Readline initialization file.

                      -
                      -V
                      +
                      -V

                      List current Readline variable names and values.

                      -
                      -s
                      +
                      -s

                      Display Readline 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 bind command +an argument to a subsequent bind command or in a Readline initialization file.

                      -
                      -S
                      +
                      -S

                      Display Readline key sequences bound to macros and the strings they output.

                      -
                      -f filename
                      -

                      Read key bindings from filename. +

                      -f filename
                      +

                      Read key bindings from filename.

                      -
                      -q function
                      -

                      Query about which keys invoke the named function. +

                      -q function
                      +

                      Query about which keys invoke the named function.

                      -
                      -u function
                      -

                      Unbind all keys bound to the named function. +

                      -u function
                      +

                      Unbind all keys bound to the named function.

                      -
                      -r keyseq
                      -

                      Remove any current binding for keyseq. +

                      -r keyseq
                      +

                      Remove any current binding for keyseq.

                      -
                      -x keyseq:shell-command
                      -

                      Cause shell-command to be executed whenever keyseq is +

                      -x keyseq:shell-command
                      +

                      Cause shell-command to be executed whenever keyseq is entered. -The separator between keyseq and shell-command is either +The separator between keyseq and shell-command is either whitespace or a colon optionally followed by whitespace. -If the separator is whitespace, shell-command +If the separator is whitespace, shell-command must be enclosed in double quotes and Readline expands any of its -special backslash-escapes in shell-command before saving it. +special backslash-escapes in shell-command before saving it. If the separator is a colon, any enclosing double quotes are 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 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 +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 insertion -point (the mark), respectively. +point (the mark), respectively. The shell assigns any numeric argument the user supplied to the -READLINE_ARGUMENT variable. +READLINE_ARGUMENT variable. If there was no argument, that variable is not set. -If the executed command changes the value of any of READLINE_LINE, -READLINE_POINT, or READLINE_MARK, those new values will be +If the executed command changes the value of any of READLINE_LINE, +READLINE_POINT, or READLINE_MARK, those new values will be reflected in the editing state.

                      -
                      -X
                      +
                      -X

                      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 bind command. +an argument to a subsequent bind command.

                      @@ -5139,485 +5152,485 @@ an argument to a subsequent bind command. error occurs.

                      -
                      builtin
                      +
                      builtin
                      -
                      builtin [shell-builtin [args]]
                      +
                      builtin [shell-builtin [args]]
                       
                      -

                      Run a shell builtin, passing it args, and return its exit status. +

                      Run a shell builtin, passing it args, and return its exit status. This is useful when defining a shell function with the same name as a shell builtin, retaining the functionality of the builtin within the function. -The return status is non-zero if shell-builtin is not a shell +The return status is non-zero if shell-builtin is not a shell builtin command.

                      -
                      caller
                      +
                      caller
                      -
                      caller [expr]
                      +
                      caller [expr]
                       

                      Returns the context of any active subroutine call (a shell function or -a script executed with the . or source builtins). +a script executed with the . or source builtins).

                      -

                      Without expr, caller displays the line number and source +

                      Without expr, caller displays the line number and source filename of the current subroutine call. -If a non-negative integer is supplied as expr, caller +If a non-negative integer is supplied as expr, caller displays the line number, subroutine name, and source file corresponding to that position in the current 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 subroutine -call or expr does not correspond to a valid position in the +call or expr does not correspond to a valid position in the call stack.

                      -
                      command
                      +
                      command
                      -
                      command [-pVv] command [arguments …]
                      +
                      command [-pVv] command [arguments ...]
                       
                      -

                      Runs command with arguments ignoring any shell function -named command. +

                      Runs command with arguments ignoring any shell function +named command. Only shell builtin commands or commands found by searching the -PATH are executed. -If there is a shell function named ls, running ‘command ls’ -within the function will execute the external command ls +PATH are executed. +If there is a shell function named ls, running ‘command ls’ +within the function will execute the external command ls instead of calling the function recursively. -The -p option means to use a default value for PATH +The -p option means to use a default value for PATH that is guaranteed to find all of the standard utilities. -The return status in this case is 127 if command cannot be -found or an error occurred, and the exit status of command +The return status in this case is 127 if command cannot be +found or an error occurred, and the exit status of command otherwise.

                      -

                      If either the -V or -v option is supplied, a -description of command is printed. The -v option +

                      If either the -V or -v option is supplied, a +description of command is printed. The -v option causes a single word indicating the command or file name used to -invoke command to be displayed; the -V option produces +invoke command to be displayed; the -V option produces a more verbose description. In this case, the return status is -zero if command is found, and non-zero if not. +zero if command is found, and non-zero if not.

                      -
                      declare
                      +
                      declare
                      -
                      declare [-aAfFgiIlnrtux] [-p] [name[=value] …]
                      +
                      declare [-aAfFgiIlnrtux] [-p] [name[=value] ...]
                       
                      -

                      Declare variables and give them attributes. If no names +

                      Declare variables and give them attributes. If no names are given, then display the values of variables instead.

                      -

                      The -p option will display the attributes and values of each -name. -When -p is used with name arguments, additional options, -other than -f and -F, are ignored. +

                      The -p option will display the attributes and values of each +name. +When -p is used with name arguments, additional options, +other than -f and -F, are ignored.

                      -

                      When -p is supplied without name arguments, declare +

                      When -p is supplied without name arguments, declare will display the attributes and values of all variables having the attributes specified by the additional options. -If no other options are supplied with -p, declare will -display the attributes and values of all shell variables. The -f +If no other options are supplied with -p, declare will +display the attributes and values of all shell variables. The -f option will restrict the display to shell functions.

                      -

                      The -F option inhibits the display of function definitions; +

                      The -F option inhibits the display of function definitions; only the function name and attributes are printed. -If the extdebug shell option is enabled using shopt -(see The Shopt Builtin), the source file name and line number where -each name is defined are displayed as well. --F implies -f. +If the extdebug shell option is enabled using shopt +(see The Shopt Builtin), the source file name and line number where +each name is defined are displayed as well. +-F implies -f.

                      -

                      The -g option forces variables to be created or modified at -the global scope, even when declare is executed in a shell function. +

                      The -g option forces variables to be created or modified at +the global scope, even when declare is executed in a shell function. It is ignored in all other cases.

                      -

                      The -I option causes local variables to inherit the attributes -(except the nameref attribute) +

                      The -I option causes local variables to inherit the attributes +(except the nameref attribute) and value of any existing variable with the same -name at a surrounding scope. +name 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 variables with the specified attributes or to give variables attributes:

                      -
                      -
                      -a
                      -

                      Each name is an indexed array variable (see Arrays). +

                      +
                      -a
                      +

                      Each name is an indexed array variable (see Arrays).

                      -
                      -A
                      -

                      Each name is an associative array variable (see Arrays). +

                      -A
                      +

                      Each name is an associative array variable (see Arrays).

                      -
                      -f
                      +
                      -f

                      Use function names only.

                      -
                      -i
                      +
                      -i

                      The variable is to be treated as -an integer; arithmetic evaluation (see Shell Arithmetic) is +an integer; arithmetic evaluation (see Shell Arithmetic) is performed when the variable is assigned a value.

                      -
                      -l
                      +
                      -l

                      When the variable is assigned a value, all upper-case characters are converted to lower-case. The upper-case attribute is disabled.

                      -
                      -n
                      -

                      Give each name the nameref attribute, making +

                      -n
                      +

                      Give each name the nameref attribute, making it a name reference to another variable. -That other variable is defined by the value of name. +That other variable is defined by the value of name. All references, assignments, and attribute modifications -to name, except for those using or changing the --n attribute itself, are performed on the variable referenced by -name’s value. +to name, except for those using or changing the +-n attribute itself, are performed on the variable referenced by +name’s value. The nameref attribute cannot be applied to array variables.

                      -
                      -r
                      -

                      Make names readonly. These names cannot then be assigned values +

                      -r
                      +

                      Make names readonly. These names cannot then be assigned values by subsequent assignment statements or unset.

                      -
                      -t
                      -

                      Give each name the trace attribute. -Traced functions inherit the DEBUG and RETURN traps from +

                      -t
                      +

                      Give each name the trace attribute. +Traced functions inherit the DEBUG and RETURN traps from the calling shell. The trace attribute has no special meaning for variables.

                      -
                      -u
                      +
                      -u

                      When the variable is assigned a value, all lower-case characters are converted to upper-case. The lower-case attribute is disabled.

                      -
                      -x
                      -

                      Mark each name for export to subsequent commands via +

                      -x
                      +

                      Mark each name for export to subsequent commands via the environment.

                      -

                      Using ‘+’ instead of ‘-’ turns off the attribute instead, -with the exceptions that ‘+a’ and ‘+A’ -may not be used to destroy array variables and ‘+r’ will not +

                      Using ‘+’ instead of ‘-’ turns off the attribute instead, +with the exceptions that ‘+a’ and ‘+A’ +may not be used to destroy array variables and ‘+r’ will not remove the readonly attribute. -When used in a function, declare makes each name local, -as with the local command, unless the -g option is used. -If a variable name is followed by =value, the value of the variable -is set to value. +When used in a function, declare makes each name local, +as with the local command, unless the -g option is used. +If a variable name is followed by =value, the value of the variable +is set to value.

                      -

                      When using -a or -A and the compound assignment syntax to +

                      When using -a or -A and the compound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments.

                      The return status is zero unless an invalid option is encountered, -an attempt is made to define a function using ‘-f foo=bar’, +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 attempt is made to assign a value to an array variable without -using the compound assignment syntax (see Arrays), -one of the names is not a valid shell variable name, +using the compound assignment syntax (see Arrays), +one of the names 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 attempt is made to display a non-existent function with -f. +or an attempt is made to display a non-existent function with -f.

                      -
                      echo
                      +
                      echo
                      -
                      echo [-neE] [arg …]
                      +
                      echo [-neE] [arg ...]
                       
                      -

                      Output the args, separated by spaces, terminated with a +

                      Output the args, separated by spaces, terminated with a newline. The return status is 0 unless a write error occurs. -If -n is specified, the trailing newline is suppressed. -If the -e option is given, interpretation of the following +If -n is specified, the trailing newline is suppressed. +If the -e option is given, interpretation of the following backslash-escaped characters is enabled. -The -E option disables the interpretation of these escape characters, +The -E option disables the interpretation of these escape characters, even on systems where they are interpreted by default. -The xpg_echo shell option may be used to -dynamically determine whether or not echo +The xpg_echo shell option may be used to +dynamically determine whether or not echo interprets any options and expands these escape characters by default. -echo does not interpret -- to mean the end of options. +echo does not interpret -- to mean the end of options.

                      -

                      echo interprets the following escape sequences: -

                      -
                      \a
                      +

                      echo interprets the following escape sequences: +

                      +
                      \a

                      alert (bell)

                      -
                      \b
                      +
                      \b

                      backspace

                      -
                      \c
                      +
                      \c

                      suppress further output

                      -
                      \e
                      -
                      \E
                      +
                      \e
                      +
                      \E

                      escape

                      -
                      \f
                      +
                      \f

                      form feed

                      -
                      \n
                      +
                      \n

                      new line

                      -
                      \r
                      +
                      \r

                      carriage return

                      -
                      \t
                      +
                      \t

                      horizontal tab

                      -
                      \v
                      +
                      \v

                      vertical tab

                      -
                      \\
                      +
                      \\

                      backslash

                      -
                      \0nnn
                      -

                      the eight-bit character whose value is the octal value nnn +

                      \0nnn
                      +

                      the eight-bit character whose value is the octal value nnn (zero to three octal digits)

                      -
                      \xHH
                      -

                      the eight-bit character whose value is the hexadecimal value HH +

                      \xHH
                      +

                      the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)

                      -
                      \uHHHH
                      +
                      \uHHHH

                      the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value -HHHH (one to four hex digits) +HHHH (one to four hex digits)

                      -
                      \UHHHHHHHH
                      +
                      \UHHHHHHHH

                      the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value -HHHHHHHH (one to eight hex digits) +HHHHHHHH (one to eight hex digits)

                      -
                      enable
                      +
                      enable
                      -
                      enable [-a] [-dnps] [-f filename] [name …]
                      +
                      enable [-a] [-dnps] [-f filename] [name ...]
                       

                      Enable and disable builtin shell commands. Disabling a builtin allows a disk command 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 disk commands. -If -n is used, the names become disabled. Otherwise -names are enabled. For example, to use the test binary -found via $PATH instead of the shell builtin version, type -‘enable -n test’. +If -n is used, the names become disabled. Otherwise +names are enabled. For example, to use the test binary +found via $PATH instead of the shell builtin version, type +‘enable -n test’.

                      -

                      If the -p option is supplied, or no name arguments appear, +

                      If the -p option is supplied, or no name arguments appear, a list of shell builtins is printed. With no other arguments, the list consists of all enabled shell builtins. -The -a option means to list +The -a option means to list each builtin with an indication of whether or not it is enabled.

                      -

                      The -f option means to load the new builtin command name -from shared object filename, on systems that support dynamic loading. -Bash will use the value of the BASH_LOADABLES_PATH variable as a -colon-separated list of directories in which to search for filename, -if filename does not contain a slash. +

                      The -f option means to load the new builtin command name +from shared object filename, on systems that support dynamic loading. +Bash will use the value of the BASH_LOADABLES_PATH variable as a +colon-separated list of directories in which to search for filename, +if filename does not contain a slash. The default is system-dependent, and may include "." to force a search of the current directory. -The -d option will delete a builtin loaded with -f. +The -d option will delete a builtin loaded with -f.

                      If there are no options, a list of the shell builtins is displayed. -The -s option restricts enable to the POSIX special -builtins. If -s is used with -f, the new builtin becomes -a special builtin (see Special Builtins). +The -s option restricts enable to the POSIX special +builtins. If -s is used with -f, the new builtin becomes +a special builtin (see 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, as if the command were -‘enable -f name name’. +

                      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, as if the command were +‘enable -f name name’.

                      -

                      The return status is zero unless a name is not a shell builtin +

                      The return status is zero unless a name is not a shell builtin or there is an error loading a new builtin from a shared object.

                      -
                      help
                      +
                      help
                      -
                      help [-dms] [pattern]
                      +
                      help [-dms] [pattern]
                       

                      Display helpful information about builtin commands. -If pattern is specified, help gives detailed help -on all commands matching pattern, otherwise a list of +If pattern is specified, help gives detailed help +on all commands matching pattern, otherwise a list of the builtins is printed.

                      Options, if supplied, have the following meanings:

                      -
                      -
                      -d
                      -

                      Display a short description of each pattern +

                      +
                      -d
                      +

                      Display a short description of each pattern

                      -
                      -m
                      -

                      Display the description of each pattern in a manpage-like format +

                      -m
                      +

                      Display the description of each pattern in a manpage-like format

                      -
                      -s
                      -

                      Display only a short usage synopsis for each pattern +

                      -s
                      +

                      Display only a short usage synopsis for each pattern

                      -

                      The return status is zero unless no command matches pattern. +

                      The return status is zero unless no command matches pattern.

                      -
                      let
                      +
                      let
                      -
                      let expression [expression …]
                      +
                      let expression [expression ...]
                       
                      -

                      The let builtin allows arithmetic to be performed on shell -variables. Each expression is evaluated according to the -rules given below in Shell Arithmetic. If the -last expression evaluates to 0, let returns 1; +

                      The let builtin allows arithmetic to be performed on shell +variables. Each expression is evaluated according to the +rules given below in Shell Arithmetic. If the +last expression evaluates to 0, let returns 1; otherwise 0 is returned.

                      -
                      local
                      +
                      local
                      -
                      local [option] name[=value] …
                      +
                      local [option] name[=value] ...
                       
                      -

                      For each argument, a local variable named name is created, -and assigned value. -The option can be any of the options accepted by declare. -local can only be used within a function; it makes the variable -name have a visible scope restricted to that function and its +

                      For each argument, a local variable named name is created, +and assigned value. +The option can be any of the options accepted by declare. +local can only be used within a function; it makes the variable +name have a visible scope restricted to that function and its children. -If name is ‘-’, the set of shell options is made local to the -function in which local is invoked: shell options changed using -the set builtin inside the function -after the call to local +If name is ‘-’, the set of shell options is made local to the +function in which local is invoked: shell options changed using +the set builtin inside the function +after the call to local are restored to their original values when the function returns. -The restore is effected as if a series of set commands were executed +The restore is effected as if a series of set commands were executed to restore the values that were in place before the function. -The return status is zero unless local is used outside -a function, an invalid name is supplied, or name is a +The return status is zero unless local is used outside +a function, an invalid name is supplied, or name is a readonly variable.

                      -
                      logout
                      +
                      logout
                      -
                      logout [n]
                      +
                      logout [n]
                       
                      -

                      Exit a login shell, returning a status of n to the shell’s +

                      Exit a login shell, returning a status of n to the shell’s parent.

                      -
                      mapfile
                      +
                      mapfile
                      -
                      mapfile [-d delim] [-n count] [-O origin] [-s count]
                      -    [-t] [-u fd] [-C callback] [-c quantum] [array]
                      +
                      mapfile [-d delim] [-n count] [-O origin] [-s count]
                      +    [-t] [-u fd] [-C callback] [-c quantum] [array]
                       
                      -

                      Read lines from the standard input into the indexed array variable array, -or from file descriptor fd -if the -u option is supplied. -The variable MAPFILE is the default array. +

                      Read lines from the standard input into the indexed array variable array, +or from file descriptor fd +if the -u option is supplied. +The variable MAPFILE is the default array. Options, if supplied, have the following meanings:

                      -
                      -
                      -d
                      -

                      The first character of delim is used to terminate each input line, +

                      +
                      -d
                      +

                      The first character of delim is used to terminate each input line, rather than newline. -If delim is the empty string, mapfile will terminate a line +If delim is the empty string, mapfile will terminate a line when it reads a NUL character.

                      -
                      -n
                      -

                      Copy at most count lines. If count is 0, all lines are copied. +

                      -n
                      +

                      Copy at most count lines. If count is 0, all lines are copied.

                      -
                      -O
                      -

                      Begin assigning to array at index origin. +

                      -O
                      +

                      Begin assigning to array at index origin. The default index is 0.

                      -
                      -s
                      -

                      Discard the first count lines read. +

                      -s
                      +

                      Discard the first count lines read.

                      -
                      -t
                      -

                      Remove a trailing delim (default newline) from each line read. +

                      -t
                      +

                      Remove a trailing delim (default newline) from each line read.

                      -
                      -u
                      -

                      Read lines from file descriptor fd instead of the standard input. +

                      -u
                      +

                      Read lines from file descriptor fd instead of the standard input.

                      -
                      -C
                      -

                      Evaluate callback each time quantum lines are read. -The -c option specifies quantum. +

                      -C
                      +

                      Evaluate callback each time quantum lines are read. +The -c option specifies quantum.

                      -
                      -c
                      -

                      Specify the number of lines read between each call to callback. +

                      -c
                      +

                      Specify the number of lines read between each call to callback.

                      -

                      If -C is specified without -c, +

                      If -C is specified without -c, the default quantum is 5000. -When callback is evaluated, it is supplied the index of the next +When callback is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that element as additional arguments. -callback is evaluated after the line is read but before the +callback is evaluated after the line is read but before the array element is assigned.

                      -

                      If not supplied with an explicit origin, mapfile will clear array +

                      If not supplied with an explicit origin, mapfile will clear array before assigning to it.

                      -

                      mapfile returns successfully unless an invalid option or option -argument is supplied, array is invalid or unassignable, or array +

                      mapfile returns successfully unless an invalid option or option +argument is supplied, array is invalid or unassignable, or array is not an indexed array.

                      -
                      printf
                      +
                      printf
                      -
                      printf [-v var] format [arguments]
                      +
                      printf [-v var] format [arguments]
                       
                      -

                      Write the formatted arguments to the standard output under the -control of the format. -The -v option causes the output to be assigned to the variable -var rather than being printed to the standard output. +

                      Write the formatted arguments to the standard output under the +control of the format. +The -v option causes the output to be assigned to the variable +var rather than being printed to the standard output.

                      -

                      The format is a character string which contains three types of objects: +

                      The format is a character string which contains three types of objects: plain characters, which are simply copied to standard output, character escape sequences, which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive -argument. -In addition to the standard printf(3) format characters -csndiouxXeEfFgGaA, -printf interprets the following additional format specifiers: -

                      -
                      -
                      %b
                      -

                      Causes printf to expand backslash escape sequences in the -corresponding argument in the same way as echo -e -(see Bash Builtin Commands). +argument. +In addition to the standard printf(3) format characters +csndiouxXeEfFgGaA, +printf interprets the following additional format specifiers: +

                      +
                      +
                      %b
                      +

                      Causes printf to expand backslash escape sequences in the +corresponding argument in the same way as echo -e +(see Bash Builtin Commands).

                      -
                      %q
                      -

                      Causes printf to output the -corresponding argument in a format that can be reused as shell input. -%q and %QP use the ANSI-C quoting style (see ANSI-C Quoting) +

                      %q
                      +

                      Causes printf to output the +corresponding argument in a format that can be reused as shell input. +%q and %QP use the ANSI-C quoting style (see ANSI-C Quoting) if any characters in the argument string require it, and backslash quoting otherwise. -If the format string uses the printf alternate form, these two +If the format string uses the printf alternate form, these two formats quote the argument string using single quotes.

                      -
                      %Q
                      -

                      like %q, but applies any supplied precision to the argument +

                      %Q
                      +

                      like %q, but applies any supplied precision to the argument before quoting it.

                      -
                      %(datefmt)T
                      -

                      Causes printf to output the date-time string resulting from using -datefmt as a format string for strftime(3). -The corresponding argument is an integer representing the number of +

                      %(datefmt)T
                      +

                      Causes printf to output the date-time string resulting from using +datefmt as a format string for strftime(3). +The corresponding argument is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. If no argument is specified, conversion behaves as if -1 had been given. -This is an exception to the usual printf behavior. +This is an exception to the usual printf behavior.

                      @@ -5639,8 +5652,8 @@ except that a leading plus or minus sign is allowed, and if the leading character is a single or double quote, the value is the ASCII value of the following character.

                      -

                      The format is reused as necessary to consume all of the arguments. -If the format requires more arguments than are supplied, the +

                      The format is reused as necessary to consume all of the arguments. +If the format requires more arguments than are supplied, the extra format specifications behave as if a zero value or null string, as appropriate, had been supplied. The return value is zero on success, @@ -5648,112 +5661,112 @@ non-zero if an invalid option is supplied or a write or assignment error occurs.

                      -
                      read
                      +
                      read
                      -
                      read [-Eers] [-a aname] [-d delim] [-i text] [-n nchars]
                      -    [-N nchars] [-p prompt] [-t timeout] [-u fd] [name …]
                      +
                      read [-Eers] [-a aname] [-d delim] [-i text] [-n nchars]
                      +    [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
                       

                      One line is read from the standard input, or from the file descriptor -fd supplied as an argument to the -u option, -split into words as described above in Word Splitting, +fd supplied as an argument to the -u option, +split into words as described above in Word Splitting, and the first word -is assigned to the first name, the second word to the second name, +is assigned to the first name, the second word to the second name, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned -to the last name. +to the last name. If there are fewer words read from the input stream than names, the remaining names are assigned empty values. -The characters in the value of the IFS variable +The characters in the value of the IFS variable are used to split the line into words using the same rules the shell -uses for expansion (described above in Word Splitting). -The backslash character ‘\’ may be used to remove any special +uses for expansion (described above in Word Splitting). +The backslash character ‘\’ may be used to remove any special meaning for the next character read and for line continuation.

                      Options, if supplied, have the following meanings:

                      -
                      -
                      -a aname
                      +
                      +
                      -a aname

                      The words are assigned to sequential indices of the array variable -aname, starting at 0. -All elements are removed from aname before the assignment. -Other name arguments are ignored. +aname, starting at 0. +All elements are removed from aname before the assignment. +Other name arguments are ignored.

                      -
                      -d delim
                      -

                      The first character of delim is used to terminate the input line, +

                      -d delim
                      +

                      The first character of delim is used to terminate the input line, rather than newline. -If delim is the empty string, read will terminate a line +If delim is the empty string, read will terminate a line when it reads a NUL character.

                      -
                      -e
                      -

                      Readline (see Command Line Editing) is used to obtain the line. +

                      -e
                      +

                      Readline (see Command Line Editing) is used to obtain the line. Readline uses the current (or default, if line editing was not previously active) editing settings, but uses Readline’s default filename completion.

                      -
                      -E
                      -

                      Readline (see Command Line Editing) is used to obtain the line. +

                      -E
                      +

                      Readline (see Command Line Editing) is used to obtain the line. Readline uses the current (or default, if line editing was not previously active) editing settings, but uses Bash’s default completion, including programmable completion.

                      -
                      -i text
                      -

                      If Readline is being used to read the line, text is placed into +

                      -i text
                      +

                      If Readline is being used to read the line, text is placed into the editing buffer before editing begins.

                      -
                      -n nchars
                      -

                      read returns after reading nchars characters rather than +

                      -n nchars
                      +

                      read returns after reading nchars characters rather than waiting for a complete line of input, but honors a delimiter if fewer -than nchars characters are read before the delimiter. +than nchars characters are read before the delimiter.

                      -
                      -N nchars
                      -

                      read returns after reading exactly nchars characters rather +

                      -N nchars
                      +

                      read returns after reading exactly nchars characters rather than waiting for a complete line of input, unless EOF is encountered or -read times out. +read times out. Delimiter characters encountered in the input are -not treated specially and do not cause read to return until -nchars characters are read. -The result is not split on the characters in IFS; the intent is +not treated specially and do not cause read to return until +nchars characters are read. +The result is not split on the characters in IFS; the intent is that the variable is assigned exactly the characters read -(with the exception of backslash; see the -r option below). +(with the exception of backslash; see the -r option below).

                      -
                      -p prompt
                      -

                      Display prompt, without a trailing newline, before attempting +

                      -p prompt
                      +

                      Display prompt, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal.

                      -
                      -r
                      +
                      -r

                      If this option is given, backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not then be used as a line continuation.

                      -
                      -s
                      +
                      -s

                      Silent mode. If input is coming from a terminal, characters are not echoed.

                      -
                      -t timeout
                      -

                      Cause read to time out and return failure if a complete line of +

                      -t timeout
                      +

                      Cause read to time out and return failure if a complete line of input (or a specified number of characters) -is not read within timeout seconds. -timeout may be a decimal number with a fractional portion following +is not read within timeout seconds. +timeout may be a decimal number with a fractional portion following the decimal point. -This option is only effective if read is reading input from a +This option is only effective if read is reading input from a terminal, pipe, or other special file; it has no effect when reading from regular files. -If read times out, read saves any partial input read into -the specified variable name. -If timeout is 0, read returns immediately, without trying to +If read times out, read saves any partial input read into +the specified variable name. +If timeout is 0, read returns immediately, without trying to read any data. The exit status is 0 if input is available on the specified file descriptor, or the read will return EOF, @@ -5761,616 +5774,619 @@ non-zero otherwise. The exit status is greater than 128 if the timeout is exceeded.

                      -
                      -u fd
                      -

                      Read input from file descriptor fd. +

                      -u fd
                      +

                      Read input from file descriptor fd.

                      -

                      If no names are supplied, the line read, +

                      Other than the case where delim is the empty string, read +ignores any NUL characters in the input. +

                      +

                      If no names are supplied, the line read, without the ending delimiter but otherwise unmodified, is assigned to the -variable REPLY. -The exit status is zero, unless end-of-file is encountered, read +variable REPLY. +The exit status is zero, unless end-of-file is encountered, read times out (in which case the status is greater than 128), a variable assignment error (such as assigning to a readonly variable) occurs, -or an invalid file descriptor is supplied as the argument to -u. +or an invalid file descriptor is supplied as the argument to -u.

                      -
                      readarray
                      +
                      readarray
                      -
                      readarray [-d delim] [-n count] [-O origin] [-s count]
                      -    [-t] [-u fd] [-C callback] [-c quantum] [array]
                      +
                      readarray [-d delim] [-n count] [-O origin] [-s count]
                      +    [-t] [-u fd] [-C callback] [-c quantum] [array]
                       
                      -

                      Read lines from the standard input into the indexed array variable array, -or from file descriptor fd -if the -u option is supplied. +

                      Read lines from the standard input into the indexed array variable array, +or from file descriptor fd +if the -u option is supplied.

                      -

                      A synonym for mapfile. +

                      A synonym for mapfile.

                      -
                      source
                      +
                      source
                      -
                      source filename
                      +
                      source filename
                       
                      -

                      A synonym for . (see Bourne Shell Builtins). +

                      A synonym for . (see Bourne Shell Builtins).

                      -
                      type
                      +
                      type
                      -
                      type [-afptP] [name …]
                      +
                      type [-afptP] [name ...]
                       
                      -

                      For each name, indicate how it would be interpreted if used as a +

                      For each name, indicate how it would be interpreted if used as a command name.

                      -

                      If the -t option is used, type prints a single word -which is one of ‘alias’, ‘keyword’, ‘function’, -‘builtin’, or ‘file’, -if name is an alias, shell reserved word, shell function, +

                      If the -t option is used, type prints a single word +which is one of ‘alias’, ‘keyword’, ‘function’, +‘builtin’, or ‘file’, +if name is an alias, shell reserved word, shell function, shell builtin, or executable disk file, respectively. -If the name is not found, then nothing is printed, and -type returns a failure status. +If the name is not found, then nothing is printed, and +type returns a failure status.

                      -

                      If the -p option is used, type either returns the name -of the executable file that would be found by searching $PATH, -or nothing if -t would not return ‘file’. +

                      If the -p option is used, type either returns the name +of the executable file that would be found by searching $PATH, +or nothing if -t would not return ‘file’.

                      -

                      The -P option forces a path search for each name, even if --t would not return ‘file’. +

                      The -P option forces a path search for each name, even if +-t would not return ‘file’.

                      -

                      If a name is present in the table of hashed commands, -options -p and -P print the hashed value, which is not -necessarily the file that appears first in $PATH. +

                      If a name is present in the table of hashed commands, +options -p and -P print the hashed value, which is not +necessarily the file that appears first in $PATH.

                      -

                      If the -a option is used, type returns all of the places -that contain a command named name. +

                      If the -a option is used, type returns all of the places +that contain a command named name. This includes aliases, reserved words, functions, and builtins, -but the path search options (-p and -P) can be supplied +but the path search options (-p and -P) can be supplied to restrict the output to executable files. -If -a is supplied with -p, type does not look -in the table of hashed commands, and only performs a PATH -search for name. +If -a is supplied with -p, type does not look +in the table of hashed commands, and only performs a PATH +search for name.

                      -

                      If the -f option is used, type does not attempt to find -shell functions, as with the command builtin. +

                      If the -f option is used, type does not attempt to find +shell functions, as with the command builtin.

                      -

                      The return status is zero if all of the names are found, non-zero +

                      The return status is zero if all of the names are found, non-zero if any are not found.

                      -
                      typeset
                      +
                      typeset
                      -
                      typeset [-afFgrxilnrtux] [-p] [name[=value] …]
                      +
                      typeset [-afFgrxilnrtux] [-p] [name[=value] ...]
                       
                      -

                      The typeset command is supplied for compatibility with the Korn +

                      The typeset command is supplied for compatibility with the Korn shell. -It is a synonym for the declare builtin command. +It is a synonym for the declare builtin command.

                      -
                      ulimit
                      +
                      ulimit
                      -
                      ulimit [-HS] -a
                      -ulimit [-HS] [-bcdefiklmnpqrstuvxPRT] [limit]
                      +
                      ulimit [-HS] -a
                      +ulimit [-HS] [-bcdefiklmnpqrstuvxPRT] [limit]
                       
                      -

                      ulimit provides control over the resources available to processes +

                      ulimit provides control over the resources available to processes started by the shell, on systems that allow such control. If an option is given, it is interpreted as follows:

                      -
                      -
                      -S
                      +
                      +
                      -S

                      Change and report the soft limit associated with a resource.

                      -
                      -H
                      +
                      -H

                      Change and report the hard limit associated with a resource.

                      -
                      -a
                      +
                      -a

                      All current limits are reported; no limits are set.

                      -
                      -b
                      +
                      -b

                      The maximum socket buffer size.

                      -
                      -c
                      +
                      -c

                      The maximum size of core files created.

                      -
                      -d
                      +
                      -d

                      The maximum size of a process’s data segment.

                      -
                      -e
                      +
                      -e

                      The maximum scheduling priority ("nice").

                      -
                      -f
                      +
                      -f

                      The maximum size of files written by the shell and its children.

                      -
                      -i
                      +
                      -i

                      The maximum number of pending signals.

                      -
                      -k
                      +
                      -k

                      The maximum number of kqueues that may be allocated.

                      -
                      -l
                      +
                      -l

                      The maximum size that may be locked into memory.

                      -
                      -m
                      +
                      -m

                      The maximum resident set size (many systems do not honor this limit).

                      -
                      -n
                      +
                      -n

                      The maximum number of open file descriptors (most systems do not allow this value to be set).

                      -
                      -p
                      +
                      -p

                      The pipe buffer size.

                      -
                      -q
                      -

                      The maximum number of bytes in POSIX message queues. +

                      -q
                      +

                      The maximum number of bytes in POSIX message queues.

                      -
                      -r
                      +
                      -r

                      The maximum real-time scheduling priority.

                      -
                      -s
                      +
                      -s

                      The maximum stack size.

                      -
                      -t
                      +
                      -t

                      The maximum amount of cpu time in seconds.

                      -
                      -u
                      +
                      -u

                      The maximum number of processes available to a single user.

                      -
                      -v
                      +
                      -v

                      The maximum amount of virtual memory available to the shell, and, on some systems, to its children.

                      -
                      -x
                      +
                      -x

                      The maximum number of file locks.

                      -
                      -P
                      +
                      -P

                      The maximum number of pseudoterminals.

                      -
                      -R
                      +
                      -R

                      The maximum time a real-time process can run before blocking, in microseconds.

                      -
                      -T
                      +
                      -T

                      The maximum number of threads.

                      -

                      If limit is given, and the -a option is not used, -limit is the new value of the specified resource. -The special limit values hard, soft, and -unlimited stand for the current hard limit, the current soft limit, +

                      If limit is given, and the -a option is not used, +limit is the new value of the specified resource. +The special limit values hard, soft, and +unlimited stand for the current hard limit, the current soft limit, and no limit, respectively. 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. Otherwise, the current value of the soft limit for the specified resource -is printed, unless the -H option is supplied. +is printed, unless the -H option is supplied. When more than one resource is specified, the limit name and unit, if appropriate, are printed before the value. -When setting new limits, if neither -H nor -S is supplied, +When setting new limits, if neither -H nor -S is supplied, both the hard and soft limits are set. -If no option is given, then -f is assumed. Values are in 1024-byte +If no option is given, then -f is assumed. 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 (see Bash and POSIX), --c and -f, which are in 512-byte increments. +-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 (see Bash and POSIX), +-c and -f, which are in 512-byte increments.

                      The return status is zero unless an invalid option or argument is supplied, or an error occurs while setting a new limit.

                      -
                      unalias
                      +
                      unalias
                      -
                      unalias [-a] [name … ]
                      +
                      unalias [-a] [name ... ]
                       
                      -

                      Remove each name from the list of aliases. If -a is +

                      Remove each name from the list of aliases. If -a is supplied, all aliases are removed. -Aliases are described in Aliases. +Aliases are described in Aliases.


                      -
                      -
                      +
                      + -

                      4.3 Modifying Shell Behavior

                      +

                      4.3 Modifying Shell Behavior

                      -
                        +
                        -
                        -
                        +
                        + -

                        4.3.1 The Set Builtin

                        +

                        4.3.1 The Set Builtin

                        -

                        This builtin is so complicated that it deserves its own section. set +

                        This builtin is so complicated that it deserves its own section. set allows you to change the values of shell options and set the positional parameters, or to display the names and values of shell variables.

                        -
                        -
                        set
                        +
                        +
                        set
                        -
                        set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [argument …]
                        -set [+abefhkmnptuvxBCEHPT] [+o option-name] [--] [-] [argument …]
                        +
                        set [-abefhkmnptuvxBCEHPT] [-o option-name] [--] [-] [argument ...]
                        +set [+abefhkmnptuvxBCEHPT] [+o option-name] [--] [-] [argument ...]
                         set -o
                         set +o
                         
                        -

                        If no options or arguments are supplied, set displays the names +

                        If no options or arguments are supplied, set displays the names and values of all shell variables and functions, sorted according to the current locale, in a format that may be reused as input for setting or resetting the currently-set variables. Read-only variables cannot be reset. -In POSIX mode, only shell variables are listed. +In POSIX mode, only shell variables are listed.

                        When options are supplied, they set or unset shell attributes. Options, if specified, have the following meanings:

                        -
                        -
                        -a
                        +
                        +
                        -a

                        Each variable or function that is created or modified is given the export attribute and marked for export to the environment of subsequent commands.

                        -
                        -b
                        +
                        -b

                        Cause the status of terminated background jobs to be reported immediately, rather than before printing the next primary prompt.

                        -
                        -e
                        +
                        -e

                        Exit immediately if -a pipeline (see Pipelines), which may consist of a single simple command -(see Simple Commands), -a list (see Lists of Commands), -or a compound command (see Compound Commands) +a pipeline (see Pipelines), which may consist of a single simple command +(see Simple Commands), +a list (see Lists of Commands), +or a compound command (see Compound Commands) returns a non-zero status. The shell does not exit if the command that fails is part of the -command list immediately following a while or until keyword, -part of the test in an if statement, -part of any command executed in a && or || list except -the command following the final && or ||, +command list immediately following a while or until keyword, +part of the test in an if statement, +part of any command executed in a && or || list except +the command following the final && or ||, any command in a pipeline but the last, -or if the command’s return status is being inverted with !. +or if the command’s return status is being inverted with !. If a compound command other than a subshell returns a non-zero status because a command failed -while -e was being ignored, the shell does not exit. -A trap on ERR, if set, is executed before the shell exits. +while -e was being ignored, the shell does not exit. +A trap on ERR, if set, is executed before the shell exits.

                        This option applies to the shell environment and each subshell environment -separately (see Command Execution Environment), and may cause +separately (see Command Execution Environment), and may cause subshells to exit before executing all the commands in the subshell.

                        If a compound command or shell function executes in a context where --e is being ignored, +-e is being ignored, none of the commands executed within the compound command or function body -will be affected by the -e setting, even if -e is set +will be affected by the -e setting, even if -e is set and a command returns a failure status. -If a compound command or shell function sets -e while executing in -a context where -e is ignored, that setting will not have any +If a compound command or shell function sets -e while executing in +a context where -e is ignored, that setting will not have any effect until the compound command or the command containing the function call completes.

                        -
                        -f
                        +
                        -f

                        Disable filename expansion (globbing).

                        -
                        -h
                        +
                        -h

                        Locate and remember (hash) commands as they are looked up for execution. This option is enabled by default.

                        -
                        -k
                        +
                        -k

                        All arguments in the form of assignment statements are placed in the environment for a command, not just those that precede the command name.

                        -
                        -m
                        -

                        Job control is enabled (see Job Control). +

                        -m
                        +

                        Job control is enabled (see Job Control). All processes run in a separate process group. When a background job completes, the shell prints a line containing its exit status.

                        -
                        -n
                        +
                        -n

                        Read commands but do not execute them. This may be used to check a script for syntax errors. This option is ignored by interactive shells.

                        -
                        -o option-name
                        +
                        -o option-name
                        -

                        Set the option corresponding to option-name. -If -o is supplied with no option-name, -set prints the current shell options settings. -If +o is supplied with no option-name, -set prints a series of -set +

                        Set the option corresponding to option-name. +If -o is supplied with no option-name, +set prints the current shell options settings. +If +o is supplied with no option-name, +set prints a series of +set commands to recreate the current option settings on the standard output. Valid option names are:

                        -
                        -
                        allexport
                        -

                        Same as -a. +

                        +
                        allexport
                        +

                        Same as -a.

                        -
                        braceexpand
                        -

                        Same as -B. +

                        braceexpand
                        +

                        Same as -B.

                        -
                        emacs
                        -

                        Use an emacs-style line editing interface (see Command Line Editing). -This also affects the editing interface used for read -e. +

                        emacs
                        +

                        Use an emacs-style line editing interface (see Command Line Editing). +This also affects the editing interface used for read -e.

                        -
                        errexit
                        -

                        Same as -e. +

                        errexit
                        +

                        Same as -e.

                        -
                        errtrace
                        -

                        Same as -E. +

                        errtrace
                        +

                        Same as -E.

                        -
                        functrace
                        -

                        Same as -T. +

                        functrace
                        +

                        Same as -T.

                        -
                        hashall
                        -

                        Same as -h. +

                        hashall
                        +

                        Same as -h.

                        -
                        histexpand
                        -

                        Same as -H. +

                        histexpand
                        +

                        Same as -H.

                        -
                        history
                        -

                        Enable command history, as described in Bash History Facilities. +

                        history
                        +

                        Enable command history, as described in Bash History Facilities. This option is on by default in interactive shells.

                        -
                        ignoreeof
                        +
                        ignoreeof

                        An interactive shell will not exit upon reading EOF.

                        -
                        keyword
                        -

                        Same as -k. +

                        keyword
                        +

                        Same as -k.

                        -
                        monitor
                        -

                        Same as -m. +

                        monitor
                        +

                        Same as -m.

                        -
                        noclobber
                        -

                        Same as -C. +

                        noclobber
                        +

                        Same as -C.

                        -
                        noexec
                        -

                        Same as -n. +

                        noexec
                        +

                        Same as -n.

                        -
                        noglob
                        -

                        Same as -f. +

                        noglob
                        +

                        Same as -f.

                        -
                        nolog
                        +
                        nolog

                        Currently ignored.

                        -
                        notify
                        -

                        Same as -b. +

                        notify
                        +

                        Same as -b.

                        -
                        nounset
                        -

                        Same as -u. +

                        nounset
                        +

                        Same as -u.

                        -
                        onecmd
                        -

                        Same as -t. +

                        onecmd
                        +

                        Same as -t.

                        -
                        physical
                        -

                        Same as -P. +

                        physical
                        +

                        Same as -P.

                        -
                        pipefail
                        +
                        pipefail

                        If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands in the pipeline exit successfully. This option is disabled by default.

                        -
                        posix
                        +
                        posix

                        Change the behavior of Bash where the default operation differs -from the POSIX standard to match the standard -(see Bash and POSIX). +from the POSIX standard to match the standard +(see Bash and POSIX). This is intended to make Bash behave as a strict superset of that standard.

                        -
                        privileged
                        -

                        Same as -p. +

                        privileged
                        +

                        Same as -p.

                        -
                        verbose
                        -

                        Same as -v. +

                        verbose
                        +

                        Same as -v.

                        -
                        vi
                        -

                        Use a vi-style line editing interface. -This also affects the editing interface used for read -e. +

                        vi
                        +

                        Use a vi-style line editing interface. +This also affects the editing interface used for read -e.

                        -
                        xtrace
                        -

                        Same as -x. +

                        xtrace
                        +

                        Same as -x.

                        -
                        -p
                        +
                        -p

                        Turn on privileged mode. -In this mode, the $BASH_ENV and $ENV files are not +In this mode, the $BASH_ENV and $ENV files are not processed, shell functions are not inherited from the environment, -and the SHELLOPTS, BASHOPTS, CDPATH and GLOBIGNORE +and the SHELLOPTS, BASHOPTS, CDPATH and GLOBIGNORE 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 -p option is not supplied, these actions +real user (group) id, and the -p option is not supplied, these actions are taken and the effective user id is set to the real user id. -If the -p option is supplied at startup, the effective user id is +If the -p option is supplied at startup, the effective user id is not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids.

                        -
                        -r
                        -

                        Enable restricted shell mode (see The Restricted Shell). +

                        -r
                        +

                        Enable restricted shell mode (see The Restricted Shell). This option cannot be unset once it has been set.

                        -
                        -t
                        +
                        -t

                        Exit after reading and executing one command.

                        -
                        -u
                        +
                        -u

                        Treat unset variables and parameters other than the special parameters -‘@’ or ‘*’, -or array variables subscripted with ‘@’ or ‘*’, +‘@’ or ‘*’, +or array variables subscripted with ‘@’ or ‘*’, as an error when performing parameter expansion. An error message will be written to the standard error, and a non-interactive shell will exit.

                        -
                        -v
                        +
                        -v

                        Print shell input lines as they are read.

                        -
                        -x
                        -

                        Print a trace of simple commands, for commands, case -commands, select commands, and arithmetic for commands +

                        -x
                        +

                        Print a trace of simple commands, for commands, case +commands, select commands, and arithmetic for commands and their arguments or associated word lists to standard error after they are expanded and before they are executed. -The shell prints the expanded value of the PS4 variable before +The shell prints the expanded value of the PS4 variable before the command and its expanded arguments.

                        -
                        -B
                        -

                        The shell will perform brace expansion (see Brace Expansion). +

                        -B
                        +

                        The shell will perform brace expansion (see Brace Expansion). This option is on by default.

                        -
                        -C
                        -

                        Prevent output redirection using ‘>’, ‘>&’, and ‘<>’ +

                        -C
                        +

                        Prevent output redirection using ‘>’, ‘>&’, and ‘<>’ from overwriting existing files.

                        -
                        -E
                        -

                        If set, any trap on ERR is inherited by shell functions, command +

                        -E
                        +

                        If set, any trap on ERR is inherited by shell functions, command substitutions, and commands executed in a subshell environment. -The ERR trap is normally not inherited in such cases. +The ERR trap is normally not inherited in such cases.

                        -
                        -H
                        -

                        Enable ‘!’ style history substitution (see History Expansion). +

                        -H
                        +

                        Enable ‘!’ style history substitution (see History Expansion). This option is on by default for interactive shells.

                        -
                        -P
                        +
                        -P

                        If set, do not resolve symbolic links when performing commands such as -cd which change the current directory. The physical directory +cd which change the current directory. The physical directory is used instead. By default, Bash follows the logical chain of directories when performing commands which change the current directory.

                        -

                        For example, if /usr/sys is a symbolic link to /usr/local/sys +

                        For example, if /usr/sys is a symbolic link to /usr/local/sys then:

                        -
                        $ cd /usr/sys; echo $PWD
                        +
                        $ cd /usr/sys; echo $PWD
                         /usr/sys
                         $ cd ..; pwd
                         /usr
                         
                        -

                        If set -P is on, then: +

                        If set -P is on, then:

                        -
                        $ cd /usr/sys; echo $PWD
                        +
                        $ cd /usr/sys; echo $PWD
                         /usr/local/sys
                         $ cd ..; pwd
                         /usr/local
                         
                        -
                        -T
                        -

                        If set, any trap on DEBUG and RETURN are inherited by +

                        -T
                        +

                        If set, any trap on DEBUG and RETURN are inherited by shell functions, command substitutions, and commands executed in a subshell environment. -The DEBUG and RETURN traps are normally not inherited +The DEBUG and RETURN traps are normally not inherited in such cases.

                        -
                        --
                        +
                        --

                        If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the -arguments, even if some of them begin with a ‘-’. +arguments, even if some of them begin with a ‘-’.

                        -
                        -
                        -

                        Signal the end of options, cause all remaining arguments -to be assigned to the positional parameters. The -x -and -v options are turned off. +

                        -
                        +

                        Signal the end of options, cause all remaining arguments +to be assigned to the positional parameters. The -x +and -v options are turned off. If there are no arguments, the positional parameters remain unchanged.

                        -

                        Using ‘+’ rather than ‘-’ causes these options to be +

                        Using ‘+’ rather than ‘-’ causes these options to be turned off. The options can also be used upon invocation of the -shell. The current set of options may be found in $-. +shell. The current set of options may be found in $-.

                        -

                        The remaining N arguments are positional parameters and are -assigned, in order, to $1, $2, … $N. -The special parameter # is set to N. +

                        The remaining N arguments are positional parameters and are +assigned, in order, to $1, $2, … $N. +The special parameter # is set to N.

                        The return status is always zero unless an invalid option is supplied.

                        @@ -6378,71 +6394,71 @@ The special parameter # is set to N.
                        -
                        -
                        +
                        + -

                        4.3.2 The Shopt Builtin

                        +

                        4.3.2 The Shopt Builtin

                        This builtin allows you to change additional shell optional behavior.

                        -
                        -
                        shopt
                        +
                        +
                        shopt
                        -
                        shopt [-pqsu] [-o] [optname …]
                        +
                        shopt [-pqsu] [-o] [optname ...]
                         

                        Toggle the values of settings controlling optional shell behavior. The settings can be either those listed below, or, if the --o option is used, those available with the -o -option to the set builtin command (see The Set Builtin). -With no options, or with the -p option, a list of all settable +-o option is used, those available with the -o +option to the set builtin command (see The Set Builtin). +With no options, or with the -p option, a list of all settable options is displayed, with an indication of whether or not each is set; -if optnames are supplied, the output is restricted to those options. -The -p option causes output to be displayed in a form that +if optnames are supplied, the output is restricted to those options. +The -p option causes output to be displayed in a form that may be reused as input. Other options have the following meanings:

                        -
                        -
                        -s
                        -

                        Enable (set) each optname. +

                        +
                        -s
                        +

                        Enable (set) each optname.

                        -
                        -u
                        -

                        Disable (unset) each optname. +

                        -u
                        +

                        Disable (unset) each optname.

                        -
                        -q
                        +
                        -q

                        Suppresses normal output; the return status -indicates whether the optname is set or unset. -If multiple optname arguments are given with -q, -the return status is zero if all optnames are enabled; +indicates whether the optname is set or unset. +If multiple optname arguments are given with -q, +the return status is zero if all optnames are enabled; non-zero otherwise.

                        -
                        -o
                        +
                        -o

                        Restricts the values of -optname to be those defined for the -o option to the -set builtin (see The Set Builtin). +optname to be those defined for the -o option to the +set builtin (see The Set Builtin).

                        -

                        If either -s or -u -is used with no optname arguments, shopt shows only +

                        If either -s or -u +is used with no optname arguments, shopt shows only those options which are set or unset, respectively.

                        -

                        Unless otherwise noted, the shopt options are disabled (off) +

                        Unless otherwise noted, the shopt options are disabled (off) by default.

                        -

                        The return status when listing options is zero if all optnames +

                        The return status when listing options is zero if all optnames are enabled, non-zero otherwise. When setting or unsetting options, -the return status is zero unless an optname is not a valid shell +the return status is zero unless an optname is not a valid shell option.

                        -

                        The list of shopt options is: -

                        -
                        array_expand_once
                        +

                        The list of shopt options is: +

                        +
                        array_expand_once

                        If set, the shell suppresses multiple evaluation of associative and indexed array subscripts during arithmetic expression evaluation, while executing @@ -6450,25 +6466,25 @@ builtins that can perform variable assignments, and while executing builtins that perform array dereferencing.

                        -
                        assoc_expand_once
                        -

                        Deprecated; a synonym for array_expand_once. +

                        assoc_expand_once
                        +

                        Deprecated; a synonym for array_expand_once.

                        -
                        autocd
                        +
                        autocd

                        If set, a command name that is the name of a directory is executed as if -it were the argument to the cd command. +it were the argument to the cd command. This option is only used by interactive shells.

                        -
                        cdable_vars
                        -

                        If this is set, an argument to the cd builtin command that +

                        cdable_vars
                        +

                        If this is set, an argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.

                        -
                        cdspell
                        +
                        cdspell

                        If set, minor errors in the spelling of a directory component in a -cd command will be corrected. +cd command will be corrected. The errors checked for are transposed characters, a missing character, and a character too many. If a correction is found, the corrected path is printed, @@ -6476,48 +6492,48 @@ and the command proceeds. This option is only used by interactive shells.

                        -
                        checkhash
                        +
                        checkhash

                        If this is set, Bash checks that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal path search is performed.

                        -
                        checkjobs
                        +
                        checkjobs

                        If set, Bash lists the status of any stopped and running jobs before exiting an interactive shell. If any jobs are running, this causes the exit to be deferred until a second exit is attempted without an -intervening command (see Job Control). +intervening command (see Job Control). The shell always postpones exiting if any jobs are stopped.

                        -
                        checkwinsize
                        +
                        checkwinsize

                        If set, Bash checks the window size after each external (non-builtin) command and, if necessary, updates the values of -LINES and COLUMNS. +LINES and COLUMNS. This option is enabled by default.

                        -
                        cmdhist
                        +
                        cmdhist

                        If set, Bash 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 (see Bash History Facilities). +history is enabled (see Bash History Facilities).

                        -
                        compat31
                        -
                        compat32
                        -
                        compat40
                        -
                        compat41
                        -
                        compat42
                        -
                        compat43
                        -
                        compat44
                        +
                        compat31
                        +
                        compat32
                        +
                        compat40
                        +
                        compat41
                        +
                        compat42
                        +
                        compat43
                        +
                        compat44

                        These control aspects of the shell’s compatibility mode -(see Shell Compatibility Mode). +(see Shell Compatibility Mode).

                        -
                        complete_fullquote
                        +
                        complete_fullquote

                        If set, Bash quotes all shell metacharacters in filenames and directory names when performing completion. @@ -6535,7 +6551,7 @@ This variable is set by default, which is the default Bash behavior in versions through 4.2.

                        -
                        direxpand
                        +
                        direxpand

                        If set, Bash replaces directory names with the results of word expansion when performing filename completion. This changes the contents of the Readline editing @@ -6543,291 +6559,291 @@ buffer. If not set, Bash attempts to preserve what the user typed.

                        -
                        dirspell
                        +
                        dirspell

                        If set, Bash attempts spelling correction on directory names during word completion if the directory name initially supplied does not exist.

                        -
                        dotglob
                        +
                        dotglob

                        If set, Bash includes filenames beginning with a ‘.’ in the results of filename expansion. -The filenames ‘.’ and ‘..’ must always be matched explicitly, -even if dotglob is set. +The filenames ‘.’ and ‘..’ must always be matched explicitly, +even if dotglob is set.

                        -
                        execfail
                        +
                        execfail

                        If this is set, a non-interactive shell will not exit if -it cannot execute the file specified as an argument to the exec -builtin command. An interactive shell does not exit if exec +it cannot execute the file specified as an argument to the exec +builtin command. An interactive shell does not exit if exec fails.

                        -
                        expand_aliases
                        +
                        expand_aliases

                        If set, aliases are expanded as described below under Aliases, -Aliases. +Aliases. This option is enabled by default for interactive shells.

                        -
                        extdebug
                        +
                        extdebug

                        If set at shell invocation, or in a shell startup file, arrange to execute the debugger profile -before the shell starts, identical to the --debugger option. +before the shell starts, identical to the --debugger option. If set after invocation, behavior intended for use by debuggers is enabled:

                        -
                          -
                        1. The -F option to the declare builtin (see Bash Builtin Commands) +
                            +
                          1. The -F option to the declare builtin (see Bash Builtin Commands) displays the source file name and line number corresponding to each function name supplied as an argument. -
                          2. If the command run by the DEBUG trap returns a non-zero value, the +
                          3. If the command run by the DEBUG trap returns a non-zero value, the next command is skipped and not executed. -
                          4. If the command run by the DEBUG trap returns a value of 2, and the +
                          5. If the command run by the DEBUG trap returns a value of 2, and the shell is executing in a subroutine (a shell function or a shell script -executed by the . or source builtins), the shell simulates -a call to return. +executed by the . or source builtins), the shell simulates +a call to return. -
                          6. BASH_ARGC and BASH_ARGV are updated as described in their -descriptions (see Bash Variables). +
                          7. BASH_ARGC and BASH_ARGV are updated as described in their +descriptions (see Bash Variables).
                          8. Function tracing is enabled: command substitution, shell functions, and -subshells invoked with ( command ) inherit the -DEBUG and RETURN traps. +subshells invoked with ( command ) inherit the +DEBUG and RETURN traps.
                          9. Error tracing is enabled: command substitution, shell functions, and -subshells invoked with ( command ) inherit the -ERR trap. +subshells invoked with ( command ) inherit the +ERR trap.
                        -
                        extglob
                        +
                        extglob

                        If set, the extended pattern matching features described above -(see Pattern Matching) are enabled. +(see Pattern Matching) are enabled.

                        -
                        extquote
                        -

                        If set, $'string' and $"string" quoting is -performed within ${parameter} expansions +

                        extquote
                        +

                        If set, $'string' and $"string" quoting is +performed within ${parameter} expansions enclosed in double quotes. This option is enabled by default.

                        -
                        failglob
                        +
                        failglob

                        If set, patterns which fail to match filenames during filename expansion result in an expansion error.

                        -
                        force_fignore
                        -

                        If set, the suffixes specified by the FIGNORE shell variable +

                        force_fignore
                        +

                        If set, the suffixes specified by the FIGNORE shell variable cause words to be ignored when performing word completion even if the ignored words are the only possible completions. -See Bash Variables, for a description of FIGNORE. +See Bash Variables, for a description of FIGNORE. This option is enabled by default.

                        -
                        globasciiranges
                        +
                        globasciiranges

                        If set, range expressions used in pattern matching bracket expressions -(see Pattern Matching) +(see Pattern Matching) behave as if in the traditional C locale when performing comparisons. That is, the current locale’s collating sequence is not taken into account, so -‘b’ will not collate between ‘A’ and ‘B’, +‘b’ will not collate between ‘A’ and ‘B’, and upper-case and lower-case ASCII characters will collate together.

                        -
                        globskipdots
                        +
                        globskipdots

                        If set, filename expansion will never match the filenames -‘.’ and ‘..’, -even if the pattern begins with a ‘.’. +‘.’ and ‘..’, +even if the pattern begins with a ‘.’. This option is enabled by default.

                        -
                        globstar
                        -

                        If set, the pattern ‘**’ used in a filename expansion context will +

                        globstar
                        +

                        If set, the pattern ‘**’ used in a filename expansion context will match all files and zero or more directories and subdirectories. -If the pattern is followed by a ‘/’, only directories and +If the pattern is followed by a ‘/’, only directories and subdirectories match.

                        -
                        gnu_errfmt
                        -

                        If set, shell error messages are written in the standard GNU error +

                        gnu_errfmt
                        +

                        If set, shell error messages are written in the standard GNU error message format.

                        -
                        histappend
                        +
                        histappend

                        If set, the history list is appended to the file named by the value -of the HISTFILE +of the HISTFILE variable when the shell exits, rather than overwriting the file.

                        -
                        histreedit
                        +
                        histreedit

                        If set, and Readline is being used, a user is given the opportunity to re-edit a failed history substitution.

                        -
                        histverify
                        +
                        histverify

                        If set, and Readline is being used, the results of history substitution are not immediately passed to the shell parser. Instead, the resulting line is loaded into the Readline editing buffer, allowing further modification.

                        -
                        hostcomplete
                        +
                        hostcomplete

                        If set, and Readline is being used, Bash will attempt to perform -hostname completion when a word containing a ‘@’ is being -completed (see Letting Readline Type For You). This option is enabled +hostname completion when a word containing a ‘@’ is being +completed (see Letting Readline Type For You). This option is enabled by default.

                        -
                        huponexit
                        -

                        If set, Bash will send SIGHUP to all jobs when an interactive -login shell exits (see Signals). +

                        huponexit
                        +

                        If set, Bash will send SIGHUP to all jobs when an interactive +login shell exits (see Signals).

                        -
                        inherit_errexit
                        -

                        If set, command substitution inherits the value of the errexit option, +

                        inherit_errexit
                        +

                        If set, command substitution inherits the value of the errexit option, instead of unsetting it in the subshell environment. -This option is enabled when POSIX mode is enabled. +This option is enabled when POSIX mode is enabled.

                        -
                        interactive_comments
                        -

                        Allow a word beginning with ‘#’ +

                        interactive_comments
                        +

                        Allow a word beginning with ‘#’ to cause that word and all remaining characters on that line to be ignored in an interactive shell. This option is enabled by default.

                        -
                        lastpipe
                        +
                        lastpipe

                        If set, and job control is not active, the shell runs the last command of a pipeline not executed in the background in the current shell environment.

                        -
                        lithist
                        -

                        If enabled, and the cmdhist +

                        lithist
                        +

                        If enabled, and the cmdhist option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible.

                        -
                        localvar_inherit
                        +
                        localvar_inherit

                        If set, local variables inherit the value and attributes of a variable of the same name that exists at a previous scope before any new value is -assigned. The nameref attribute is not inherited. +assigned. The nameref attribute is not inherited.

                        -
                        localvar_unset
                        -

                        If set, calling unset on local variables in previous function scopes +

                        localvar_unset
                        +

                        If set, calling unset on local variables in previous function scopes marks them so subsequent lookups find them unset until that function returns. This is identical to the behavior of unsetting local variables at the current function scope.

                        -
                        login_shell
                        +
                        login_shell

                        The shell sets this option if it is started as a login shell -(see Invoking Bash). +(see Invoking Bash). The value may not be changed.

                        -
                        mailwarn
                        +
                        mailwarn

                        If set, and a file that Bash is checking for mail has been accessed since the last time it was checked, the message -"The mail in mailfile has been read" is displayed. +"The mail in mailfile has been read" is displayed.

                        -
                        no_empty_cmd_completion
                        +
                        no_empty_cmd_completion

                        If set, and Readline is being used, Bash will not attempt to search -the PATH for possible completions when completion is attempted +the PATH for possible completions when completion is attempted on an empty line.

                        -
                        nocaseglob
                        +
                        nocaseglob

                        If set, Bash matches filenames in a case-insensitive fashion when performing filename expansion.

                        -
                        nocasematch
                        +
                        nocasematch

                        If set, Bash matches patterns in a case-insensitive fashion when -performing matching while executing case or [[ -conditional commands (see Conditional Constructs, +performing matching while executing case or [[ +conditional commands (see Conditional Constructs, when performing pattern substitution word expansions, or when filtering possible completions as part of programmable completion.

                        -
                        noexpand_translation
                        +
                        noexpand_translation

                        If set, Bash encloses the translated results of $"..." quoting in single quotes instead of double quotes. If the string is not translated, this has no effect.

                        -
                        nullglob
                        +
                        nullglob

                        If set, filename expansion patterns which match no files -(see Filename Expansion) +(see Filename Expansion) expand to nothing and are removed, rather than expanding to themselves.

                        -
                        patsub_replacement
                        +
                        patsub_replacement

                        If set, Bash -expands occurrences of ‘&’ in the replacement string of pattern +expands occurrences of ‘&’ in the replacement string of pattern substitution to the text matched by the pattern, as described -above (see Shell Parameter Expansion). +above (see Shell Parameter Expansion). This option is enabled by default.

                        -
                        progcomp
                        +
                        progcomp

                        If set, the programmable completion facilities -(see Programmable Completion) are enabled. +(see Programmable Completion) are enabled. This option is enabled by default.

                        -
                        progcomp_alias
                        +
                        progcomp_alias

                        If set, and programmable completion is enabled, Bash treats a command name that doesn’t have any completions as a possible alias and attempts alias expansion. If it has an alias, Bash attempts programmable completion using the command word resulting from the expanded alias.

                        -
                        promptvars
                        +
                        promptvars

                        If set, prompt strings undergo parameter expansion, command substitution, arithmetic expansion, and quote removal after being expanded -as described below (see Controlling the Prompt). +as described below (see Controlling the Prompt). This option is enabled by default.

                        -
                        restricted_shell
                        +
                        restricted_shell

                        The shell sets this option if it is started in restricted mode -(see The Restricted Shell). +(see The Restricted Shell). The value may not be changed. This is not reset when the startup files are executed, allowing the startup files to discover whether or not a shell is restricted.

                        -
                        shift_verbose
                        -

                        If this is set, the shift +

                        shift_verbose
                        +

                        If this is set, the shift builtin prints an error message when the shift count exceeds the number of positional parameters.

                        -
                        sourcepath
                        -

                        If set, the . (source) builtin uses the value of PATH +

                        sourcepath
                        +

                        If set, the . (source) builtin uses the value of PATH to find the directory containing the file supplied as an argument. This option is enabled by default.

                        -
                        varredir_close
                        +
                        varredir_close

                        If set, the shell automatically closes file descriptors assigned using the -{varname} redirection syntax (see Redirections) instead of +{varname} redirection syntax (see Redirections) instead of leaving them open when the command completes.

                        -
                        xpg_echo
                        -

                        If set, the echo builtin expands backslash-escape sequences +

                        xpg_echo
                        +

                        If set, the echo builtin expands backslash-escape sequences by default. -If the posix shell option (see The Set Builtin) is also enabled, -echo does not +If the posix shell option (see The Set Builtin) is also enabled, +echo does not interpret any options.

                        @@ -6838,20 +6854,20 @@ interpret any options.
                        -
                        -
                        +
                        + -

                        4.4 Special Builtins

                        - +

                        4.4 Special Builtins

                        + -

                        For historical reasons, the POSIX standard has classified -several builtin commands as special. -When Bash is executing in POSIX mode, the special builtins +

                        For historical reasons, the POSIX standard has classified +several builtin commands as special. +When Bash is executing in POSIX mode, the special builtins differ from other builtin commands in three respects:

                        -
                          +
                          1. Special builtins are found before shell functions during command lookup.
                          2. If a special builtin returns an error status, a non-interactive shell exits. @@ -6860,106 +6876,106 @@ differ from other builtin commands in three respects: environment after the command completes.
                          -

                          When Bash is not executing in POSIX mode, these builtins behave no +

                          When Bash is not executing in POSIX mode, these builtins behave no differently than the rest of the Bash builtin commands. -The Bash POSIX mode is described in Bash and POSIX. +The Bash POSIX mode is described in Bash and POSIX.

                          -

                          These are the POSIX special builtins: +

                          These are the POSIX special builtins:

                          -
                          break : . source continue eval exec exit export readonly return set
                          +
                          break : . source continue eval exec exit export readonly return set
                           shift times trap unset
                           

                        -
                        -
                        +
                        + -

                        5 Shell Variables

                        +

                        5 Shell Variables

                        This chapter describes the shell variables that Bash uses. Bash automatically assigns default values to a number of variables.

                        -
                          +
                          -
                          -
                          +
                          + -

                          5.1 Bourne Shell Variables

                          +

                          5.1 Bourne Shell Variables

                          Bash uses certain shell variables in the same way as the Bourne shell. In some cases, Bash assigns a default value to the variable.

                          -
                          -
                          CDPATH
                          +
                          +
                          CDPATH

                          A colon-separated list of directories used as a search path for -the cd builtin command. +the cd builtin command.

                          -
                          HOME
                          -

                          The current user’s home directory; the default for the cd builtin +

                          HOME
                          +

                          The current user’s home directory; the default for the cd builtin command. The value of this variable is also used by tilde expansion -(see Tilde Expansion). +(see Tilde Expansion).

                          -
                          IFS
                          +
                          IFS

                          A list of characters that separate fields; used when the shell splits words as part of expansion.

                          -
                          MAIL
                          +
                          MAIL

                          If this parameter is set to a filename or directory name -and the MAILPATH variable +and the MAILPATH variable is not set, Bash informs the user of the arrival of mail in the specified file or Maildir-format directory.

                          -
                          MAILPATH
                          +
                          MAILPATH

                          A colon-separated list of filenames which the shell periodically checks for new mail. Each list entry can specify the message that is printed when new mail arrives in the mail file by separating the filename from the message with -a ‘?’. -When used in the text of the message, $_ expands to the name of +a ‘?’. +When used in the text of the message, $_ expands to the name of the current mail file.

                          -
                          OPTARG
                          -

                          The value of the last option argument processed by the getopts builtin. +

                          OPTARG
                          +

                          The value of the last option argument processed by the getopts builtin.

                          -
                          OPTIND
                          -

                          The index of the last option argument processed by the getopts builtin. +

                          OPTIND
                          +

                          The index of the last option argument processed by the getopts builtin.

                          -
                          PATH
                          +
                          PATH

                          A colon-separated list of directories in which the shell looks for commands. -A zero-length (null) directory name in the value of PATH indicates the +A zero-length (null) directory name in the value of PATH indicates the current directory. A null directory name may appear as two adjacent colons, or as an initial or trailing colon.

                          -
                          PS1
                          -

                          The primary prompt string. The default value is ‘\s-\v\$ ’. -See Controlling the Prompt, for the complete list of escape -sequences that are expanded before PS1 is displayed. +

                          PS1
                          +

                          The primary prompt string. The default value is ‘\s-\v\$ ’. +See Controlling the Prompt, for the complete list of escape +sequences that are expanded before PS1 is displayed.

                          -
                          PS2
                          -

                          The secondary prompt string. The default value is ‘> ’. -PS2 is expanded in the same way as PS1 before being +

                          PS2
                          +

                          The secondary prompt string. The default value is ‘> ’. +PS2 is expanded in the same way as PS1 before being displayed.

                          @@ -6967,23 +6983,23 @@ displayed.
                          -
                          -
                          +
                          + -

                          5.2 Bash Variables

                          +

                          5.2 Bash Variables

                          These variables are set or used by Bash, but other shells do not normally treat them specially.

                          A few variables used by Bash are described in different chapters: variables for controlling the job control facilities -(see Job Control Variables). +(see Job Control Variables).

                          -
                          -
                          _
                          -
                          +
                          +
                          _
                          +

                          ($_, an underscore.) At shell startup, set to the pathname used to invoke the shell or shell script being executed as passed in the environment @@ -6995,512 +7011,512 @@ and placed in the environment exported to that command. When checking mail, this parameter holds the name of the mail file.

                          -
                          BASH
                          +
                          BASH

                          The full pathname used to execute the current instance of Bash.

                          -
                          BASHOPTS
                          +
                          BASHOPTS

                          A colon-separated list of enabled shell options. Each word in -the list is a valid argument for the -s option to the -shopt builtin command (see The Shopt Builtin). -The options appearing in BASHOPTS are those reported -as ‘on’ by ‘shopt’. +the list is a valid argument for the -s option to the +shopt builtin command (see The Shopt Builtin). +The options appearing in BASHOPTS are those reported +as ‘on’ by ‘shopt’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files. This variable is readonly.

                          -
                          BASHPID
                          +
                          BASHPID

                          Expands to the process ID of the current Bash process. -This differs from $$ under certain circumstances, such as subshells +This differs from $$ under certain circumstances, such as subshells that do not require Bash to be re-initialized. -Assignments to BASHPID have no effect. -If BASHPID +Assignments to BASHPID have no effect. +If BASHPID is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_ALIASES
                          +
                          BASH_ALIASES

                          An associative array variable whose members correspond to the internal -list of aliases as maintained by the alias builtin. -(see Bourne Shell Builtins). +list of aliases as maintained by the alias builtin. +(see Bourne Shell Builtins). Elements added to this array appear in the alias list; however, unsetting array elements currently does not cause aliases to be removed from the alias list. -If BASH_ALIASES +If BASH_ALIASES is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_ARGC
                          +
                          BASH_ARGC

                          An array variable whose values are the number of parameters in each frame of the current Bash execution call stack. The number of parameters to the current subroutine (shell function or script executed -with . or source) is at the top of the stack. When a +with . or source) is at the top of the stack. When a subroutine is executed, the number of parameters passed is pushed onto -BASH_ARGC. -The shell sets BASH_ARGC only when in extended debugging mode -(see The Shopt Builtin -for a description of the extdebug option to the shopt +BASH_ARGC. +The shell sets BASH_ARGC only when in extended debugging mode +(see The Shopt Builtin +for a description of the extdebug option to the shopt builtin). -Setting extdebug after the shell has started to execute a script, -or referencing this variable when extdebug is not set, +Setting extdebug after the shell has started to execute a script, +or referencing this variable when extdebug is not set, may result in inconsistent values. -Assignments to BASH_ARGC have no effect, and it may not be unset. +Assignments to BASH_ARGC have no effect, and it may not be unset.

                          -
                          BASH_ARGV
                          +
                          BASH_ARGV

                          An array variable containing all of the parameters in the current Bash execution call stack. The final parameter of the last subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is executed, the parameters supplied -are pushed onto BASH_ARGV. -The shell sets BASH_ARGV only when in extended debugging mode -(see The Shopt Builtin -for a description of the extdebug option to the shopt +are pushed onto BASH_ARGV. +The shell sets BASH_ARGV only when in extended debugging mode +(see The Shopt Builtin +for a description of the extdebug option to the shopt builtin). -Setting extdebug after the shell has started to execute a script, -or referencing this variable when extdebug is not set, +Setting extdebug after the shell has started to execute a script, +or referencing this variable when extdebug is not set, may result in inconsistent values. -Assignments to BASH_ARGV have no effect, and it may not be unset. +Assignments to BASH_ARGV have no effect, and it may not be unset.

                          -
                          BASH_ARGV0
                          +
                          BASH_ARGV0

                          When referenced, this variable expands to the name of the shell or shell -script (identical to $0; See Special Parameters, +script (identical to $0; See Special Parameters, for the description of special parameter 0). -Assignment to BASH_ARGV0 -causes the value assigned to also be assigned to $0. -If BASH_ARGV0 +Assignment to BASH_ARGV0 +causes the value assigned to also be assigned to $0. +If BASH_ARGV0 is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_CMDS
                          +
                          BASH_CMDS

                          An associative array variable whose members correspond to the internal -hash table of commands as maintained by the hash builtin -(see Bourne Shell Builtins). +hash table of commands as maintained by the hash builtin +(see Bourne Shell Builtins). Elements added to this array appear in the hash table; however, unsetting array elements currently does not cause command names to be removed from the hash table. -If BASH_CMDS +If BASH_CMDS is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_COMMAND
                          +
                          BASH_COMMAND

                          The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, in which case it is the command executing at the time of the trap. -If BASH_COMMAND +If BASH_COMMAND is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_COMPAT
                          +
                          BASH_COMPAT

                          The value is used to set the shell’s compatibility level. -See Shell Compatibility Mode, for a description of the various +See Shell Compatibility Mode, for a description of the various compatibility levels and their effects. The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) corresponding to the desired compatibility level. -If BASH_COMPAT is unset or set to the empty string, the compatibility +If BASH_COMPAT is unset or set to the empty string, the compatibility level is set to the default for the current version. -If BASH_COMPAT is set to a value that is not one of the valid +If BASH_COMPAT is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level to the default for the current version. -The valid values correspond to the compatibility levels -described below (see Shell Compatibility Mode). +A subset of the valid values correspond to the compatibility levels +described below (see Shell Compatibility Mode). For example, 4.2 and 42 are valid values that correspond -to the compat42 shopt option +to the compat42 shopt option and set the compatibility level to 42. The current version is also a valid value.

                          -
                          BASH_ENV
                          +
                          BASH_ENV

                          If this variable is set when Bash is invoked to execute a shell script, its value is expanded and used as the name of a startup file -to read before executing the script. See Bash Startup Files. +to read before executing the script. See Bash Startup Files.

                          -
                          BASH_EXECUTION_STRING
                          -

                          The command argument to the -c invocation option. +

                          BASH_EXECUTION_STRING
                          +

                          The command argument to the -c invocation option.

                          -
                          BASH_LINENO
                          +
                          BASH_LINENO

                          An array variable whose members are the line numbers in source files -where each corresponding member of FUNCNAME was invoked. -${BASH_LINENO[$i]} is the line number in the source file -(${BASH_SOURCE[$i+1]}) where -${FUNCNAME[$i]} was called (or ${BASH_LINENO[$i-1]} if +where each corresponding member of FUNCNAME was invoked. +${BASH_LINENO[$i]} is the line number in the source file +(${BASH_SOURCE[$i+1]}) where +${FUNCNAME[$i]} was called (or ${BASH_LINENO[$i-1]} if referenced within another shell function). -Use LINENO to obtain the current line number. -Assignments to BASH_LINENO have no effect, and it may not be unset. +Use LINENO to obtain the current line number. +Assignments to BASH_LINENO have no effect, and it may not be unset.

                          -
                          BASH_LOADABLES_PATH
                          +
                          BASH_LOADABLES_PATH

                          A colon-separated list of directories in which the shell looks for dynamically loadable builtins specified by the -enable command. +enable command.

                          -
                          BASH_MONOSECONDS
                          +
                          BASH_MONOSECONDS

                          Each time this variable is referenced, it expands to the value returned by the system’s monotonic clock, if one is available. -If there is no monotonic clock, this is equivalent to EPOCHSECONDS. -If BASH_MONOSECONDS +If there is no monotonic clock, this is equivalent to EPOCHSECONDS. +If BASH_MONOSECONDS is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_REMATCH
                          -

                          An array variable whose members are assigned by the ‘=~’ binary -operator to the [[ conditional command -(see Conditional Constructs). +

                          BASH_REMATCH
                          +

                          An array variable whose members are assigned by the ‘=~’ binary +operator to the [[ conditional command +(see Conditional Constructs). The element with index 0 is the portion of the string matching the entire regular expression. -The element with index n is the portion of the -string matching the nth parenthesized subexpression. +The element with index n is the portion of the +string matching the nth parenthesized subexpression.

                          -
                          BASH_SOURCE
                          +
                          BASH_SOURCE

                          An array variable whose members are the source filenames where the -corresponding shell function names in the FUNCNAME array +corresponding shell function names in the FUNCNAME array variable are defined. -The shell function ${FUNCNAME[$i]} is defined in the file -${BASH_SOURCE[$i]} and called from ${BASH_SOURCE[$i+1]} -Assignments to BASH_SOURCE have no effect, and it may not be unset. +The shell function ${FUNCNAME[$i]} is defined in the file +${BASH_SOURCE[$i]} and called from ${BASH_SOURCE[$i+1]} +Assignments to BASH_SOURCE have no effect, and it may not be unset.

                          -
                          BASH_SUBSHELL
                          +
                          BASH_SUBSHELL

                          Incremented by one within each subshell or subshell environment when the shell begins executing in that environment. The initial value is 0. -If BASH_SUBSHELL +If BASH_SUBSHELL is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          BASH_TRAPSIG
                          +
                          BASH_TRAPSIG

                          Set to the signal number corresponding to the trap action being executed during its execution. -See the description of trap -(see Bourne Shell Builtins) +See the description of trap +(see Bourne Shell Builtins) for information about signal numbers and trap execution.

                          -
                          BASH_VERSINFO
                          -

                          A readonly array variable (see Arrays) +

                          BASH_VERSINFO
                          +

                          A readonly array variable (see Arrays) whose members hold version information for this instance of Bash. The values assigned to the array members are as follows:

                          -
                          -
                          BASH_VERSINFO[0]
                          -

                          The major version number (the release). +

                          +
                          BASH_VERSINFO[0]
                          +

                          The major version number (the release).

                          -
                          BASH_VERSINFO[1]
                          -

                          The minor version number (the version). +

                          BASH_VERSINFO[1]
                          +

                          The minor version number (the version).

                          -
                          BASH_VERSINFO[2]
                          +
                          BASH_VERSINFO[2]

                          The patch level.

                          -
                          BASH_VERSINFO[3]
                          +
                          BASH_VERSINFO[3]

                          The build version.

                          -
                          BASH_VERSINFO[4]
                          -

                          The release status (e.g., beta1). +

                          BASH_VERSINFO[4]
                          +

                          The release status (e.g., beta).

                          -
                          BASH_VERSINFO[5]
                          -

                          The value of MACHTYPE. +

                          BASH_VERSINFO[5]
                          +

                          The value of MACHTYPE.

                          -
                          BASH_VERSION
                          +
                          BASH_VERSION

                          The version number of the current instance of Bash.

                          -
                          BASH_XTRACEFD
                          +
                          BASH_XTRACEFD

                          If set to an integer corresponding to a valid file descriptor, Bash -will write the trace output generated when ‘set -x’ +will write the trace output generated when ‘set -x’ is enabled to that file descriptor. This allows tracing output to be separated from diagnostic and error messages. -The file descriptor is closed when BASH_XTRACEFD is unset or assigned +The file descriptor is closed when BASH_XTRACEFD is unset or assigned a new value. -Unsetting BASH_XTRACEFD or assigning it the empty string causes the +Unsetting BASH_XTRACEFD or assigning it the empty string causes the trace output to be sent to the standard error. -Note that setting BASH_XTRACEFD to 2 (the standard error file +Note that setting BASH_XTRACEFD to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed.

                          -
                          CHILD_MAX
                          +
                          CHILD_MAX

                          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 +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
                          -

                          Used by the select command to determine the terminal width +

                          COLUMNS
                          +

                          Used by the select command to determine the terminal width when printing selection lists. -Automatically set if the checkwinsize option is enabled -(see The Shopt Builtin), or in an interactive shell upon receipt of a -SIGWINCH. +Automatically set if the checkwinsize option is enabled +(see The Shopt Builtin), or in an interactive shell upon receipt of a +SIGWINCH.

                          -
                          COMP_CWORD
                          -

                          An index into ${COMP_WORDS} of the word containing the current +

                          COMP_CWORD
                          +

                          An index into ${COMP_WORDS} of the word containing the current cursor position. This variable is available only in shell functions invoked by the -programmable completion facilities (see Programmable Completion). +programmable completion facilities (see Programmable Completion).

                          -
                          COMP_LINE
                          +
                          COMP_LINE

                          The current command line. This variable is available only in shell functions and external commands invoked by the -programmable completion facilities (see Programmable Completion). +programmable completion facilities (see Programmable Completion).

                          -
                          COMP_POINT
                          +
                          COMP_POINT

                          The index of the current cursor position relative to the beginning of the current command. If the current cursor position is at the end of the current command, -the value of this variable is equal to ${#COMP_LINE}. +the value of this variable is equal to ${#COMP_LINE}. This variable is available only in shell functions and external commands invoked by the -programmable completion facilities (see Programmable Completion). +programmable completion facilities (see Programmable Completion).

                          -
                          COMP_TYPE
                          +
                          COMP_TYPE

                          Set to an integer value corresponding to the type of completion attempted that caused a completion function to be called: -TAB, for normal completion, -‘?’, for listing completions after successive tabs, -‘!’, for listing alternatives on partial word completion, -‘@’, to list completions if the word is not unmodified, +TAB, for normal completion, +‘?’, for listing completions after successive tabs, +‘!’, for listing alternatives on partial word completion, +‘@’, to list completions if the word is not unmodified, or -‘%’, for menu completion. +‘%’, for menu completion. This variable is available only in shell functions and external commands invoked by the -programmable completion facilities (see Programmable Completion). +programmable completion facilities (see Programmable Completion).

                          -
                          COMP_KEY
                          +
                          COMP_KEY

                          The key (or final key of a key sequence) used to invoke the current completion function.

                          -
                          COMP_WORDBREAKS
                          +
                          COMP_WORDBREAKS

                          The set of characters that the Readline library treats as word separators when performing word completion. -If COMP_WORDBREAKS +If COMP_WORDBREAKS is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          COMP_WORDS
                          +
                          COMP_WORDS

                          An array variable consisting of the individual words in the current command line. The line is split into words as Readline would split it, using -COMP_WORDBREAKS as described above. +COMP_WORDBREAKS as described above. This variable is available only in shell functions invoked by the -programmable completion facilities (see Programmable Completion). +programmable completion facilities (see Programmable Completion).

                          -
                          COMPREPLY
                          +
                          COMPREPLY

                          An array variable from which Bash reads the possible completions generated by a shell function invoked by the programmable completion -facility (see Programmable Completion). +facility (see Programmable Completion). Each array element contains one possible completion.

                          -
                          COPROC
                          +
                          COPROC

                          An array variable created to hold the file descriptors -for output from and input to an unnamed coprocess (see Coprocesses). +for output from and input to an unnamed coprocess (see Coprocesses).

                          -
                          DIRSTACK
                          +
                          DIRSTACK

                          An array variable containing the current contents of the directory stack. Directories appear in the stack in the order they are displayed by the -dirs builtin. +dirs builtin. Assigning to members of this array variable may be used to modify -directories already in the stack, but the pushd and popd +directories already in the stack, but the pushd and popd builtins must be used to add and remove directories. Assignment to this variable will not change the current directory. -If DIRSTACK +If DIRSTACK is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          EMACS
                          +
                          EMACS

                          If Bash finds this variable in the environment when the shell -starts with value ‘t’, it assumes that the shell is running in an +starts with value ‘t’, it assumes that the shell is running in an Emacs shell buffer and disables line editing.

                          -
                          ENV
                          -

                          Expanded and executed similarly to BASH_ENV -(see Bash Startup Files) +

                          ENV
                          +

                          Expanded and executed similarly to BASH_ENV +(see Bash Startup Files) when an interactive shell is invoked in -POSIX Mode (see Bash and POSIX). +POSIX Mode (see Bash and POSIX).

                          -
                          EPOCHREALTIME
                          +
                          EPOCHREALTIME

                          Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch as a floating point value with micro-second granularity -(see the documentation for the C library function time for the +(see the documentation for the C library function time for the definition of Epoch). -Assignments to EPOCHREALTIME are ignored. -If EPOCHREALTIME +Assignments to EPOCHREALTIME are ignored. +If EPOCHREALTIME is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          EPOCHSECONDS
                          +
                          EPOCHSECONDS

                          Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch (see the documentation for the C library function -time for the definition of Epoch). -Assignments to EPOCHSECONDS are ignored. -If EPOCHSECONDS +time for the definition of Epoch). +Assignments to EPOCHSECONDS are ignored. +If EPOCHSECONDS is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          EUID
                          +
                          EUID

                          The numeric effective user id of the current user. This variable is readonly.

                          -
                          EXECIGNORE
                          -

                          A colon-separated list of shell patterns (see Pattern Matching) +

                          EXECIGNORE
                          +

                          A colon-separated list of shell patterns (see Pattern Matching) defining the list of filenames to be ignored by command search using -PATH. +PATH. Files whose full pathnames match one of these patterns are not considered executable files for the purposes of completion and command execution -via PATH lookup. -This does not affect the behavior of the [, test, and [[ +via PATH lookup. +This does not affect the behavior of the [, test, and [[ commands. -Full pathnames in the command hash table are not subject to EXECIGNORE. +Full pathnames in the command hash table are not subject to EXECIGNORE. Use this variable to ignore shared library files that have the executable bit set, but are not executable files. -The pattern matching honors the setting of the extglob shell +The pattern matching honors the setting of the extglob shell option.

                          -
                          FCEDIT
                          -

                          The editor used as a default by the -e option to the fc +

                          FCEDIT
                          +

                          The editor used as a default by the -e option to the fc builtin command.

                          -
                          FIGNORE
                          +
                          FIGNORE

                          A colon-separated list of suffixes to ignore when performing filename completion. A filename whose suffix matches one of the entries in -FIGNORE +FIGNORE is excluded from the list of matched filenames. A sample -value is ‘.o:~’ +value is ‘.o:~

                          -
                          FUNCNAME
                          +
                          FUNCNAME

                          An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bottom-most element (the one with the highest index) -is "main". +is "main". This variable exists only when a shell function is executing. -Assignments to FUNCNAME have no effect. -If FUNCNAME +Assignments to FUNCNAME have no effect. +If FUNCNAME is unset, it loses its special properties, even if it is subsequently reset.

                          -

                          This variable can be used with BASH_LINENO and BASH_SOURCE. -Each element of FUNCNAME has corresponding elements in -BASH_LINENO and BASH_SOURCE to describe the call stack. -For instance, ${FUNCNAME[$i]} was called from the file -${BASH_SOURCE[$i+1]} at line number ${BASH_LINENO[$i]}. -The caller builtin displays the current call stack using this +

                          This variable can be used with BASH_LINENO and BASH_SOURCE. +Each element of FUNCNAME has corresponding elements in +BASH_LINENO and BASH_SOURCE to describe the call stack. +For instance, ${FUNCNAME[$i]} was called from the file +${BASH_SOURCE[$i+1]} at line number ${BASH_LINENO[$i]}. +The caller builtin displays the current call stack using this information.

                          -
                          FUNCNEST
                          +
                          FUNCNEST

                          If set to a numeric value greater than 0, defines a maximum function nesting level. Function invocations that exceed this nesting level will cause the current command to abort.

                          -
                          GLOBIGNORE
                          +
                          GLOBIGNORE

                          A colon-separated list of patterns defining the set of file names to be ignored by filename expansion. If a file name matched by a filename expansion pattern also matches one -of the patterns in GLOBIGNORE, it is removed from the list +of the patterns in GLOBIGNORE, it is removed from the list of matches. -The pattern matching honors the setting of the extglob shell +The pattern matching honors the setting of the extglob shell option.

                          -
                          GLOBSORT
                          +
                          GLOBSORT

                          Control how the results of filename expansion are sorted. The value of this variable specifies the sort criteria and sort order for the results of filename expansion. If this variable is unset or set to the null string, filename expansion uses the historical behavior of sorting by name. -If set, a valid value begins with an optional ‘+’, which is ignored, -or ‘-’, which reverses the sort order from ascending to descending, +If set, a valid value begins with an optional ‘+’, which is ignored, +or ‘-’, which reverses the sort order from ascending to descending, followed by a sort specifier. The valid sort specifiers are -‘name’, -‘size’, -‘mtime’, -‘atime’, -‘ctime’, +‘name’, +‘size’, +‘mtime’, +‘atime’, +‘ctime’, and -‘blocks’, +‘blocks’, which sort the files on name, file size, modification time, access time, inode change time, and number of blocks, respectively.

                          -

                          For example, a value of -mtime sorts the results in descending +

                          For example, a value of -mtime sorts the results in descending order by modification time (newest first).

                          -

                          A sort specifier of ‘nosort’ disables sorting completely; the results +

                          A sort specifier of ‘nosort’ disables sorting completely; the results are returned in the order they are read from the file system,.

                          -

                          If the sort specifier is missing, it defaults to name, -so a value of ‘+’ is equivalent to the null string, -and a value of ‘-’ sorts by name in descending order. +

                          If the sort specifier is missing, it defaults to name, +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.

                          -
                          GROUPS
                          +
                          GROUPS

                          An array variable containing the list of groups of which the current user is a member. -Assignments to GROUPS have no effect. -If GROUPS +Assignments to GROUPS have no effect. +If GROUPS is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          histchars
                          +
                          histchars

                          Up to three characters which control history expansion, quick -substitution, and tokenization (see History Expansion). +substitution, and tokenization (see History Expansion). The first character is the -history expansion character, that is, the character which signifies the -start of a history expansion, normally ‘!’. +history expansion character, that is, the character which signifies the +start of a history expansion, normally ‘!’. The second character is the character which signifies "quick substitution" when seen as the first -character on a line, normally ‘^’. +character on a line, normally ‘^’. 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 ‘#’. +found as the first character of a word, usually ‘#’. The history comment character causes history substitution to be skipped for the remaining words on the line. @@ -7508,44 +7524,44 @@ It does not necessarily cause the shell parser to treat the rest of the line as a comment.

                          -
                          HISTCMD
                          +
                          HISTCMD

                          The history number, or index in the history list, of the current command. -Assignments to HISTCMD are ignored. -If HISTCMD +Assignments to HISTCMD are ignored. +If HISTCMD is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          HISTCONTROL
                          +
                          HISTCONTROL

                          A colon-separated list of values controlling how commands are saved on the history list. -If the list of values includes ‘ignorespace’, lines which begin +If the list of values includes ‘ignorespace’, lines which begin with a space character are not saved in the history list. -A value of ‘ignoredups’ causes lines which match the previous +A value of ‘ignoredups’ causes lines which match the previous history entry to not be saved. -A value of ‘ignoreboth’ is shorthand for -‘ignorespace’ and ‘ignoredups’. -A value of ‘erasedups’ causes all previous lines matching the +A value of ‘ignoreboth’ is shorthand for +‘ignorespace’ and ‘ignoredups’. +A value of ‘erasedups’ 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 HISTCONTROL is unset, or does not include a valid value, +If HISTCONTROL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, -subject to the value of HISTIGNORE. +subject to the value of HISTIGNORE. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of -HISTCONTROL. +HISTCONTROL.

                          -
                          HISTFILE
                          +
                          HISTFILE

                          The name of the file to which the command history is saved. -Bash assigns a default value of ~/.bash_history. -If HISTFILE is unset or null, +Bash assigns a default value of ~/.bash_history. +If HISTFILE is unset or null, the command history is not saved when a shell exits.

                          -
                          HISTFILESIZE
                          +
                          HISTFILESIZE

                          The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if necessary, to contain no more than that number of lines @@ -7554,34 +7570,36 @@ The history file is also truncated to this size after writing it when a shell exits. If the value is 0, the history file is truncated to zero size. Non-numeric values and numeric values less than zero inhibit truncation. -The shell sets the default value to the value of HISTSIZE +The shell sets the default value to the value of HISTSIZE after reading any startup files.

                          -
                          HISTIGNORE
                          +
                          HISTIGNORE

                          A colon-separated list of patterns used to decide which command -lines should be saved on the history list. Each pattern is +lines should be saved on the history list. +Each pattern is anchored at the beginning of the line and must match the complete -line (no implicit ‘*’ is appended). Each pattern is tested -against the line after the checks specified by HISTCONTROL +line (Bash will not implicitly append a ‘*’). +Each pattern is tested +against the line after the checks specified by HISTCONTROL are applied. In addition to the normal shell pattern matching -characters, ‘&’ matches the previous history line. ‘&’ +characters, ‘&’ matches the previous history line. ‘&’ may be escaped using a backslash; the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of -HISTIGNORE. -The pattern matching honors the setting of the extglob shell +HISTIGNORE. +The pattern matching honors the setting of the extglob shell option.

                          -

                          HISTIGNORE subsumes the function of HISTCONTROL. A -pattern of ‘&’ is identical to ignoredups, and a -pattern of ‘[ ]*’ is identical to ignorespace. +

                          HISTIGNORE subsumes the function of HISTCONTROL. A +pattern of ‘&’ is identical to ignoredups, and a +pattern of ‘[ ]*’ is identical to ignorespace. Combining these two patterns, separating them with a colon, -provides the functionality of ignoreboth. +provides the functionality of ignoreboth.

                          -
                          HISTSIZE
                          +
                          HISTSIZE

                          The maximum number of commands to remember on the history list. If the value is 0, commands are not saved in the history list. Numeric values less than zero result in every command being saved @@ -7589,350 +7607,350 @@ on the history list (there is no limit). The shell sets the default value to 500 after reading any startup files.

                          -
                          HISTTIMEFORMAT
                          +
                          HISTTIMEFORMAT

                          If this variable is set and not null, its value is used as a format string -for strftime to print the time stamp associated with each history -entry displayed by the history builtin. +for strftime(3) to print the time stamp associated with each history +entry displayed by the history builtin. If this variable is set, time stamps are written to the history file so they may be preserved across shell sessions. This uses the history comment character to distinguish timestamps from other history lines.

                          -
                          HOSTFILE
                          -

                          Contains the name of a file in the same format as /etc/hosts that +

                          HOSTFILE
                          +

                          Contains the name of a file in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, Bash adds the contents of the new file to the existing list. -If HOSTFILE is set, but has no value, or does not name a readable file, +If HOSTFILE is set, but has no value, or does not name a readable file, Bash attempts to read -/etc/hosts to obtain the list of possible hostname completions. -When HOSTFILE is unset, the hostname list is cleared. +/etc/hosts to obtain the list of possible hostname completions. +When HOSTFILE is unset, the hostname list is cleared.

                          -
                          HOSTNAME
                          +
                          HOSTNAME

                          The name of the current host.

                          -
                          HOSTTYPE
                          +
                          HOSTTYPE

                          A string describing the machine Bash is running on.

                          -
                          IGNOREEOF
                          -

                          Controls the action of the shell on receipt of an EOF character +

                          IGNOREEOF
                          +

                          Controls the action of the shell on receipt of an EOF character as the sole input. If set, the value denotes the number -of consecutive EOF characters that can be read as the +of consecutive EOF characters that can be read as the first character on an input line before the shell will exit. If the variable exists but does not have a numeric value, or has no value, then the default is 10. -If the variable does not exist, then EOF signifies the end of +If the variable does not exist, then EOF signifies the end of input to the shell. This is only in effect for interactive shells.

                          -
                          INPUTRC
                          +
                          INPUTRC

                          The name of the Readline initialization file, overriding the default -of ~/.inputrc. +of ~/.inputrc.

                          -
                          INSIDE_EMACS
                          +
                          INSIDE_EMACS

                          If Bash finds this variable in the environment when the shell starts, it assumes that the shell is running in an Emacs shell buffer -and may disable line editing depending on the value of TERM. +and may disable line editing depending on the value of TERM.

                          -
                          LANG
                          +
                          LANG

                          Used to determine the locale category for any category not specifically -selected with a variable starting with LC_. +selected with a variable starting with LC_.

                          -
                          LC_ALL
                          -

                          This variable overrides the value of LANG and any other -LC_ variable specifying a locale category. +

                          LC_ALL
                          +

                          This variable overrides the value of LANG and any other +LC_ variable specifying a locale category.

                          -
                          LC_COLLATE
                          +
                          LC_COLLATE

                          This variable determines the collation order used when sorting the results of filename expansion, and determines the behavior of range expressions, equivalence classes, and collating sequences within filename expansion and pattern matching -(see Filename Expansion). +(see Filename Expansion).

                          -
                          LC_CTYPE
                          +
                          LC_CTYPE

                          This variable determines the interpretation of characters and the behavior of character classes within filename expansion and pattern -matching (see Filename Expansion). +matching (see Filename Expansion).

                          -
                          LC_MESSAGES
                          +
                          LC_MESSAGES

                          This variable determines the locale used to translate double-quoted -strings preceded by a ‘$’ (see Locale-Specific Translation). +strings preceded by a ‘$’ (see Locale-Specific Translation).

                          -
                          LC_NUMERIC
                          +
                          LC_NUMERIC

                          This variable determines the locale category used for number formatting.

                          -
                          LC_TIME
                          +
                          LC_TIME

                          This variable determines the locale category used for data and time formatting.

                          -
                          LINENO
                          +
                          LINENO

                          The line number in the script or shell function currently executing. -If LINENO +If LINENO is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          LINES
                          -

                          Used by the select command to determine the column length +

                          LINES
                          +

                          Used by the select command to determine the column length for printing selection lists. -Automatically set if the checkwinsize option is enabled -(see The Shopt Builtin), or in an interactive shell upon receipt of a -SIGWINCH. +Automatically set if the checkwinsize option is enabled +(see The Shopt Builtin), or in an interactive shell upon receipt of a +SIGWINCH.

                          -
                          MACHTYPE
                          +
                          MACHTYPE

                          A string that fully describes the system type on which Bash -is executing, in the standard GNU cpu-company-system format. +is executing, in the standard GNU cpu-company-system format.

                          -
                          MAILCHECK
                          +
                          MAILCHECK

                          How often (in seconds) that the shell should check for mail in the -files specified in the MAILPATH or MAIL variables. +files specified in the MAILPATH or MAIL variables. The default 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.

                          -
                          MAPFILE
                          +
                          MAPFILE

                          An array variable created to hold the text read by the -mapfile builtin when no variable name is supplied. +mapfile builtin when no variable name is supplied.

                          -
                          OLDPWD
                          -

                          The previous working directory as set by the cd builtin. +

                          OLDPWD
                          +

                          The previous working directory as set by the cd builtin.

                          -
                          OPTERR
                          +
                          OPTERR

                          If set to the value 1, Bash displays error messages -generated by the getopts builtin command. +generated by the getopts builtin command.

                          -
                          OSTYPE
                          +
                          OSTYPE

                          A string describing the operating system Bash is running on.

                          -
                          PIPESTATUS
                          -

                          An array variable (see Arrays) +

                          PIPESTATUS
                          +

                          An array variable (see Arrays) containing a list of exit status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command).

                          -
                          POSIXLY_CORRECT
                          +
                          POSIXLY_CORRECT

                          If this variable is in the environment when Bash starts, the shell -enters POSIX mode (see Bash and POSIX) before reading the -startup files, as if the --posix invocation option had been supplied. -If it is set while the shell is running, Bash enables POSIX mode, +enters POSIX mode (see Bash and POSIX) before reading the +startup files, as if the --posix invocation option had been supplied. +If it is set while the shell is running, Bash enables POSIX mode, as if the command

                          -
                          set -o posix
                          +
                          set -o posix
                           

                          had been executed. -When the shell enters POSIX mode, it sets this variable if it was +When the shell enters POSIX mode, it sets this variable if it was not already set.

                          -
                          PPID
                          -

                          The process ID of the shell’s parent process. This variable +

                          PPID
                          +

                          The process ID of the shell’s parent process. This variable is readonly.

                          -
                          PROMPT_COMMAND
                          +
                          PROMPT_COMMAND

                          If this variable is set, and is an array, the value of each set element is interpreted as a command to execute -before printing the primary prompt ($PS1). +before printing the primary prompt ($PS1). If this is set but not an array variable, its value is used as a command to execute instead.

                          -
                          PROMPT_DIRTRIM
                          +
                          PROMPT_DIRTRIM

                          If set to a number greater than zero, the value is used as the number of -trailing directory components to retain when expanding the \w and -\W prompt string escapes (see Controlling the Prompt). +trailing directory components to retain when expanding the \w and +\W prompt string escapes (see Controlling the Prompt). Characters removed are replaced with an ellipsis.

                          -
                          PS0
                          -

                          The value of this parameter is expanded like PS1 +

                          PS0
                          +

                          The value of this parameter is expanded like PS1 and displayed by interactive shells after reading a command and before the command is executed.

                          -
                          PS3
                          +
                          PS3

                          The value of this variable is used as the prompt for the -select command. If this variable is not set, the -select command prompts with ‘#? ’ +select command. If this variable is not set, the +select command prompts with ‘#?

                          -
                          PS4
                          -

                          The value of this parameter is expanded like PS1 +

                          PS4
                          +

                          The value of this parameter is expanded like PS1 and the expanded value is the prompt printed before the command line -is echoed when the -x option is set (see The Set Builtin). +is echoed when the -x option is set (see The Set Builtin). The first character of the expanded value is replicated multiple times, as necessary, to indicate multiple levels of indirection. -The default is ‘+ ’. +The default is ‘+ ’.

                          -
                          PWD
                          -

                          The current working directory as set by the cd builtin. +

                          PWD
                          +

                          The current working directory as set by the cd builtin.

                          -
                          RANDOM
                          +
                          RANDOM

                          Each time this parameter is referenced, it expands to a random integer between 0 and 32767. Assigning a value to this variable seeds the random number generator. -If RANDOM +If RANDOM is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          READLINE_ARGUMENT
                          +
                          READLINE_ARGUMENT

                          Any numeric argument given to a Readline command that was defined using -‘bind -x’ (see Bash Builtin Commands +‘bind -x’ (see Bash Builtin Commands when it was invoked.

                          -
                          READLINE_LINE
                          +
                          READLINE_LINE

                          The contents of the Readline line buffer, for use -with ‘bind -x’ (see Bash Builtin Commands). +with ‘bind -x’ (see Bash Builtin Commands).

                          -
                          READLINE_MARK
                          -

                          The position of the mark (saved insertion point) in the +

                          READLINE_MARK
                          +

                          The position of the mark (saved insertion point) in the Readline line buffer, for use -with ‘bind -x’ (see Bash Builtin Commands). +with ‘bind -x’ (see Bash Builtin Commands). The characters between the insertion point and the mark are often -called the region. +called the region.

                          -
                          READLINE_POINT
                          +
                          READLINE_POINT

                          The position of the insertion point in the Readline line buffer, for use -with ‘bind -x’ (see Bash Builtin Commands). +with ‘bind -x’ (see Bash Builtin Commands).

                          -
                          REPLY
                          -

                          The default variable for the read builtin. +

                          REPLY
                          +

                          The default variable for the read builtin.

                          -
                          SECONDS
                          +
                          SECONDS

                          This variable expands to the number of seconds since the shell was started. Assignment to this variable resets the count to the value assigned, and the expanded value becomes the value assigned plus the number of seconds since the assignment. The number of seconds at shell invocation and the current time are always determined by querying the system clock. -If SECONDS +If SECONDS is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          SHELL
                          +
                          SHELL

                          This environment variable expands to the full pathname to the shell. If it is not set when the shell starts, Bash assigns to it the full pathname of the current user’s login shell.

                          -
                          SHELLOPTS
                          +
                          SHELLOPTS

                          A colon-separated list of enabled shell options. Each word in -the list is a valid argument for the -o option to the -set builtin command (see The Set Builtin). -The options appearing in SHELLOPTS are those reported -as ‘on’ by ‘set -o’. +the list is a valid argument for the -o option to the +set builtin command (see The Set Builtin). +The options appearing in SHELLOPTS are those reported +as ‘on’ by ‘set -o’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files. This variable is readonly.

                          -
                          SHLVL
                          +
                          SHLVL

                          Incremented by one each time a new instance of Bash is started. This is intended to be a count of how deeply your Bash shells are nested.

                          -
                          SRANDOM
                          +
                          SRANDOM

                          This variable expands to a 32-bit pseudo-random number each time it is referenced. The random number generator is not linear on systems that -support /dev/urandom or arc4random, so each returned number +support /dev/urandom or arc4random, so each returned number has no relationship to the numbers preceding it. The random number generator cannot be seeded, so assignments to this variable have no effect. -If SRANDOM +If SRANDOM is unset, it loses its special properties, even if it is subsequently reset.

                          -
                          TIMEFORMAT
                          +
                          TIMEFORMAT

                          The value of this parameter is used as a format string specifying -how the timing information for pipelines prefixed with the time +how the timing information for pipelines prefixed with the time reserved word should be displayed. -The ‘%’ character introduces an +The ‘%’ character introduces an escape sequence that is expanded to a time value or other information. The escape sequences and their meanings are as -follows; the braces denote optional portions. +follows; the brackets denote optional portions.

                          -
                          -
                          %%
                          -

                          A literal ‘%’. +

                          +
                          %%
                          +

                          A literal ‘%’.

                          -
                          %[p][l]R
                          +
                          %[p][l]R

                          The elapsed time in seconds.

                          -
                          %[p][l]U
                          +
                          %[p][l]U

                          The number of CPU seconds spent in user mode.

                          -
                          %[p][l]S
                          +
                          %[p][l]S

                          The number of CPU seconds spent in system mode.

                          -
                          %P
                          +
                          %P

                          The CPU percentage, computed as (%U + %S) / %R.

                          -

                          The optional p is a digit specifying the precision, the number of +

                          The optional p is a digit specifying the precision, the number of fractional digits after a decimal point. A value of 0 causes no decimal point or fraction to be output. At most six places after the decimal point may be specified; -values of p greater than 6 are changed to 6. -If p is not specified, the value 3 is used. +values of p greater than 6 are changed to 6. +If p is not specified, the value 3 is used.

                          -

                          The optional l specifies a longer format, including minutes, of -the form MMmSS.FFs. -The value of p determines whether or not the fraction is included. +

                          The optional l specifies a longer format, including minutes, of +the form MMmSS.FFs. +The value of p determines whether or not the fraction is included.

                          If this variable is not set, Bash acts as if it had the value

                          -
                          $'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
                          +
                          $'\nreal\t%3lR\nuser\t%3lU\nsys\t%3lS'
                           

                          If the value is null, Bash does not display any timing information. A trailing newline is added when the format string is displayed.

                          -
                          TMOUT
                          -

                          If set to a value greater than zero, TMOUT is treated as the -default timeout for the read builtin (see Bash Builtin Commands). -The select command (see Conditional Constructs) terminates -if input does not arrive after TMOUT seconds when input is coming +

                          TMOUT
                          +

                          If set to a value greater than zero, TMOUT is treated as the +default timeout for the read builtin (see Bash Builtin Commands). +The select command (see Conditional Constructs) terminates +if input does not arrive after TMOUT seconds when input is coming from a terminal.

                          In an interactive shell, the value is interpreted as @@ -7943,12 +7961,12 @@ terminates after waiting for that number of seconds if a complete line of input does not arrive.

                          -
                          TMPDIR
                          +
                          TMPDIR

                          If set, Bash uses its value as the name of a directory in which Bash creates temporary files for the shell’s use.

                          -
                          UID
                          +
                          UID

                          The numeric real user id of the current user. This variable is readonly.

                          @@ -7957,17 +7975,17 @@ Bash creates temporary files for the shell’s use.
                          -
                          -
                          +
                          + -

                          6 Bash Features

                          +

                          6 Bash Features

                          This chapter describes features unique to Bash.

                          -
                            +
                            -
                            -
                            +
                            + -

                            6.1 Invoking Bash

                            +

                            6.1 Invoking Bash

                            -
                            bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o option]
                            -    [-O shopt_option] [argument …]
                            -bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o option]
                            -    [-O shopt_option] -c string [argument …]
                            -bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o option]
                            -    [-O shopt_option] [argument …]
                            +
                            bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o option]
                            +    [-O shopt_option] [argument ...]
                            +bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o option]
                            +    [-O shopt_option] -c string [argument ...]
                            +bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o option]
                            +    [-O shopt_option] [argument ...]
                             
                            -

                            All of the single-character options used with the set builtin -(see The Set Builtin) can be used as options when the shell is invoked. +

                            All of the single-character options used with the set builtin +(see The Set Builtin) can be used as options when the shell is invoked. In addition, there are several multi-character options that you can use. These options must appear on the command line before the single-character options to be recognized.

                            -
                            -
                            --debugger
                            +
                            +
                            --debugger

                            Arrange for the debugger profile to be executed before the shell -starts. Turns on extended debugging mode (see The Shopt Builtin -for a description of the extdebug option to the shopt +starts. Turns on extended debugging mode (see The Shopt Builtin +for a description of the extdebug option to the shopt builtin).

                            -
                            --dump-po-strings
                            -

                            A list of all double-quoted strings preceded by ‘$’ +

                            --dump-po-strings
                            +

                            A list of all double-quoted strings preceded by ‘$’ is printed on the standard output -in the GNU gettext PO (portable object) file format. -Equivalent to -D except for the output format. +in the GNU gettext PO (portable object) file format. +Equivalent to -D except for the output format.

                            -
                            --dump-strings
                            -

                            Equivalent to -D. +

                            --dump-strings
                            +

                            Equivalent to -D.

                            -
                            --help
                            +
                            --help

                            Display a usage message on standard output and exit successfully.

                            -
                            --init-file filename
                            -
                            --rcfile filename
                            -

                            Execute commands from filename (instead of ~/.bashrc) +

                            --init-file filename
                            +
                            --rcfile filename
                            +

                            Execute commands from filename (instead of ~/.bashrc) in an interactive shell.

                            -
                            --login
                            -

                            Equivalent to -l. +

                            --login
                            +

                            Equivalent to -l.

                            -
                            --noediting
                            -

                            Do not use the GNU Readline library (see Command Line Editing) +

                            --noediting
                            +

                            Do not use the GNU Readline library (see Command Line Editing) to read command lines when the shell is interactive.

                            -
                            --noprofile
                            -

                            Don’t load the system-wide startup file /etc/profile +

                            --noprofile
                            +

                            Don’t load the system-wide startup file /etc/profile or any of the personal initialization files -~/.bash_profile, ~/.bash_login, or ~/.profile +~/.bash_profile, ~/.bash_login, or ~/.profile when Bash is invoked as a login shell.

                            -
                            --norc
                            -

                            Don’t read the ~/.bashrc initialization file in an +

                            --norc
                            +

                            Don’t read the ~/.bashrc initialization file in an interactive shell. This is on by default if the shell is -invoked as sh. +invoked as sh.

                            -
                            --posix
                            +
                            --posix

                            Change the behavior of Bash where the default operation differs -from the POSIX standard to match the standard. This +from the POSIX standard to match the standard. This is intended to make Bash behave as a strict superset of that -standard. See Bash and POSIX, for a description of the Bash -POSIX mode. +standard. See Bash and POSIX, for a description of the Bash +POSIX mode.

                            -
                            --restricted
                            -

                            Equivalent to -r. -Make the shell a restricted shell (see The Restricted Shell). +

                            --restricted
                            +

                            Equivalent to -r. +Make the shell a restricted shell (see The Restricted Shell).

                            -
                            --verbose
                            -

                            Equivalent to -v. Print shell input lines as they’re read. +

                            --verbose
                            +

                            Equivalent to -v. Print shell input lines as they’re read.

                            -
                            --version
                            +
                            --version

                            Show version information for this instance of Bash on the standard output and exit successfully.

                            There are several single-character options that may be supplied at -invocation which are not available with the set builtin. +invocation which are not available with the set builtin.

                            -
                            -
                            -c
                            +
                            +
                            -c

                            Read and execute commands from the first non-option argument -command_string, then exit. -If there are arguments after the command_string, -the first argument is assigned to $0 +command_string, then exit. +If there are arguments after the command_string, +the first argument is assigned to $0 and any remaining arguments are assigned to the positional parameters. -The assignment to $0 sets the name of the shell, which is used +The assignment to $0 sets the name of the shell, which is used in warning and error messages.

                            -
                            -i
                            +
                            -i

                            Force the shell to run interactively. Interactive shells are -described in Interactive Shells. +described in Interactive Shells.

                            -
                            -l
                            +
                            -l

                            Make this shell act as if it had been directly invoked by login. When the shell is interactive, this is equivalent to starting a -login shell with ‘exec -l bash’. +login shell with ‘exec -l bash’. When the shell is not interactive, the login shell startup files will be executed. -‘exec bash -l’ or ‘exec bash --login’ +‘exec bash -l’ or ‘exec bash --login’ will replace the current shell with a Bash login shell. -See Bash Startup Files, for a description of the special behavior +See Bash Startup Files, for a description of the special behavior of a login shell.

                            -
                            -r
                            -

                            Make the shell a restricted shell (see The Restricted Shell). +

                            -r
                            +

                            Make the shell a restricted shell (see The Restricted Shell).

                            -
                            -s
                            +
                            -s

                            If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set @@ -8121,57 +8139,57 @@ when invoking an interactive shell or when reading input through a pipe.

                            -
                            -D
                            -

                            A list of all double-quoted strings preceded by ‘$’ +

                            -D
                            +

                            A list of all double-quoted strings preceded by ‘$’ is printed on the standard output. These are the strings that are subject to language translation when the current locale -is not C or POSIX (see Locale-Specific Translation). -This implies the -n option; no commands will be executed. -

                            -
                            -
                            [-+]O [shopt_option]
                            -

                            shopt_option is one of the shell options accepted by the -shopt builtin (see The Shopt Builtin). -If shopt_option is present, -O sets the value of that option; -+O unsets it. -If shopt_option is not supplied, the names and values of the shell -options accepted by shopt are printed on the standard output. -If the invocation option is +O, the output is displayed in a format +is not C or POSIX (see Locale-Specific Translation). +This implies the -n option; no commands will be executed. +

                            +
                            +
                            [-+]O [shopt_option]
                            +

                            shopt_option is one of the shell options accepted by the +shopt builtin (see The Shopt Builtin). +If shopt_option is present, -O sets the value of that option; ++O unsets it. +If shopt_option is not supplied, the names and values of the shell +options accepted by shopt are printed on the standard output. +If the invocation option is +O, the output is displayed in a format that may be reused as input.

                            -
                            --
                            -

                            A -- signals the end of options and disables further option +

                            --
                            +

                            A -- signals the end of options and disables further option processing. -Any arguments after the -- -are treated as a shell script filename (see Shell Scripts) +Any arguments after the -- +are treated as a shell script filename (see Shell Scripts) and arguments passed to that script.

                            -
                            -
                            -

                            Equivalent to --. +

                            -
                            +

                            Equivalent to --.

                            - -

                            A login shell is one whose first character of argument zero is -‘-’, or one invoked with the --login option. + +

                            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, -unless -s is specified, -without specifying the -c option, and whose input and output are both -connected to terminals (as determined by isatty(3)), or one -started with the -i option. See Interactive Shells, for more + +

                            An interactive shell is one started without non-option arguments, +unless -s is specified, +without specifying the -c option, and whose input and output are both +connected to terminals (as determined by isatty(3)), or one +started with the -i option. See Interactive Shells, for more information.

                            If arguments remain after option processing, and neither the --c nor the -s +-c nor the -s option has been supplied, the first argument is assumed to -be the name of a file containing shell commands (see Shell Scripts). -When Bash is invoked in this fashion, $0 +be the name of a file containing shell commands (see 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. @@ -8180,194 +8198,194 @@ in the script. If no commands are executed, the exit status is 0.


                            -
                            -
                            +
                            + -

                            6.2 Bash Startup Files

                            - +

                            6.2 Bash Startup Files

                            +

                            This section describes how Bash executes its startup files. If any of the files exist but cannot be read, Bash reports an error. Tildes are expanded in filenames as described above under -Tilde Expansion (see Tilde Expansion). +Tilde Expansion (see Tilde Expansion).

                            -

                            Interactive shells are described in Interactive Shells. +

                            Interactive shells are described in Interactive Shells.

                            -

                            Invoked as an interactive login shell, or with --login

                            +

                            Invoked as an interactive login shell, or with --login

                            When Bash is invoked as an interactive login shell, or as a -non-interactive shell with the --login option, it first reads and -executes commands from the file /etc/profile, if that file exists. -After reading that file, it looks for ~/.bash_profile, -~/.bash_login, and ~/.profile, in that order, and reads +non-interactive shell with the --login option, it first reads and +executes commands from the file /etc/profile, if that file exists. +After reading that file, it looks for ~/.bash_profile, +~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. -The --noprofile option may be used when the shell is started to +The --noprofile 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 exit builtin command, +or a non-interactive login shell executes the exit builtin command, Bash reads and executes commands from -the file ~/.bash_logout, if it exists. +the file ~/.bash_logout, if it exists.

                            -

                            Invoked as an interactive non-login shell

                            +

                            Invoked as an interactive non-login shell

                            When an interactive shell that is not a login shell is started, Bash -reads and executes commands from ~/.bashrc, if that file exists. -This may be inhibited by using the --norc option. -The --rcfile file option will force Bash to read and -execute commands from file instead of ~/.bashrc. +reads and executes commands from ~/.bashrc, if that file exists. +This may be inhibited by using the --norc option. +The --rcfile file option will force Bash to read and +execute commands from file instead of ~/.bashrc.

                            -

                            So, typically, your ~/.bash_profile contains the line +

                            So, typically, your ~/.bash_profile contains the line

                            -
                            if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
                            +
                            if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
                             

                            after (or before) any login-specific initializations.

                            -

                            Invoked non-interactively

                            +

                            Invoked non-interactively

                            When Bash is started non-interactively, to run a shell script, -for example, it looks for the variable BASH_ENV in the environment, +for example, it looks for the variable BASH_ENV 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. Bash behaves as if the following command were executed:

                            -
                            if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
                            +
                            if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
                             
                            -

                            but the value of the PATH variable is not used to search for the +

                            but the value of the PATH variable is not used to search for the filename.

                            As noted above, if a non-interactive shell is invoked with the ---login option, Bash attempts to read and execute commands from the +--login option, Bash attempts to read and execute commands from the login shell startup files.

                            -

                            Invoked with name sh

                            +

                            Invoked with name sh

                            -

                            If Bash is invoked with the name sh, it tries to mimic the -startup behavior of historical versions of sh as closely as -possible, while conforming to the POSIX standard as well. +

                            If Bash is invoked with the name sh, it tries to mimic the +startup behavior of historical versions of sh as closely as +possible, while conforming to the POSIX standard as well.

                            When invoked as an interactive login shell, or as a non-interactive -shell with the --login option, it first attempts to read -and execute commands from /etc/profile and ~/.profile, in +shell with the --login option, it first attempts to read +and execute commands from /etc/profile and ~/.profile, in that order. -The --noprofile option may be used to inhibit this behavior. -When invoked as an interactive shell with the name sh, Bash -looks for the variable ENV, expands its value if it is defined, +The --noprofile option may be used to inhibit this behavior. +When invoked as an interactive shell with the name sh, Bash +looks for the variable ENV, 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 sh does not attempt to read and execute -commands from any other startup files, the --rcfile option has +Since a shell invoked as sh does not attempt to read and execute +commands from any other startup files, the --rcfile option has no effect. -A non-interactive shell invoked with the name sh does not attempt +A non-interactive shell invoked with the name sh does not attempt to read any other startup files.

                            -

                            When invoked as sh, Bash enters POSIX mode after +

                            When invoked as sh, Bash enters POSIX mode after the startup files are read.

                            -

                            Invoked in POSIX mode

                            +

                            Invoked in POSIX mode

                            -

                            When Bash is started in POSIX mode, as with the ---posix command line option, it follows the POSIX standard +

                            When Bash is started in POSIX mode, as with the +--posix command line option, it follows the POSIX standard for startup files. -In this mode, interactive shells expand the ENV variable +In this mode, interactive shells expand the ENV variable and commands are read and executed from the file whose name is the expanded value. No other startup files are read.

                            -

                            Invoked by remote shell daemon

                            +

                            Invoked by remote shell daemon

                            Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by -the historical remote shell daemon, usually rshd, -or the secure shell daemon sshd. +the historical remote shell daemon, usually rshd, +or the secure shell daemon sshd. If Bash determines it is being run non-interactively in this fashion, -it reads and executes commands from ~/.bashrc, if that +it reads and executes commands from ~/.bashrc, if that file exists and is readable. -It will not do this if invoked as sh. -The --norc option may be used to inhibit this behavior, and the ---rcfile option may be used to force another file to be read, but -neither rshd nor sshd generally invoke the shell with those +It will not do this if invoked as sh. +The --norc option may be used to inhibit this behavior, and the +--rcfile option may be used to force another file to be read, but +neither rshd nor sshd generally invoke the shell with those options or allow them to be specified.

                            -

                            Invoked with unequal effective and real UID/GIDs

                            +

                            Invoked with unequal effective and real UID/GIDs

                            If Bash is started with the effective user (group) id not equal to the -real user (group) id, and the -p option is not supplied, no startup +real user (group) id, and the -p option is not supplied, no startup files are read, shell functions are not inherited from the environment, -the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE +the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE variables, if they appear in the environment, are ignored, and the effective user id is set to the real user id. -If the -p option is supplied at invocation, the startup behavior is +If the -p option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset.


                            -
                            -
                            +
                            + -

                            6.3 Interactive Shells

                            - - +

                            6.3 Interactive Shells

                            + + -
                              +
                              -
                              -
                              +
                              + -

                              6.3.1 What is an Interactive Shell?

                              +

                              6.3.1 What is an Interactive Shell?

                              An interactive shell is one started without non-option arguments -(unless -s is specified) -and without specifying the -c option, +(unless -s is specified) +and without specifying the -c option, whose input and error output are both -connected to terminals (as determined by isatty(3)), -or one started with the -i option. +connected to terminals (as determined by isatty(3)), +or one started with the -i option.

                              An interactive shell generally reads from and writes to a user’s terminal.

                              -

                              The -s invocation option may be used to set the positional parameters +

                              The -s invocation option may be used to set the positional parameters when an interactive shell is started.


                              -
                              -
                              +
                              + -

                              6.3.2 Is this Shell Interactive?

                              +

                              6.3.2 Is this Shell Interactive?

                              To determine within a startup script whether or not Bash is running interactively, -test the value of the ‘-’ special parameter. -It contains i when the shell is interactive. For example: +test the value of the ‘-’ special parameter. +It contains i when the shell is interactive. For example:

                              -
                              case "$-" in
                              +
                              case "$-" in
                               *i*)	echo This shell is interactive ;;
                               *)	echo This shell is not interactive ;;
                               esac
                               

                              Alternatively, startup scripts may examine the variable -PS1; it is unset in non-interactive shells, and set in +PS1; it is unset in non-interactive shells, and set in interactive shells. Thus:

                              -
                              if [ -z "$PS1" ]; then
                              +
                              if [ -z "$PS1" ]; then
                                       echo This shell is not interactive
                               else
                                       echo This shell is interactive
                              @@ -8376,115 +8394,115 @@ fi
                               
                               
                              -
                              -
                              +
                              + -

                              6.3.3 Interactive Shell Behavior

                              +

                              6.3.3 Interactive Shell Behavior

                              When the shell is running interactively, it changes its behavior in several ways.

                              -
                                -
                              1. Startup files are read and executed as described in Bash Startup Files. +
                                  +
                                1. Startup files are read and executed as described in Bash Startup Files. -
                                2. Job Control (see Job Control) is enabled by default. When job +
                                3. Job Control (see Job Control) is enabled by default. When job control is in effect, Bash ignores the keyboard-generated job control -signals SIGTTIN, SIGTTOU, and SIGTSTP. +signals SIGTTIN, SIGTTOU, and SIGTSTP. -
                                4. Bash expands and displays PS1 before reading the first line -of a command, and expands and displays PS2 before reading the +
                                5. Bash expands and displays PS1 before reading the first line +of a command, and expands and displays PS2 before reading the second and subsequent lines of a multi-line command. -Bash expands and displays PS0 after it reads a command but before +Bash expands and displays PS0 after it reads a command but before executing it. -See Controlling the Prompt, for a complete list of prompt +See Controlling the Prompt, for a complete list of prompt string escape sequences. -
                                6. Bash executes the values of the set elements of the PROMPT_COMMAND -array variable as commands before printing the primary prompt, $PS1 -(see Bash Variables). +
                                7. Bash executes the values of the set elements of the PROMPT_COMMAND +array variable as commands before printing the primary prompt, $PS1 +(see Bash Variables). -
                                8. Readline (see Command Line Editing) is used to read commands from +
                                9. Readline (see Command Line Editing) is used to read commands from the user’s terminal. -
                                10. Bash inspects the value of the ignoreeof option to set -o -instead of exiting immediately when it receives an EOF on its -standard input when reading a command (see The Set Builtin). +
                                11. Bash inspects the value of the ignoreeof option to set -o +instead of exiting immediately when it receives an EOF on its +standard input when reading a command (see The Set Builtin). -
                                12. Command history (see Bash History Facilities) -and history expansion (see History Expansion) +
                                13. Command history (see Bash History Facilities) +and history expansion (see History Expansion) are enabled by default. -Bash will save the command history to the file named by $HISTFILE +Bash will save the command history to the file named by $HISTFILE when a shell with history enabled exits. -
                                14. Alias expansion (see Aliases) is performed by default. +
                                15. Alias expansion (see Aliases) is performed by default. -
                                16. In the absence of any traps, Bash ignores SIGTERM -(see Signals). +
                                17. In the absence of any traps, Bash ignores SIGTERM +(see Signals). -
                                18. In the absence of any traps, SIGINT is caught and handled -(see Signals). -SIGINT will interrupt some shell builtins. +
                                19. In the absence of any traps, SIGINT is caught and handled +(see Signals). +SIGINT will interrupt some shell builtins. -
                                20. An interactive login shell sends a SIGHUP to all jobs on exit -if the huponexit shell option has been enabled (see Signals). +
                                21. An interactive login shell sends a SIGHUP to all jobs on exit +if the huponexit shell option has been enabled (see Signals). -
                                22. The -n invocation option is ignored, and ‘set -n’ has -no effect (see The Set Builtin). +
                                23. The -n invocation option is ignored, and ‘set -n’ has +no effect (see The Set Builtin).
                                24. Bash will check for mail periodically, depending on the values of the -MAIL, MAILPATH, and MAILCHECK shell variables -(see Bash Variables). +MAIL, MAILPATH, and MAILCHECK shell variables +(see Bash Variables).
                                25. Expansion errors due to references to unbound shell variables after -‘set -u’ has been enabled will not cause the shell to exit -(see The Set Builtin). +‘set -u’ has been enabled will not cause the shell to exit +(see The Set Builtin). -
                                26. The shell will not exit on expansion errors caused by var being unset -or null in ${var:?word} expansions -(see Shell Parameter Expansion). +
                                27. The shell will not exit on expansion errors caused by var being unset +or null in ${var:?word} expansions +(see Shell Parameter Expansion).
                                28. Redirection errors encountered by shell builtins will not cause the shell to exit. -
                                29. When running in POSIX mode, a special builtin returning an error -status will not cause the shell to exit (see Bash and POSIX). +
                                30. When running in POSIX mode, a special builtin returning an error +status will not cause the shell to exit (see Bash and POSIX). -
                                31. A failed exec will not cause the shell to exit -(see Bourne Shell Builtins). +
                                32. A failed exec will not cause the shell to exit +(see Bourne Shell Builtins).
                                33. Parser syntax errors will not cause the shell to exit. -
                                34. If the cdspell shell option is enabled, the shell will attempt -simple spelling correction for directory arguments to the cd -builtin (see the description of the cdspell -option to the shopt builtin in The Shopt Builtin). -The cdspell option is only effective in interactive shells. +
                                35. If the cdspell shell option is enabled, the shell will attempt +simple spelling correction for directory arguments to the cd +builtin (see the description of the cdspell +option to the shopt builtin in The Shopt Builtin). +The cdspell option is only effective in interactive shells. -
                                36. The shell will check the value of the TMOUT variable and exit +
                                37. The shell will check the value of the TMOUT variable and exit if a command is not read within the specified number of seconds after -printing $PS1 (see Bash Variables). +printing $PS1 (see Bash Variables).

                              -
                              -
                              +
                              + -

                              6.4 Bash Conditional Expressions

                              - +

                              6.4 Bash Conditional Expressions

                              + -

                              Conditional expressions are used by the [[ compound command -(see Conditional Constructs) -and the test and [ builtin commands -(see Bourne Shell Builtins). -The test -and [ commands determine their behavior based on the number +

                              Conditional expressions are used by the [[ compound command +(see Conditional Constructs) +and the test and [ builtin commands +(see Bourne Shell Builtins). +The test +and [ commands determine their behavior based on the number of arguments; see the descriptions of those commands for any other command-specific actions.

                              @@ -8497,199 +8515,199 @@ expressions. If the operating system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with this behavior: -If the file argument to one of the primaries is of the form -/dev/fd/N, then file descriptor N is checked. -If the file argument to one of the primaries is one of -/dev/stdin, /dev/stdout, or /dev/stderr, file +If the file argument to one of the primaries is of the form +/dev/fd/N, then file descriptor N is checked. +If the file argument to one of the primaries is one of +/dev/stdin, /dev/stdout, or /dev/stderr, file descriptor 0, 1, or 2, respectively, is checked.

                              -

                              When used with [[, the ‘<’ and ‘>’ operators sort +

                              When used with [[, the ‘<’ and ‘>’ operators sort lexicographically using the current locale. -The test command uses ASCII ordering. +The test command uses ASCII ordering.

                              Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself.

                              -
                              -
                              -a file
                              -

                              True if file exists. +

                              +
                              -a file
                              +

                              True if file exists.

                              -
                              -b file
                              -

                              True if file exists and is a block special file. +

                              -b file
                              +

                              True if file exists and is a block special file.

                              -
                              -c file
                              -

                              True if file exists and is a character special file. +

                              -c file
                              +

                              True if file exists and is a character special file.

                              -
                              -d file
                              -

                              True if file exists and is a directory. +

                              -d file
                              +

                              True if file exists and is a directory.

                              -
                              -e file
                              -

                              True if file exists. +

                              -e file
                              +

                              True if file exists.

                              -
                              -f file
                              -

                              True if file exists and is a regular file. +

                              -f file
                              +

                              True if file exists and is a regular file.

                              -
                              -g file
                              -

                              True if file exists and its set-group-id bit is set. +

                              -g file
                              +

                              True if file exists and its set-group-id bit is set.

                              -
                              -h file
                              -

                              True if file exists and is a symbolic link. +

                              -h file
                              +

                              True if file exists and is a symbolic link.

                              -
                              -k file
                              -

                              True if file exists and its "sticky" bit is set. +

                              -k file
                              +

                              True if file exists and its "sticky" bit is set.

                              -
                              -p file
                              -

                              True if file exists and is a named pipe (FIFO). +

                              -p file
                              +

                              True if file exists and is a named pipe (FIFO).

                              -
                              -r file
                              -

                              True if file exists and is readable. +

                              -r file
                              +

                              True if file exists and is readable.

                              -
                              -s file
                              -

                              True if file exists and has a size greater than zero. +

                              -s file
                              +

                              True if file exists and has a size greater than zero.

                              -
                              -t fd
                              -

                              True if file descriptor fd is open and refers to a terminal. +

                              -t fd
                              +

                              True if file descriptor fd is open and refers to a terminal.

                              -
                              -u file
                              -

                              True if file exists and its set-user-id bit is set. +

                              -u file
                              +

                              True if file exists and its set-user-id bit is set.

                              -
                              -w file
                              -

                              True if file exists and is writable. +

                              -w file
                              +

                              True if file exists and is writable.

                              -
                              -x file
                              -

                              True if file exists and is executable. +

                              -x file
                              +

                              True if file exists and is executable.

                              -
                              -G file
                              -

                              True if file exists and is owned by the effective group id. +

                              -G file
                              +

                              True if file exists and is owned by the effective group id.

                              -
                              -L file
                              -

                              True if file exists and is a symbolic link. +

                              -L file
                              +

                              True if file exists and is a symbolic link.

                              -
                              -N file
                              -

                              True if file exists and has been modified since it was last read. +

                              -N file
                              +

                              True if file exists and has been modified since it was last read.

                              -
                              -O file
                              -

                              True if file exists and is owned by the effective user id. +

                              -O file
                              +

                              True if file exists and is owned by the effective user id.

                              -
                              -S file
                              -

                              True if file exists and is a socket. +

                              -S file
                              +

                              True if file exists and is a socket.

                              -
                              file1 -ef file2
                              -

                              True if file1 and file2 refer to the same device and +

                              file1 -ef file2
                              +

                              True if file1 and file2 refer to the same device and inode numbers.

                              -
                              file1 -nt file2
                              -

                              True if file1 is newer (according to modification date) -than file2, or if file1 exists and file2 does not. +

                              file1 -nt file2
                              +

                              True if file1 is newer (according to modification date) +than file2, or if file1 exists and file2 does not.

                              -
                              file1 -ot file2
                              -

                              True if file1 is older than file2, -or if file2 exists and file1 does not. +

                              file1 -ot file2
                              +

                              True if file1 is older than file2, +or if file2 exists and file1 does not.

                              -
                              -o optname
                              -

                              True if the shell option optname is enabled. -The list of options appears in the description of the -o -option to the set builtin (see The Set Builtin). +

                              -o optname
                              +

                              True if the shell option optname is enabled. +The list of options appears in the description of the -o +option to the set builtin (see The Set Builtin).

                              -
                              -v varname
                              -

                              True if the shell variable varname is set (has been assigned a value). -If varname is an indexed -array variable name subscripted by ‘@’ or ‘*’, +

                              -v varname
                              +

                              True if the shell variable varname is set (has been assigned a value). +If varname is an indexed +array variable name subscripted by ‘@’ or ‘*’, this returns true if the array has any set elements. -If varname is an associative -array variable name subscripted by ‘@’ or ‘*’, +If varname is an associative +array variable name subscripted by ‘@’ or ‘*’, this returns true if an element with that key is set.

                              -
                              -R varname
                              -

                              True if the shell variable varname is set and is a name reference. +

                              -R varname
                              +

                              True if the shell variable varname is set and is a name reference.

                              -
                              -z string
                              -

                              True if the length of string is zero. +

                              -z string
                              +

                              True if the length of string is zero.

                              -
                              -n string
                              -
                              string
                              -

                              True if the length of string is non-zero. +

                              -n string
                              +
                              string
                              +

                              True if the length of string is non-zero.

                              -
                              string1 == string2
                              -
                              string1 = string2
                              +
                              string1 == string2
                              +
                              string1 = string2

                              True if the strings are equal. -When used with the [[ command, this performs pattern matching as -described above (see Conditional Constructs). +When used with the [[ command, this performs pattern matching as +described above (see Conditional Constructs).

                              -

                              =’ should be used with the test command for POSIX conformance. +

                              =’ should be used with the test command for POSIX conformance.

                              -
                              string1 != string2
                              +
                              string1 != string2

                              True if the strings are not equal.

                              -
                              string1 < string2
                              -

                              True if string1 sorts before string2 lexicographically. +

                              string1 < string2
                              +

                              True if string1 sorts before string2 lexicographically.

                              -
                              string1 > string2
                              -

                              True if string1 sorts after string2 lexicographically. +

                              string1 > string2
                              +

                              True if string1 sorts after string2 lexicographically.

                              -
                              arg1 OP arg2
                              -

                              OP is one of -‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. -These arithmetic binary operators return true if arg1 +

                              arg1 OP arg2
                              +

                              OP is one of +‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. +These arithmetic binary operators return true if arg1 is equal to, not equal to, less than, less than or equal to, -greater than, or greater than or equal to arg2, -respectively. Arg1 and arg2 +greater than, or greater than or equal to arg2, +respectively. Arg1 and arg2 may be positive or negative integers. -When used with the [[ command, Arg1 and Arg2 -are evaluated as arithmetic expressions (see Shell Arithmetic). +When used with the [[ command, Arg1 and Arg2 +are evaluated as arithmetic expressions (see Shell Arithmetic).


                              -
                              -
                              +
                              + -

                              6.5 Shell Arithmetic

                              - - - - - +

                              6.5 Shell Arithmetic

                              + + + + +

                              The shell allows arithmetic expressions to be evaluated, as one of -the shell expansions or by using the (( compound command, the -let builtin, or the -i option to the declare builtin. +the shell expansions or by using the (( compound command, the +let builtin, or the -i option to the declare builtin.

                              Evaluation is done in fixed-width integers with no check for overflow, though division by 0 is trapped and flagged as an error. @@ -8699,83 +8717,83 @@ The following list of operators is grouped into levels of equal-precedence operators. The levels are listed in order of decreasing precedence.

                              -
                              -
                              - - - - +
                              +
                              + + + +
                              -
                              id++ id--
                              +
                              id++ id--

                              variable post-increment and post-decrement

                              -
                              ++id --id
                              +
                              ++id --id

                              variable pre-increment and pre-decrement

                              -
                              - +
                              +
                              - +

                              unary minus and plus

                              -
                              ! ~
                              +
                              ! ~

                              logical and bitwise negation

                              -
                              **
                              +
                              **

                              exponentiation

                              -
                              * / %
                              +
                              * / %

                              multiplication, division, remainder

                              -
                              + -
                              +
                              + -

                              addition, subtraction

                              -
                              << >>
                              +
                              << >>

                              left and right bitwise shifts

                              -
                              <= >= < >
                              +
                              <= >= < >

                              comparison

                              -
                              == !=
                              +
                              == !=

                              equality and inequality

                              -
                              &
                              +
                              &

                              bitwise AND

                              -
                              ^
                              +
                              ^

                              bitwise exclusive OR

                              -
                              |
                              +
                              |

                              bitwise OR

                              -
                              &&
                              +
                              &&

                              logical AND

                              -
                              ||
                              +
                              ||

                              logical OR

                              -
                              expr ? if-true-expr : if-false-expr
                              +
                              expr ? if-true-expr : if-false-expr

                              conditional operator

                              -
                              = *= /= %= += -= <<= >>= &= ^= |=
                              +
                              = *= /= %= += -= <<= >>= &= ^= |=

                              assignment

                              -
                              expr1 , expr2
                              +
                              expr1 , expr2

                              comma

                              @@ -8788,24 +8806,24 @@ A shell variable that is null or unset evaluates to 0 when referenced by name without using the parameter expansion syntax. The value of a variable is evaluated as an arithmetic expression when it is referenced, or when a variable which has been given the -integer attribute using ‘declare -i’ is assigned a value. +integer attribute using ‘declare -i’ is assigned a value. A null value evaluates to 0. -A shell variable need not have its integer attribute turned on +A shell variable need not have its integer attribute turned on to be used in an expression.

                              Integer constants follow the C language definition, without suffixes or character constants. Constants with a leading 0 are interpreted as octal numbers. -A leading ‘0x’ or ‘0X’ denotes hexadecimal. Otherwise, -numbers take the form [base#]n, where the optional base +A leading ‘0x’ or ‘0X’ denotes hexadecimal. Otherwise, +numbers take the form [base#]n, where the optional base is a decimal number between 2 and 64 representing the arithmetic -base, and n is a number in that base. -If base# is omitted, then base 10 is used. -When specifying n, +base, and n is a number in that base. +If base# is omitted, then base 10 is used. +When specifying n, if a non-digit is required, the digits greater than 9 are represented by the lowercase letters, -the uppercase letters, ‘@’, and ‘_’, in that order. -If base is less than or equal to 36, lowercase and uppercase +the uppercase letters, ‘@’, and ‘_’, in that order. +If base is less than or equal to 36, lowercase and uppercase letters may be used interchangeably to represent numbers between 10 and 35.

                              @@ -8815,19 +8833,20 @@ rules above.


                              -
                              -
                              +
                              + -

                              6.6 Aliases

                              - +

                              6.6 Aliases

                              + -

                              Aliases allow a string to be substituted for a word that is in +

                              Aliases allow a string to be substituted for a word that is in a position in the input where it can be the first word of a simple -command. Aliases have names and corresponding values that are set -and unset using the alias and unalias builtin commands -(see Shell Builtin Commands). +command. +Aliases have names and corresponding values that are set +and unset using the alias and unalias builtin commands +(see Shell Builtin Commands).

                              If the shell reads an unquoted word in the right position, it checks the word to see if it matches an alias name. If it matches, the shell @@ -8836,7 +8855,7 @@ had been read instead of the word. The shell doesn’t look at any characters following the word before attempting alias substitution.

                              -

                              The characters ‘/’, ‘$’, ‘`’, ‘=’ and any of the +

                              The characters ‘/’, ‘$’, ‘`’, ‘=’ and any of the shell metacharacters or quoting characters listed above may not appear in an alias name. The replacement text may contain any valid @@ -8844,25 +8863,25 @@ shell input, including shell metacharacters. The first word of the replacement text is tested for aliases, but a word that is identical to an alias being expanded is not expanded a second time. -This means that one may alias ls to "ls -F", +This means that one may alias ls to "ls -F", for instance, and Bash does not try to recursively expand the replacement text.

                              If the last character of the alias value is a -blank, then the next command word following the +blank, then the next command word following the alias is also checked for alias expansion.

                              -

                              Aliases are created and listed with the alias -command, and removed with the unalias command. +

                              Aliases are created and listed with the alias +command, and removed with the unalias command.

                              There is no mechanism for using arguments in the replacement text, -as in csh. +as in csh. If arguments are needed, use a shell function -(see Shell Functions) instead. +(see Shell Functions) instead.

                              Aliases are not expanded when the shell is not interactive, -unless the expand_aliases shell option is set using -shopt (see The Shopt Builtin). +unless the expand_aliases shell option is set using +shopt (see The Shopt Builtin).

                              The rules concerning the definition and use of aliases are somewhat confusing. Bash @@ -8881,75 +8900,75 @@ not when the function is executed, because a function definition is itself a command. As a consequence, aliases defined in a function are not available until after that function is executed. To be safe, always put -alias definitions on a separate line, and do not use alias +alias definitions on a separate line, and do not use alias in compound commands.

                              For almost every purpose, shell functions are preferred over aliases.


                              -
                              -
                              +
                              + -

                              6.7 Arrays

                              - +

                              6.7 Arrays

                              +

                              Bash provides one-dimensional indexed and associative array variables. Any variable may be used as an indexed array; -the declare builtin will explicitly declare an array. +the declare builtin will explicitly declare an array. 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 integers (including arithmetic -expressions (see Shell Arithmetic)) and are zero-based; +expressions (see Shell Arithmetic)) and are zero-based; associative arrays use 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 +

                              The subscript is treated as an arithmetic expression that must evaluate to a number. To explicitly declare an array, use

                              -
                              declare -a name
                              +
                              declare -a name
                               

                              The syntax

                              -
                              declare -a name[subscript]
                              +
                              declare -a name[subscript]
                               
                              -

                              is also accepted; the subscript is ignored. +

                              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 declare and -readonly builtins. Each attribute applies to all members of +specified for an array variable using the declare and +readonly builtins. Each attribute applies to all members of an array.

                              Arrays are assigned to using compound assignments of the form

                              -
                              name=(value1 value2 … )
                              +
                              name=(value1 value2 ... )
                               

                              where each -value may be of the form [subscript]=string. -Indexed array assignments do not require anything but string. +value may be of the form [subscript]=string. +Indexed array assignments do not require anything but string. When assigning to indexed arrays, if the optional subscript is supplied, that index is assigned to; otherwise the index of the element assigned is the last index assigned to by the statement plus one. Indexing starts at zero.

                              -

                              Each value in the list undergoes the shell expansions -described above (see Shell Expansions), -but values that are valid variable assignments +

                              Each value in the list undergoes the shell expansions +described above (see Shell Expansions), +but values that are valid variable assignments including the brackets and subscript do not undergo brace expansion and word splitting, as with individual variable assignments. @@ -8958,53 +8977,53 @@ variable assignments. may be either assignment statements, for which the subscript is required, or a list of words that is interpreted as a sequence of alternating keys and values: -name=(key1 value1 key2 value2 … ). +name=(key1 value1 key2 value2 … ). These are treated identically to -name=( [key1]=value1 [key2]=value2 … ). +name=( [key1]=value1 [key2]=value2 … ). The first word in the list determines how the remaining words are interpreted; all assignments in a list must be of the same type. When using key/value pairs, the keys may not be missing or empty; a final missing value is treated like the empty string.

                              -

                              This syntax is also accepted by the declare +

                              This syntax is also accepted by the declare builtin. Individual array elements may be assigned to using the -name[subscript]=value syntax introduced above. +name[subscript]=value syntax introduced above.

                              -

                              When assigning to an indexed array, if name +

                              When assigning to an indexed array, if name is subscripted by a negative number, that number is interpreted as relative to one greater than the maximum index of -name, so negative indices count back from the end of the +name, so negative indices count back from the end of the array, and an index of -1 references the last element.

                              -

                              The ‘+=’ operator will append to an array variable when assigning -using the compound assignment syntax; see Shell Parameters above. +

                              The ‘+=’ operator will append to an array variable when assigning +using the compound assignment syntax; see Shell Parameters above.

                              Any element of an array may be referenced using -${name[subscript]}. +${name[subscript]}. The braces are required to avoid conflicts with the shell’s filename expansion operators. If the -subscript is ‘@’ or ‘*’, the word expands to all members -of the array name, unless otherwise noted in the description of a +subscript is ‘@’ or ‘*’, the word expands to all members +of the array name, unless otherwise 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 double-quoted, -${name[*]} expands to a single word with +${name[*]} expands to a single word with the value of each array member separated by the first character of the -IFS variable, and ${name[@]} expands each element of -name to a separate word. When there are no array members, -${name[@]} expands to nothing. +IFS variable, and ${name[@]} expands each element of +name to a separate word. When there are no array members, +${name[@]} 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 original word, and the expansion of the last parameter is joined with the last part of the original word. This is analogous to the -expansion of the special parameters ‘@’ and ‘*’. -${#name[subscript]} expands to the length of -${name[subscript]}. -If subscript is ‘@’ or -‘*’, the expansion is the number of elements in the array. -If the subscript +expansion of the special parameters ‘@’ and ‘*’. +${#name[subscript]} expands to the length of +${name[subscript]}. +If subscript is ‘@’ or +‘*’, the expansion is the number of elements in the array. +If the subscript used to reference an element of an indexed array evaluates to a number less than zero, it is interpreted as relative to one greater than the maximum index of the array, @@ -9020,207 +9039,206 @@ Bash will create an array if necessary. value. The null string is a valid value.

                              It is possible to obtain the keys (indices) of an array as well as the values. -${!name[@]} and ${!name[*]} expand to the indices -assigned in array variable name. +${!name[@]} and ${!name[*]} expand to the indices +assigned in array variable name. The treatment when in double quotes is similar to the expansion of the -special parameters ‘@’ and ‘*’ within double quotes. +special parameters ‘@’ and ‘*’ within double quotes.

                              -

                              The unset builtin is used to destroy arrays. -unset name[subscript] -destroys the array element at index subscript. +

                              The unset builtin is used to destroy arrays. +unset name[subscript] +destroys the array element at index subscript. Negative subscripts to indexed arrays are interpreted as described above. Unsetting the last element of an array variable does not unset the variable. -unset name, where name is an array, removes the +unset name, where name is an array, removes the entire array. -unset name[subscript] behaves differently +unset name[subscript] behaves differently depending on the array type when given a -subscript of ‘*’ or ‘@’. -When name is an associative array, it removes the element with key -‘*’ or ‘@’. -If name is an indexed array, unset removes all of the elements, +subscript of ‘*’ or ‘@’. +When name is an associative array, it removes the element with key +‘*’ or ‘@’. +If name is an indexed array, unset removes all of the elements, but does not remove the array itself.

                              When using a variable name with a subscript as an argument to a command, -such as with unset, without using the word expansion syntax +such as with unset, without using the word expansion syntax described above, the argument is subject to the shell’s filename expansion. If filename expansion is not desired, the argument should be quoted.

                              -

                              The declare, local, and readonly -builtins each accept a -a option to specify an indexed -array and a -A option to specify an associative array. -If both options are supplied, -A takes precedence. -The read builtin accepts a -a +

                              The declare, local, and readonly +builtins each accept a -a option to specify an indexed +array and a -A option to specify an associative array. +If both options are supplied, -A takes precedence. +The read builtin accepts a -a option to assign a list of words read from the standard input to an array, and can read values from the standard input into -individual array elements. The set and declare +individual array elements. The set and declare builtins display array values in a way that allows them to be reused as input.


                              -
                              -
                              +
                              + -

                              6.8 The Directory Stack

                              - +

                              6.8 The Directory Stack

                              +

                              The directory stack is a list of recently-visited directories. The -pushd builtin adds directories to the stack as it changes -the current directory, and the popd builtin removes specified +pushd builtin adds directories to the stack as it changes +the current directory, and the popd builtin removes specified directories from the stack and changes the current directory to -the directory removed. The dirs builtin displays the contents +the directory removed. The dirs builtin displays the contents of the directory stack. The current directory is always the "top" of the directory stack.

                              The contents of the directory stack are also visible -as the value of the DIRSTACK shell variable. +as the value of the DIRSTACK shell variable.

                              -
                                +
                                -
                                -
                                +
                                + -

                                6.8.1 Directory Stack Builtins

                                +

                                6.8.1 Directory Stack Builtins

                                -
                                -
                                dirs
                                +
                                +
                                dirs
                                -
                                dirs [-clpv] [+N | -N]
                                +
                                dirs [-clpv] [+N | -N]
                                 

                                Display the list of currently remembered directories. Directories -are added to the list with the pushd command; the -popd command removes directories from the list. +are added to the list with the pushd command; the +popd command removes directories from the list. The current directory is always the first directory in the stack.

                                -
                                -
                                -c
                                +
                                +
                                -c

                                Clears the directory stack by deleting all of the elements.

                                -
                                -l
                                +
                                -l

                                Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory.

                                -
                                -p
                                -

                                Causes dirs to print the directory stack with one entry per +

                                -p
                                +

                                Causes dirs to print the directory stack with one entry per line.

                                -
                                -v
                                -

                                Causes dirs to print the directory stack with one entry per +

                                -v
                                +

                                Causes dirs to print the directory stack with one entry per line, prefixing each entry with its index in the stack.

                                -
                                +N
                                -

                                Displays the Nth directory (counting from the left of the -list printed by dirs when invoked without options), starting +

                                +N
                                +

                                Displays the Nth directory (counting from the left of the +list printed by dirs when invoked without options), starting with zero.

                                -
                                -N
                                -

                                Displays the Nth directory (counting from the right of the -list printed by dirs when invoked without options), starting +

                                -N
                                +

                                Displays the Nth directory (counting from the right of the +list printed by dirs when invoked without options), starting with zero.

                                -
                                popd
                                +
                                popd
                                -
                                popd [-n] [+N | -N]
                                +
                                popd [-n] [+N | -N]
                                 

                                Removes elements from the directory stack. The elements are numbered from 0 starting at the first directory -listed by dirs; -that is, popd is equivalent to popd +0. +listed by dirs; +that is, popd is equivalent to popd +0.

                                -

                                When no arguments are given, popd +

                                When no arguments are given, popd removes the top directory from the stack and changes to the new top directory.

                                Arguments, if supplied, have the following meanings:

                                -
                                -
                                -n
                                +
                                +
                                -n

                                Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated.

                                -
                                +N
                                -

                                Removes the Nth directory (counting from the left of the -list printed by dirs), starting with zero, from the stack. +

                                +N
                                +

                                Removes the Nth directory (counting from the left of the +list printed by dirs), starting with zero, from the stack.

                                -
                                -N
                                -

                                Removes the Nth directory (counting from the right of the -list printed by dirs), starting with zero, from the stack. +

                                -N
                                +

                                Removes the Nth directory (counting from the right of the +list printed by dirs), starting with zero, from the stack.

                                If the top element of the directory stack is modified, and -the -n option was not supplied, popd uses the cd +the -n option was not supplied, popd uses the cd builtin to change to the directory at the top of the stack. -If the cd fails, popd returns a non-zero value. +If the cd fails, popd returns a non-zero value.

                                -

                                Otherwise, popd returns an unsuccessful status if +

                                Otherwise, popd returns an unsuccessful status if an invalid option is encountered, the directory stack is empty, or a non-existent directory stack entry is specified.

                                -

                                If the popd command is successful, -Bash runs dirs to show the final contents of the directory stack, +

                                If the popd command is successful, +Bash runs dirs to show the final contents of the directory stack, and the return status is 0.

                                -
                                -
                                pushd
                                +
                                pushd
                                -
                                pushd [-n] [+N | -N | dir]
                                +
                                pushd [-n] [+N | -N | dir]
                                 

                                Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working directory. -With no arguments, pushd exchanges the top two elements +With no arguments, pushd exchanges the top two elements of the directory stack.

                                Arguments, if supplied, have the following meanings:

                                -
                                -
                                -n
                                +
                                +
                                -n

                                Suppresses the normal change of directory when rotating or adding directories to the stack, so that only the stack is manipulated.

                                -
                                +N
                                -

                                Brings the Nth directory (counting from the left of the -list printed by dirs, starting with zero) to the top of +

                                +N
                                +

                                Brings the Nth directory (counting from the left of the +list printed by dirs, starting with zero) to the top of the list by rotating the stack.

                                -
                                -N
                                -

                                Brings the Nth directory (counting from the right of the -list printed by dirs, starting with zero) to the top of +

                                -N
                                +

                                Brings the Nth directory (counting from the right of the +list printed by dirs, starting with zero) to the top of the list by rotating the stack.

                                -
                                dir
                                -

                                Makes dir be the top of the stack. +

                                dir
                                +

                                Makes dir be the top of the stack.

                                -

                                After the stack has been modified, if the -n option was not -supplied, pushd uses the cd builtin to change to the +

                                After the stack has been modified, if the -n option was not +supplied, pushd uses the cd builtin to change to the directory at the top of the stack. -If the cd fails, pushd returns a non-zero value. +If the cd fails, pushd returns a non-zero value.

                                -

                                Otherwise, if no arguments are supplied, pushd returns 0 unless the +

                                Otherwise, if no arguments are supplied, pushd returns 0 unless the directory stack is empty. -When rotating the directory stack, pushd returns 0 unless +When rotating the directory stack, pushd returns 0 unless the directory stack is empty or a non-existent directory stack element is specified.

                                -

                                If the pushd command is successful, -Bash runs dirs to show the final contents of the directory stack. +

                                If the pushd command is successful, +Bash runs dirs to show the final contents of the directory stack.

                                @@ -9228,110 +9246,110 @@ Bash runs dirs to show the final contents of the directory stack.
                                -
                                -
                                +
                                + -

                                6.9 Controlling the Prompt

                                - +

                                6.9 Controlling the Prompt

                                + -

                                Bash examines the value of the array variable PROMPT_COMMAND just before +

                                Bash examines the value of the array variable PROMPT_COMMAND just before printing each primary prompt. -If any elements in PROMPT_COMMAND are set and non-null, Bash +If any elements in PROMPT_COMMAND are set and non-null, Bash executes each value, in numeric order, just as if it had been typed on the command line.

                                In addition, the following table describes the special characters which -can appear in the prompt variables PS0, PS1, PS2, and -PS4: +can appear in the prompt variables PS0, PS1, PS2, and +PS4:

                                -
                                -
                                \a
                                +
                                +
                                \a

                                A bell character.

                                -
                                \d
                                +
                                \d

                                The date, in "Weekday Month Date" format (e.g., "Tue May 26").

                                -
                                \D{format}
                                -

                                The format is passed to strftime(3) and the result is inserted -into the prompt string; an empty format results in a locale-specific +

                                \D{format}
                                +

                                The format is passed to strftime(3) and the result is inserted +into the prompt string; an empty format results in a locale-specific time representation. The braces are required.

                                -
                                \e
                                +
                                \e

                                An escape character.

                                -
                                \h
                                +
                                \h

                                The hostname, up to the first ‘.’.

                                -
                                \H
                                +
                                \H

                                The hostname.

                                -
                                \j
                                +
                                \j

                                The number of jobs currently managed by the shell.

                                -
                                \l
                                +
                                \l

                                The basename of the shell’s terminal device name.

                                -
                                \n
                                +
                                \n

                                A newline.

                                -
                                \r
                                +
                                \r

                                A carriage return.

                                -
                                \s
                                -

                                The name of the shell, the basename of $0 (the portion +

                                \s
                                +

                                The name of the shell, the basename of $0 (the portion following the final slash).

                                -
                                \t
                                +
                                \t

                                The time, in 24-hour HH:MM:SS format.

                                -
                                \T
                                +
                                \T

                                The time, in 12-hour HH:MM:SS format.

                                -
                                \@
                                +
                                \@

                                The time, in 12-hour am/pm format.

                                -
                                \A
                                +
                                \A

                                The time, in 24-hour HH:MM format.

                                -
                                \u
                                +
                                \u

                                The username of the current user.

                                -
                                \v
                                +
                                \v

                                The version of Bash (e.g., 2.00)

                                -
                                \V
                                +
                                \V

                                The release of Bash, version + patchlevel (e.g., 2.00.0)

                                -
                                \w
                                -

                                The value of the PWD shell variable ($PWD), -with $HOME abbreviated with a tilde -(uses the $PROMPT_DIRTRIM variable). +

                                \w
                                +

                                The value of the PWD shell variable ($PWD), +with $HOME abbreviated with a tilde +(uses the $PROMPT_DIRTRIM variable).

                                -
                                \W
                                -

                                The basename of $PWD, with $HOME abbreviated with a tilde. +

                                \W
                                +

                                The basename of $PWD, with $HOME abbreviated with a tilde.

                                -
                                \!
                                +
                                \!

                                The history number of this command.

                                -
                                \#
                                +
                                \#

                                The command number of this command.

                                -
                                \$
                                -

                                If the effective uid is 0, #, otherwise $. +

                                \$
                                +

                                If the effective uid is 0, #, otherwise $.

                                -
                                \nnn
                                -

                                The character whose ASCII code is the octal value nnn. +

                                \nnn
                                +

                                The character whose ASCII code is the octal value nnn.

                                -
                                \\
                                +
                                \\

                                A backslash.

                                -
                                \[
                                +
                                \[

                                Begin a sequence of non-printing characters. This could be used to embed a terminal control sequence into the prompt.

                                -
                                \]
                                +
                                \]

                                End a sequence of non-printing characters.

                                @@ -9339,104 +9357,104 @@ embed a terminal control sequence into the prompt.

                                The command number and the history number are usually different: the history number of a command is its position in the history list, which may include commands restored from the history file -(see Bash History Facilities), while the command number is +(see Bash History Facilities), while the command number is the position in the sequence of commands executed during the current shell session.

                                After the string is decoded, it is expanded via parameter expansion, command substitution, arithmetic expansion, and quote removal, subject to the value of the -promptvars shell option (see The Shopt Builtin). +promptvars shell option (see The Shopt Builtin). This can have unwanted side effects if escaped portions of the string appear within command substitution or contain characters special to word expansion.


                                -
                                -
                                +
                                + -

                                6.10 The Restricted Shell

                                - +

                                6.10 The Restricted Shell

                                + -

                                If Bash is started with the name rbash, or the ---restricted +

                                If Bash is started with the name rbash, or the +--restricted or --r +-r option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than the standard shell. -A restricted shell behaves identically to bash +A restricted shell behaves identically to bash with the exception that the following are disallowed or not performed:

                                -
                                  -
                                • Changing directories with the cd builtin. -
                                • Setting or unsetting the values of the SHELL, PATH, -HISTFILE, -ENV, or BASH_ENV variables. -
                                • Specifying command names containing slashes. -
                                • Specifying a filename containing a slash as an argument to the . +
                                    +
                                  • Changing directories with the cd builtin. +
                                  • Setting or unsetting the values of the SHELL, PATH, +HISTFILE, +ENV, or BASH_ENV variables. +
                                  • Specifying command names containing slashes. +
                                  • Specifying a filename containing a slash as an argument to the . builtin command. -
                                  • Specifying a filename containing a slash as an argument to the history +
                                  • Specifying a filename containing a slash as an argument to the history builtin command. -
                                  • Specifying a filename containing a slash as an argument to the -p -option to the hash builtin command. -
                                  • Importing function definitions from the shell environment at startup. -
                                  • Parsing the value of SHELLOPTS from the shell environment at startup. -
                                  • Redirecting output using the ‘>’, ‘>|’, ‘<>’, ‘>&’, -‘&>’, and ‘>>’ redirection operators. -
                                  • Using the exec builtin to replace the shell with another command. -
                                  • Adding or deleting builtin commands with the --f and -d options to the enable builtin. -
                                  • Using the enable builtin command to enable disabled shell builtins. -
                                  • Specifying the -p option to the command builtin. -
                                  • Turning off restricted mode with ‘set +r’ or ‘shopt -u restricted_shell’. +
                                  • Specifying a filename containing a slash as an argument to the -p +option to the hash builtin command. +
                                  • Importing function definitions from the shell environment at startup. +
                                  • Parsing the value of SHELLOPTS from the shell environment at startup. +
                                  • Redirecting output using the ‘>’, ‘>|’, ‘<>’, ‘>&’, +‘&>’, and ‘>>’ redirection operators. +
                                  • Using the exec builtin to replace the shell with another command. +
                                  • Adding or deleting builtin commands with the +-f and -d options to the enable builtin. +
                                  • Using the enable builtin command to enable disabled shell builtins. +
                                  • Specifying the -p option to the command builtin. +
                                  • Turning off restricted mode with ‘set +r’ or ‘shopt -u restricted_shell’.

                                  These restrictions are enforced after any startup files are read.

                                  When a command that is found to be a shell script is executed -(see Shell Scripts), rbash turns off any restrictions in +(see Shell Scripts), rbash turns off any restrictions in the shell spawned to execute the script.

                                  The restricted shell mode is only one component of a useful restricted -environment. It should be accompanied by setting PATH to a value +environment. It should be accompanied by setting PATH to a value that allows execution of only a few verified commands (commands that allow shell escapes are particularly vulnerable), changing the current -directory to a non-writable directory other than $HOME after login, +directory to a non-writable directory other than $HOME after login, not allowing the restricted shell to execute shell scripts, and cleaning the environment of variables that cause some commands to modify their -behavior (e.g., VISUAL or PAGER). +behavior (e.g., VISUAL or PAGER).

                                  Modern systems provide more secure ways to implement a restricted environment, -such as jails, zones, or containers. +such as jails, zones, or containers.


                                -
                                -
                                +
                                + -

                                6.11 Bash and POSIX

                                +

                                6.11 Bash and POSIX

                                -
                                  + -
                                  -

                                  6.11.1 What is POSIX?

                                  - +
                                  +

                                  6.11.1 What is POSIX?

                                  + -

                                  POSIX is the name for a family of standards based on Unix. +

                                  POSIX is the name for a family of standards based on Unix. A number of Unix services, tools, and functions are part of the standard, ranging from the basic system calls and C library functions to common applications and tools to system administration and management.

                                  -

                                  The POSIX Shell and Utilities standard was originally developed by +

                                  The POSIX Shell and Utilities standard was originally developed by IEEE Working Group 1003.2 (POSIX.2). The first edition of the 1003.2 standard was published in 1992. It was merged with the original IEEE 1003.1 Working Group and is @@ -9444,28 +9462,28 @@ currently maintained by the Austin Group (a joint working group of the IEEE, The Open Group and ISO/IEC SC22/WG15). Today the Shell and Utilities are a volume within the set of documents that make up IEEE Std 1003.1-2017, and thus the former POSIX.2 (from 1992) -is now part of the current unified POSIX standard. +is now part of the current unified POSIX standard.

                                  The Shell and Utilities volume concentrates on the command interpreter interface and utility programs commonly executed from the command line or by other programs. The standard is freely available on the web at -https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html. +https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html.

                                  Bash is concerned with the aspects of the shell’s behavior defined -by the POSIX Shell and Utilities volume. The shell command +by the POSIX Shell and Utilities volume. The shell command language has of course been standardized, including the basic flow control and program execution constructs, I/O redirection and pipelines, argument handling, variable expansion, and quoting.

                                  -

                                  The special builtins, which must be implemented as part of the +

                                  The special builtins, which must be implemented as part of the shell to provide the desired functionality, are specified as -being part of the shell; examples of these are eval and -export. +being part of the shell; examples of these are eval and +export. Other utilities appear in the sections of POSIX not devoted to the shell which are commonly (and in some cases must be) implemented as builtin commands, such as -read and test. +read and test. POSIX also specifies aspects of the shell’s interactive behavior, including job control and command line editing. @@ -9474,43 +9492,43 @@ standardized; emacs editing commands were left out due to objections.

                                  -
                                  -

                                  6.11.2 Bash POSIX Mode

                                  - +
                                  +

                                  6.11.2 Bash POSIX Mode

                                  + -

                                  Although Bash is an implementation of the POSIX shell +

                                  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 +The Bash posix mode changes the Bash behavior in these areas so that it conforms to the standard more closely.

                                  -

                                  Starting Bash with the --posix command-line option or executing -‘set -o posix’ while Bash is running will cause Bash to conform more -closely to the POSIX standard by changing the behavior to -match that specified by POSIX in areas where the Bash default differs. +

                                  Starting Bash with the --posix command-line option or executing +‘set -o posix’ while Bash is running will cause Bash to conform more +closely to the POSIX standard by changing the behavior to +match that specified by POSIX in areas where the Bash default differs.

                                  -

                                  When invoked as sh, Bash enters POSIX mode after reading the +

                                  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. +
                                      +
                                    1. Bash ensures that the POSIXLY_CORRECT variable is set.
                                    2. When a command in the hash table no longer exists, Bash will re-search -$PATH to find the new location. This is also available with -‘shopt -s checkhash’. +$PATH to find the new location. This is also available with +‘shopt -s checkhash’.
                                    3. Bash will not insert a command without the execute bit set into the command hash table, even if it returns it as a (last-ditch) result -from a $PATH search. +from a $PATH search.
                                    4. The message printed by the job control code and builtins when a job exits with a non-zero status is ‘Done(status)’.
                                    5. The message printed by the job control code and builtins when a job -is stopped is ‘Stopped(signame)’, where signame is, for -example, SIGTSTP. +is stopped is ‘Stopped(signame)’, where signame is, for +example, SIGTSTP.
                                    6. Alias expansion is always enabled, even in non-interactive shells. @@ -9523,19 +9541,19 @@ substitution is executed. This means that command substitution will not expand aliases that are defined after the command substitution is initially parsed (e.g., as part of a function definition). -
                                    7. The POSIX PS1 and PS2 expansions of ‘!’ to -the history number and ‘!!’ to ‘!’ are enabled, -and parameter expansion is performed on the values of PS1 and -PS2 regardless of the setting of the promptvars option. +
                                    8. The POSIX PS1 and PS2 expansions of ‘!’ to +the history number and ‘!!’ to ‘!’ are enabled, +and parameter expansion is performed on the values of PS1 and +PS2 regardless of the setting of the promptvars option. -
                                    9. The POSIX startup files are executed ($ENV) rather than +
                                    10. The POSIX startup files are executed ($ENV) rather than the normal Bash files.
                                    11. Tilde expansion is only performed on assignments preceding a command name, rather than on all assignment statements on the line. -
                                    12. The default history file is ~/.sh_history (this is the -default value the shell assigns to $HISTFILE). +
                                    13. The default history file is ~/.sh_history (this is the +default value the shell assigns to $HISTFILE).
                                    14. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. @@ -9543,32 +9561,32 @@ in the redirection unless the shell is interactive.
                                    15. Redirection operators do not perform word splitting on the word in the redirection. -
                                    16. Function names must be valid shell names. That is, they may not +
                                    17. Function names must be valid shell names. That is, they may not contain characters other than letters, digits, and underscores, and may not start with a digit. Declaring a function with an invalid name causes a fatal syntax error in non-interactive shells. -
                                    18. Function names may not be the same as one of the POSIX special +
                                    19. Function names may not be the same as one of the POSIX special builtins.
                                    20. Even if a shell function whose name contains a slash was defined before -entering POSIX mode, the shell will not execute a function whose name +entering POSIX mode, the shell will not execute a function whose name contains one or more slashes. -
                                    21. POSIX special builtins are found before shell functions -during command lookup, including output printed by the type -and command builtins. +
                                    22. POSIX special builtins are found before shell functions +during command lookup, including output printed by the type +and command builtins. -
                                    23. When printing shell function definitions (e.g., by type), Bash does -not print the function keyword. +
                                    24. When printing shell function definitions (e.g., by type), Bash does +not print the function keyword.
                                    25. Literal tildes that appear as the first character in elements of -the PATH variable are not expanded as described above -under Tilde Expansion. +the PATH variable are not expanded as described above +under Tilde Expansion. -
                                    26. The time reserved word may be used by itself as a command. When +
                                    27. The time reserved word may be used by itself as a command. When used in this way, it displays timing statistics for the shell and its -completed children. The TIMEFORMAT variable controls the format +completed children. The TIMEFORMAT variable controls the format of the timing information.
                                    28. When parsing and expanding a ${…} expansion that appears within @@ -9577,26 +9595,26 @@ quote a closing brace or other special character, unless the operator is one of those defined to perform pattern removal. In this case, they do not have to appear as matched pairs. -
                                    29. The parser does not recognize time as a reserved word if the next -token begins with a ‘-’. +
                                    30. The parser does not recognize time as a reserved word if the next +token begins with a ‘-’. -
                                    31. The ‘!’ character does not introduce history expansion within a -double-quoted string, even if the histexpand option is enabled. +
                                    32. The ‘!’ character does not introduce history expansion within a +double-quoted string, even if the histexpand option is enabled. -
                                    33. If a POSIX special builtin returns an error status, a +
                                    34. If a POSIX special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in -the POSIX standard, and include things like passing incorrect options, +the POSIX standard, and include things like passing incorrect options, redirection errors, variable assignment errors for assignments preceding the command name, and so on. -
                                    35. The unset builtin with the -v option specified returns a -fatal error if it attempts to unset a readonly or non-unsettable +
                                    36. The unset builtin with the -v option specified returns a +fatal error if it attempts to unset a readonly or non-unsettable variable, or encounters a variable name argument that is an invalid identifier, which causes a non-interactive shell to exit.
                                    37. When asked to unset a variable that appears in an assignment statement -preceding the command, the unset builtin attempts to unset a variable +preceding the command, the unset builtin attempts to unset a variable of the same name in the current or previous scope as well. This implements the required "if an assigned variable is further modified by the utility, the modifications made by the utility shall persist" behavior. @@ -9615,10 +9633,10 @@ at the top level ("the shell shall not perform any further processing of th command in which the error occurred").
                                    38. A non-interactive shell exits with an error status if the iteration -variable in a for statement or the selection variable in a -select statement is a readonly variable or has an invalid name. +variable in a for statement or the selection variable in a +select statement is a readonly variable or has an invalid name. -
                                    39. Non-interactive shells exit if filename in . filename +
                                    40. Non-interactive shells exit if filename in . filename is not found.
                                    41. Non-interactive shells exit if a syntax error in an arithmetic expansion @@ -9627,146 +9645,152 @@ results in an invalid expression.
                                    42. Non-interactive shells exit if a parameter expansion error occurs.
                                    43. Non-interactive shells exit if there is a syntax error in a script read -with the . or source builtins, or in a string processed by -the eval builtin. +with the . or source builtins, or in a string processed by +the eval builtin.
                                    44. While variable indirection is available, it may not be applied to the -‘#’ and ‘?’ special parameters. +‘#’ and ‘?’ special parameters. -
                                    45. Expanding the ‘*’ special parameter in a pattern context where the -expansion is double-quoted does not treat the $* as if it were +
                                    46. Expanding the ‘*’ special parameter in a pattern context where the +expansion is double-quoted does not treat the $* as if it were double-quoted. -
                                    47. Assignment statements preceding POSIX special builtins +
                                    48. Assignment statements preceding POSIX special builtins persist in the shell environment after the builtin completes. -
                                    49. The command builtin does not prevent builtins that take assignment +
                                    50. The command builtin does not prevent builtins that take assignment statements as arguments from expanding them as assignment statements; -when not in POSIX mode, assignment builtins lose their assignment -statement expansion properties when preceded by command. +when not in POSIX mode, assignment builtins lose their assignment +statement expansion properties when preceded by command. -
                                    51. The bg builtin uses the required format to describe each job placed +
                                    52. The bg builtin uses the required format to describe each job placed in the background, which does not include an indication of whether the job is the current or previous job. -
                                    53. The output of ‘kill -l’ prints all the signal names on a single line, -separated by spaces, without the ‘SIG’ prefix. +
                                    54. The output of ‘kill -l’ prints all the signal names on a single line, +separated by spaces, without the ‘SIG’ prefix. -
                                    55. The kill builtin does not accept signal names with a ‘SIG’ +
                                    56. The kill builtin does not accept signal names with a ‘SIG’ prefix. -
                                    57. The export and readonly builtin commands display their -output in the format required by POSIX. +
                                    58. The export and readonly builtin commands display their +output in the format required by POSIX. -
                                    59. The trap builtin displays signal names without the leading -SIG. +
                                    60. If the export and readonly builtin commands get an argument +that is not a valid identifier, and they are not operating on shell +functions, they return an error. +This will cause a non-interactive shell to exit because these are +special builtins. -
                                    61. The trap builtin doesn’t check the first argument for a possible +
                                    62. The trap builtin displays signal names without the leading +SIG. + +
                                    63. The trap builtin doesn’t check the first argument for a possible signal specification and revert the signal handling to the original disposition if it is, unless that argument consists solely of digits and is a valid signal number. If users want to reset the handler for a given -signal to the original disposition, they should use ‘-’ as the +signal to the original disposition, they should use ‘-’ as the first argument. -
                                    64. trap -p without arguments displays signals whose dispositions are +
                                    65. trap -p without arguments displays signals whose dispositions are set to SIG_DFL and those that were ignored when the shell started, not just trapped signals. -
                                    66. The . and source builtins do not search the current directory -for the filename argument if it is not found by searching PATH. +
                                    67. The . and source builtins do not search the current directory +for the filename argument if it is not found by searching PATH. -
                                    68. Enabling POSIX mode has the effect of setting the -inherit_errexit option, so +
                                    69. Enabling POSIX mode has the effect of setting the +inherit_errexit option, so subshells spawned to execute command substitutions inherit the value of -the -e option from the parent shell. -When the inherit_errexit option is not enabled, -Bash clears the -e option in such subshells. +the -e option from the parent shell. +When the inherit_errexit option is not enabled, +Bash clears the -e option in such subshells. -
                                    70. Enabling POSIX mode has the effect of setting the -shift_verbose option, so numeric arguments to shift +
                                    71. Enabling POSIX mode has the effect of setting the +shift_verbose option, so numeric arguments to shift that exceed the number of positional parameters will result in an error message. -
                                    72. When the alias builtin displays alias definitions, it does not -display them with a leading ‘alias ’ unless the -p option +
                                    73. When the alias builtin displays alias definitions, it does not +display them with a leading ‘alias ’ unless the -p option is supplied. -
                                    74. When the set builtin is invoked without options, it does not display +
                                    75. When the set builtin is invoked without options, it does not display shell function names and definitions. -
                                    76. When the set builtin is invoked without options, it displays +
                                    77. When the set builtin is invoked without options, it displays variable values without quotes, unless they contain shell metacharacters, even if the result contains nonprinting characters. -
                                    78. When the cd builtin is invoked in logical mode, and the pathname -constructed from $PWD and the directory name supplied as an argument -does not refer to an existing directory, cd will fail instead of +
                                    79. When the cd builtin is invoked in logical mode, and the pathname +constructed from $PWD and the directory name supplied as an argument +does not refer to an existing directory, cd will fail instead of falling back to physical mode. -
                                    80. When the cd builtin cannot change a directory because the +
                                    81. When the cd builtin cannot change a directory because the length of the pathname -constructed from $PWD and the directory name supplied as an argument -exceeds PATH_MAX when all symbolic links are expanded, cd will +constructed from $PWD and the directory name supplied as an argument +exceeds PATH_MAX when all symbolic links are expanded, cd will fail instead of attempting to use only the supplied directory name. -
                                    82. The pwd builtin verifies that the value it prints is the same as the +
                                    83. The pwd builtin verifies that the value it prints is the same as the current directory, even if it is not asked to check the file system with the --P option. +-P option. -
                                    84. When listing the history, the fc builtin does not include an +
                                    85. When listing the history, the fc builtin does not include an indication of whether or not a history entry has been modified. -
                                    86. The default editor used by fc is ed. +
                                    87. The default editor used by fc is ed. -
                                    88. If there are too many arguments supplied to fc -s, fc prints +
                                    89. If there are too many arguments supplied to fc -s, fc prints an error message and returns failure. -
                                    90. The type and command builtins will not report a non-executable +
                                    91. The type and command builtins will not report a non-executable file as having been found, though the shell will attempt to execute such a -file if it is the only so-named file found in $PATH. +file if it is the only so-named file found in $PATH. -
                                    92. The vi editing mode will invoke the vi editor directly when -the ‘v’ command is run, instead of checking $VISUAL and -$EDITOR. +
                                    93. The vi editing mode will invoke the vi editor directly when +the ‘v’ command is run, instead of checking $VISUAL and +$EDITOR. -
                                    94. When the xpg_echo option is enabled, Bash does not attempt to interpret -any arguments to echo as options. Each argument is displayed, after +
                                    95. When the xpg_echo option is enabled, Bash does not attempt to interpret +any arguments to echo as options. Each argument is displayed, after escape characters are converted. -
                                    96. The ulimit builtin uses a block size of 512 bytes for the -c -and -f options. +
                                    97. The ulimit builtin uses a block size of 512 bytes for the -c +and -f options. -
                                    98. The arrival of SIGCHLD when a trap is set on SIGCHLD does -not interrupt the wait builtin and cause it to return immediately. +
                                    99. The arrival of SIGCHLD when a trap is set on SIGCHLD does +not interrupt the wait builtin and cause it to return immediately. The trap command is run once for each child that exits. -
                                    100. The read builtin may be interrupted by a signal for which a trap +
                                    101. The read builtin may be interrupted by a signal for which a trap has been set. -If Bash receives a trapped signal while executing read, the trap -handler executes and read returns an exit status greater than 128. +If Bash receives a trapped signal while executing read, the trap +handler executes and read returns an exit status greater than 128. -
                                    102. The printf builtin uses double (via strtod) to convert +
                                    103. The printf builtin uses double (via strtod) to convert arguments corresponding to floating point conversion specifiers, instead of -long double if it’s available. The ‘L’ length modifier forces -printf to use long double if it’s available. +long double if it’s available. The ‘L’ length modifier forces +printf to use long double if it’s available.
                                    104. Bash removes an exited background process’s status from the list of such -statuses after the wait builtin is used to obtain it. +statuses after the wait builtin is used to obtain it. -
                                    105. A double quote character (‘"’) is treated specially when it appears +
                                    106. A double quote character (‘"’) is treated specially when it appears in a backquoted command substitution in the body of a here-document that undergoes expansion. That means, for example, that a backslash preceding a double quote character will escape it and the backslash will be removed. -
                                    107. The test builtin compares strings using the current locale when -processing the ‘<’ and ‘>’ binary operators. +
                                    108. The test builtin compares strings using the current locale when +processing the ‘<’ and ‘>’ binary operators. -
                                    109. The test builtin’s -t unary primary requires an argument. -Historical versions of test made the argument optional in certain +
                                    110. The test builtin’s -t unary primary requires an argument. +Historical versions of test made the argument optional in certain cases, and Bash attempts to accommodate those for backwards compatibility. -
                                    111. Command substitutions don’t set the ‘?’ special parameter. The exit +
                                    112. Command substitutions don’t set the ‘?’ special parameter. The exit status of a simple command without a command word is still the exit status of the last command substitution that occurred while evaluating the variable assignments and redirections in that command, but that does not happen until @@ -9774,45 +9798,45 @@ after all of the assignments and redirections.
                                    -

                                    There is other POSIX behavior that Bash does not implement by -default even when in POSIX mode. +

                                    There is other POSIX behavior that Bash does not implement by +default even when in POSIX mode. Specifically:

                                    -
                                      -
                                    1. The fc builtin checks $EDITOR as a program to edit history -entries if FCEDIT is unset, rather than defaulting directly to -ed. fc uses ed if EDITOR is unset. +
                                        +
                                      1. The fc builtin checks $EDITOR as a program to edit history +entries if FCEDIT is unset, rather than defaulting directly to +ed. fc uses ed if EDITOR is unset.
                                      2. A non-interactive shell does not exit if a variable assignment preceding -the command builtin or another non-special builtin fails. +the command builtin or another non-special builtin fails. -
                                      3. As noted above, Bash requires the xpg_echo option to be enabled for -the echo builtin to be fully conformant. +
                                      4. As noted above, Bash requires the xpg_echo option to be enabled for +the echo builtin to be fully conformant.
                                      -

                                      Bash can be configured to be POSIX-conformant by default, by specifying -the --enable-strict-posix-default to configure when building -(see Optional Features). +

                                      Bash can be configured to be POSIX-conformant by default, by specifying +the --enable-strict-posix-default to configure when building +(see Optional Features).


                                  -
                                  -
                                  +
                                  + -

                                  6.12 Shell Compatibility Mode

                                  - - +

                                  6.12 Shell Compatibility Mode

                                  + + -

                                  Bash-4.0 introduced the concept of a shell compatibility level, +

                                  Bash-4.0 introduced the concept of a shell compatibility level, specified as a set of options to the shopt builtin -(compat31, -compat32, -compat40, -compat41, +(compat31, +compat32, +compat40, +compat41, and so on). There is only one current compatibility level – each option is mutually exclusive. @@ -9822,58 +9846,58 @@ while they migrate scripts to use current features and behavior. It’s intended to be a temporary solution.

                                  This section does not mention behavior that is standard for a particular -version (e.g., setting compat32 means that quoting the rhs of the regexp +version (e.g., setting compat32 means that quoting the rhs of the regexp matching operator quotes special regexp characters in the word, which is default behavior in bash-3.2 and subsequent versions).

                                  -

                                  If a user enables, say, compat32, it may affect the behavior of other +

                                  If a user enables, say, compat32, 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 Bash, but that behavior may have been present in earlier versions. -For instance, the change to use locale-based comparisons with the [[ +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 compat32 will enable ASCII-based comparisons as well. +so enabling compat32 will enable ASCII-based comparisons as well. That granularity may not be sufficient 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: BASH_COMPAT. +

                                  Bash-4.3 introduced a new shell variable: BASH_COMPAT. The value assigned to this variable (a decimal version number like 4.2, or an integer -corresponding to the compatNN option, like 42) determines the +corresponding to the compatNN option, like 42) determines the compatibility level.

                                  Starting with bash-4.4, Bash has begun deprecating older compatibility levels. -Eventually, the options will be removed in favor of BASH_COMPAT. +Eventually, the options will be removed in favor of BASH_COMPAT.

                                  -

                                  Bash-5.0 is the final version for which there will be an individual shopt -option for the previous version. Users should use BASH_COMPAT -on bash-5.0 and later versions. +

                                  Bash-5.0 was the final version for which there will be an individual shopt +option for the previous version. +Users should control the compatibility level with BASH_COMPAT.

                                  The following table describes the behavior changes controlled by each compatibility level setting. -The compatNN tag is used as shorthand for setting the +The compatNN tag is used as shorthand for setting the compatibility level -to NN using one of the following mechanisms. +to NN using one of the following mechanisms. For versions prior to bash-5.0, the compatibility level may be set using -the corresponding compatNN shopt option. -For bash-4.3 and later versions, the BASH_COMPAT variable is preferred, +the corresponding compatNN shopt option. +For bash-4.3 and later versions, the BASH_COMPAT variable is preferred, and it is required for bash-5.1 and later versions.

                                  -
                                  -
                                  compat31
                                  -
                                    -
                                  • quoting the rhs of the [[ command’s regexp matching operator (=~) +
                                    +
                                    compat31
                                    +
                                      +
                                    • quoting the rhs of the [[ command’s regexp matching operator (=~) has no special effect
                                    -
                                    compat40
                                    -
                                      -
                                    • the ‘<’ and ‘>’ operators to the [[ command do not +
                                      compat40
                                      +
                                        +
                                      • the ‘<’ and ‘>’ operators to the [[ command do not consider the current locale when comparing strings; they use ASCII ordering. Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); @@ -9882,103 +9906,103 @@ strcoll(3).
                                      -
                                      compat41
                                      -
                                        -
                                      • 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 ${…} +
                                        compat41
                                        +
                                          +
                                        • 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)
                                        -
                                        compat42
                                        -
                                          -
                                        • the replacement string in double-quoted pattern substitution does not +
                                          compat42
                                          +
                                            +
                                          • 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 expanding -the word portion of a double-quoted ${…} parameter expansion +
                                          • 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
                                          -
                                          compat43
                                          -
                                            -
                                          • the shell does not print a warning message if an attempt is made to +
                                            compat43
                                            +
                                              +
                                            • the shell does not print a warning message if an attempt is made to use a quoted compound assignment as an argument to declare (e.g., declare -a foo=’(1 2)’). Later versions warn that this usage is deprecated -
                                            • word expansion errors are considered non-fatal errors that cause the +
                                            • 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) -
                                            • when executing a shell function, the loop state (while/until/etc.) -is not reset, so break or continue in that function will break +
                                            • when executing a shell function, the loop state (while/until/etc.) +is not reset, so break or continue in that function will break or continue loops in the calling context. Bash-4.4 and later reset the loop state to prevent this
                                            -
                                            compat44
                                            -
                                              -
                                            • the shell sets up the values used by BASH_ARGV and BASH_ARGC +
                                              compat44
                                              +
                                                +
                                              • the shell sets up the values used by BASH_ARGV and BASH_ARGC so they can expand to the shell’s positional parameters even if extended debugging mode is not enabled -
                                              • a subshell inherits loops from its parent context, so break -or continue will cause the subshell to exit. +
                                              • a subshell inherits loops from its parent context, so break +or continue will cause the subshell to exit. Bash-5.0 and later reset the loop state to prevent the exit -
                                              • variable assignments preceding builtins like export and readonly +
                                              • 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
                                              -
                                              compat50 (set using BASH_COMPAT)
                                              -
                                                -
                                              • Bash-5.1 changed the way $RANDOM is generated to introduce slightly +
                                                compat50 (set using BASH_COMPAT)
                                                +
                                                  +
                                                • Bash-5.1 changed the way $RANDOM is generated to introduce slightly more randomness. If the shell compatibility level is set to 50 or lower, it reverts to the method from bash-5.0 and previous versions, so seeding the random number generator by assigning a value to -RANDOM will produce the same sequence as in bash-5.0 -
                                                • If the command hash table is empty, Bash versions prior to bash-5.1 +RANDOM will produce the same sequence as in bash-5.0 +
                                                • If the command hash table is empty, Bash versions prior to bash-5.1 printed an informational message to that effect, even when producing output that can be reused as input. Bash-5.1 suppresses that message -when the -l option is supplied. +when the -l option is supplied.
                                                -
                                                compat51 (set using BASH_COMPAT)
                                                -
                                                  -
                                                • The unset builtin will unset the array a given an argument like -‘a[@]’. -Bash-5.2 will unset an element with key ‘@’ (associative arrays) +
                                                  compat51 (set using BASH_COMPAT)
                                                  +
                                                    +
                                                  • The unset builtin will unset the array a given an argument like +‘a[@]’. +Bash-5.2 will unset an element with key ‘@’ (associative arrays) or remove all the elements without unsetting the array (indexed arrays) -
                                                  • arithmetic commands ( ((...)) ) and the expressions in an arithmetic for +
                                                  • arithmetic commands ( ((...)) ) and the expressions in an arithmetic for statement can be expanded more than once -
                                                  • expressions used as arguments to arithmetic operators in the [[ +
                                                  • expressions used as arguments to arithmetic operators in the [[ conditional command can be expanded more than once -
                                                  • the expressions in substring parameter brace expansion can be +
                                                  • the expressions in substring parameter brace expansion can be expanded more than once -
                                                  • the expressions in the $(( ... )) word expansion can be expanded +
                                                  • the expressions in the $(( ... )) word expansion can be expanded more than once -
                                                  • arithmetic expressions used as indexed array subscripts can be +
                                                  • arithmetic expressions used as indexed array subscripts can be expanded more than once -
                                                  • test -v, when given an argument of ‘A[@]’, where A is +
                                                  • test -v, when given an argument of ‘A[@]’, where A is an existing associative array, will return true if the array has any set elements. -Bash-5.2 will look for and report on a key named ‘@’ -
                                                  • the ${parameter[:]=value} word expansion will return -value, before any variable-specific transformations have been +Bash-5.2 will look for and report on a key named ‘@’ +
                                                  • the ${parameter[:]=value} word expansion will return +value, 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. -
                                                  • Parsing command substitutions will behave as if extended globbing -(see The Shopt Builtin) +
                                                  • Parsing command substitutions will behave as if extended globbing +(see The Shopt Builtin) is enabled, so that parsing a command substitution containing an extglob pattern (say, as part of a shell function) will not fail. This assumes the intent is to enable extglob before the command is executed @@ -9992,33 +10016,33 @@ enabled by the time the command is executed.
                                  -
                                  -
                                  +
                                  + -

                                  7 Job Control

                                  +

                                  7 Job Control

                                  This chapter discusses what job control is, how it works, and how Bash allows you to access its facilities.

                                  -
                                    +
                                    -
                                    -
                                    +
                                    + -

                                    7.1 Job Control Basics

                                    - - - - +

                                    7.1 Job Control Basics

                                    + + + +

                                    Job control refers to the ability to selectively stop (suspend) @@ -10027,295 +10051,295 @@ their execution at a later point. A user typically employs this facility via an interactive interface supplied jointly by the operating system kernel’s terminal driver and Bash.

                                    -

                                    The shell associates a job with each pipeline. It keeps a +

                                    The shell associates a job with each pipeline. It keeps a table of currently executing jobs, which may be listed with the -jobs command. When Bash starts a job +jobs command. When Bash starts a job asynchronously, it prints a line that looks like:

                                    -
                                    [1] 25647
                                    +
                                    [1] 25647
                                     
                                    -

                                    indicating that this job is job number 1 and that the process ID +

                                    indicating that this job is job number 1 and that the process ID of the last process in the pipeline associated with this job is 25647. All of the processes in a single pipeline are members of -the same job. Bash uses the job abstraction as the +the same job. Bash uses the job abstraction as the basis for job control.

                                    To facilitate the implementation of the user interface to job control, the operating system maintains the notion of a current terminal -process group ID. Members of this process group (processes whose -process group ID is equal to the current terminal process group -ID) receive keyboard-generated signals such as SIGINT. +process group ID. Members of this process group (processes whose +process group ID is equal to the current terminal process group +ID) receive keyboard-generated signals such as SIGINT. These processes are said to be in the foreground. Background -processes are those whose process group ID differs from the +processes are those whose process group ID differs from the terminal’s; such processes are immune to keyboard-generated signals. Only foreground processes are allowed to read from or, if -the user so specifies with stty tostop, write to the terminal. +the user so specifies with stty tostop, write to the terminal. Background processes which attempt to -read from (write to when stty tostop is in effect) the -terminal are sent a SIGTTIN (SIGTTOU) +read from (write to when tostop is in effect) the +terminal are sent a SIGTTIN (SIGTTOU) signal by the kernel’s terminal driver, which, unless caught, suspends the process.

                                    If the operating system on which Bash is running supports job control, Bash contains facilities to use it. Typing the -suspend character (typically ‘^Z’, Control-Z) while a +suspend character (typically ‘^Z’, Control-Z) while a process is running causes that process to be stopped and returns -control to Bash. Typing the delayed suspend character -(typically ‘^Y’, Control-Y) causes the process to be stopped +control to Bash. Typing the delayed suspend character +(typically ‘^Y’, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to be returned to Bash. The user then manipulates the state of -this job, using the bg command to continue it in the -background, the fg command to continue it in the -foreground, or the kill command to kill it. A ‘^Z’ +this job, using the bg command to continue it in the +background, the fg command to continue it in the +foreground, or the kill command to kill it. A ‘^Z’ takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded.

                                    There are a number of ways to refer to a job in the shell. The -character ‘%’ introduces a job specification (jobspec). +character ‘%’ introduces a job specification (jobspec).

                                    -

                                    Job number n may be referred to as ‘%n’. -The symbols ‘%%’ and ‘%+’ refer to the shell’s notion of the +

                                    Job number n may be referred to as ‘%n’. +The symbols ‘%%’ and ‘%+’ refer to the shell’s notion of the current job, which is the last job stopped while it was in the foreground or started in the background. -A single ‘%’ (with no accompanying job specification) also refers +A single ‘%’ (with no accompanying job specification) also refers to the current job. -The previous job may be referenced using ‘%-’. -If there is only a single job, ‘%+’ and ‘%-’ can both be used +The previous job may be referenced using ‘%-’. +If there is only a single job, ‘%+’ and ‘%-’ can both be used to refer to that job. -In output pertaining to jobs (e.g., the output of the jobs -command), the current job is always flagged with a ‘+’, and the -previous job with a ‘-’. +In output pertaining to jobs (e.g., the output of the jobs +command), the current job is always flagged with a ‘+’, and the +previous job with a ‘-’.

                                    A job may also be referred to using a prefix of the name used to start it, or using a substring -that appears in its command line. For example, ‘%ce’ refers -to a stopped job whose command name begins with ‘ce’. -Using ‘%?ce’, on the -other hand, refers to any job containing the string ‘ce’ in +that appears in its command line. For example, ‘%ce’ refers +to a stopped job whose command name begins with ‘ce’. +Using ‘%?ce’, on the +other hand, refers to any job containing the string ‘ce’ in its command line. If the prefix or substring matches more than one job, Bash reports an error.

                                    Simply naming a job can be used to bring it into the foreground: -‘%1’ is a synonym for ‘fg %1’, bringing job 1 from the -background into the foreground. Similarly, ‘%1 &’ resumes -job 1 in the background, equivalent to ‘bg %1’ +‘%1’ is a synonym for ‘fg %1’, bringing job 1 from the +background into the foreground. Similarly, ‘%1 &’ resumes +job 1 in the background, equivalent to ‘bg %1

                                    The shell learns immediately whenever a job changes state. Normally, Bash waits until it is about to print a prompt before reporting changes in a job’s status so as to not interrupt any other output. -If the -b option to the set builtin is enabled, -Bash reports such changes immediately (see The Set Builtin). -Any trap on SIGCHLD is executed for each child process +If the -b option to the set builtin is enabled, +Bash reports such changes immediately (see The Set Builtin). +Any trap on SIGCHLD is executed for each child process that exits.

                                    If an attempt to exit Bash is made while jobs are stopped, (or running, if -the checkjobs option is enabled – see The Shopt Builtin), the -shell prints a warning message, and if the checkjobs option is +the checkjobs option is enabled – see The Shopt Builtin), the +shell prints a warning message, and if the checkjobs option is enabled, lists the jobs and their statuses. -The jobs command may then be used to inspect their status. +The jobs command may then be used to inspect their status. If a second attempt to exit is made without an intervening command, Bash does not print another warning, and any stopped jobs are terminated.

                                    -

                                    When the shell is waiting for a job or process using the wait -builtin, and job control is enabled, wait will return when the -job changes state. The -f option causes wait to wait +

                                    When the shell is waiting for a job or process using the wait +builtin, and job control is enabled, wait will return when the +job changes state. The -f option causes wait to wait until the job or process terminates before returning.


                                    -
                                    -
                                    +
                                    + -

                                    7.2 Job Control Builtins

                                    +

                                    7.2 Job Control Builtins

                                    -
                                    -
                                    bg
                                    +
                                    +
                                    bg
                                    -
                                    bg [jobspec …]
                                    +
                                    bg [jobspec ...]
                                     
                                    -

                                    Resume each suspended job jobspec in the background, as if it -had been started with ‘&’. -If jobspec is not supplied, the current job is used. +

                                    Resume each suspended job jobspec in the background, as if it +had been started with ‘&’. +If jobspec is not supplied, the current job is used. The return status is zero unless it is run when job control is not enabled, or, when run with job control enabled, any -jobspec was not found or specifies a job +jobspec was not found or specifies a job that was started without job control.

                                    -
                                    fg
                                    +
                                    fg
                                    -
                                    fg [jobspec]
                                    +
                                    fg [jobspec]
                                     
                                    -

                                    Resume the job jobspec in the foreground and make it the current job. -If jobspec is not supplied, the current job is used. +

                                    Resume the job jobspec in the foreground and make it the current job. +If jobspec is not supplied, the current job is used. The return status is that of the command placed into the foreground, or non-zero if run when job control is disabled or, when run with -job control enabled, jobspec does not specify a valid job or -jobspec specifies a job that was started without job control. +job control enabled, jobspec does not specify a valid job or +jobspec specifies a job that was started without job control.

                                    -
                                    jobs
                                    +
                                    jobs
                                    -
                                    jobs [-lnprs] [jobspec]
                                    -jobs -x command [arguments]
                                    +
                                    jobs [-lnprs] [jobspec]
                                    +jobs -x command [arguments]
                                     

                                    The first form lists the active jobs. The options have the following meanings:

                                    -
                                    -
                                    -l
                                    -

                                    List process IDs in addition to the normal information. +

                                    +
                                    -l
                                    +

                                    List process IDs in addition to the normal information.

                                    -
                                    -n
                                    +
                                    -n

                                    Display information only about jobs that have changed status since the user was last notified of their status.

                                    -
                                    -p
                                    -

                                    List only the process ID of the job’s process group leader. +

                                    -p
                                    +

                                    List only the process ID of the job’s process group leader.

                                    -
                                    -r
                                    +
                                    -r

                                    Display only running jobs.

                                    -
                                    -s
                                    +
                                    -s

                                    Display only stopped jobs.

                                    -

                                    If jobspec is given, +

                                    If jobspec is given, output is restricted to information about that job. -If jobspec is not supplied, the status of all jobs is +If jobspec is not supplied, the status of all jobs is listed.

                                    -

                                    If the -x option is supplied, jobs replaces any -jobspec found in command or arguments with the -corresponding process group ID, and executes command, -passing it arguments, returning its exit status. +

                                    If the -x option is supplied, jobs replaces any +jobspec found in command or arguments with the +corresponding process group ID, and executes command, +passing it arguments, returning its exit status.

                                    -
                                    kill
                                    +
                                    kill
                                    -
                                    kill [-s sigspec] [-n signum] [-sigspec] jobspec or pid
                                    -kill -l|-L [exit_status]
                                    +
                                    kill [-s sigspec] [-n signum] [-sigspec] jobspec or pid
                                    +kill -l|-L [exit_status]
                                     
                                    -

                                    Send a signal specified by sigspec or signum to the process -named by job specification jobspec or process ID pid. -sigspec is either a case-insensitive signal name such as -SIGINT (with or without the SIG prefix) -or a signal number; signum is a signal number. -If sigspec and signum are not present, SIGTERM is used. -The -l option lists the signal names. -If any arguments are supplied when -l is given, the names of the +

                                    Send a signal specified by sigspec or signum to the process +named by job specification jobspec or process ID pid. +sigspec is either a case-insensitive signal name such as +SIGINT (with or without the SIG prefix) +or a signal number; signum is a signal number. +If sigspec and signum are not present, SIGTERM is used. +The -l option lists the signal names. +If any arguments are supplied when -l is given, the names of the signals corresponding to the arguments are listed, and the return status is zero. -exit_status is a number specifying a signal number or the exit +exit_status is a number specifying a signal number or the exit status of a process terminated by a signal. -The -L option is equivalent to -l. +The -L option is equivalent to -l. The return status is zero if at least one signal was successfully sent, or non-zero if an error occurs or an invalid option is encountered.

                                    -
                                    wait
                                    +
                                    wait
                                    -
                                    wait [-fn] [-p varname] [jobspec or pid …]
                                    +
                                    wait [-fn] [-p varname] [jobspec or pid ...]
                                     
                                    -

                                    Wait until the child process specified by each process ID pid -or job specification jobspec exits and return the exit status of the +

                                    Wait until the child process specified by each process ID pid +or job specification jobspec exits and return the exit status of the last command waited for. If a job spec is given, all processes in the job are waited for. If no arguments are given, -wait waits for all running background jobs and +wait 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 -n option is supplied, wait waits for a single job -from the list of pids or jobspecs or, if no arguments are +If the -n option is supplied, wait waits for a single job +from the list of pids or jobspecs or, if no arguments are supplied, any job, to complete and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the shell has no unwaited-for children, the exit status is 127. -If the -p option is supplied, the process or job identifier of the job +If the -p option is supplied, the process or job identifier of the job for which the exit status is returned is assigned to the variable -varname named by the option argument. +varname named by the option argument. The variable will be unset initially, before any assignment. -This is useful only when the -n option is supplied. -Supplying the -f option, when job control is enabled, -forces wait to wait for each pid or jobspec to +This is useful only when the -n option is supplied. +Supplying the -f option, when job control is enabled, +forces wait to wait for each pid or jobspec to terminate before returning its status, instead of returning when it changes status. -If neither jobspec nor pid specifies an active child process +If neither jobspec nor pid specifies an active child process of the shell, the return status is 127. -If wait is interrupted by a signal, the return status will be greater -than 128, as described above (see Signals). +If wait is interrupted by a signal, the return status will be greater +than 128, as described above (see Signals). Otherwise, the return status is the exit status of the last process or job waited for.

                                    -
                                    disown
                                    +
                                    disown
                                    -
                                    disown [-ar] [-h] [jobspec … | pid … ]
                                    +
                                    disown [-ar] [-h] [jobspec ... | pid ... ]
                                     
                                    -

                                    Without options, remove each jobspec from the table of +

                                    Without options, remove each jobspec from the table of active jobs. -If the -h option is given, the job is not removed from the table, -but is marked so that SIGHUP is not sent to the job if the shell -receives a SIGHUP. -If jobspec is not present, and neither the -a nor the --r option is supplied, the current job is used. -If no jobspec is supplied, the -a option means to remove or -mark all jobs; the -r option without a jobspec +If the -h option is given, the job is not removed from the table, +but is marked so that SIGHUP is not sent to the job if the shell +receives a SIGHUP. +If jobspec is not present, and neither the -a nor the +-r option is supplied, the current job is used. +If no jobspec is supplied, the -a option means to remove or +mark all jobs; the -r option without a jobspec argument restricts operation to running jobs.

                                    -
                                    suspend
                                    +
                                    suspend
                                    -
                                    suspend [-f]
                                    +
                                    suspend [-f]
                                     

                                    Suspend the execution of this shell until it receives a -SIGCONT signal. +SIGCONT signal. A login shell, or a shell without job control enabled, -cannot be suspended; the -f +cannot be suspended; the -f option can be used to 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 --f +-f is not supplied.

                                    -

                                    When job control is not active, the kill and wait -builtins do not accept jobspec arguments. They must be -supplied process IDs. +

                                    When job control is not active, the kill and wait +builtins do not accept jobspec arguments. They must be +supplied process IDs.


                                    -
                                    -
                                    +
                                    + -

                                    7.3 Job Control Variables

                                    +

                                    7.3 Job Control Variables

                                    -
                                    -
                                    auto_resume
                                    +
                                    +
                                    auto_resume

                                    This variable controls how the shell interacts with the user and job control. If this variable exists then single word simple commands without redirections are treated as candidates for resumption @@ -10323,20 +10347,20 @@ of an existing job. There is no ambiguity allowed; if there is more than one job beginning with the string typed, then the most recently accessed job will be selected. The name of a stopped job, in this context, is the command line -used to start it. If this variable is set to the value ‘exact’, +used to start it. If this variable is set to the value ‘exact’, the string supplied must match the name of a stopped job exactly; -if set to ‘substring’, +if set to ‘substring’, the string supplied needs to match a substring of the name of a -stopped job. The ‘substring’ value provides functionality -analogous to the ‘%?’ job ID (see Job Control Basics). +stopped job. The ‘substring’ value provides functionality +analogous to the ‘%?’ job ID (see Job Control Basics). If set to any other value, the supplied string must be a prefix of a stopped job’s name; this provides functionality -analogous to the ‘%’ job ID. +analogous to the ‘%’ job ID.

                                    - + @@ -10344,30 +10368,30 @@ analogous to the ‘%’ job ID.
                                    -
                                    -
                                    +
                                    + -

                                    8 Command Line Editing

                                    +

                                    8 Command Line Editing

                                    -

                                    This chapter describes the basic features of the GNU +

                                    This chapter describes the basic features of the GNU command line editing interface. Command line editing is provided by the Readline library, which is used by several different programs, including Bash. Command line editing is enabled by default when using an interactive shell, -unless the --noediting option is supplied at shell invocation. -Line editing is also used when using the -e option to the -read builtin command (see Bash Builtin Commands). +unless the --noediting option is supplied at shell invocation. +Line editing is also used when using the -e option to the +read builtin command (see Bash Builtin Commands). By default, the line editing commands are similar to those of Emacs. A vi-style line editing interface is also available. -Line editing can be enabled at any time using the -o emacs or --o vi options to the set builtin command -(see The Set Builtin), or disabled using the +o emacs or -+o vi options to set. +Line editing can be enabled at any time using the -o emacs or +-o vi options to the set builtin command +(see The Set Builtin), or disabled using the +o emacs or ++o vi options to set.

                                    -
                                      +
                                      -
                                      -
                                      +
                                      + -

                                      8.1 Introduction to Line Editing

                                      +

                                      8.1 Introduction to Line Editing

                                      The following paragraphs describe the notation used to represent keystrokes.

                                      -

                                      The text C-k is read as ‘Control-K’ and describes the character -produced when the k key is pressed while the Control key +

                                      The text C-k is read as ‘Control-K’ and describes the character +produced when the k key is pressed while the Control key is depressed.

                                      -

                                      The text M-k is read as ‘Meta-K’ and describes the character -produced when the Meta key (if you have one) is depressed, and the k +

                                      The text M-k is read as ‘Meta-K’ and describes the character +produced when the Meta key (if you have one) is depressed, and the k key is pressed. -The Meta key is labeled ALT on many keyboards. -On keyboards with two keys labeled ALT (usually to either side of -the space bar), the ALT on the left side is generally set to +The Meta key is labeled ALT on many keyboards. +On keyboards with two keys labeled ALT (usually to either side of +the space bar), the ALT on the left side is generally set to work as a Meta key. -The ALT key on the right may also be configured to work as a +The ALT key on the right may also be configured to work as a Meta key or may be configured as some other modifier, such as a Compose key for typing accented characters.

                                      -

                                      If you do not have a Meta or ALT key, or another key working as -a Meta key, the identical keystroke can be generated by typing ESC -first, and then typing k. -Either process is known as metafying the k key. +

                                      If you do not have a Meta or ALT key, or another key working as +a Meta key, the identical keystroke can be generated by typing ESC +first, and then typing k. +Either process is known as metafying the k key.

                                      -

                                      The text M-C-k is read as ‘Meta-Control-k’ and describes the -character produced by metafying C-k. +

                                      The text M-C-k is read as ‘Meta-Control-k’ and describes the +character produced by metafying C-k.

                                      In addition, several keys have their own names. Specifically, -DEL, ESC, LFD, SPC, RET, and TAB all +DEL, ESC, LFD, SPC, RET, and TAB all stand for themselves when seen in this text, or in an init file -(see Readline Init File). -If your keyboard lacks a LFD key, typing C-j will +(see Readline Init File). +If your keyboard lacks a LFD key, typing C-j will produce the desired character. -The RET key may be labeled Return or Enter on +The RET key may be labeled Return or Enter on some keyboards.


                                      -
                                      -
                                      +
                                      + -

                                      8.2 Readline Interaction

                                      - +

                                      8.2 Readline Interaction

                                      +

                                      Often during an interactive session you type in a long line of text, only to notice that the first word on the line is misspelled. The @@ -10437,12 +10461,12 @@ as you type it in, allowing you to just fix your typo, and not forcing you to retype the majority of the line. Using these editing commands, you move the cursor to the place that needs correction, and delete or insert the text of the corrections. Then, when you are satisfied with -the line, you simply press RET. You do not have to be at the -end of the line to press RET; the entire line is accepted +the line, you simply press RET. You do not have to be at the +end of the line to press RET; the entire line is accepted regardless of the location of the cursor within the line.

                                      -
                                        +
                                        -
                                        -
                                        +
                                        + -

                                        8.2.1 Readline Bare Essentials

                                        - - - +

                                        8.2.1 Readline Bare Essentials

                                        + + +

                                        In order to enter characters into the line, simply type them. The typed character appears where the cursor was, and then the cursor moves one @@ -10467,9 +10491,9 @@ erase character to back up and delete the mistyped character.

                                        Sometimes you may mistype a character, and not notice the error until you have typed several other characters. In -that case, you can type C-b to move the cursor to the left, and then +that case, you can type C-b to move the cursor to the left, and then correct your mistake. Afterwards, you can move the cursor to the right -with C-f. +with C-f.

                                        When you add text in the middle of a line, you will notice that characters to the right of the cursor are ‘pushed over’ to make room for the text @@ -10478,85 +10502,85 @@ characters to the right of the cursor are ‘pulled back’ to fill in t blank space created by the removal of the text. A list of the bare essentials for editing the text of an input line follows.

                                        -
                                        -
                                        C-b
                                        +
                                        +
                                        C-b

                                        Move back one character.

                                        -
                                        C-f
                                        +
                                        C-f

                                        Move forward one character.

                                        -
                                        DEL or Backspace
                                        +
                                        DEL or Backspace

                                        Delete the character to the left of the cursor.

                                        -
                                        C-d
                                        +
                                        C-d

                                        Delete the character underneath the cursor.

                                        -
                                        Printing characters
                                        +
                                        Printing characters

                                        Insert the character into the line at the cursor.

                                        -
                                        C-_ or C-x C-u
                                        +
                                        C-_ or C-x C-u

                                        Undo the last editing command. You can undo all the way back to an empty line.

                                        -

                                        (Depending on your configuration, the Backspace key might be set to -delete the character to the left of the cursor and the DEL key set -to delete the character underneath the cursor, like C-d, rather +

                                        (Depending on your configuration, the Backspace key might be set to +delete the character to the left of the cursor and the DEL key set +to delete the character underneath the cursor, like C-d, rather than the character to the left of the cursor.)


                                        -
                                        -
                                        +
                                        + -

                                        8.2.2 Readline Movement Commands

                                        +

                                        8.2.2 Readline Movement Commands

                                        The above table describes the most basic keystrokes that you need in order to do editing of the input line. For your convenience, many -other commands have been added in addition to C-b, C-f, -C-d, and DEL. Here are some commands for moving more rapidly +other commands have been added in addition to C-b, C-f, +C-d, and DEL. Here are some commands for moving more rapidly about the line.

                                        -
                                        -
                                        C-a
                                        +
                                        +
                                        C-a

                                        Move to the start of the line.

                                        -
                                        C-e
                                        +
                                        C-e

                                        Move to the end of the line.

                                        -
                                        M-f
                                        +
                                        M-f

                                        Move forward a word, where a word is composed of letters and digits.

                                        -
                                        M-b
                                        +
                                        M-b

                                        Move backward a word.

                                        -
                                        C-l
                                        +
                                        C-l

                                        Clear the screen, reprinting the current line at the top.

                                        -

                                        Notice how C-f moves forward a character, while M-f moves +

                                        Notice how C-f moves forward a character, while M-f moves forward a word. It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words.


                                        -
                                        -
                                        +
                                        + -

                                        8.2.3 Readline Killing Commands

                                        +

                                        8.2.3 Readline Killing Commands

                                        - - + + -

                                        Killing text means to delete the text from the line, but to save -it away for later use, usually by yanking (re-inserting) +

                                        Killing text means to delete the text from the line, but to save +it away for later use, usually by yanking (re-inserting) it back into the line. (‘Cut’ and ‘paste’ are more recent jargon for ‘kill’ and ‘yank’.)

                                        @@ -10564,91 +10588,91 @@ it back into the line. be sure that you can get the text back in a different (or the same) place later.

                                        -

                                        When you use a kill command, the text is saved in a kill-ring. +

                                        When you use a kill command, the text is saved in a kill-ring. Any number of consecutive kills save all of the killed text together, so that when you yank it back, you get it all. The kill ring is not line specific; the text that you killed on a previously typed line is available to be yanked back later, when you are typing another line. - +

                                        Here is the list of commands for killing text.

                                        -
                                        -
                                        C-k
                                        +
                                        +
                                        C-k

                                        Kill the text from the current cursor position to the end of the line.

                                        -
                                        M-d
                                        +
                                        M-d

                                        Kill from the cursor 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 M-f. +Word boundaries are the same as those used by M-f.

                                        -
                                        M-DEL
                                        +
                                        M-DEL

                                        Kill from the cursor to the start of the current word, or, if between words, to the start of the previous word. -Word boundaries are the same as those used by M-b. +Word boundaries are the same as those used by M-b.

                                        -
                                        C-w
                                        +
                                        C-w

                                        Kill from the cursor to the previous whitespace. This is different than -M-DEL because the word boundaries differ. +M-DEL because the word boundaries differ.

                                        -

                                        Here is how to yank the text back into the line. Yanking +

                                        Here is how to yank the text back into the line. Yanking means to copy the most-recently-killed text from the kill buffer.

                                        -
                                        -
                                        C-y
                                        +
                                        +
                                        C-y

                                        Yank the most recently killed text back into the buffer at the cursor.

                                        -
                                        M-y
                                        +
                                        M-y

                                        Rotate the kill-ring, and yank the new top. You can only do this if -the prior command is C-y or M-y. +the prior command is C-y or M-y.


                                        -
                                        -
                                        +
                                        + -

                                        8.2.4 Readline Arguments

                                        +

                                        8.2.4 Readline Arguments

                                        You can pass numeric arguments to Readline commands. Sometimes the -argument acts as a repeat count, other times it is the sign of the +argument acts as a repeat count, other times it is the sign of the argument that is significant. If you pass a negative argument to a command which normally acts in a forward direction, that command will act in a backward direction. For example, to kill text back to the -start of the line, you might type ‘M-- C-k’. +start of the line, you might type ‘M-- C-k’.

                                        The general way to pass numeric arguments to a command is to type meta digits before the command. If the first ‘digit’ typed is a minus -sign (‘-’), then the sign of the argument will be negative. Once +sign (‘-’), then the sign of the argument will be negative. Once you have typed one meta digit to get the argument started, you can type the remainder of the digits, and then the command. For example, to give -the C-d command an argument of 10, you could type ‘M-1 0 C-d’, +the C-d command an argument of 10, you could type ‘M-1 0 C-d’, which will delete the next ten characters on the input line.


                                        -
                                        -
                                        +
                                        + -

                                        8.2.5 Searching for Commands in the History

                                        +

                                        8.2.5 Searching for Commands in the History

                                        Readline provides commands for searching through the command history -(see Bash History Facilities) +(see Bash History Facilities) for lines containing a specified string. -There are two search modes: incremental and non-incremental. +There are two search modes: incremental and non-incremental.

                                        Incremental searches begin before the user has finished typing the search string. @@ -10657,136 +10681,138 @@ 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. To search backward in the history for a particular string, type -C-r. Typing C-s searches forward through the history. -The characters present in the value of the isearch-terminators variable +C-r. Typing C-s searches forward through the history. +The characters present in the value of the isearch-terminators variable are used to terminate an incremental search. -If that variable has not been assigned a value, the ESC and -C-J characters will terminate an incremental search. -C-g will abort an incremental search and restore the original line. +If that variable has not been assigned a value, the ESC and +C-J characters will terminate an incremental search. +C-g will abort an incremental search and restore 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 C-r or -C-s as appropriate. +

                                        To find other matching entries in the history list, type C-r or +C-s as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. Any other key sequence bound to a Readline command will terminate the search and execute that command. -For instance, a RET will terminate the search and accept +For instance, a RET will terminate the search and accept the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing.

                                        -

                                        Readline remembers the last incremental search string. If two -C-rs are typed without any intervening characters defining a new -search string, any remembered search string is used. +

                                        Readline remembers the last incremental search string. +If two C-rs are typed without any intervening characters defining +a new search string, Readline uses any remembered search string.

                                        Non-incremental searches read the entire search string before starting -to search for matching history lines. The search string may be -typed by the user or be part of the contents of the current line. +to search for matching history lines. +The search string may be typed by the user or be part of the contents of +the current line.


                                        -
                                        -
                                        +
                                        + -

                                        8.3 Readline Init File

                                        - +

                                        8.3 Readline Init File

                                        +

                                        Although the Readline library comes with a set of Emacs-like keybindings installed by default, it is possible to use a different set of keybindings. Any user can customize programs that use Readline by putting -commands in an inputrc file, +commands in an inputrc file, conventionally in their home directory. The name of this -file is taken from the value of the shell variable INPUTRC. If -that variable is unset, the default is ~/.inputrc. If that +file is taken from the value of the shell variable INPUTRC. If +that variable is unset, the default is ~/.inputrc. If that file does not exist or cannot be read, the ultimate default is -/etc/inputrc. -The bind builtin command can also be used to set Readline +/etc/inputrc. +The bind builtin command can also be used to set Readline keybindings and variables. -See Bash Builtin Commands. +See Bash Builtin Commands.

                                        When a program which uses the Readline library starts up, the init file is read, and the key bindings are set.

                                        -

                                        In addition, the C-x C-r command re-reads this init file, thus +

                                        In addition, the C-x C-r command re-reads this init file, thus incorporating any changes that you might have made to it.

                                        -
                                          +
                                          -
                                          -
                                          +
                                          + -

                                          8.3.1 Readline Init File Syntax

                                          +

                                          8.3.1 Readline Init File Syntax

                                          There are only a few basic constructs allowed in the Readline init file. Blank lines are ignored. -Lines beginning with a ‘#’ are comments. -Lines beginning with a ‘$’ indicate conditional -constructs (see Conditional Init Constructs). Other lines +Lines beginning with a ‘#’ are comments. +Lines beginning with a ‘$’ indicate conditional +constructs (see Conditional Init Constructs). Other lines denote variable settings and key bindings.

                                          -
                                          -
                                          Variable Settings
                                          +
                                          +
                                          Variable Settings

                                          You can modify the run-time behavior of Readline by altering the values of variables in Readline -using the set command within the init file. +using the set command within the init file. The syntax is simple:

                                          -
                                          set variable value
                                          +
                                          set variable value
                                           

                                          Here, for example, is how to change from the default Emacs-like key binding to use -vi line editing commands: +vi line editing commands:

                                          -
                                          set editing-mode vi
                                          +
                                          set editing-mode vi
                                           

                                          Variable names and values, where appropriate, are recognized without regard -to case. Unrecognized variable names are ignored. +to case. +Unrecognized variable names are ignored.

                                          Boolean variables (those that can be set to on or off) are set to on if -the value is null or empty, on (case-insensitive), or 1. Any other -value results in the variable being set to off. +the value is null or empty, on (case-insensitive), or 1. +Any other value results in the variable being set to off.

                                          -

                                          The bind -V command lists the current Readline variable names -and values. See Bash Builtin Commands. +

                                          The bind -V command lists the current Readline variable names +and values. See Bash Builtin Commands.

                                          A great deal of run-time behavior is changeable with the following variables.

                                          - -
                                          -
                                          active-region-start-color
                                          + +
                                          +
                                          active-region-start-color

                                          A string variable that controls the text color and background when displaying the text in the active region (see the description of -enable-active-region below). +enable-active-region below). This string must not take up any physical character positions on the display, so it should consist only of terminal escape sequences. It is output to the terminal before displaying the text in the active region. This variable is reset to the default value whenever the terminal type changes. The default value is the string that puts the terminal in standout mode, as obtained from the terminal’s terminfo description. -A sample value might be ‘\e[01;33m’. +A sample value might be ‘\e[01;33m’.

                                          -
                                          active-region-end-color
                                          -

                                          A string variable that "undoes" the effects of active-region-start-color +

                                          active-region-end-color
                                          +

                                          A string variable that "undoes" the effects of active-region-start-color and restores "normal" terminal display appearance after displaying text in the active region. This string must not take up any physical character positions on the display, @@ -10795,59 +10821,59 @@ It is output to the terminal after displaying the text in the active region. This variable is reset to the default value whenever the terminal type changes. The default value is the string that restores the terminal from standout mode, as obtained from the terminal’s terminfo description. -A sample value might be ‘\e[0m’. +A sample value might be ‘\e[0m’.

                                          -
                                          bell-style
                                          +
                                          bell-style

                                          Controls what happens when Readline wants to ring the terminal bell. -If set to ‘none’, Readline never rings the bell. If set to -‘visible’, Readline uses a visible bell if one is available. -If set to ‘audible’ (the default), Readline attempts to ring +If set to ‘none’, Readline never rings the bell. If set to +‘visible’, Readline uses a visible bell if one is available. +If set to ‘audible’ (the default), Readline attempts to ring the terminal’s bell.

                                          -
                                          bind-tty-special-chars
                                          -

                                          If set to ‘on’ (the default), Readline attempts to bind the control +

                                          bind-tty-special-chars
                                          +

                                          If set to ‘on’ (the default), Readline attempts to bind the control characters that are treated specially by the kernel’s terminal driver to their Readline equivalents. These override the default Readline bindings described here. -Type ‘stty -a’ at a Bash prompt to see your current terminal settings, -including the special control characters (usually cchars). +Type ‘stty -a’ at a Bash prompt to see your current terminal settings, +including the special control characters (usually cchars).

                                          - -

                                          If set to ‘on’, Readline attempts to briefly move the cursor to an +

                                          blink-matching-paren
                                          +

                                          If set to ‘on’, Readline attempts to briefly move the cursor to an opening parenthesis when a closing parenthesis is inserted. The default -is ‘off’. +is ‘off’.

                                          -
                                          colored-completion-prefix
                                          -

                                          If set to ‘on’, when listing completions, Readline displays the +

                                          colored-completion-prefix
                                          +

                                          If set to ‘on’, when listing completions, Readline displays the common prefix of the set of possible completions using a different color. -The color definitions are taken from the value of the LS_COLORS +The color definitions are taken from the value of the LS_COLORS environment variable. -If there is a color definition in LS_COLORS for the custom suffix -‘readline-colored-completion-prefix’, Readline uses this color for +If there is a color definition in LS_COLORS for the custom suffix +‘readline-colored-completion-prefix’, Readline uses this color for the common prefix instead of its default. -The default is ‘off’. +The default is ‘off’.

                                          -
                                          colored-stats
                                          -

                                          If set to ‘on’, Readline displays possible completions using different +

                                          colored-stats
                                          +

                                          If set to ‘on’, Readline displays possible completions using different colors to indicate their file type. -The color definitions are taken from the value of the LS_COLORS +The color definitions are taken from the value of the LS_COLORS environment variable. -The default is ‘off’. +The default is ‘off’.

                                          -
                                          comment-begin
                                          +
                                          comment-begin

                                          The string to insert at the beginning of the line when the -insert-comment command is executed. The default value -is "#". +insert-comment command is executed. The default value +is "#".

                                          -
                                          completion-display-width
                                          +
                                          completion-display-width

                                          The number of screen columns used to display possible matches when performing completion. The value is ignored if it is less than 0 or greater than the terminal @@ -10856,27 +10882,27 @@ A value of 0 will cause matches to be displayed one per line. The default value is -1.

                                          -
                                          completion-ignore-case
                                          -

                                          If set to ‘on’, Readline performs filename matching and completion +

                                          completion-ignore-case
                                          +

                                          If set to ‘on’, Readline performs filename matching and completion in a case-insensitive fashion. -The default value is ‘off’. +The default value is ‘off’.

                                          -
                                          completion-map-case
                                          -

                                          If set to ‘on’, and completion-ignore-case is enabled, Readline -treats hyphens (‘-’) and underscores (‘_’) as equivalent when +

                                          completion-map-case
                                          +

                                          If set to ‘on’, and completion-ignore-case is enabled, Readline +treats hyphens (‘-’) and underscores (‘_’) as equivalent when performing case-insensitive filename matching and completion. -The default value is ‘off’. +The default value is ‘off’.

                                          -
                                          completion-prefix-display-length
                                          +
                                          completion-prefix-display-length

                                          The length in characters of the common prefix of a list of possible completions that is displayed without modification. When set to a value greater than zero, common prefixes longer than this value are replaced with an ellipsis when displaying possible completions.

                                          -
                                          completion-query-items
                                          +
                                          completion-query-items

                                          The number of possible completions that determines when the user is asked whether the list of possibilities should be displayed. If the number of possible completions is greater than or equal to this value, @@ -10885,161 +10911,161 @@ otherwise, they are simply listed. This variable must be set to an integer value greater than or equal to zero. A zero value means Readline should never ask; negative values are treated as zero. -The default limit is 100. +The default limit is 100.

                                          -
                                          convert-meta
                                          -

                                          If set to ‘on’, Readline will convert characters with the -eighth bit set to an ASCII key sequence by stripping the eighth -bit and prefixing an ESC character, converting them to a +

                                          convert-meta
                                          +

                                          If set to ‘on’, Readline will convert characters with the +eighth bit set to an ASCII key sequence by stripping the eighth +bit and prefixing an ESC character, converting them to a meta-prefixed key sequence. -The default value is ‘on’, but -will be set to ‘off’ if the locale is one that contains +The default value is ‘on’, but +will be set to ‘off’ if the locale is one that contains eight-bit characters. -This variable is dependent on the LC_CTYPE locale category, and +This variable is dependent on the LC_CTYPE locale category, and may change if the locale is changed.

                                          -
                                          disable-completion
                                          -

                                          If set to ‘On’, Readline will inhibit word completion. +

                                          disable-completion
                                          +

                                          If set to ‘On’, Readline will inhibit word completion. Completion characters will be inserted into the line as if they had -been mapped to self-insert. The default is ‘off’. +been mapped to self-insert. The default is ‘off’.

                                          -
                                          echo-control-characters
                                          -

                                          When set to ‘on’, on operating systems that indicate they support it, +

                                          echo-control-characters
                                          +

                                          When set to ‘on’, on operating systems that indicate they support it, Readline echoes a character corresponding to a signal generated from the -keyboard. The default is ‘on’. +keyboard. The default is ‘on’.

                                          -
                                          editing-mode
                                          -

                                          The editing-mode variable controls which default set of +

                                          editing-mode
                                          +

                                          The editing-mode variable controls which default set of key bindings is used. By default, Readline starts up in Emacs editing mode, where the keystrokes are most similar to Emacs. This variable can be -set to either ‘emacs’ or ‘vi’. +set to either ‘emacs’ or ‘vi’.

                                          -
                                          emacs-mode-string
                                          -

                                          If the show-mode-in-prompt variable is enabled, +

                                          emacs-mode-string
                                          +

                                          If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary prompt when emacs editing mode is active. The value is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. -The default is ‘@’. +The default is ‘@’.

                                          -
                                          enable-active-region
                                          -

                                          The point is the current cursor position, and mark refers -to a saved cursor position (see Commands For Moving). -The text between the point and mark is referred to as the region. -When this variable is set to ‘On’, Readline allows certain commands -to designate the region as active. +

                                          enable-active-region
                                          +

                                          The point is the current cursor position, and mark refers +to a saved cursor position (see Commands For Moving). +The text between the point and mark is referred to as the region. +When this variable is set to ‘On’, Readline allows certain commands +to designate the region as active. When the region is active, Readline highlights the text in the region using -the value of the active-region-start-color, which defaults to the +the value of the active-region-start-color, which defaults to the string that enables the terminal’s standout mode. The active region shows the text inserted by bracketed-paste and any matching text found by incremental and non-incremental history searches. -The default is ‘On’. +The default is ‘On’.

                                          -
                                          enable-bracketed-paste
                                          -

                                          When set to ‘On’, Readline configures the terminal to insert each +

                                          enable-bracketed-paste
                                          +

                                          When set to ‘On’, Readline configures the terminal to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard. -This is called putting the terminal into bracketed paste mode; +This is called putting the terminal into bracketed paste mode; it prevents Readline from executing any editing commands bound to key sequences appearing in the pasted text. -The default is ‘On’. +The default is ‘On’.

                                          -
                                          enable-keypad
                                          -

                                          When set to ‘on’, Readline will try to enable the application +

                                          enable-keypad
                                          +

                                          When set to ‘on’, Readline will try to enable the application keypad when it is called. Some systems need this to enable the -arrow keys. The default is ‘off’. +arrow keys. The default is ‘off’.

                                          -
                                          enable-meta-key
                                          -

                                          When set to ‘on’, Readline will try to enable any meta modifier +

                                          enable-meta-key
                                          +

                                          When set to ‘on’, Readline will try to enable any meta modifier key the terminal claims to support when it is called. On many terminals, the meta key is used to send eight-bit characters. -The default is ‘on’. +The default is ‘on’.

                                          -
                                          expand-tilde
                                          -

                                          If set to ‘on’, tilde expansion is performed when Readline -attempts word completion. The default is ‘off’. +

                                          expand-tilde
                                          +

                                          If set to ‘on’, tilde expansion is performed when Readline +attempts word completion. The default is ‘off’.

                                          -
                                          history-preserve-point
                                          -

                                          If set to ‘on’, the history code attempts to place the point (the +

                                          history-preserve-point
                                          +

                                          If set to ‘on’, the history code attempts to place the point (the current cursor position) at the -same location on each history line retrieved with previous-history -or next-history. The default is ‘off’. +same location on each history line retrieved with previous-history +or next-history. The default is ‘off’.

                                          -
                                          history-size
                                          +
                                          history-size

                                          Set the maximum number of history entries saved in the history list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less than zero, the number of history entries is not limited. By default, the number of history entries is not limited. -If an attempt is made to set history-size to a non-numeric value, +If an attempt is made to set history-size to a non-numeric value, the maximum number of history entries will be set to 500.

                                          -
                                          horizontal-scroll-mode
                                          -

                                          This variable can be set to either ‘on’ or ‘off’. Setting it -to ‘on’ means that the text of the lines being edited will scroll +

                                          horizontal-scroll-mode
                                          +

                                          This variable can be set to either ‘on’ or ‘off’. Setting it +to ‘on’ means that the text of the lines being edited will scroll horizontally on a single screen line when they are longer than the width of the screen, instead of wrapping onto a new screen line. -This variable is automatically set to ‘on’ for terminals of height 1. -By default, this variable is set to ‘off’. +This variable is automatically set to ‘on’ for terminals of height 1. +By default, this variable is set to ‘off’.

                                          -
                                          input-meta
                                          -
                                          -

                                          If set to ‘on’, Readline will enable eight-bit input (it +

                                          +input-meta
                                          +

                                          If set to ‘on’, Readline will enable eight-bit input (it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The -default value is ‘off’, but Readline will set it to ‘on’ if the +default value is ‘off’, but Readline will set it to ‘on’ if the locale contains eight-bit characters. -The name meta-flag is a synonym for this variable. -This variable is dependent on the LC_CTYPE locale category, and +The name meta-flag is a synonym for this variable. +This variable is dependent on the LC_CTYPE locale category, and may change if the locale is changed.

                                          -
                                          isearch-terminators
                                          +
                                          isearch-terminators

                                          The string of characters that should terminate an incremental search without -subsequently executing the character as a command (see Searching for Commands in the History). -If this variable has not been given a value, the characters ESC and -C-J will terminate an incremental search. +subsequently executing the character as a command (see Searching for Commands in the History). +If this variable has not been given a value, the characters ESC and +C-J will terminate an incremental search.

                                          -
                                          keymap
                                          +
                                          keymap

                                          Sets Readline’s idea of the current keymap for key binding commands. -Built-in keymap names are -emacs, -emacs-standard, -emacs-meta, -emacs-ctlx, -vi, -vi-move, -vi-command, and -vi-insert. -vi is equivalent to vi-command (vi-move is also a -synonym); emacs is equivalent to emacs-standard. +Built-in keymap names are +emacs, +emacs-standard, +emacs-meta, +emacs-ctlx, +vi, +vi-move, +vi-command, and +vi-insert. +vi is equivalent to vi-command (vi-move is also a +synonym); emacs is equivalent to emacs-standard. Applications may add additional names. -The default value is emacs. -The value of the editing-mode variable also affects the +The default value is emacs. +The value of the editing-mode variable also affects the default keymap.

                                          -
                                          keyseq-timeout
                                          +
                                          keyseq-timeout

                                          Specifies the duration Readline 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 @@ -11047,159 +11073,159 @@ key sequence). If no input is received within the timeout, Readline will use the shorter but complete key sequence. Readline uses this value to determine whether or not input is -available on the current input source (rl_instream by default). +available on the current input source (rl_instream by default). The value is specified in milliseconds, so a value of 1000 means that Readline 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, Readline will wait until another key is pressed to decide which key sequence to complete. -The default value is 500. +The default value is 500.

                                          -
                                          mark-directories
                                          -

                                          If set to ‘on’, completed directory names have a slash -appended. The default is ‘on’. +

                                          mark-directories
                                          +

                                          If set to ‘on’, completed directory names have a slash +appended. The default is ‘on’.

                                          -
                                          mark-modified-lines
                                          -

                                          This variable, when set to ‘on’, causes Readline to display an -asterisk (‘*’) at the start of history lines which have been modified. -This variable is ‘off’ by default. +

                                          mark-modified-lines
                                          +

                                          This variable, when set to ‘on’, causes Readline to display an +asterisk (‘*’) at the start of history lines which have been modified. +This variable is ‘off’ by default.

                                          -
                                          mark-symlinked-directories
                                          -

                                          If set to ‘on’, completed names which are symbolic links +

                                          mark-symlinked-directories
                                          +

                                          If set to ‘on’, completed names which are symbolic links to directories have a slash appended (subject to the value of -mark-directories). -The default is ‘off’. +mark-directories). +The default is ‘off’.

                                          -
                                          match-hidden-files
                                          -

                                          This variable, when set to ‘on’, causes Readline to match files whose -names begin with a ‘.’ (hidden files) when performing filename +

                                          match-hidden-files
                                          +

                                          This variable, when set to ‘on’, forces Readline to match files whose +names begin with a ‘.’ (hidden files) when performing filename completion. -If set to ‘off’, the leading ‘.’ must be -supplied by the user in the filename to be completed. -This variable is ‘on’ by default. +If set to ‘off’, the user must include the leading ‘.’ +in the filename to be completed. +This variable is ‘on’ by default.

                                          -
                                          menu-complete-display-prefix
                                          -

                                          If set to ‘on’, menu completion displays the common prefix of the +

                                          menu-complete-display-prefix
                                          +

                                          If set to ‘on’, menu completion displays the common prefix of the list of possible completions (which may be empty) before cycling through -the list. The default is ‘off’. +the list. The default is ‘off’.

                                          -
                                          output-meta
                                          -

                                          If set to ‘on’, Readline will display characters with the +

                                          output-meta
                                          +

                                          If set to ‘on’, Readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. -The default is ‘off’, but Readline will set it to ‘on’ if the +The default is ‘off’, but Readline will set it to ‘on’ if the locale contains eight-bit characters. -This variable is dependent on the LC_CTYPE locale category, and +This variable is dependent on the LC_CTYPE locale category, and may change if the locale is changed.

                                          -
                                          page-completions
                                          -

                                          If set to ‘on’, Readline uses an internal more-like pager +

                                          page-completions
                                          +

                                          If set to ‘on’, Readline uses an internal more-like pager to display a screenful of possible completions at a time. -This variable is ‘on’ by default. +This variable is ‘on’ by default.

                                          -
                                          print-completions-horizontally
                                          -

                                          If set to ‘on’, Readline will display completions with matches +

                                          print-completions-horizontally
                                          +

                                          If set to ‘on’, Readline will display completions with matches sorted horizontally in alphabetical order, rather than down the screen. -The default is ‘off’. +The default is ‘off’.

                                          -
                                          revert-all-at-newline
                                          -

                                          If set to ‘on’, Readline will undo all changes to history lines -before returning when accept-line is executed. By default, +

                                          revert-all-at-newline
                                          +

                                          If set to ‘on’, Readline will undo all changes to history lines +before returning when accept-line is executed. By default, history lines may be modified and retain individual undo lists across -calls to readline(). The default is ‘off’. +calls to readline(). The default is ‘off’.

                                          -
                                          search-ignore-case
                                          -

                                          If set to ‘on’, Readline performs incremental and non-incremental +

                                          search-ignore-case
                                          +

                                          If set to ‘on’, Readline performs incremental and non-incremental history list searches in a case-insensitive fashion. -The default value is ‘off’. +The default value is ‘off’.

                                          -
                                          show-all-if-ambiguous
                                          +
                                          show-all-if-ambiguous

                                          This alters the default behavior of the completion functions. If -set to ‘on’, +set to ‘on’, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell. -The default value is ‘off’. +The default value is ‘off’.

                                          -
                                          show-all-if-unmodified
                                          +
                                          show-all-if-unmodified

                                          This alters the default behavior of the completion functions in -a fashion similar to show-all-if-ambiguous. -If set to ‘on’, +a fashion similar to show-all-if-ambiguous. +If set to ‘on’, words which have more than one possible completion without any possible partial completion (the possible completions don’t share a common prefix) cause the matches to be listed immediately instead of ringing the bell. -The default value is ‘off’. +The default value is ‘off’.

                                          -
                                          show-mode-in-prompt
                                          -

                                          If set to ‘on’, add a string to the beginning of the prompt +

                                          show-mode-in-prompt
                                          +

                                          If set to ‘on’, add a string to the beginning of the prompt indicating the editing mode: emacs, vi command, or vi insertion. -The mode strings are user-settable (e.g., emacs-mode-string). -The default value is ‘off’. +The mode strings are user-settable (e.g., emacs-mode-string). +The default value is ‘off’.

                                          -
                                          skip-completed-text
                                          -

                                          If set to ‘on’, this alters the default completion behavior when +

                                          skip-completed-text
                                          +

                                          If set to ‘on’, 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, Readline 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. For instance, if this is enabled, attempting completion when the cursor -is after the ‘e’ in ‘Makefile’ will result in ‘Makefile’ -rather than ‘Makefilefile’, assuming there is a single possible +is after the ‘e’ in ‘Makefile’ will result in ‘Makefile’ +rather than ‘Makefilefile’, assuming there is a single possible completion. -The default value is ‘off’. +The default value is ‘off’.

                                          -
                                          vi-cmd-mode-string
                                          -

                                          If the show-mode-in-prompt variable is enabled, +

                                          vi-cmd-mode-string
                                          +

                                          If the show-mode-in-prompt 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 is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. -The default is ‘(cmd)’. +The default is ‘(cmd)’.

                                          -
                                          vi-ins-mode-string
                                          -

                                          If the show-mode-in-prompt variable is enabled, +

                                          vi-ins-mode-string
                                          +

                                          If the show-mode-in-prompt 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. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. -The default is ‘(ins)’. +The default is ‘(ins)’.

                                          -
                                          visible-stats
                                          -

                                          If set to ‘on’, a character denoting a file’s type +

                                          visible-stats
                                          +

                                          If set to ‘on’, a character denoting a file’s type is appended to the filename when listing possible -completions. The default is ‘off’. +completions. The default is ‘off’.

                                          -
                                          Key Bindings
                                          +
                                          Key Bindings

                                          The syntax for controlling key bindings in the init file is simple. First you need to find the name of the command that you want to change. The following sections contain tables of the command @@ -11216,124 +11242,124 @@ The name of the key can be expressed in different ways, depending on what you find most comfortable.

                                          In addition to command names, Readline allows keys to be bound -to a string that is inserted when the key is pressed (a macro). +to a string that is inserted when the key is pressed (a macro).

                                          -

                                          The bind -p command displays Readline function names and +

                                          The bind -p command displays Readline function names and bindings in a format that can be put directly into an initialization file. -See Bash Builtin Commands. +See Bash Builtin Commands.

                                          -
                                          -
                                          keynamefunction-name or macro
                                          -

                                          keyname is the name of a key spelled out in English. For example: +

                                          +
                                          keynamefunction-name or macro
                                          +

                                          keyname is the name of a key spelled out in English. For example:

                                          -
                                          Control-u: universal-argument
                                          +
                                          Control-u: universal-argument
                                           Meta-Rubout: backward-kill-word
                                           Control-o: "> output"
                                           
                                          -

                                          In the example above, C-u is bound to the function -universal-argument, -M-DEL is bound to the function backward-kill-word, and -C-o is bound to run the macro +

                                          In the example above, C-u is bound to the function +universal-argument, +M-DEL is bound to the function backward-kill-word, and +C-o is bound to run the macro expressed on the right hand side (that is, to insert the text -‘> output’ into the line). +‘> output’ into the line).

                                          A number of symbolic character names are recognized while processing this key binding syntax: -DEL, -ESC, -ESCAPE, -LFD, -NEWLINE, -RET, -RETURN, -RUBOUT, -SPACE, -SPC, +DEL, +ESC, +ESCAPE, +LFD, +NEWLINE, +RET, +RETURN, +RUBOUT, +SPACE, +SPC, and -TAB. +TAB.

                                          -
                                          "keyseq": function-name or macro
                                          -

                                          keyseq differs from keyname above in that strings +

                                          "keyseq": function-name or macro
                                          +

                                          keyseq differs from keyname above in that strings denoting an entire key sequence can be specified, by placing -the key sequence in double quotes. Some GNU Emacs style key +the key sequence in double quotes. Some GNU Emacs style key escapes can be used, as in the following example, but the special character names are not recognized.

                                          -
                                          "\C-u": universal-argument
                                          +
                                          "\C-u": universal-argument
                                           "\C-x\C-r": re-read-init-file
                                           "\e[11~": "Function Key 1"
                                           
                                          -

                                          In the above example, C-u is again bound to the function -universal-argument (just as it was in the first example), -‘C-x C-r’ is bound to the function re-read-init-file, -and ‘ESC [ 1 1 ~’ is bound to insert -the text ‘Function Key 1’. +

                                          In the above example, C-u is again bound to the function +universal-argument (just as it was in the first example), +‘C-x C-r’ is bound to the function re-read-init-file, +and ‘ESC [ 1 1 ~’ is bound to insert +the text ‘Function Key 1’.

                                          -

                                          The following GNU Emacs style escape sequences are available when +

                                          The following GNU Emacs style escape sequences are available when specifying key sequences:

                                          -
                                          -
                                          \C-
                                          +
                                          +
                                          \C-

                                          control prefix

                                          -
                                          \M-
                                          +
                                          \M-

                                          meta prefix

                                          -
                                          \e
                                          +
                                          \e

                                          an escape character

                                          -
                                          \\
                                          +
                                          \\

                                          backslash

                                          -
                                          \"
                                          -

                                          ", a double quotation mark +

                                          \"
                                          +

                                          ", a double quotation mark

                                          -
                                          \'
                                          -

                                          ', a single quote or apostrophe +

                                          \'
                                          +

                                          ', a single quote or apostrophe

                                          -

                                          In addition to the GNU Emacs style escape sequences, a second +

                                          In addition to the GNU Emacs style escape sequences, a second set of backslash escapes is available:

                                          -
                                          -
                                          \a
                                          +
                                          +
                                          \a

                                          alert (bell)

                                          -
                                          \b
                                          +
                                          \b

                                          backspace

                                          -
                                          \d
                                          +
                                          \d

                                          delete

                                          -
                                          \f
                                          +
                                          \f

                                          form feed

                                          -
                                          \n
                                          +
                                          \n

                                          newline

                                          -
                                          \r
                                          +
                                          \r

                                          carriage return

                                          -
                                          \t
                                          +
                                          \t

                                          horizontal tab

                                          -
                                          \v
                                          +
                                          \v

                                          vertical tab

                                          -
                                          \nnn
                                          -

                                          the eight-bit character whose value is the octal value nnn +

                                          \nnn
                                          +

                                          the eight-bit character whose value is the octal value nnn (one to three digits)

                                          -
                                          \xHH
                                          -

                                          the eight-bit character whose value is the hexadecimal value HH +

                                          \xHH
                                          +

                                          the eight-bit character whose value is the hexadecimal value HH (one or two hex digits)

                                          @@ -11343,11 +11369,11 @@ be used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. 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 the line: +including ‘"’ and ‘'’. +For example, the following binding will make ‘C-x \’ +insert a single ‘\’ into the line:

                                          -
                                          "\C-x\\": "\\"
                                          +
                                          "\C-x\\": "\\"
                                           
                                          @@ -11355,97 +11381,97 @@ insert a single ‘\’ into the line:
                                          -
                                          -
                                          +
                                          + -

                                          8.3.2 Conditional Init Constructs

                                          +

                                          8.3.2 Conditional Init Constructs

                                          Readline 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 used.

                                          -
                                          -
                                          $if
                                          -

                                          The $if construct allows bindings to be made based on the +

                                          +
                                          $if
                                          +

                                          The $if construct allows bindings to be made based on the editing mode, the terminal being used, or the application using Readline. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it.

                                          -
                                          -
                                          mode
                                          -

                                          The mode= form of the $if directive is used to test -whether Readline is in emacs or vi mode. +

                                          +
                                          mode
                                          +

                                          The mode= form of the $if directive is used to test +whether Readline is in emacs or vi mode. This may be used in conjunction -with the ‘set keymap’ command, for instance, to set bindings in -the emacs-standard and emacs-ctlx keymaps only if -Readline is starting out in emacs mode. +with the ‘set keymap’ command, for instance, to set bindings in +the emacs-standard and emacs-ctlx keymaps only if +Readline is starting out in emacs mode.

                                          -
                                          term
                                          -

                                          The term= form may be used to include terminal-specific +

                                          term
                                          +

                                          The term= 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 terminal and -the portion of the terminal name before the first ‘-’. This -allows sun to match both sun and sun-cmd, +‘=’ is tested against both the full name of the terminal and +the portion of the terminal name before the first ‘-’. This +allows sun to match both sun and sun-cmd, for instance.

                                          -
                                          version
                                          -

                                          The version test may be used to perform comparisons against +

                                          version
                                          +

                                          The version test may be used to perform comparisons against specific Readline versions. -The version expands to the current Readline version. +The version expands to the current Readline version. The set of comparison operators includes -‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, -and ‘>’. +‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, +and ‘>’. The version number supplied on the right side of the operator consists of a major version number, an optional decimal point, and an optional -minor version (e.g., ‘7.1’). If the minor version is omitted, it -is assumed to be ‘0’. -The operator may be separated from the string version and +minor version (e.g., ‘7.1’). If the minor version is omitted, it +is assumed to be ‘0’. +The operator may be separated from the string version and from the version number argument by whitespace. The following example sets a variable if the Readline version being used is 7.0 or newer:

                                          -
                                          $if version >= 7.0
                                          +
                                          $if version >= 7.0
                                           set show-mode-in-prompt on
                                           $endif
                                           
                                          -
                                          application
                                          -

                                          The application construct is used to include +

                                          application
                                          +

                                          The application construct is used to include application-specific settings. Each program using the Readline -library sets the application name, and you can test for +library sets the application name, and you 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 Bash:

                                          -
                                          $if Bash
                                          +
                                          $if Bash
                                           # Quote the current or previous word
                                           "\C-xq": "\eb\"\ef\""
                                           $endif
                                           
                                          -
                                          variable
                                          -

                                          The variable construct provides simple equality tests for Readline +

                                          variable
                                          +

                                          The variable construct provides simple equality tests for Readline variables and values. -The permitted comparison operators are ‘=’, ‘==’, and ‘!=’. +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. Both string and boolean variables may be tested. Boolean variables must be -tested against the values on and off. -The following example is equivalent to the mode=emacs test described +tested against the values on and off. +The following example is equivalent to the mode=emacs test described above:

                                          -
                                          $if editing-mode == emacs
                                          +
                                          $if editing-mode == emacs
                                           set show-mode-in-prompt on
                                           $endif
                                           
                                          @@ -11453,40 +11479,40 @@ $endif
                                          -
                                          $endif
                                          +
                                          $endif

                                          This command, as seen in the previous example, terminates an -$if command. +$if command.

                                          -
                                          $else
                                          -

                                          Commands in this branch of the $if directive are executed if +

                                          $else
                                          +

                                          Commands in this branch of the $if directive are executed if the test fails.

                                          -
                                          $include
                                          +
                                          $include

                                          This directive takes a single filename as an argument and reads commands and bindings from that file. -For example, the following directive reads from /etc/inputrc: +For example, the following directive reads from /etc/inputrc:

                                          -
                                          $include /etc/inputrc
                                          +
                                          $include /etc/inputrc
                                           

                                          -
                                          -
                                          +
                                          + -

                                          8.3.3 Sample Init File

                                          +

                                          8.3.3 Sample Init File

                                          -

                                          Here is an example of an inputrc file. This illustrates key +

                                          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 behaviour of line input editing for
                                           # programs that use the GNU Readline library.  Existing
                                           # programs include FTP, Bash, and GDB.
                                           #
                                          @@ -11590,27 +11616,27 @@ $endif
                                           
                                          -
                                          -
                                          +
                                          + -

                                          8.4 Bindable Readline Commands

                                          +

                                          8.4 Bindable Readline Commands

                                          This section describes Readline commands that may be bound to key sequences. You can list your key bindings by executing -bind -P or, for a more terse format, suitable for an -inputrc file, bind -p. (See Bash Builtin Commands.) +bind -P or, for a more terse format, suitable for an +inputrc file, bind -p. (See Bash Builtin Commands.) Command names without an accompanying key sequence are unbound by default.

                                          -

                                          In the following descriptions, point refers to the current cursor -position, and mark refers to a cursor position saved by the -set-mark command. -The text between the point and mark is referred to as the region. +

                                          In the following descriptions, point refers to the current cursor +position, and mark refers to a cursor position saved by the +set-mark command. +The text between the point and mark is referred to as the region.

                                          -
                                            +
                                            -
                                            -
                                            +
                                            + -

                                            8.4.1 Commands For Moving

                                            -
                                            -
                                            beginning-of-line (C-a)
                                            +

                                            8.4.1 Commands For Moving

                                            +
                                            +
                                            beginning-of-line (C-a)

                                            Move to the start of the current line.

                                            -
                                            end-of-line (C-e)
                                            +
                                            end-of-line (C-e)

                                            Move to the end of the line.

                                            -
                                            forward-char (C-f)
                                            +
                                            forward-char (C-f)

                                            Move forward a character.

                                            -
                                            backward-char (C-b)
                                            +
                                            backward-char (C-b)

                                            Move back a character.

                                            -
                                            forward-word (M-f)
                                            +
                                            forward-word (M-f)

                                            Move forward to the end of the next word. Words are composed of letters and digits.

                                            -
                                            backward-word (M-b)
                                            +
                                            backward-word (M-b)

                                            Move back to the start of the current or previous word. Words are composed of letters and digits.

                                            -
                                            shell-forward-word (M-C-f)
                                            +
                                            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 (M-C-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.

                                            -
                                            previous-screen-line ()
                                            +
                                            previous-screen-line ()

                                            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 Readline 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.

                                            -
                                            next-screen-line ()
                                            +
                                            next-screen-line ()

                                            Attempt to move point to the same physical screen column on the next physical screen line. This will not have the desired effect if the current Readline line does not take up more than one physical line or if the length @@ -11679,19 +11705,19 @@ of the current Readline line is not greater than the length of the prompt plus the screen width.

                                            -
                                            clear-display (M-C-l)
                                            +
                                            clear-display (M-C-l)

                                            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.

                                            -
                                            clear-screen (C-l)
                                            +
                                            clear-screen (C-l)

                                            Clear the screen, then redraw the current line, leaving the current line at the top of the screen.

                                            -
                                            redraw-current-line ()
                                            +
                                            redraw-current-line ()

                                            Refresh the current line. By default, this is unbound.

                                            @@ -11699,67 +11725,67 @@ leaving the current line at the top of the screen.
                                            -
                                            -
                                            +
                                            + -

                                            8.4.2 Commands For Manipulating The History

                                            +

                                            8.4.2 Commands For Manipulating The History

                                            -
                                            -
                                            accept-line (Newline or Return)
                                            +
                                            +
                                            accept-line (Newline or Return)

                                            Accept the line regardless of where the cursor is. If this line is non-empty, add it to the history list according to the setting of -the HISTCONTROL and HISTIGNORE variables. +the HISTCONTROL and HISTIGNORE variables. If this line is a modified history line, then restore the history line to its original state.

                                            -
                                            previous-history (C-p)
                                            +
                                            previous-history (C-p)

                                            Move ‘back’ through the history list, fetching the previous command.

                                            -
                                            next-history (C-n)
                                            +
                                            next-history (C-n)

                                            Move ‘forward’ through the history list, fetching the next command.

                                            -
                                            beginning-of-history (M-<)
                                            +
                                            beginning-of-history (M-<)

                                            Move to the first line in the history.

                                            -
                                            end-of-history (M->)
                                            +
                                            end-of-history (M->)

                                            Move to the end of the input history, i.e., the line currently being entered.

                                            -
                                            reverse-search-history (C-r)
                                            +
                                            reverse-search-history (C-r)

                                            Search backward starting at the current line and moving ‘up’ through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the mark.

                                            -
                                            forward-search-history (C-s)
                                            +
                                            forward-search-history (C-s)

                                            Search forward starting at the current line and moving ‘down’ through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the mark.

                                            -
                                            non-incremental-reverse-search-history (M-p)
                                            +
                                            non-incremental-reverse-search-history (M-p)

                                            Search backward starting at the current line and moving ‘up’ through the history as necessary using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line.

                                            -
                                            non-incremental-forward-search-history (M-n)
                                            +
                                            non-incremental-forward-search-history (M-n)

                                            Search forward starting at the current line and moving ‘down’ through the history as necessary using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line.

                                            -
                                            history-search-forward ()
                                            +
                                            history-search-forward ()

                                            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. @@ -11767,7 +11793,7 @@ This is a non-incremental search. By default, this command is unbound.

                                            -
                                            history-search-backward ()
                                            +
                                            history-search-backward ()

                                            Search backward 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. @@ -11775,7 +11801,7 @@ This is a non-incremental search. By default, this command is unbound.

                                            -
                                            history-substring-search-forward ()
                                            +
                                            history-substring-search-forward ()

                                            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. @@ -11783,7 +11809,7 @@ This is a non-incremental search. By default, this command is unbound.

                                            -
                                            history-substring-search-backward ()
                                            +
                                            history-substring-search-backward ()

                                            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. @@ -11791,32 +11817,32 @@ This is a non-incremental search. By default, this command is unbound.

                                            -
                                            yank-nth-arg (M-C-y)
                                            +
                                            yank-nth-arg (M-C-y)

                                            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 +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 -inserts the nth word from the end of the previous command. -Once the argument n is computed, the argument is extracted -as if the ‘!n’ history expansion had been specified. +inserts the nth word from the end of the previous command. +Once the argument n is computed, the argument is extracted +as if the ‘!n’ history expansion had been specified.

                                            -
                                            yank-last-arg (M-. or M-_)
                                            +
                                            yank-last-arg (M-. or M-_)

                                            Insert last argument to the previous command (the last word of the previous history entry). -With a numeric argument, behave exactly like yank-nth-arg. -Successive calls to yank-last-arg move back through the history +With a numeric argument, behave exactly like yank-nth-arg. +Successive calls to yank-last-arg 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). The history expansion facilities are used to extract the last argument, -as if the ‘!$’ history expansion had been specified. +as if the ‘!$’ history expansion had been specified.

                                            -
                                            operate-and-get-next (C-o)
                                            +
                                            operate-and-get-next (C-o)

                                            Accept the current line for return to the calling application as if a newline had been entered, and fetch the next line relative to the current line from the history @@ -11825,7 +11851,7 @@ A numeric argument, if supplied, specifies the history entry to use instead of the current line.

                                            -
                                            fetch-history ()
                                            +
                                            fetch-history ()

                                            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. @@ -11835,63 +11861,63 @@ Without an argument, move back to the first entry in the history list.


                                            -
                                            -
                                            +
                                            + -

                                            8.4.3 Commands For Changing Text

                                            +

                                            8.4.3 Commands For Changing Text

                                            -
                                            -
                                            end-of-file (usually C-d)
                                            +
                                            +
                                            end-of-file (usually C-d)

                                            The character indicating end-of-file as set, for example, by -stty. If this character is read when there are no characters +stty. If this character is read when there are no characters on the line, and point is at the beginning of the line, Readline -interprets it as the end of input and returns EOF. +interprets it as the end of input and returns EOF.

                                            -
                                            delete-char (C-d)
                                            +
                                            delete-char (C-d)

                                            Delete the character at point. If this function is bound to the -same character as the tty EOF character, as C-d +same character as the tty EOF character, as C-d commonly is, see above for the effects.

                                            -
                                            backward-delete-char (Rubout)
                                            +
                                            backward-delete-char (Rubout)

                                            Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them.

                                            -
                                            forward-backward-delete-char ()
                                            +
                                            forward-backward-delete-char ()

                                            Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is deleted. By default, this is not bound to a key.

                                            -
                                            quoted-insert (C-q or C-v)
                                            +
                                            quoted-insert (C-q or C-v)

                                            Add the next character typed to the line verbatim. This is -how to insert key sequences like C-q, for example. +how to insert key sequences like C-q, for example.

                                            -
                                            self-insert (a, b, A, 1, !, …)
                                            +
                                            self-insert (a, b, A, 1, !, …)

                                            Insert yourself.

                                            -
                                            bracketed-paste-begin ()
                                            +
                                            bracketed-paste-begin ()

                                            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 Readline to insert the pasted text as a single unit without treating each character as if it had been read from the keyboard. The characters -are inserted as if each one was bound to self-insert instead of +are inserted as if each one was bound to self-insert instead of executing any editing commands.

                                            Bracketed paste sets the region (the characters between point and the mark) -to the inserted text. It uses the concept of an active mark: when the +to the inserted text. It uses the concept of an active mark: when the mark is active, Readline redisplay uses the terminal’s standout mode to denote the region.

                                            -
                                            transpose-chars (C-t)
                                            +
                                            transpose-chars (C-t)

                                            Drag the character before the cursor forward over the character at the cursor, moving the cursor forward as well. If the insertion point @@ -11900,47 +11926,47 @@ transposes the last two characters of the line. Negative arguments have no effect.

                                            -
                                            transpose-words (M-t)
                                            +
                                            transpose-words (M-t)

                                            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.

                                            -
                                            shell-transpose-words (M-C-t)
                                            +
                                            shell-transpose-words (M-C-t)

                                            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 shell-forward-word and -shell-backward-word. +Word boundaries are the same as shell-forward-word and +shell-backward-word.

                                            -
                                            upcase-word (M-u)
                                            +
                                            upcase-word (M-u)

                                            Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but do not move the cursor.

                                            -
                                            downcase-word (M-l)
                                            +
                                            downcase-word (M-l)

                                            Lowercase the current (or following) word. With a negative argument, lowercase the previous word, but do not move the cursor.

                                            -
                                            capitalize-word (M-c)
                                            +
                                            capitalize-word (M-c)

                                            Capitalize the current (or following) word. With a negative argument, capitalize the previous word, but do not move the cursor.

                                            -
                                            overwrite-mode ()
                                            +
                                            overwrite-mode ()

                                            Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only -emacs mode; vi mode does overwrite differently. -Each call to readline() starts in insert mode. +emacs mode; vi mode does overwrite differently. +Each call to readline() starts in insert mode.

                                            -

                                            In overwrite mode, characters bound to self-insert replace +

                                            In overwrite mode, characters bound to self-insert replace the text at point rather than pushing the text to the right. -Characters bound to backward-delete-char replace the character +Characters bound to backward-delete-char replace the character before point with a space.

                                            By default, this command is unbound. @@ -11950,123 +11976,123 @@ before point with a space.


                                            -
                                            -
                                            +
                                            + -

                                            8.4.4 Killing And Yanking

                                            +

                                            8.4.4 Killing And Yanking

                                            -
                                            -
                                            kill-line (C-k)
                                            +
                                            +
                                            kill-line (C-k)

                                            Kill the text from point to the end of the line. With a negative numeric argument, kill backward from the cursor to the beginning of the current line.

                                            -
                                            backward-kill-line (C-x Rubout)
                                            +
                                            backward-kill-line (C-x Rubout)

                                            Kill backward from the cursor to the beginning of the current line. With a negative numeric argument, kill forward from the cursor to the end of the current line.

                                            -
                                            unix-line-discard (C-u)
                                            +
                                            unix-line-discard (C-u)

                                            Kill backward from the cursor to the beginning of the current line.

                                            -
                                            kill-whole-line ()
                                            +
                                            kill-whole-line ()

                                            Kill all characters on the current line, no matter where point is. By default, this is unbound.

                                            -
                                            kill-word (M-d)
                                            +
                                            kill-word (M-d)

                                            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 forward-word. +Word boundaries are the same as forward-word.

                                            -
                                            backward-kill-word (M-DEL)
                                            +
                                            backward-kill-word (M-DEL)

                                            Kill the word behind point. -Word boundaries are the same as backward-word. +Word boundaries are the same as backward-word.

                                            -
                                            shell-kill-word (M-C-d)
                                            +
                                            shell-kill-word (M-C-d)

                                            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 shell-forward-word. +Word boundaries are the same as shell-forward-word.

                                            -
                                            shell-backward-kill-word ()
                                            +
                                            shell-backward-kill-word ()

                                            Kill the word behind point. -Word boundaries are the same as shell-backward-word. +Word boundaries are the same as shell-backward-word.

                                            -
                                            unix-word-rubout (C-w)
                                            +
                                            unix-word-rubout (C-w)

                                            Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring.

                                            -
                                            unix-filename-rubout ()
                                            +
                                            unix-filename-rubout ()

                                            Kill the word behind point, using white space and the slash character as the word boundaries. The killed text is saved on the kill-ring.

                                            -
                                            delete-horizontal-space ()
                                            +
                                            delete-horizontal-space ()

                                            Delete all spaces and tabs around point. By default, this is unbound.

                                            -
                                            kill-region ()
                                            +
                                            kill-region ()

                                            Kill the text in the current region. By default, this command is unbound.

                                            -
                                            copy-region-as-kill ()
                                            +
                                            copy-region-as-kill ()

                                            Copy the text in the region to the kill buffer, so it can be yanked right away. By default, this command is unbound.

                                            -
                                            copy-backward-word ()
                                            +
                                            copy-backward-word ()

                                            Copy the word before point to the kill buffer. -The word boundaries are the same as backward-word. +The word boundaries are the same as backward-word. By default, this command is unbound.

                                            -
                                            copy-forward-word ()
                                            +
                                            copy-forward-word ()

                                            Copy the word following point to the kill buffer. -The word boundaries are the same as forward-word. +The word boundaries are the same as forward-word. By default, this command is unbound.

                                            -
                                            yank (C-y)
                                            +
                                            yank (C-y)

                                            Yank the top of the kill ring into the buffer at point.

                                            -
                                            yank-pop (M-y)
                                            +
                                            yank-pop (M-y)

                                            Rotate the kill-ring, and yank the new top. You can only do this if -the prior command is yank or yank-pop. +the prior command is yank or yank-pop.


                                            -
                                            -
                                            +
                                            + -

                                            8.4.5 Specifying Numeric Arguments

                                            -
                                            -
                                            digit-argument (M-0, M-1, … M--)
                                            +

                                            8.4.5 Specifying Numeric Arguments

                                            +
                                            +
                                            digit-argument (M-0, M-1, … M--)

                                            Add this digit to the argument already accumulating, or start a new -argument. M-- starts a negative argument. +argument. M-- starts a negative argument.

                                            -
                                            universal-argument ()
                                            +
                                            universal-argument ()

                                            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 followed by digits, executing universal-argument +If the command is followed by digits, executing universal-argument again ends the numeric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is neither a digit nor minus sign, the argument count @@ -12080,105 +12106,105 @@ By default, this is not bound to a key.


                                            -
                                            -
                                            +
                                            + -

                                            8.4.6 Letting Readline Type For You

                                            +

                                            8.4.6 Letting Readline Type For You

                                            -
                                            -
                                            complete (TAB)
                                            +
                                            +
                                            complete (TAB)

                                            Attempt to perform completion on the text before point. The actual completion performed is application-specific. Bash attempts completion treating the text as a variable (if the -text begins with ‘$’), username (if the text begins with -‘~’), hostname (if the text begins with ‘@’), or +text begins with ‘$’), username (if the text begins with +‘~’), hostname (if the text begins with ‘@’), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted.

                                            -
                                            possible-completions (M-?)
                                            +
                                            possible-completions (M-?)

                                            List the possible completions of the text before point. When displaying completions, Readline sets the number of columns used -for display to the value of completion-display-width, the value of -the environment variable COLUMNS, or the screen width, in that order. +for display to the value of completion-display-width, the value of +the environment variable COLUMNS, or the screen width, in that order.

                                            -
                                            insert-completions (M-*)
                                            +
                                            insert-completions (M-*)

                                            Insert all completions of the text before point that would have -been generated by possible-completions. +been generated by possible-completions.

                                            -
                                            menu-complete ()
                                            -

                                            Similar to complete, but replaces the word to be completed +

                                            menu-complete ()
                                            +

                                            Similar to complete, but replaces the word to be completed with a single match from the list of possible completions. -Repeated execution of menu-complete steps through the list +Repeated execution of menu-complete steps through the list of possible completions, inserting each match in turn. At the end of the list of completions, the bell is rung -(subject to the setting of bell-style) +(subject to the setting of bell-style) and the original text is restored. -An argument of n moves n positions forward in the list +An argument of n moves n positions forward in the list of matches; a negative argument may be used to move backward through the list. -This command is intended to be bound to TAB, but is unbound +This command is intended to be bound to TAB, but is unbound by default.

                                            -
                                            menu-complete-backward ()
                                            -

                                            Identical to menu-complete, but moves backward through the list -of possible completions, as if menu-complete had been given a +

                                            menu-complete-backward ()
                                            +

                                            Identical to menu-complete, but moves backward through the list +of possible completions, as if menu-complete had been given a negative argument.

                                            -
                                            delete-char-or-list ()
                                            +
                                            delete-char-or-list ()

                                            Deletes the character under the cursor if not at the beginning or -end of the line (like delete-char). +end of the line (like delete-char). If at the end of the line, behaves identically to -possible-completions. +possible-completions. This command is unbound by default.

                                            -
                                            complete-filename (M-/)
                                            +
                                            complete-filename (M-/)

                                            Attempt filename completion on the text before point.

                                            -
                                            possible-filename-completions (C-x /)
                                            +
                                            possible-filename-completions (C-x /)

                                            List the possible completions of the text before point, treating it as a filename.

                                            -
                                            complete-username (M-~)
                                            +
                                            complete-username (M-~)

                                            Attempt completion on the text before point, treating it as a username.

                                            -
                                            possible-username-completions (C-x ~)
                                            +
                                            possible-username-completions (C-x ~)

                                            List the possible completions of the text before point, treating it as a username.

                                            -
                                            complete-variable (M-$)
                                            +
                                            complete-variable (M-$)

                                            Attempt completion on the text before point, treating it as a shell variable.

                                            -
                                            possible-variable-completions (C-x $)
                                            +
                                            possible-variable-completions (C-x $)

                                            List the possible completions of the text before point, treating it as a shell variable.

                                            -
                                            complete-hostname (M-@)
                                            +
                                            complete-hostname (M-@)

                                            Attempt completion on the text before point, treating it as a hostname.

                                            -
                                            possible-hostname-completions (C-x @)
                                            +
                                            possible-hostname-completions (C-x @)

                                            List the possible completions of the text before point, treating it as a hostname.

                                            -
                                            complete-command (M-!)
                                            +
                                            complete-command (M-!)

                                            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 @@ -12186,128 +12212,128 @@ functions, shell builtins, and finally executable filenames, in that order.

                                            -
                                            possible-command-completions (C-x !)
                                            +
                                            possible-command-completions (C-x !)

                                            List the possible completions of the text before point, treating it as a command name.

                                            -
                                            dynamic-complete-history (M-TAB)
                                            +
                                            dynamic-complete-history (M-TAB)

                                            Attempt completion on the text before point, comparing the text against lines from the history list for possible completion matches.

                                            -
                                            dabbrev-expand ()
                                            +
                                            dabbrev-expand ()

                                            Attempt menu completion on the text before point, comparing the text against lines from the history list for possible completion matches.

                                            -
                                            complete-into-braces (M-{)
                                            +
                                            complete-into-braces (M-{)

                                            Perform filename completion and insert the list of possible completions enclosed within braces so the list is available to the shell -(see Brace Expansion). +(see Brace Expansion).


                                            -
                                            -
                                            +
                                            + -

                                            8.4.7 Keyboard Macros

                                            -
                                            -
                                            start-kbd-macro (C-x ()
                                            +

                                            8.4.7 Keyboard Macros

                                            +
                                            +
                                            start-kbd-macro (C-x ()

                                            Begin saving the characters typed into the current keyboard macro.

                                            -
                                            end-kbd-macro (C-x ))
                                            +
                                            end-kbd-macro (C-x ))

                                            Stop saving the characters typed into the current keyboard macro and save the definition.

                                            -
                                            call-last-kbd-macro (C-x e)
                                            +
                                            call-last-kbd-macro (C-x e)

                                            Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard.

                                            -
                                            print-last-kbd-macro ()
                                            +
                                            print-last-kbd-macro ()

                                            Print the last keyboard macro defined in a format suitable for the -inputrc file. +inputrc file.


                                            -
                                            -
                                            +
                                            + -

                                            8.4.8 Some Miscellaneous Commands

                                            -
                                            -
                                            re-read-init-file (C-x C-r)
                                            -

                                            Read in the contents of the inputrc file, and incorporate +

                                            8.4.8 Some Miscellaneous Commands

                                            +
                                            +
                                            re-read-init-file (C-x C-r)
                                            +

                                            Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.

                                            -
                                            abort (C-g)
                                            +
                                            abort (C-g)

                                            Abort the current editing command and ring the terminal’s bell (subject to the setting of -bell-style). +bell-style).

                                            -
                                            do-lowercase-version (M-A, M-B, M-x, …)
                                            -

                                            If the metafied character x is upper case, run the command +

                                            do-lowercase-version (M-A, M-B, M-x, …)
                                            +

                                            If the metafied character x is upper case, run the command that is bound to the corresponding metafied lower case character. -The behavior is undefined if x is already lower case. +The behavior is undefined if x is already lower case.

                                            -
                                            prefix-meta (ESC)
                                            +
                                            prefix-meta (ESC)

                                            Metafy the next character typed. This is for keyboards -without a meta key. Typing ‘ESC f’ is equivalent to typing -M-f. +without a meta key. Typing ‘ESC f’ is equivalent to typing +M-f.

                                            -
                                            undo (C-_ or C-x C-u)
                                            +
                                            undo (C-_ or C-x C-u)

                                            Incremental undo, separately remembered for each line.

                                            -
                                            revert-line (M-r)
                                            -

                                            Undo all changes made to this line. This is like executing the undo +

                                            revert-line (M-r)
                                            +

                                            Undo all changes made to this line. This is like executing the undo command enough times to get back to the beginning.

                                            -
                                            tilde-expand (M-&)
                                            +
                                            tilde-expand (M-&)

                                            Perform tilde expansion on the current word.

                                            -
                                            set-mark (C-@)
                                            +
                                            set-mark (C-@)

                                            Set the mark to the point. If a numeric argument is supplied, the mark is set to that position.

                                            -
                                            exchange-point-and-mark (C-x C-x)
                                            +
                                            exchange-point-and-mark (C-x C-x)

                                            Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark.

                                            -
                                            character-search (C-])
                                            +
                                            character-search (C-])

                                            A character is read and point is moved to the next occurrence of that character. A negative argument searches for previous occurrences.

                                            -
                                            character-search-backward (M-C-])
                                            +
                                            character-search-backward (M-C-])

                                            A character is read and point is moved to the previous occurrence of that character. A negative argument searches for subsequent occurrences.

                                            -
                                            skip-csi-sequence ()
                                            +
                                            skip-csi-sequence ()

                                            Read enough characters to consume a multi-key sequence such as those defined for keys like Home and End. Such sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this sequence is @@ -12317,112 +12343,114 @@ stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[.

                                            -
                                            insert-comment (M-#)
                                            -

                                            Without a numeric argument, the value of the comment-begin +

                                            insert-comment (M-#)
                                            +

                                            Without a numeric argument, the value of the comment-begin variable is inserted 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 comment-begin, the value is inserted, otherwise -the characters in comment-begin are deleted from the beginning of +of comment-begin, the value is inserted, otherwise +the characters in comment-begin are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed. -The default value of comment-begin causes this command +The default value of comment-begin 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 executed by the shell.

                                            -
                                            dump-functions ()
                                            +
                                            dump-functions ()

                                            Print all of the functions and their key bindings to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. This command is unbound by default.

                                            -
                                            dump-variables ()
                                            +
                                            dump-variables ()

                                            Print all of the settable variables and their values to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. This command is unbound by default.

                                            -
                                            dump-macros ()
                                            +
                                            dump-macros ()

                                            Print all of the Readline key sequences bound to macros and the strings they output. If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. This command is unbound by default.

                                            -
                                            spell-correct-word (C-x s)
                                            +
                                            spell-correct-word (C-x s)

                                            Perform spelling correction on the current word, treating it as a directory -or filename, in the same way as the cdspell shell option. -Word boundaries are the same as those used by shell-forward-word. +or filename, in the same way as the cdspell shell option. +Word boundaries are the same as those used by shell-forward-word.

                                            -
                                            glob-complete-word (M-g)
                                            +
                                            glob-complete-word (M-g)

                                            The word before point is treated as a pattern for pathname expansion, with an asterisk implicitly appended. This pattern is used to generate a list of matching file names for possible completions.

                                            -
                                            glob-expand-word (C-x *)
                                            +
                                            glob-expand-word (C-x *)

                                            The word before point is treated as a pattern for pathname expansion, and the list of matching file names is inserted, replacing the word. -If a numeric argument is supplied, a ‘*’ is appended before +If a numeric argument is supplied, a ‘*’ is appended before pathname expansion.

                                            -
                                            glob-list-expansions (C-x g)
                                            +
                                            glob-list-expansions (C-x g)

                                            The list of expansions that would have been generated by -glob-expand-word is displayed, and the line is redrawn. -If a numeric argument is supplied, a ‘*’ is appended before +glob-expand-word is displayed, and the line is redrawn. +If a numeric argument is supplied, a ‘*’ is appended before pathname expansion.

                                            -
                                            display-shell-version (C-x C-v)
                                            +
                                            display-shell-version (C-x C-v)

                                            Display version information about the current instance of Bash.

                                            -
                                            shell-expand-line (M-C-e)
                                            +
                                            shell-expand-line (M-C-e)

                                            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, +$’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.

                                            -
                                            history-expand-line (M-^)
                                            +
                                            history-expand-line (M-^)

                                            Perform history expansion on the current line.

                                            -
                                            magic-space ()
                                            +
                                            magic-space ()

                                            Perform history expansion on the current line and insert a space -(see History Expansion). +(see History Expansion).

                                            -
                                            alias-expand-line ()
                                            -

                                            Perform alias expansion on the current line (see Aliases). +

                                            alias-expand-line ()
                                            +

                                            Perform alias expansion on the current line (see Aliases).

                                            -
                                            history-and-alias-expand-line ()
                                            +
                                            history-and-alias-expand-line ()

                                            Perform history and alias expansion on the current line.

                                            -
                                            insert-last-argument (M-. or M-_)
                                            -

                                            A synonym for yank-last-arg. +

                                            insert-last-argument (M-. or M-_)
                                            +

                                            A synonym for yank-last-arg.

                                            -
                                            edit-and-execute-command (C-x C-e)
                                            +
                                            edit-and-execute-command (C-x C-e)

                                            Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke -$VISUAL, $EDITOR, and emacs +$VISUAL, $EDITOR, and emacs as the editor, in that order.

                                            -
                                            execute-named-command (M-x)
                                            +
                                            execute-named-command (M-x)

                                            Read a bindable readline 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. @@ -12435,43 +12463,43 @@ argument to the function it executes.


                                            -
                                            -
                                            +
                                            + -

                                            8.5 Readline vi Mode

                                            +

                                            8.5 Readline vi Mode

                                            -

                                            While the Readline library does not have a full set of vi +

                                            While the Readline library does not have a full set of vi editing functions, it does contain enough to allow simple editing -of the line. The Readline vi mode behaves as specified in -the POSIX standard. +of the line. The Readline vi mode behaves as specified in +the POSIX standard.

                                            -

                                            In order to switch interactively between emacs and vi -editing modes, use the ‘set -o emacs’ and ‘set -o vi’ -commands (see The Set Builtin). -The Readline default is emacs mode. +

                                            In order to switch interactively between emacs and vi +editing modes, use the ‘set -o emacs’ and ‘set -o vi’ +commands (see The Set Builtin). +The Readline default is emacs mode.

                                            -

                                            When you enter a line in vi mode, you are already placed in -‘insertion’ mode, as if you had typed an ‘i’. Pressing ESC +

                                            When you enter a line in vi mode, you are already placed in +‘insertion’ mode, as if you had typed an ‘i’. Pressing ESC switches you into ‘command’ mode, where you can edit the text of the -line with the standard vi movement keys, move to previous -history lines with ‘k’ and subsequent lines with ‘j’, and +line with the standard vi movement keys, move to previous +history lines with ‘k’ and subsequent lines with ‘j’, and so forth.


                                            -
                                            -
                                            +
                                            + -

                                            8.6 Programmable Completion

                                            - +

                                            8.6 Programmable Completion

                                            +

                                            When word completion is attempted for an argument to a command for -which a completion specification (a compspec) has been defined -using the complete builtin (see Programmable Completion Builtins), +which a completion specification (a compspec) has been defined +using the complete builtin (see Programmable Completion Builtins), the programmable completion facilities are invoked.

                                            First, the command name is identified. @@ -12479,13 +12507,13 @@ If a compspec has been defined 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), any compspec defined with -the -E option to complete is used. +the -E option to complete is used. If the command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. If those searches do not result in a compspec, any compspec defined with -the -D option to complete is used as the default. +the -D option to complete is used as the default. If there is no default compspec, Bash attempts alias expansion on the command word as a final resort, and attempts to find a compspec for the command word from any successful expansion @@ -12493,45 +12521,45 @@ for the command word from any successful expansion

                                            Once a compspec has been found, it is used to generate the list of matching words. If a compspec is not found, the default Bash completion -described above (see Letting Readline Type For You) is performed. +described above (see Letting Readline Type For You) is performed.

                                            First, the actions specified by the compspec are used. Only matches which are prefixed by the word being completed are returned. -When the -f or -d option is used for filename or -directory name completion, the shell variable FIGNORE is +When the -f or -d option is used for filename or +directory name completion, the shell variable FIGNORE is used to filter the matches. -See Bash Variables, for a description of FIGNORE. +See Bash Variables, for a description of FIGNORE.

                                            Any completions specified by a filename expansion pattern to the --G option are generated next. +-G option are generated next. The words generated by the pattern need not match the word being completed. -The GLOBIGNORE shell variable is not used to filter the matches, -but the FIGNORE shell variable is used. +The GLOBIGNORE shell variable is not used to filter the matches, +but the FIGNORE shell variable is used.

                                            -

                                            Next, the string specified as the argument to the -W option +

                                            Next, the string specified as the argument to the -W option is considered. -The string is first split using the characters in the IFS +The string is first split using the characters in the IFS special variable as delimiters. Shell quoting is honored within the string, in order to provide a mechanism for the words to contain shell metacharacters or characters -in the value of IFS. +in the value of IFS. Each word is then expanded using brace expansion, tilde expansion, parameter and variable expansion, command substitution, and arithmetic expansion, -as described above (see Shell Expansions). +as described above (see Shell Expansions). The results are split using the rules described above -(see Word Splitting). +(see Word Splitting). The results of the expansion are prefix-matched against the word being completed, and the matching words become the possible completions.

                                            After these matches have been generated, any shell function or command -specified with the -F and -C options is invoked. -When the command or function is invoked, the COMP_LINE, -COMP_POINT, COMP_KEY, and COMP_TYPE variables are -assigned values as described above (see Bash Variables). -If a shell function is being invoked, the COMP_WORDS and -COMP_CWORD variables are also set. +specified with the -F and -C options is invoked. +When the command or function is invoked, the COMP_LINE, +COMP_POINT, COMP_KEY, and COMP_TYPE variables are +assigned values as described above (see Bash Variables). +If a shell function is being invoked, the COMP_WORDS and +COMP_CWORD variables are also set. When the function or command is invoked, the first argument ($1) is the name of the command whose arguments are being completed, the second argument ($2) is the word being completed, and the third argument @@ -12541,43 +12569,43 @@ No filtering of the generated completions against the word being completed is performed; the function or command has complete freedom in generating the matches.

                                            -

                                            Any function specified with -F is invoked first. +

                                            Any function specified with -F is invoked first. The function may use any of the shell facilities, including the -compgen and compopt builtins described below -(see Programmable Completion Builtins), to generate the matches. -It must put the possible completions in the COMPREPLY array +compgen and compopt builtins described below +(see Programmable Completion Builtins), to generate the matches. +It must put the possible completions in the COMPREPLY array variable, one per array element.

                                            -

                                            Next, any command specified with the -C option is invoked +

                                            Next, any command specified with the -C option is invoked in an environment equivalent to command substitution. It should print a list of completions, one per line, to the standard output. Backslash may be used to escape a newline, if necessary.

                                            After all of the possible completions are generated, any filter -specified with the -X option is applied to the list. -The filter is a pattern as used for pathname expansion; a ‘&’ +specified with the -X option is applied to 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 +A literal ‘&’ may be escaped with a backslash; the backslash is removed before attempting a match. Any completion that matches the pattern will be removed from the list. -A leading ‘!’ negates the pattern; in this case any completion +A leading ‘!’ negates the pattern; in this case any completion not matching the pattern will be removed. -If the nocasematch shell option -(see the description of shopt in The Shopt Builtin) +If the nocasematch shell option +(see the description of shopt in The Shopt Builtin) is enabled, the match is performed without regard to the case of alphabetic characters.

                                            -

                                            Finally, any prefix and suffix specified with the -P and -S +

                                            Finally, any prefix and suffix specified with the -P and -S options are added to each member of the completion list, and the result is returned to the Readline completion code as the list of possible completions.

                                            If the previously-applied actions do not generate any matches, and the --o dirnames option was supplied to complete when the +-o dirnames option was supplied to complete when the compspec was defined, directory name completion is attempted.

                                            -

                                            If the -o plusdirs option was supplied to complete when +

                                            If the -o plusdirs option was supplied to complete when the compspec was defined, directory name completion is attempted and any matches are added to the results of the other actions.

                                            @@ -12585,10 +12613,10 @@ matches are added to the results of the other actions. the completion code as the full set of possible completions. The default Bash completions are not attempted, and the Readline default of filename completion is disabled. -If the -o bashdefault option was supplied to complete when +If the -o bashdefault option was supplied to complete when the compspec was defined, the default Bash completions are attempted if the compspec generates no matches. -If the -o default option was supplied to complete when the +If the -o default option was supplied to complete when the compspec was defined, Readline’s default completion will be performed if the compspec (and, if attempted, the default Bash completions) generate no matches. @@ -12596,12 +12624,12 @@ generate no matches.

                                            When a compspec indicates that directory name completion is desired, the programmable completion functions force Readline to append a slash to completed names which are symbolic links to directories, subject to -the value of the mark-directories Readline variable, regardless -of the setting of the mark-symlinked-directories Readline variable. +the value of the mark-directories Readline variable, regardless +of the setting of the mark-symlinked-directories Readline variable.

                                            There is some support for dynamically modifying completions. This is most useful when used in combination with a default completion specified -with -D. It’s possible for shell functions executed as completion +with -D. It’s possible for shell functions executed as completion handlers 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 @@ -12616,7 +12644,7 @@ file corresponding to the name of the command, the following default completion function would load completions dynamically:

                                            -
                                            _completion_loader()
                                            +
                                            _completion_loader()
                                             {
                                                 . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
                                             }
                                            @@ -12625,144 +12653,145 @@ complete -D -F _completion_loader -o bashdefault -o default
                                             
                                             
                                            -
                                            -
                                            +
                                            + -

                                            8.7 Programmable Completion Builtins

                                            - +

                                            8.7 Programmable Completion Builtins

                                            +

                                            Three builtin commands are available to manipulate the programmable completion facilities: one to specify how the arguments to a particular command are to be completed, and two to modify the completion as it is happening.

                                            -
                                            -
                                            compgen
                                            +
                                            +
                                            compgen
                                            -
                                            compgen [-V varname] [option] [word]
                                            +
                                            compgen [-V varname] [option] [word]
                                             
                                            -

                                            Generate possible completion matches for word according to -the options, which may be any option accepted by the -complete +

                                            Generate possible completion matches for word according to +the options, which may be any option accepted by the +complete builtin with the exceptions of --p, --r, --D, --E, +-p, +-r, +-D, +-E, and --I, +-I, and write the matches to the standard output.

                                            -

                                            If the -V option is supplied, compgen stores the generated -completions into the indexed array variable varname instead of writing +

                                            If the -V option is supplied, compgen stores the generated +completions into the indexed array variable varname instead of writing them to the standard output.

                                            -

                                            When using the -F or -C options, the various shell variables +

                                            When using the -F or -C options, the various shell variables set by the programmable completion facilities, while available, will not have useful values.

                                            The matches will be generated in the same way as if the programmable completion code had generated them directly from a completion specification with the same flags. -If word is specified, only those completions matching word +If word is specified, only those completions matching word will be displayed.

                                            The return value is true unless an invalid option is supplied, or no matches were generated.

                                            -
                                            complete
                                            +
                                            complete
                                            -
                                            complete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action]
                                            -[-G globpat] [-W wordlist] [-F function] [-C command]
                                            -[-X filterpat] [-P prefix] [-S suffix] name [name …]
                                            -complete -pr [-DEI] [name …]
                                            +
                                            complete [-abcdefgjksuv] [-o comp-option] [-DEI] [-A action]
                                            +[-G globpat] [-W wordlist] [-F function] [-C command]
                                            +[-X filterpat] [-P prefix] [-S suffix] name [name ...]
                                            +complete -pr [-DEI] [name ...]
                                             
                                            -

                                            Specify how arguments to each name should be completed. -If the -p option is supplied, or if no options are supplied, existing +

                                            Specify how arguments to each name should be completed. +If the -p option is supplied, or if no options or names +are supplied, existing completion specifications are printed in a way that allows them to be reused as input. -The -r option removes a completion specification for -each name, or, if no names are supplied, all +The -r option removes a completion specification for +each name, or, if no names are supplied, all completion specifications. -The -D option indicates that other supplied options and actions should +The -D option indicates that other supplied options and actions should apply to the “default” command completion; that is, completion attempted on a command for which no completion has previously been defined. -The -E option indicates that other supplied options and actions should +The -E option indicates that other supplied options and actions should apply to “empty” command completion; that is, completion attempted on a blank line. -The -I option indicates that other supplied options and actions should +The -I 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 usually command +command delimiter such as ‘;’ or ‘|’, which is usually command name completion. -If multiple options are supplied, the -D option takes precedence -over -E, and both take precedence over -I. -If any of -D, -E, or -I are supplied, any other -name arguments are ignored; these completions only apply to the case +If multiple options are supplied, the -D option takes precedence +over -E, and both take precedence over -I. +If any of -D, -E, or -I are supplied, any other +name arguments are ignored; these completions only apply to the case specified by the option.

                                            The process of applying these completion specifications when word completion -is attempted is described above (see Programmable Completion). +is attempted is described above (see Programmable Completion).

                                            Other options, if specified, have the following meanings. -The arguments to the -G, -W, and -X options -(and, if necessary, the -P and -S options) +The arguments to the -G, -W, and -X options +(and, if necessary, the -P and -S options) should be quoted to protect them from expansion before the -complete builtin is invoked. +complete builtin is invoked.

                                            -
                                            -
                                            -o comp-option
                                            -

                                            The comp-option controls several aspects of the compspec’s behavior +

                                            +
                                            -o comp-option
                                            +

                                            The comp-option controls several aspects of the compspec’s behavior beyond the simple generation of completions. -comp-option may be one of: +comp-option may be one of:

                                            -
                                            -
                                            bashdefault
                                            +
                                            +
                                            bashdefault

                                            Perform the rest of the default Bash completions if the compspec generates no matches.

                                            -
                                            default
                                            +
                                            default

                                            Use Readline’s default filename completion if the compspec generates no matches.

                                            -
                                            dirnames
                                            +
                                            dirnames

                                            Perform directory name completion if the compspec generates no matches.

                                            -
                                            filenames
                                            +
                                            filenames

                                            Tell Readline that the compspec generates filenames, so it can perform any filename-specific processing (like adding a slash to directory names, quoting special characters, or suppressing trailing spaces). This option is intended to be used with shell functions specified -with -F. +with -F.

                                            -
                                            fullquote
                                            +
                                            fullquote

                                            Tell Readline to quote all the completed words even if they are not filenames.

                                            -
                                            noquote
                                            +
                                            noquote

                                            Tell Readline not to quote the completed words if they are filenames (quoting filenames is the default).

                                            -
                                            nosort
                                            +
                                            nosort

                                            Tell Readline not to sort the list of possible completions alphabetically.

                                            -
                                            nospace
                                            +
                                            nospace

                                            Tell Readline not to append a space (the default) to words completed at the end of the line.

                                            -
                                            plusdirs
                                            +
                                            plusdirs

                                            After any matches defined by the compspec are generated, directory name completion is attempted and any matches are added to the results of the other actions. @@ -12771,203 +12800,203 @@ matches are added to the results of the other actions.

                                            -
                                            -A action
                                            -

                                            The action may be one of the following to generate a list of possible +

                                            -A action
                                            +

                                            The action may be one of the following to generate a list of possible completions:

                                            -
                                            -
                                            alias
                                            -

                                            Alias names. May also be specified as -a. +

                                            +
                                            alias
                                            +

                                            Alias names. May also be specified as -a.

                                            -
                                            arrayvar
                                            +
                                            arrayvar

                                            Array variable names.

                                            -
                                            binding
                                            -

                                            Readline key binding names (see Bindable Readline Commands). +

                                            binding
                                            +

                                            Readline key binding names (see Bindable Readline Commands).

                                            -
                                            builtin
                                            -

                                            Names of shell builtin commands. May also be specified as -b. +

                                            builtin
                                            +

                                            Names of shell builtin commands. May also be specified as -b.

                                            -
                                            command
                                            -

                                            Command names. May also be specified as -c. +

                                            command
                                            +

                                            Command names. May also be specified as -c.

                                            -
                                            directory
                                            -

                                            Directory names. May also be specified as -d. +

                                            directory
                                            +

                                            Directory names. May also be specified as -d.

                                            -
                                            disabled
                                            +
                                            disabled

                                            Names of disabled shell builtins.

                                            -
                                            enabled
                                            +
                                            enabled

                                            Names of enabled shell builtins.

                                            -
                                            export
                                            -

                                            Names of exported shell variables. May also be specified as -e. +

                                            export
                                            +

                                            Names of exported shell variables. May also be specified as -e.

                                            -
                                            file
                                            -

                                            File names. May also be specified as -f. +

                                            file
                                            +

                                            File names. May also be specified as -f.

                                            -
                                            function
                                            +
                                            function

                                            Names of shell functions.

                                            -
                                            group
                                            -

                                            Group names. May also be specified as -g. +

                                            group
                                            +

                                            Group names. May also be specified as -g.

                                            -
                                            helptopic
                                            -

                                            Help topics as accepted by the help builtin (see Bash Builtin Commands). +

                                            helptopic
                                            +

                                            Help topics as accepted by the help builtin (see Bash Builtin Commands).

                                            -
                                            hostname
                                            +
                                            hostname

                                            Hostnames, as taken from the file specified by the -HOSTFILE shell variable (see Bash Variables). +HOSTFILE shell variable (see Bash Variables).

                                            -
                                            job
                                            -

                                            Job names, if job control is active. May also be specified as -j. +

                                            job
                                            +

                                            Job names, if job control is active. May also be specified as -j.

                                            -
                                            keyword
                                            -

                                            Shell reserved words. May also be specified as -k. +

                                            keyword
                                            +

                                            Shell reserved words. May also be specified as -k.

                                            -
                                            running
                                            +
                                            running

                                            Names of running jobs, if job control is active.

                                            -
                                            service
                                            -

                                            Service names. May also be specified as -s. +

                                            service
                                            +

                                            Service names. May also be specified as -s.

                                            -
                                            setopt
                                            -

                                            Valid arguments for the -o option to the set builtin -(see The Set Builtin). +

                                            setopt
                                            +

                                            Valid arguments for the -o option to the set builtin +(see The Set Builtin).

                                            -
                                            shopt
                                            -

                                            Shell option names as accepted by the shopt builtin -(see Bash Builtin Commands). +

                                            shopt
                                            +

                                            Shell option names as accepted by the shopt builtin +(see Bash Builtin Commands).

                                            -
                                            signal
                                            +
                                            signal

                                            Signal names.

                                            -
                                            stopped
                                            +
                                            stopped

                                            Names of stopped jobs, if job control is active.

                                            -
                                            user
                                            -

                                            User names. May also be specified as -u. +

                                            user
                                            +

                                            User names. May also be specified as -u.

                                            -
                                            variable
                                            -

                                            Names of all shell variables. May also be specified as -v. +

                                            variable
                                            +

                                            Names of all shell variables. May also be specified as -v.

                                            -
                                            -C command
                                            -

                                            command is executed in a subshell environment, and its output is +

                                            -C command
                                            +

                                            command is executed in a subshell environment, and its output is used as the possible completions. -Arguments are passed as with the -F option. +Arguments are passed as with the -F option.

                                            -
                                            -F function
                                            -

                                            The shell function function is executed in the current shell +

                                            -F function
                                            +

                                            The shell function function is executed in the current shell environment. When it is executed, $1 is the name of the command whose arguments are being completed, $2 is the word being completed, and $3 is the word preceding the word being completed, as described above -(see Programmable Completion). +(see Programmable Completion). When it finishes, the possible completions are retrieved from the value -of the COMPREPLY array variable. +of the COMPREPLY array variable.

                                            -
                                            -G globpat
                                            -

                                            The filename expansion pattern globpat is expanded to generate +

                                            -G globpat
                                            +

                                            The filename expansion pattern globpat is expanded to generate the possible completions.

                                            -
                                            -P prefix
                                            -

                                            prefix is added at the beginning of each possible completion +

                                            -P prefix
                                            +

                                            prefix is added at the beginning of each possible completion after all other options have been applied.

                                            -
                                            -S suffix
                                            -

                                            suffix is appended to each possible completion +

                                            -S suffix
                                            +

                                            suffix is appended to each possible completion after all other options have been applied.

                                            -
                                            -W wordlist
                                            -

                                            The wordlist is split using the characters in the -IFS special variable as delimiters, and each resultant word +

                                            -W wordlist
                                            +

                                            The wordlist is split using the characters in the +IFS special variable as delimiters, and each resultant word is expanded. The possible completions are the members of the resultant list which match the word being completed.

                                            -
                                            -X filterpat
                                            -

                                            filterpat is a pattern as used for filename expansion. +

                                            -X filterpat
                                            +

                                            filterpat is a pattern as used for filename expansion. It is applied to the list of possible completions generated by the preceding options and arguments, and each completion matching -filterpat is removed from the list. -A leading ‘!’ in filterpat negates the pattern; in this -case, any completion not matching filterpat is removed. +filterpat is removed from the list. +A leading ‘!’ in filterpat negates the pattern; in this +case, any completion not matching filterpat is removed.

                                            The return value is true unless an invalid option is supplied, an option other than --p, --r, --D, --E, +-p, +-r, +-D, +-E, or --I -is supplied without a name +-I +is supplied without a name argument, an attempt is made to remove a completion specification for -a name for which no specification exists, or +a name for which no specification exists, or an error occurs adding a completion specification.

                                            -
                                            compopt
                                            +
                                            compopt
                                            -
                                            compopt [-o option] [-DEI] [+o option] [name]
                                            +
                                            compopt [-o option] [-DEI] [+o option] [name]
                                             
                                            -

                                            Modify completion options for each name according to the -options, or for the currently-executing completion if no names +

                                            Modify completion options for each name according to the +options, or for the currently-executing completion if no names are supplied. -If no options are given, display the completion options for each -name or the current completion. -The possible values of option are those valid for the complete +If no options are given, display the completion options for each +name or the current completion. +The possible values of option are those valid for the complete builtin described above. -The -D option indicates that other supplied options should +The -D option indicates that other supplied options should apply to the “default” command completion; that is, completion attempted on a command for which no completion has previously been defined. -The -E option indicates that other supplied options should +The -E option indicates that other supplied options should apply to “empty” command completion; that is, completion attempted on a blank line. -The -I option indicates that other supplied options should +The -I option indicates that other supplied options should apply to completion on the initial non-assignment word on the line, or after a -command delimiter such as ‘;’ or ‘|’, which is usually command +command delimiter such as ‘;’ or ‘|’, which is usually command name completion.

                                            -

                                            If multiple options are supplied, the -D option takes precedence -over -E, and both take precedence over -I +

                                            If multiple options are supplied, the -D option takes precedence +over -E, and both take precedence over -I

                                            The return value is true unless an invalid option is supplied, an attempt -is made to modify the options for a name for which no completion +is made to modify the options for a name for which no completion specification exists, or an output error occurs.

                                            @@ -12975,42 +13004,42 @@ specification exists, or an output error occurs.
                                            -
                                            -
                                            +
                                            + -

                                            8.8 A Programmable Completion Example

                                            +

                                            8.8 A Programmable Completion Example

                                            The most common way to obtain additional completion functionality beyond -the default actions complete and compgen provide is to use -a shell function and bind it to a particular command using complete -F. +the default actions complete and compgen provide is to use +a shell function and bind it to a particular command using complete -F.

                                            -

                                            The following function provides completions for the cd builtin. +

                                            The following function provides completions for the cd builtin. It is a reasonably good example of what shell functions must do when -used for completion. This function uses the word passed as $2 +used for completion. This function uses the word passed as $2 to determine the directory name to complete. You can also use the -COMP_WORDS array variable; the current word is indexed by the -COMP_CWORD variable. +COMP_WORDS array variable; the current word is indexed by the +COMP_CWORD variable.

                                            -

                                            The function relies on the complete and compgen builtins -to do much of the work, adding only the things that the Bash cd +

                                            The function relies on the complete and compgen builtins +to do much of the work, adding only the things that the Bash cd does beyond accepting basic directory names: -tilde expansion (see Tilde Expansion), -searching directories in $CDPATH, which is described above -(see Bourne Shell Builtins), -and basic support for the cdable_vars shell option -(see The Shopt Builtin). -_comp_cd modifies the value of IFS so that it contains only +tilde expansion (see Tilde Expansion), +searching directories in $CDPATH, which is described above +(see Bourne Shell Builtins), +and basic support for the cdable_vars shell option +(see The Shopt Builtin). +_comp_cd modifies the value of IFS so that it contains only a newline to accommodate file names containing spaces and tabs – -compgen prints the possible completions it generates one per line. +compgen prints the possible completions it generates one per line.

                                            -

                                            Possible completions go into the COMPREPLY array variable, one +

                                            Possible completions go into the COMPREPLY array variable, one completion per array element. The programmable completion system retrieves the completions from there when the function returns.

                                            -
                                            # A completion function for the cd builtin
                                            +
                                            # A completion function for the cd builtin
                                             # based on the cd completion function from the bash_completion package
                                             _comp_cd()
                                             {
                                            @@ -13058,300 +13087,303 @@ _comp_cd()
                                             }
                                             
                                            -

                                            We install the completion function using the -F option to -complete: +

                                            We install the completion function using the -F option to +complete:

                                            -
                                            # Tell readline to quote appropriate and append slashes to directories;
                                            +
                                            # Tell readline to quote appropriate and append slashes to directories;
                                             # use the bash default completion for other arguments
                                             complete -o filenames -o nospace -o bashdefault -F _comp_cd cd
                                             

                                            Since we’d like Bash and Readline to take care of some of the other details for us, we use several other options to tell Bash -and Readline what to do. The -o filenames option tells Readline +and Readline what to do. +The -o filenames option tells Readline that the possible completions should be treated as filenames, and quoted -appropriately. That option will also cause Readline to append a slash to +appropriately. +That option will also cause Readline to append a slash to filenames it can determine are directories (which is why we might want to -extend _comp_cd to append a slash if we’re using directories found -via CDPATH: Readline can’t tell those completions are directories). -The -o nospace option tells Readline to not append a space +extend _comp_cd to append a slash if we’re using directories found +via CDPATH: Readline can’t tell those completions are directories). +The -o nospace option tells Readline to not append a space character to the directory name, in case we want to append to it. -The -o bashdefault option brings in the rest of the "Bash default" +The -o bashdefault option brings in the rest of the "Bash default" completions – possible completions that Bash adds to the default Readline -set. These include things like command name completion, variable completion -for words beginning with ‘$’ or ‘${’, completions containing pathname -expansion patterns (see Filename Expansion), and so on. +set. +These include things like command name completion, variable completion +for words beginning with ‘$’ or ‘${’, completions containing +pathname expansion patterns (see Filename Expansion), and so on.

                                            -

                                            Once installed using complete, _comp_cd will be called every -time we attempt word completion for a cd command. +

                                            Once installed using complete, _comp_cd will be called every +time we attempt word completion for a cd command.

                                            Many more examples – an extensive collection of completions for most of the common GNU, Unix, and Linux commands – are available as part of the bash_completion project. This is installed by default on many GNU/Linux distributions. Originally written by Ian Macdonald, the project now lives -at https://github.com/scop/bash-completion/. There are ports for -other systems such as Solaris and Mac OS X. +at https://github.com/scop/bash-completion/. +There are ports for other systems such as Solaris and Mac OS X.

                                            An older version of the bash_completion package is distributed with bash -in the examples/complete subdirectory. +in the examples/complete subdirectory.

                                            - +
                                            -
                                            -
                                            +
                                            + -

                                            9 Using History Interactively

                                            +

                                            9 Using History Interactively

                                            -

                                            This chapter describes how to use the GNU History Library +

                                            This chapter describes how to use the GNU History Library interactively, from a user’s standpoint. It should be considered a user’s guide. -For information on using the GNU History Library in other programs, -see the GNU Readline Library Manual. +For information on using the GNU History Library in other programs, +see the GNU Readline Library Manual.

                                            -
                                              +
                                              -
                                              -
                                              +
                                              + -

                                              9.1 Bash History Facilities

                                              - - +

                                              9.1 Bash History Facilities

                                              + + -

                                              When the -o history option to the set builtin -is enabled (see The Set Builtin), -the shell provides access to the command history, +

                                              When the -o history option to the set builtin +is enabled (see The Set Builtin), +the shell provides access to the command history, the list of commands previously typed. -The value of the HISTSIZE shell variable is used as the +The value of the HISTSIZE shell variable is used as the number of commands to save in a history list. -The text of the last $HISTSIZE +The text of the last $HISTSIZE commands (default 500) is saved. The shell stores each command in the history list prior to parameter and variable expansion but after history expansion is performed, subject to the values of the shell variables -HISTIGNORE and HISTCONTROL. +HISTIGNORE and HISTCONTROL.

                                              When the shell starts up, the history is initialized from the -file named by the HISTFILE variable (default ~/.bash_history). -The file named by the value of HISTFILE is truncated, if +file named by the HISTFILE variable (default ~/.bash_history). +The file named by the value of HISTFILE is truncated, if necessary, to contain no more than the number of lines specified by -the value of the HISTFILESIZE variable. +the value of the HISTFILESIZE variable. When a shell with history enabled exits, the last -$HISTSIZE lines are copied from the history list to the file -named by $HISTFILE. -If the histappend shell option is set (see Bash Builtin Commands), +$HISTSIZE lines are copied from the history list to the file +named by $HISTFILE. +If the histappend shell option is set (see Bash Builtin Commands), the lines are appended to the history file, otherwise the history file is overwritten. -If HISTFILE is unset or null, +If HISTFILE is unset or null, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated -to contain no more than $HISTFILESIZE lines. -If HISTFILESIZE is unset, or set to null, a non-numeric value, or +to contain no more than $HISTFILESIZE lines. +If HISTFILESIZE is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated.

                                              -

                                              If the HISTTIMEFORMAT is set, the time stamp information +

                                              If the HISTTIMEFORMAT is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character. When the history file is read, lines beginning with the history comment character followed immediately by a digit are interpreted as timestamps for the following history entry.

                                              -

                                              The fc builtin command may be used to list or edit and re-execute +

                                              The fc builtin command may be used to list or edit and re-execute a portion of the history list. -The history builtin may be used to display or modify the history +The history builtin may be used to display or modify the history list and manipulate the history file. When using command-line editing, search commands are available in each editing mode that provide access to the -history list (see Commands For Manipulating The History). +history list (see Commands For Manipulating The History).

                                              The shell allows control over which commands are saved on the history list. -The HISTCONTROL and HISTIGNORE +The HISTCONTROL and HISTIGNORE variables are used to cause the shell to save only a subset of the commands entered. -The cmdhist +The cmdhist shell option, if enabled, causes the shell to attempt to save each line of a multi-line command in the same history entry, adding semicolons where necessary to preserve syntactic correctness. -The lithist +The lithist shell option causes the shell to save the command with embedded newlines instead of semicolons. -The shopt builtin is used to set these options. -See The Shopt Builtin, for a description of shopt. +The shopt builtin is used to set these options. +See The Shopt Builtin, for a description of shopt.


                                              -
                                              -
                                              +
                                              + -

                                              9.2 Bash History Builtins

                                              - +

                                              9.2 Bash History Builtins

                                              +

                                              Bash provides two builtin commands which manipulate the history list and history file.

                                              -
                                              -
                                              fc
                                              +
                                              +
                                              fc
                                              -
                                              fc [-e ename] [-lnr] [first] [last]
                                              -fc -s [pat=rep] [command]
                                              +
                                              fc [-e ename] [-lnr] [first] [last]
                                              +fc -s [pat=rep] [command]
                                               
                                              -

                                              The first form selects a range of commands from first to -last from the history list and displays or edits and re-executes +

                                              The first form selects a range of commands from first to +last from the history list and displays or edits and re-executes them. -Both first and -last may be specified as a string (to locate the most recent +Both first and +last may be specified as a string (to locate the most recent 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 first or last of 0 is equivalent to -1 -and -0 is equivalent to the current command (usually the fc +

                                              When listing, a first or last of 0 is equivalent to -1 +and -0 is equivalent to the current command (usually the fc command); otherwise 0 is equivalent to -1 and -0 is invalid.

                                              -

                                              If last is not specified, it is set to -first. If first is not specified, it is set to the previous -command for editing and -16 for listing. If the -l flag is -given, the commands are listed on standard output. The -n flag -suppresses the command numbers when listing. The -r flag +

                                              If last is not specified, it is set to +first. If first is not specified, it is set to the previous +command for editing and −16 for listing. If the -l flag is +given, the commands are listed on standard output. The -n flag +suppresses the command numbers when listing. The -r flag reverses the order of the listing. Otherwise, the editor given by -ename is invoked on a file containing those commands. If -ename is not given, the value of the following variable expansion -is used: ${FCEDIT:-${EDITOR:-vi}}. This says to use the -value of the FCEDIT variable if set, or the value of the -EDITOR variable if that is set, or vi if neither is set. +ename is invoked on a file containing those commands. If +ename is not given, the value of the following variable expansion +is used: ${FCEDIT:-${EDITOR:-vi}}. This says to use the +value of the FCEDIT variable if set, or the value of the +EDITOR variable if that is set, or vi if neither is set. When editing is complete, the edited commands are echoed and executed.

                                              -

                                              In the second form, command is re-executed after each instance -of pat in the selected command is replaced by rep. -command is interpreted the same as first above. +

                                              In the second form, command is re-executed after each instance +of pat in the selected command is replaced by rep. +command is interpreted the same as first above.

                                              -

                                              A useful alias to use with the fc command is r='fc -s', so -that typing ‘r cc’ runs the last command beginning with cc -and typing ‘r’ re-executes the last command (see Aliases). +

                                              A useful alias to use with the fc command is r='fc -s', so +that typing ‘r cc’ runs the last command beginning with cc +and typing ‘r’ re-executes the last command (see Aliases).

                                              -
                                              history
                                              +
                                              history
                                              -
                                              history [n]
                                              +
                                              history [n]
                                               history -c
                                              -history -d offset
                                              -history -d start-end
                                              -history [-anrw] [filename]
                                              -history -ps arg
                                              +history -d offset
                                              +history -d start-end
                                              +history [-anrw] [filename]
                                              +history -ps arg
                                               

                                              With no options, display the history list with line numbers. -Lines prefixed with a ‘*’ have been modified. -An argument of n lists only the last n lines. -If the shell variable HISTTIMEFORMAT is set and not null, -it is used as a format string for strftime to display +Lines prefixed with a ‘*’ have been modified. +An argument of n lists only the last n lines. +If the shell variable HISTTIMEFORMAT is set and not null, +it is used as a format string for strftime(3) to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp and the history line.

                                              Options, if supplied, have the following meanings:

                                              -
                                              -
                                              -c
                                              +
                                              +
                                              -c

                                              Clear the history list. This may be combined with the other options to replace the history list completely.

                                              -
                                              -d offset
                                              -

                                              Delete the history entry at position offset. -If offset is positive, it should be specified as it appears when +

                                              -d offset
                                              +

                                              Delete the history entry at position offset. +If offset is positive, it should be specified as it appears when the history is displayed. -If offset is negative, it is interpreted as relative to one greater +If offset is negative, it is interpreted as relative to one greater than the last history position, so negative indices count back from the -end of the history, and an index of ‘-1’ refers to the current -history -d command. +end of the history, and an index of ‘-1’ refers to the current +history -d command.

                                              -
                                              -d start-end
                                              -

                                              Delete the range of history entries between positions start and -end, inclusive. -Positive and negative values for start and end +

                                              -d start-end
                                              +

                                              Delete the range of history entries between positions start and +end, inclusive. +Positive and negative values for start and end are interpreted as described above.

                                              -
                                              -a
                                              +
                                              -a

                                              Append the new history lines to the history file. These are history lines entered since the beginning of the current Bash session, but not already appended to the history file.

                                              -
                                              -n
                                              +
                                              -n

                                              Append the history lines not already read from the history file to the current history list. These are lines appended to the history file since the beginning of the current Bash session.

                                              -
                                              -r
                                              +
                                              -r

                                              Read the history file and append its contents to the history list.

                                              -
                                              -w
                                              +
                                              -w

                                              Write out the current history list to the history file.

                                              -
                                              -p
                                              -

                                              Perform history substitution on the args and display the result +

                                              -p
                                              +

                                              Perform history substitution on the args and display the result on the standard output, without storing the results in the history list.

                                              -
                                              -s
                                              -

                                              The args are added to the end of +

                                              -s
                                              +

                                              The args are added to the end of the history list as a single entry.

                                              -

                                              If a filename argument is supplied -when any of the -w, -r, -a, or -n options -is used, Bash uses filename as the history file. -If not, then the value of the HISTFILE variable is used. -If HISTFILE is unset or null, these options have no effect. +

                                              If a filename argument is supplied +when any of the -w, -r, -a, or -n options +is used, Bash uses filename as the history file. +If not, then the value of the HISTFILE variable is used. +If HISTFILE is unset or null, these options have no effect.

                                              The return value is 0 unless an invalid option is encountered, an error occurs while reading or writing the history file, an invalid -offset or range is supplied as an argument to -d, or the -history expansion supplied as an argument to -p fails. +offset or range is supplied as an argument to -d, or the +history expansion supplied as an argument to -p fails.


                                              -
                                              -
                                              +
                                              + -

                                              9.3 History Expansion

                                              - +

                                              9.3 History Expansion

                                              +

                                              The History library provides a history expansion feature that is similar -to the history expansion provided by csh. This section +to the history expansion provided by csh. This section describes the syntax used to manipulate the history information.

                                              History expansions introduce words from the history list into @@ -13369,18 +13401,18 @@ which line from the history list should be used during substitution. The second is to select portions of that line for inclusion into the current one.

                                              -

                                              The line selected from the history is called the event, -and the portions of that line that are acted upon are called words. +

                                              The line selected from the history is called the event, +and the portions of that line that are acted upon are called words. The line is broken into words in the same fashion that Bash does, so that several words surrounded by quotes are considered one word. -The event designator selects the event, the optional -word designator selects words from the event, and -various optional modifiers are available to manipulate the +The event designator selects the event, the optional +word designator selects words from the event, and +various optional modifiers are available to manipulate the selected words.

                                              History expansions are introduced by the appearance of the -history expansion character, which is ‘!’ by default. +history expansion character, which is ‘!’ by default. History expansions may appear anywhere in the input, but do not nest.

                                              History expansion implements shell-like quoting conventions: @@ -13392,59 +13424,59 @@ expansion, since backslash can escape the history expansion character, but single quotes may not, since they are not treated specially within double quotes.

                                              -

                                              When using the shell, only ‘\’ and ‘'’ may be used to escape the +

                                              When using the shell, only ‘\’ and ‘'’ may be used to escape 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.

                                              There is a special abbreviation for substitution, active when the -quick substitution character (default ‘^’) +quick substitution character (default ‘^’) is the first character on the line. It selects the previous history list entry, using an event designator -equivalent to !!, +equivalent to !!, and substitutes one string for another in that line. -It is described below (see Event Designators). +It is described below (see Event Designators). This is the only history expansion that does not begin with the history expansion character.

                                              -

                                              Several shell options settable with the shopt -builtin (see The Shopt Builtin) may be used to tailor +

                                              Several shell options settable with the shopt +builtin (see The Shopt Builtin) may be used to tailor the behavior of history expansion. If the -histverify shell option is enabled, and Readline +histverify shell option is enabled, and Readline is being used, history substitutions are not immediately passed to the shell parser. Instead, the expanded line is reloaded into the Readline editing buffer for further modification. -If Readline is being used, and the histreedit +If Readline is being used, and the histreedit shell option is enabled, a failed history expansion will be reloaded into the Readline editing buffer for correction. -The -p option to the history builtin command +The -p option to the history builtin command may be used to see what a history expansion will do before using it. -The -s option to the history builtin may be used to +The -s option to the history builtin may be used to add commands to the end of the history list without actually executing them, so that they are available for subsequent recall. This is most useful in conjunction with Readline.

                                              The shell allows control of the various characters used by the -history expansion mechanism with the histchars variable, -as explained above (see Bash Variables). The shell uses +history expansion mechanism with the histchars variable, +as explained above (see Bash Variables). The shell uses the history comment character to mark history timestamps when writing the history file.

                                              -
                                                +
                                                -
                                                -
                                                +
                                                + -

                                                9.3.1 Event Designators

                                                - +

                                                9.3.1 Event Designators

                                                +

                                                An event designator is a reference to a command line entry in the history list. @@ -13453,52 +13485,52 @@ position 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 one is present, or the end of the word. - +

                                                -
                                                -
                                                !
                                                +
                                                +
                                                !

                                                Start a history substitution, except when followed by a space, tab, -the end of the line, ‘=’, +the end of the line, ‘=’, or the rest of the shell metacharacters defined above -(see Definitions). +(see Definitions).

                                                -
                                                !n
                                                -

                                                Refer to command line n. +

                                                !n
                                                +

                                                Refer to command line n.

                                                -
                                                !-n
                                                -

                                                Refer to the command n lines back. +

                                                !-n
                                                +

                                                Refer to the command n lines back.

                                                -
                                                !!
                                                -

                                                Refer to the previous command. This is a synonym for ‘!-1’. +

                                                !!
                                                +

                                                Refer to the previous command. This is a synonym for ‘!-1’.

                                                -
                                                !string
                                                +
                                                !string

                                                Refer to the most recent command preceding the current position in the history list -starting with string. +starting with string.

                                                -
                                                !?string[?]
                                                +
                                                !?string[?]

                                                Refer to the most recent command preceding the current position in the history list -containing string. +containing string. The trailing -‘?’ may be omitted if the string is followed immediately by +‘?’ may be omitted if the string is followed immediately by a newline. -If string is missing, the string from the most recent search is used; +If string is missing, the string from the most recent search is used; it is an error if there is no previous search string.

                                                -
                                                ^string1^string2^
                                                -

                                                Quick Substitution. Repeat the last command, replacing string1 -with string2. Equivalent to -!!:s^string1^string2^. +

                                                ^string1^string2^
                                                +

                                                Quick Substitution. Repeat the last command, replacing string1 +with string2. Equivalent to +!!:s^string1^string2^.

                                                -
                                                !#
                                                +
                                                !#

                                                The entire command line typed so far.

                                                @@ -13506,82 +13538,82 @@ with string2. Equivalent to
                                                -
                                                -
                                                +
                                                + -

                                                9.3.2 Word Designators

                                                +

                                                9.3.2 Word Designators

                                                Word designators are used to select desired words from the event. They are optional; if the word designator isn’t supplied, the history expansion 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 +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 inserted into the current line separated by single spaces.

                                                For example,

                                                -
                                                -
                                                !!
                                                +
                                                +
                                                !!

                                                designates the preceding command. When you type this, the preceding command is repeated in toto.

                                                -
                                                !!:$
                                                +
                                                !!:$

                                                designates the last argument of the preceding command. This may be -shortened to !$. +shortened to !$.

                                                -
                                                !fi:2
                                                +
                                                !fi:2

                                                designates the second argument of the most recent command starting with -the letters fi. +the letters fi.

                                                Here are the word designators:

                                                -
                                                -
                                                0 (zero)
                                                -

                                                The 0th word. For many applications, this is the command word. +

                                                +
                                                0 (zero)
                                                +

                                                The 0th word. For many applications, this is the command word.

                                                -
                                                n
                                                -

                                                The nth word. +

                                                n
                                                +

                                                The nth word.

                                                -
                                                ^
                                                +
                                                ^

                                                The first argument; that is, word 1.

                                                -
                                                $
                                                +
                                                $

                                                The last argument.

                                                -
                                                %
                                                -

                                                The first word matched by the most recent ‘?string?’ search, +

                                                %
                                                +

                                                The first word matched by the most recent ‘?string?’ search, if the search string begins with a character that is part of a word.

                                                -
                                                x-y
                                                -

                                                A range of words; ‘-y’ abbreviates ‘0-y’. +

                                                x-y
                                                +

                                                A range of words; ‘-y’ abbreviates ‘0-y’.

                                                -
                                                *
                                                -

                                                All of the words, except the 0th. This is a synonym for ‘1-$’. -It is not an error to use ‘*’ if there is just one word in the event; +

                                                *
                                                +

                                                All of the words, except the 0th. This is a synonym for ‘1-$’. +It is not an error to use ‘*’ if there is just one word in the event; the empty string is returned in that case.

                                                -
                                                x*
                                                -

                                                Abbreviates ‘x-$’ +

                                                x*
                                                +

                                                Abbreviates ‘x-$

                                                -
                                                x-
                                                -

                                                Abbreviates ‘x-$’ like ‘x*’, but omits the last word. -If ‘x’ is missing, it defaults to 0. +

                                                x-
                                                +

                                                Abbreviates ‘x-$’ like ‘x*’, but omits the last word. +If ‘x’ is missing, it defaults to 0.

                                                @@ -13591,81 +13623,81 @@ previous command is used as the event.


                                                -
                                                -
                                                +
                                                + -

                                                9.3.3 Modifiers

                                                +

                                                9.3.3 Modifiers

                                                After the optional word designator, you can add a sequence of one or more -of the following modifiers, each preceded by a ‘:’. +of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event.

                                                -
                                                -
                                                h
                                                +
                                                +
                                                h

                                                Remove a trailing pathname component, leaving only the head.

                                                -
                                                t
                                                +
                                                t

                                                Remove all leading pathname components, leaving the tail.

                                                -
                                                r
                                                -

                                                Remove a trailing suffix of the form ‘.suffix’, leaving +

                                                r
                                                +

                                                Remove a trailing suffix of the form ‘.suffix’, leaving the basename.

                                                -
                                                e
                                                +
                                                e

                                                Remove all but the trailing suffix.

                                                -
                                                p
                                                +
                                                p

                                                Print the new command but do not execute it.

                                                -
                                                q
                                                +
                                                q

                                                Quote the substituted words, escaping further substitutions.

                                                -
                                                x
                                                -

                                                Quote the substituted words as with ‘q’, +

                                                x
                                                +

                                                Quote the substituted words as with ‘q’, but break into words at spaces, tabs, and newlines. -The ‘q’ and ‘x’ modifiers are mutually exclusive; the last one +The ‘q’ and ‘x’ modifiers are mutually exclusive; the last one supplied is used.

                                                -
                                                s/old/new/
                                                -

                                                Substitute new for the first occurrence of old in the +

                                                s/old/new/
                                                +

                                                Substitute new for the first occurrence of old in the event line. -Any character may be used as the delimiter in place of ‘/’. -The delimiter may be quoted in old and new -with a single backslash. If ‘&’ appears in new, -it is replaced by old. A single backslash will quote -the ‘&’. -If old is null, it is set to the last old +Any character may be used as the delimiter in place of ‘/’. +The delimiter may be quoted in old and new +with a single backslash. If ‘&’ appears in new, +it is replaced by old. A single backslash will quote +the ‘&’. +If old is null, it is set to the last old substituted, or, if no previous history substitutions took place, -the last string -in a !?string[?] +the last string +in a !?string[?] search. -If new is null, each matching old is deleted. +If new is null, each matching old is deleted. The final delimiter is optional if it is the last character on the input line.

                                                -
                                                &
                                                +
                                                &

                                                Repeat the previous substitution.

                                                -
                                                g
                                                -
                                                a
                                                +
                                                g
                                                +
                                                a

                                                Cause changes to be applied over the entire event line. Used in -conjunction with ‘s’, as in gs/old/new/, -or with ‘&’. +conjunction with ‘s’, as in gs/old/new/, +or with ‘&’.

                                                -
                                                G
                                                -

                                                Apply the following ‘s’ or ‘&’ modifier once to each word +

                                                G
                                                +

                                                Apply the following ‘s’ or ‘&’ modifier once to each word in the event.

                                                @@ -13675,22 +13707,22 @@ in the event.
                                                -
                                                -
                                                +
                                                + -

                                                10 Installing Bash

                                                +

                                                10 Installing Bash

                                                This chapter provides basic instructions for installing Bash on the various supported platforms. The distribution supports the -GNU operating systems, nearly every version of Unix, and several +GNU operating systems, nearly every version of Unix, and several non-Unix systems such as BeOS and Interix. Other independent ports exist for -MS-DOS, OS/2, and Windows platforms. +MS-DOS, OS/2, and Windows platforms.

                                                -
                                                  +
                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.1 Basic Installation

                                                  - - - - +

                                                  10.1 Basic Installation

                                                  + + + +

                                                  These are installation instructions for Bash.

                                                  The simplest way to compile Bash is:

                                                  -
                                                    -
                                                  1. cd to the directory containing the source code and type -‘./configure’ to configure Bash for your system. If you’re -using csh on an old version of System V, you might need to -type ‘sh ./configure’ instead to prevent csh from trying -to execute configure itself. +
                                                      +
                                                    1. cd to the directory containing the source code and type +‘./configure’ to configure Bash for your system. If you’re +using csh on an old version of System V, you might need to +type ‘sh ./configure’ instead to prevent csh from trying +to execute configure itself. -

                                                      Running configure takes some time. +

                                                      Running configure takes some time. While running, it prints messages telling which features it is checking for.

                                                      -
                                                    2. Type ‘make’ to compile Bash and build the bashbug bug +
                                                    3. Type ‘make’ to compile Bash and build the bashbug bug reporting script. -
                                                    4. Optionally, type ‘make tests’ to run the Bash test suite. +
                                                    5. Optionally, type ‘make tests’ to run the Bash test suite. -
                                                    6. Type ‘make install’ to install bash and bashbug. +
                                                    7. Type ‘make install’ to install bash and bashbug. This will also install the manual pages and Info file, message translation files, some supplemental documentation, a number of example loadable builtin commands, and a set of header files for developing loadable builtins. -You may need additional privileges to install bash to your -desired destination, so ‘sudo make install’ might be required. -More information about controlling the locations where bash and -other files are installed is below (see Installation Names). +You may need additional privileges to install bash to your +desired destination, so ‘sudo make install’ might be required. +More information about controlling the locations where bash and +other files are installed is below (see Installation Names).
                                                    -

                                                    The configure shell script attempts to guess correct +

                                                    The configure shell script attempts to guess correct values for various system-dependent variables used during -compilation. It uses those values to create a Makefile in +compilation. It uses those values to create a Makefile in each directory of the package (the top directory, the -builtins, doc, po, and support directories, -each directory under lib, and several others). It also creates a -config.h file containing system-dependent definitions. -Finally, it creates a shell script named config.status that you +builtins, doc, po, and support directories, +each directory under lib, and several others). It also creates a +config.h file containing system-dependent definitions. +Finally, it creates a shell script named config.status that you can run in the future to recreate the current configuration, a -file config.cache that saves the results of its tests to -speed up reconfiguring, and a file config.log containing -compiler output (useful mainly for debugging configure). +file config.cache that saves the results of its tests to +speed up reconfiguring, and a file config.log containing +compiler output (useful mainly for debugging configure). If at some point -config.cache contains results you don’t want to keep, you +config.cache contains results you don’t want to keep, you may remove or edit it.

                                                    To find out more about the options and arguments that the -configure script understands, type +configure script understands, type

                                                    -
                                                    bash-4.2$ ./configure --help
                                                    +
                                                    bash-4.2$ ./configure --help
                                                     

                                                    at the Bash prompt in your Bash source directory. @@ -13772,60 +13804,60 @@ may remove or edit it.

                                                    If you want to build Bash in a directory separate from the source directory – to build for multiple architectures, for example – just use the full path to the configure script. The following commands -will build Bash in a directory under /usr/local/build from -the source code in /usr/local/src/bash-4.4: +will build Bash in a directory under /usr/local/build from +the source code in /usr/local/src/bash-4.4:

                                                    -
                                                    mkdir /usr/local/build/bash-4.4
                                                    +
                                                    mkdir /usr/local/build/bash-4.4
                                                     cd /usr/local/build/bash-4.4
                                                     bash /usr/local/src/bash-4.4/configure
                                                     make
                                                     
                                                    -

                                                    See Compiling For Multiple Architectures for more information +

                                                    See Compiling For Multiple Architectures for more information about building in a directory separate from the source.

                                                    If you need to do unusual things to compile Bash, please -try to figure out how configure could check whether or not +try to figure out how configure could check whether or not to do them, and mail diffs or instructions to -bash-maintainers@gnu.org so they can be + so they can be considered for the next release.

                                                    -

                                                    The file configure.ac is used to create configure +

                                                    The file configure.ac is used to create configure by a program called Autoconf. -You only need configure.ac if you want to change it or regenerate -configure using a newer version of Autoconf. +You only need configure.ac if you want to change it or regenerate +configure using a newer version of Autoconf. If you do this, make sure you are using Autoconf version 2.69 or newer.

                                                    You can remove the program binaries and object files from the -source code directory by typing ‘make clean’. To also remove the -files that configure created (so you can compile Bash for -a different kind of computer), type ‘make distclean’. +source code directory by typing ‘make clean’. To also remove the +files that configure created (so you can compile Bash for +a different kind of computer), type ‘make distclean’.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.2 Compilers and Options

                                                  +

                                                  10.2 Compilers and Options

                                                  Some systems require unusual options for compilation or linking -that the configure script does not know about. You can -give configure initial values for variables by setting +that the configure script does not know about. You can +give configure initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this:

                                                  -
                                                  CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
                                                  +
                                                  CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
                                                   
                                                  -

                                                  On systems that have the env program, you can do it like this: +

                                                  On systems that have the env program, you can do it like this:

                                                  -
                                                  env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
                                                  +
                                                  env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
                                                   

                                                  The configuration process uses GCC to build Bash if it @@ -13833,524 +13865,524 @@ is available.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.3 Compiling For Multiple Architectures

                                                  +

                                                  10.3 Compiling For Multiple Architectures

                                                  You can compile Bash for more than one kind of computer at the same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of make that -supports the VPATH variable, such as GNU make. -cd to the +own directory. To do this, you must use a version of make that +supports the VPATH variable, such as GNU make. +cd to the directory where you want the object files and executables to go and run -the configure script from the source directory -(see Basic Installation). +the configure script from the source directory +(see Basic Installation). You may need to -supply the --srcdir=PATH argument to tell configure where the -source files are. configure automatically checks for the -source code in the directory that configure is in and in ‘..’. +supply the --srcdir=PATH argument to tell configure where the +source files are. configure automatically checks for the +source code in the directory that configure is in and in ‘..’.

                                                  -

                                                  If you have to use a make that does not support the VPATH +

                                                  If you have to use a make that does not support the VPATH variable, you can compile Bash for one architecture at a time in the source code directory. After you have installed -Bash for one architecture, use ‘make distclean’ before +Bash for one architecture, use ‘make distclean’ before reconfiguring for another architecture.

                                                  Alternatively, if your system supports symbolic links, you can use the -support/mkclone script to create a build tree which has +support/mkclone script to create a build tree which has symbolic links back to each file in the source directory. Here’s an example that creates a build directory in the current directory from a -source directory /usr/gnu/src/bash-2.0: +source directory /usr/gnu/src/bash-2.0:

                                                  -
                                                  bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
                                                  +
                                                  bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 .
                                                   
                                                  -

                                                  The mkclone script requires Bash, so you must have already built +

                                                  The mkclone script requires Bash, so you must have already built Bash for at least one architecture before you can create build directories for other architectures.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.4 Installation Names

                                                  - -

                                                  By default, ‘make install’ will install into -/usr/local/bin, /usr/local/man, etc.; -that is, the installation prefix defaults to /usr/local. -You can specify an installation prefix other than /usr/local by -giving configure the option --prefix=PATH, -or by specifying a value for the prefixmake’ -variable when running ‘make install’ -(e.g., ‘make install prefix=PATH’). -The prefix variable provides a default for exec_prefix and +

                                                  10.4 Installation Names

                                                  + +

                                                  By default, ‘make install’ will install into +/usr/local/bin, /usr/local/man, etc.; +that is, the installation prefix defaults to /usr/local. +You can specify an installation prefix other than /usr/local by +giving configure the option --prefix=PATH, +or by specifying a value for the prefixmake’ +variable when running ‘make install’ +(e.g., ‘make install prefix=PATH’). +The prefix variable provides a default for exec_prefix and other variables used when installing Bash.

                                                  You can specify separate installation prefixes for architecture-specific files and architecture-independent files. -If you give configure the option ---exec-prefix=PATH, ‘make install’ will use -PATH as the prefix for installing programs and libraries. +If you give configure the option +--exec-prefix=PATH, ‘make install’ will use +PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix.

                                                  If you would like to change the installation locations for a single run, -you can specify these variables as arguments to make: -‘make install exec_prefix=/’ will install bash and -bashbug into /bin instead of the default /usr/local/bin. +you can specify these variables as arguments to make: +‘make install exec_prefix=/’ will install bash and +bashbug into /bin instead of the default /usr/local/bin.

                                                  If you want to see the files Bash will install and where it will install them without changing anything on your system, specify the variable -DESTDIR as an argument to make. Its value should be the +DESTDIR as an argument to make. Its value should be the absolute directory path you’d like to use as the root of your sample installation tree. For example,

                                                  -
                                                  mkdir /fs1/bash-install
                                                  +
                                                  mkdir /fs1/bash-install
                                                   make install DESTDIR=/fs1/bash-install
                                                   
                                                  -

                                                  will install bash into /fs1/bash-install/usr/local/bin/bash, +

                                                  will install bash into /fs1/bash-install/usr/local/bin/bash, the documentation into directories within -/fs1/bash-install/usr/local/share, the example loadable builtins into -/fs1/bash-install/usr/local/lib/bash, and so on. -You can use the usual exec_prefix and prefix variables to alter -the directory paths beneath the value of DESTDIR. +/fs1/bash-install/usr/local/share, the example loadable builtins into +/fs1/bash-install/usr/local/lib/bash, and so on. +You can use the usual exec_prefix and prefix variables to alter +the directory paths beneath the value of DESTDIR.

                                                  The GNU Makefile standards provide a more complete description of these variables and their effects.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.5 Specifying the System Type

                                                  +

                                                  10.5 Specifying the System Type

                                                  -

                                                  There may be some features configure can not figure out +

                                                  There may be some features configure can not figure out automatically, but needs to determine by the type of host Bash -will run on. Usually configure can figure that +will run on. Usually configure can figure that out, but if it prints a message saying it can not guess the host -type, give it the --host=TYPE option. ‘TYPE’ can -either be a short name for the system type, such as ‘sun4’, -or a canonical name with three fields: ‘CPU-COMPANY-SYSTEM’ -(e.g., ‘i386-unknown-freebsd4.2’). +type, give it the --host=TYPE option. ‘TYPE’ can +either be a short name for the system type, such as ‘sun4’, +or a canonical name with three fields: ‘CPU-COMPANY-SYSTEM’ +(e.g., ‘i386-unknown-freebsd4.2’).

                                                  -

                                                  See the file support/config.sub for the possible +

                                                  See the file support/config.sub for the possible values of each field.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.6 Sharing Defaults

                                                  +

                                                  10.6 Sharing Defaults

                                                  -

                                                  If you want to set default values for configure scripts to +

                                                  If you want to set default values for configure scripts to share, you can create a site shell script called -config.site that gives default values for variables like -CC, cache_file, and prefix. configure -looks for PREFIX/share/config.site if it exists, then -PREFIX/etc/config.site if it exists. Or, you can set the -CONFIG_SITE environment variable to the location of the site -script. A warning: the Bash configure looks for a site script, -but not all configure scripts do. +config.site that gives default values for variables like +CC, cache_file, and prefix. configure +looks for PREFIX/share/config.site if it exists, then +PREFIX/etc/config.site if it exists. Or, you can set the +CONFIG_SITE environment variable to the location of the site +script. A warning: the Bash configure looks for a site script, +but not all configure scripts do.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.7 Operation Controls

                                                  +

                                                  10.7 Operation Controls

                                                  -

                                                  configure recognizes the following options to control how it +

                                                  configure recognizes the following options to control how it operates.

                                                  -
                                                  -
                                                  --cache-file=file
                                                  +
                                                  +
                                                  --cache-file=file

                                                  Use and save the results of the tests in -file instead of ./config.cache. Set file to -/dev/null to disable caching, for debugging -configure. +file instead of ./config.cache. Set file to +/dev/null to disable caching, for debugging +configure.

                                                  -
                                                  --help
                                                  -

                                                  Print a summary of the options to configure, and exit. +

                                                  --help
                                                  +

                                                  Print a summary of the options to configure, and exit.

                                                  -
                                                  --quiet
                                                  -
                                                  --silent
                                                  -
                                                  -q
                                                  +
                                                  --quiet
                                                  +
                                                  --silent
                                                  +
                                                  -q

                                                  Do not print messages saying which checks are being made.

                                                  -
                                                  --srcdir=dir
                                                  -

                                                  Look for the Bash source code in directory dir. Usually -configure can determine that directory automatically. +

                                                  --srcdir=dir
                                                  +

                                                  Look for the Bash source code in directory dir. Usually +configure can determine that directory automatically.

                                                  -
                                                  --version
                                                  -

                                                  Print the version of Autoconf used to generate the configure +

                                                  --version
                                                  +

                                                  Print the version of Autoconf used to generate the configure script, and exit.

                                                  -

                                                  configure also accepts some other, not widely used, boilerplate -options. ‘configure --help’ prints the complete list. +

                                                  configure also accepts some other, not widely used, boilerplate +options. ‘configure --help’ prints the complete list.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  10.8 Optional Features

                                                  +

                                                  10.8 Optional Features

                                                  -

                                                  The Bash configure has a number of --enable-feature -options, where feature indicates an optional part of Bash. -There are also several --with-package options, -where package is something like ‘bash-malloc’ or ‘purify’. +

                                                  The Bash configure has a number of --enable-feature +options, where feature indicates an optional part of Bash. +There are also several --with-package options, +where package is something like ‘bash-malloc’ or ‘purify’. To turn off the default use of a package, use ---without-package. To configure Bash without a feature -that is enabled by default, use --disable-feature. +--without-package. To configure Bash without a feature +that is enabled by default, use --disable-feature.

                                                  -

                                                  Here is a complete list of the --enable- and ---with- options that the Bash configure recognizes. +

                                                  Here is a complete list of the --enable- and +--with- options that the Bash configure recognizes.

                                                  -
                                                  -
                                                  --with-afs
                                                  +
                                                  +
                                                  --with-afs

                                                  Define if you are using the Andrew File System from Transarc.

                                                  -
                                                  --with-bash-malloc
                                                  +
                                                  --with-bash-malloc

                                                  Use the Bash version of -malloc in the directory lib/malloc. This is not the same -malloc that appears in GNU libc, but an older version -originally derived from the 4.2 BSD malloc. This malloc +malloc in the directory lib/malloc. This is not the same +malloc that appears in GNU libc, but an older version +originally derived from the 4.2 BSD malloc. This malloc is very fast, but wastes some space on each allocation. This option is enabled by default. -The NOTES file contains a list of systems for -which this should be turned off, and configure disables this +The NOTES file contains a list of systems for +which this should be turned off, and configure disables this option automatically for a number of systems.

                                                  -
                                                  --with-curses
                                                  +
                                                  --with-curses

                                                  Use the curses library instead of the termcap library. This should be supplied if your system has an inadequate or incomplete termcap database.

                                                  -
                                                  --with-gnu-malloc
                                                  -

                                                  A synonym for --with-bash-malloc. +

                                                  --with-gnu-malloc
                                                  +

                                                  A synonym for --with-bash-malloc.

                                                  -
                                                  --with-installed-readline[=PREFIX]
                                                  +
                                                  --with-installed-readline[=PREFIX]

                                                  Define this to make Bash link with a locally-installed version of Readline -rather than the version in lib/readline. This works only with -Readline 5.0 and later versions. If PREFIX is yes or not -supplied, configure uses the values of the make variables -includedir and libdir, which are subdirectories of prefix +rather than the version in lib/readline. This works only with +Readline 5.0 and later versions. If PREFIX is yes or not +supplied, configure uses the values of the make variables +includedir and libdir, which are subdirectories of prefix by default, to find the installed version of Readline if it is not in the standard system include and library directories. -If PREFIX is no, Bash links with the version in -lib/readline. -If PREFIX is set to any other value, configure treats it as +If PREFIX is no, Bash links with the version in +lib/readline. +If PREFIX is set to any other value, configure treats it as a directory pathname and looks for the installed version of Readline in subdirectories of that directory -(include files in PREFIX/include and the library in -PREFIX/lib). +(include files in PREFIX/include and the library in +PREFIX/lib).

                                                  -
                                                  --with-libintl-prefix[=PREFIX]
                                                  +
                                                  --with-libintl-prefix[=PREFIX]

                                                  Define this to make Bash link with a locally-installed version of the -libintl library instead of the version in lib/intl. +libintl library instead of the version in lib/intl.

                                                  -
                                                  --with-libiconv-prefix[=PREFIX]
                                                  -

                                                  Define this to make Bash look for libiconv in PREFIX instead of the +

                                                  --with-libiconv-prefix[=PREFIX]
                                                  +

                                                  Define this to make Bash look for libiconv in PREFIX instead of the standard system locations. There is no version included with Bash.

                                                  -
                                                  --enable-minimal-config
                                                  +
                                                  --enable-minimal-config

                                                  This produces a shell with minimal features, close to the historical Bourne shell.

                                                  -

                                                  There are several --enable- options that alter how Bash is +

                                                  There are several --enable- options that alter how Bash is compiled, linked, and installed, rather than changing run-time features.

                                                  -
                                                  -
                                                  --enable-largefile
                                                  -

                                                  Enable support for large files if the operating system requires special compiler options +

                                                  +
                                                  --enable-largefile
                                                  +

                                                  Enable support for large files if the operating system requires special compiler options to build programs which can access large files. This is enabled by default, if the operating system provides large file support.

                                                  -
                                                  --enable-profiling
                                                  +
                                                  --enable-profiling

                                                  This builds a Bash binary that produces profiling information to be -processed by gprof each time it is executed. +processed by gprof each time it is executed.

                                                  -
                                                  --enable-separate-helpfiles
                                                  -

                                                  Use external files for the documentation displayed by the help builtin +

                                                  --enable-separate-helpfiles
                                                  +

                                                  Use external files for the documentation displayed by the help builtin instead of storing the text internally.

                                                  -
                                                  --enable-static-link
                                                  -

                                                  This causes Bash to be linked statically, if gcc is being used. +

                                                  --enable-static-link
                                                  +

                                                  This causes Bash to be linked statically, if gcc is being used. This could be used to build a version to use as root’s shell.

                                                  -

                                                  The ‘minimal-config’ option can be used to disable all of +

                                                  The ‘minimal-config’ option can be used to disable all of the following options, but it is processed first, so individual -options may be enabled using ‘enable-feature’. +options may be enabled using ‘enable-feature’.

                                                  All of the following options except for -‘alt-array-implementation’, -‘disabled-builtins’, -‘direxpand-default’, -‘strict-posix-default’, +‘alt-array-implementation’, +‘disabled-builtins’, +‘direxpand-default’, +‘strict-posix-default’, and -‘xpg-echo-default’ are +‘xpg-echo-default’ are enabled by default, unless the operating system does not provide the necessary support.

                                                  -
                                                  -
                                                  --enable-alias
                                                  -

                                                  Allow alias expansion and include the alias and unalias -builtins (see Aliases). +

                                                  +
                                                  --enable-alias
                                                  +

                                                  Allow alias expansion and include the alias and unalias +builtins (see Aliases).

                                                  -
                                                  --enable-alt-array-implementation
                                                  +
                                                  --enable-alt-array-implementation

                                                  This builds Bash using an alternate implementation of arrays -(see Arrays) that provides faster access at the expense of using +(see Arrays) that provides faster access at the expense of using more memory (sometimes many times more, depending on how sparse an array is).

                                                  -
                                                  --enable-arith-for-command
                                                  -

                                                  Include support for the alternate form of the for command -that behaves like the C language for statement -(see Looping Constructs). +

                                                  --enable-arith-for-command
                                                  +

                                                  Include support for the alternate form of the for command +that behaves like the C language for statement +(see Looping Constructs).

                                                  -
                                                  --enable-array-variables
                                                  +
                                                  --enable-array-variables

                                                  Include support for one-dimensional array shell variables -(see Arrays). +(see Arrays).

                                                  -
                                                  --enable-bang-history
                                                  -

                                                  Include support for csh-like history substitution -(see History Expansion). +

                                                  --enable-bang-history
                                                  +

                                                  Include support for csh-like history substitution +(see History Expansion).

                                                  -
                                                  --enable-brace-expansion
                                                  -

                                                  Include csh-like brace expansion -( b{a,b}cbac bbc ). -See Brace Expansion, for a complete description. +

                                                  --enable-brace-expansion
                                                  +

                                                  Include csh-like brace expansion +( b{a,b}cbac bbc ). +See Brace Expansion, for a complete description.

                                                  -
                                                  --enable-casemod-attributes
                                                  -

                                                  Include support for case-modifying attributes in the declare builtin -and assignment statements. Variables with the uppercase attribute, +

                                                  --enable-casemod-attributes
                                                  +

                                                  Include support for case-modifying attributes in the declare builtin +and assignment statements. Variables with the uppercase attribute, for example, will have their values converted to uppercase upon assignment.

                                                  -
                                                  --enable-casemod-expansion
                                                  +
                                                  --enable-casemod-expansion

                                                  Include support for case-modifying word expansions.

                                                  -
                                                  --enable-command-timing
                                                  -

                                                  Include support for recognizing time as a reserved word and for -displaying timing statistics for the pipeline following time -(see Pipelines). +

                                                  --enable-command-timing
                                                  +

                                                  Include support for recognizing time as a reserved word and for +displaying timing statistics for the pipeline following time +(see Pipelines). This allows pipelines as well as shell builtins and functions to be timed.

                                                  -
                                                  --enable-cond-command
                                                  -

                                                  Include support for the [[ conditional command. -(see Conditional Constructs). +

                                                  --enable-cond-command
                                                  +

                                                  Include support for the [[ conditional command. +(see Conditional Constructs).

                                                  -
                                                  --enable-cond-regexp
                                                  -

                                                  Include support for matching POSIX regular expressions using the -‘=~’ binary operator in the [[ conditional command. -(see Conditional Constructs). +

                                                  --enable-cond-regexp
                                                  +

                                                  Include support for matching POSIX regular expressions using the +‘=~’ binary operator in the [[ conditional command. +(see Conditional Constructs).

                                                  -
                                                  --enable-coprocesses
                                                  -

                                                  Include support for coprocesses and the coproc reserved word -(see Pipelines). +

                                                  --enable-coprocesses
                                                  +

                                                  Include support for coprocesses and the coproc reserved word +(see Pipelines).

                                                  -
                                                  --enable-debugger
                                                  +
                                                  --enable-debugger

                                                  Include support for the Bash debugger (distributed separately).

                                                  -
                                                  --enable-dev-fd-stat-broken
                                                  -

                                                  If calling stat on /dev/fd/N returns different results than -calling fstat on file descriptor N, supply this option to +

                                                  --enable-dev-fd-stat-broken
                                                  +

                                                  If calling stat on /dev/fd/N returns different results than +calling fstat on file descriptor N, supply this option to enable a workaround. This has implications for conditional commands that test file attributes.

                                                  -
                                                  --enable-direxpand-default
                                                  -

                                                  Cause the direxpand shell option (see The Shopt Builtin) +

                                                  --enable-direxpand-default
                                                  +

                                                  Cause the direxpand shell option (see The Shopt Builtin) to be enabled by default when the shell starts. It is normally disabled by default.

                                                  -
                                                  --enable-directory-stack
                                                  -

                                                  Include support for a csh-like directory stack and the -pushd, popd, and dirs builtins -(see The Directory Stack). +

                                                  --enable-directory-stack
                                                  +

                                                  Include support for a csh-like directory stack and the +pushd, popd, and dirs builtins +(see The Directory Stack).

                                                  -
                                                  --enable-disabled-builtins
                                                  -

                                                  Allow builtin commands to be invoked via ‘builtin xxx’ -even after xxx has been disabled using ‘enable -n xxx’. -See Bash Builtin Commands, for details of the builtin and -enable builtin commands. +

                                                  --enable-disabled-builtins
                                                  +

                                                  Allow builtin commands to be invoked via ‘builtin xxx’ +even after xxx has been disabled using ‘enable -n xxx’. +See Bash Builtin Commands, for details of the builtin and +enable builtin commands.

                                                  -
                                                  --enable-dparen-arithmetic
                                                  -

                                                  Include support for the ((…)) command -(see Conditional Constructs). +

                                                  --enable-dparen-arithmetic
                                                  +

                                                  Include support for the ((…)) command +(see Conditional Constructs).

                                                  -
                                                  --enable-extended-glob
                                                  +
                                                  --enable-extended-glob

                                                  Include support for the extended pattern matching features described -above under Pattern Matching. +above under Pattern Matching.

                                                  -
                                                  --enable-extended-glob-default
                                                  -

                                                  Set the default value of the extglob shell option described -above under The Shopt Builtin to be enabled. +

                                                  --enable-extended-glob-default
                                                  +

                                                  Set the default value of the extglob shell option described +above under The Shopt Builtin to be enabled.

                                                  -
                                                  --enable-function-import
                                                  +
                                                  --enable-function-import

                                                  Include support for importing function definitions exported by another instance of the shell from the environment. This option is enabled by default.

                                                  -
                                                  --enable-glob-asciiranges-default
                                                  -

                                                  Set the default value of the globasciiranges shell option described -above under The Shopt Builtin to be enabled. +

                                                  --enable-glob-asciiranges-default
                                                  +

                                                  Set the default value of the globasciiranges shell option described +above under The Shopt Builtin to be enabled. This controls the behavior of character ranges when used in pattern matching bracket expressions.

                                                  -
                                                  --enable-help-builtin
                                                  -

                                                  Include the help builtin, which displays help on shell builtins and -variables (see Bash Builtin Commands). +

                                                  --enable-help-builtin
                                                  +

                                                  Include the help builtin, which displays help on shell builtins and +variables (see Bash Builtin Commands).

                                                  -
                                                  --enable-history
                                                  -

                                                  Include command history and the fc and history -builtin commands (see Bash History Facilities). +

                                                  --enable-history
                                                  +

                                                  Include command history and the fc and history +builtin commands (see Bash History Facilities).

                                                  -
                                                  --enable-job-control
                                                  -

                                                  This enables the job control features (see Job Control), +

                                                  --enable-job-control
                                                  +

                                                  This enables the job control features (see Job Control), if the operating system supports them.

                                                  -
                                                  --enable-multibyte
                                                  +
                                                  --enable-multibyte

                                                  This enables support for multibyte characters if the operating system provides the necessary support.

                                                  -
                                                  --enable-net-redirections
                                                  +
                                                  --enable-net-redirections

                                                  This enables the special handling of filenames of the form -/dev/tcp/host/port and -/dev/udp/host/port -when used in redirections (see Redirections). +/dev/tcp/host/port and +/dev/udp/host/port +when used in redirections (see Redirections).

                                                  -
                                                  --enable-process-substitution
                                                  -

                                                  This enables process substitution (see Process Substitution) if +

                                                  --enable-process-substitution
                                                  +

                                                  This enables process substitution (see Process Substitution) if the operating system provides the necessary support.

                                                  -
                                                  --enable-progcomp
                                                  +
                                                  --enable-progcomp

                                                  Enable the programmable completion facilities -(see Programmable Completion). +(see Programmable Completion). If Readline is not enabled, this option has no effect.

                                                  -
                                                  --enable-prompt-string-decoding
                                                  +
                                                  --enable-prompt-string-decoding

                                                  Turn on the interpretation of a number of backslash-escaped characters -in the $PS0, $PS1, $PS2, and $PS4 prompt -strings. See Controlling the Prompt, for a complete list of prompt +in the $PS0, $PS1, $PS2, and $PS4 prompt +strings. See Controlling the Prompt, for a complete list of prompt string escape sequences.

                                                  -
                                                  --enable-readline
                                                  +
                                                  --enable-readline

                                                  Include support for command-line editing and history with the Bash -version of the Readline library (see Command Line Editing). +version of the Readline library (see Command Line Editing).

                                                  -
                                                  --enable-restricted
                                                  -

                                                  Include support for a restricted shell. If this is enabled, Bash, -when called as rbash, enters a restricted mode. See -The Restricted Shell, for a description of restricted mode. +

                                                  --enable-restricted
                                                  +

                                                  Include support for a restricted shell. If this is enabled, Bash, +when called as rbash, enters a restricted mode. See +The Restricted Shell, for a description of restricted mode.

                                                  -
                                                  --enable-select
                                                  -

                                                  Include the select compound command, which allows the generation of -simple menus (see Conditional Constructs). +

                                                  --enable-select
                                                  +

                                                  Include the select compound command, which allows the generation of +simple menus (see Conditional Constructs).

                                                  -
                                                  --enable-single-help-strings
                                                  -

                                                  Store the text displayed by the help builtin as a single string for +

                                                  --enable-single-help-strings
                                                  +

                                                  Store the text displayed by the help builtin as a single string for each help topic. This aids in translating the text to different languages. You may need to disable this if your compiler cannot handle very long string literals.

                                                  -
                                                  --enable-strict-posix-default
                                                  -

                                                  Make Bash POSIX-conformant by default (see Bash and POSIX). +

                                                  --enable-strict-posix-default
                                                  +

                                                  Make Bash POSIX-conformant by default (see Bash and POSIX).

                                                  -
                                                  --enable-translatable-strings
                                                  -

                                                  Enable support for $"string" translatable strings -(see Locale-Specific Translation). +

                                                  --enable-translatable-strings
                                                  +

                                                  Enable support for $"string" translatable strings +(see Locale-Specific Translation).

                                                  -
                                                  --enable-usg-echo-default
                                                  -

                                                  A synonym for --enable-xpg-echo-default. +

                                                  --enable-usg-echo-default
                                                  +

                                                  A synonym for --enable-xpg-echo-default.

                                                  -
                                                  --enable-xpg-echo-default
                                                  -

                                                  Make the echo builtin expand backslash-escaped characters by default, -without requiring the -e option. -This sets the default value of the xpg_echo shell option to on, -which makes the Bash echo behave more like the version specified in +

                                                  --enable-xpg-echo-default
                                                  +

                                                  Make the echo builtin expand backslash-escaped characters by default, +without requiring the -e option. +This sets the default value of the xpg_echo shell option to on, +which makes the Bash echo behave more like the version specified in the Single Unix Specification, version 3. -See Bash Builtin Commands, for a description of the escape sequences that -echo recognizes. +See Bash Builtin Commands, for a description of the escape sequences that +echo recognizes.

                                                  -

                                                  The file config-top.h contains C Preprocessor -‘#define’ statements for options which are not settable from -configure. +

                                                  The file config-top.h contains C Preprocessor +‘#define’ statements for options which are not settable from +configure. Some of these are not meant to be changed; beware of the consequences if you do. Read the comments associated with each definition for more @@ -14359,463 +14391,463 @@ information about its effect.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  Appendix A Reporting Bugs

                                                  +

                                                  Appendix A Reporting Bugs

                                                  Please report all bugs you find in Bash. But first, you should make sure that it really is a bug, and that it appears in the latest version of Bash. The latest version of Bash is always available for FTP from -ftp://ftp.gnu.org/pub/gnu/bash/ and from -http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz. +ftp://ftp.gnu.org/pub/gnu/bash/ and from +http://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-master.tar.gz.

                                                  Once you have determined that a bug actually exists, use the -bashbug command to submit a bug report or use the form at the -Bash project page. +bashbug command to submit a bug report or use the form at the +Bash project page. If you have a fix, you are encouraged to submit that as well! Suggestions and ‘philosophical’ bug reports may be mailed -to bug-bash@gnu.org or help-bash@gnu.org. +to or .

                                                  All bug reports should include: -

                                                    -
                                                  • The version number of Bash. -
                                                  • The hardware and operating system. -
                                                  • The compiler used to compile Bash. -
                                                  • A description of the bug behaviour. -
                                                  • A short script or ‘recipe’ which exercises the bug and may be used +

                                                      +
                                                    • The version number of Bash. +
                                                    • The hardware and operating system. +
                                                    • The compiler used to compile Bash. +
                                                    • A description of the bug behaviour. +
                                                    • A short script or ‘recipe’ which exercises the bug and may be used to reproduce it.
                                                    -

                                                    bashbug inserts the first three items automatically into +

                                                    bashbug inserts the first three items automatically into the template it provides for filing a bug report.

                                                    Please send all reports concerning this manual to -bug-bash@gnu.org. +.


                                                  -
                                                  -
                                                  +
                                                  + -

                                                  Appendix B Major Differences From The Bourne Shell

                                                  +

                                                  Appendix B Major Differences From The Bourne Shell

                                                  Bash implements essentially the same grammar, parameter and variable expansion, redirection, and quoting as the Bourne Shell. -Bash uses the POSIX standard as the specification of +Bash uses the POSIX standard as the specification of how these features are to be implemented. There are some differences between the traditional Bourne shell and Bash; this section quickly details the differences of significance. A number of these differences are explained in greater depth in previous sections. -This section uses the version of sh included in SVR4.2 (the +This section uses the version of sh included in SVR4.2 (the last version of the historical Bourne shell) as the baseline reference.

                                                  -
                                                    -
                                                  • Bash is POSIX-conformant, even where the POSIX specification -differs from traditional sh behavior (see Bash and POSIX). +
                                                      +
                                                    • Bash is POSIX-conformant, even where the POSIX specification +differs from traditional sh behavior (see Bash and POSIX). -
                                                    • Bash has multi-character invocation options (see Invoking Bash). +
                                                    • Bash has multi-character invocation options (see Invoking Bash). -
                                                    • Bash has command-line editing (see Command Line Editing) and -the bind builtin. +
                                                    • Bash has command-line editing (see Command Line Editing) and +the bind builtin. -
                                                    • Bash provides a programmable word completion mechanism -(see Programmable Completion), and builtin commands -complete, compgen, and compopt, to +
                                                    • Bash provides a programmable word completion mechanism +(see Programmable Completion), and builtin commands +complete, compgen, and compopt, to manipulate it. -
                                                    • Bash has command history (see Bash History Facilities) and the -history and fc builtins to manipulate it. +
                                                    • Bash has command history (see Bash History Facilities) and the +history and fc builtins to manipulate it. The Bash history list maintains timestamp information and uses the -value of the HISTTIMEFORMAT variable to display it. +value of the HISTTIMEFORMAT variable to display it. -
                                                    • Bash implements csh-like history expansion -(see History Expansion). +
                                                    • Bash implements csh-like history expansion +(see History Expansion). -
                                                    • Bash has one-dimensional array variables (see Arrays), and the +
                                                    • Bash has one-dimensional array variables (see Arrays), and the appropriate variable expansions and assignment syntax to use them. Several of the Bash builtins take options to act on arrays. Bash provides a number of built-in array variables. -
                                                    • The $'…' quoting syntax, which expands ANSI-C +
                                                    • The $'…' quoting syntax, which expands ANSI-C backslash-escaped characters in the text between the single quotes, -is supported (see ANSI-C Quoting). +is supported (see ANSI-C Quoting). -
                                                    • Bash supports the $"…" quoting syntax to do +
                                                    • Bash supports the $"…" quoting syntax to do locale-specific translation of the characters between the double -quotes. The -D, --dump-strings, and --dump-po-strings +quotes. The -D, --dump-strings, and --dump-po-strings invocation options list the translatable strings found in a script -(see Locale-Specific Translation). +(see Locale-Specific Translation). -
                                                    • Bash implements the ! keyword to negate the return value of -a pipeline (see Pipelines). -Very useful when an if statement needs to act only if a test fails. -The Bash ‘-o pipefail’ option to set will cause a pipeline to +
                                                    • Bash implements the ! keyword to negate the return value of +a pipeline (see Pipelines). +Very useful when an if statement needs to act only if a test fails. +The Bash ‘-o pipefail’ option to set will cause a pipeline to return a failure status if any command fails. -
                                                    • Bash has the time reserved word and command timing (see Pipelines). +
                                                    • Bash has the time reserved word and command timing (see Pipelines). The display of the timing statistics may be controlled with the -TIMEFORMAT variable. +TIMEFORMAT variable. -
                                                    • Bash implements the for (( expr1 ; expr2 ; expr3 )) -arithmetic for command, similar to the C language (see Looping Constructs). +
                                                    • Bash implements the for (( expr1 ; expr2 ; expr3 )) +arithmetic for command, similar to the C language (see Looping Constructs). -
                                                    • Bash includes the select compound command, which allows the -generation of simple menus (see Conditional Constructs). +
                                                    • Bash includes the select compound command, which allows the +generation of simple menus (see Conditional Constructs). -
                                                    • Bash includes the [[ compound command, which makes conditional -testing part of the shell grammar (see Conditional Constructs), including +
                                                    • Bash includes the [[ compound command, which makes conditional +testing part of the shell grammar (see Conditional Constructs), including optional regular expression matching. -
                                                    • Bash provides optional case-insensitive matching for the case and -[[ constructs. +
                                                    • Bash provides optional case-insensitive matching for the case and +[[ constructs. -
                                                    • Bash includes brace expansion (see Brace Expansion) and tilde -expansion (see Tilde Expansion). +
                                                    • Bash includes brace expansion (see Brace Expansion) and tilde +expansion (see Tilde Expansion). -
                                                    • Bash implements command aliases and the alias and unalias -builtins (see Aliases). +
                                                    • Bash implements command aliases and the alias and unalias +builtins (see Aliases). -
                                                    • Bash provides shell arithmetic, the (( compound command -(see Conditional Constructs), -and arithmetic expansion (see Shell Arithmetic). +
                                                    • Bash provides shell arithmetic, the (( compound command +(see Conditional Constructs), +and arithmetic expansion (see Shell Arithmetic). -
                                                    • Variables present in the shell’s initial environment are automatically +
                                                    • Variables present in the shell’s initial environment are automatically exported to child processes. The Bourne shell does not normally do -this unless the variables are explicitly marked using the export +this unless the variables are explicitly marked using the export command. -
                                                    • Bash supports the ‘+=’ assignment operator, which appends to the value +
                                                    • Bash supports the ‘+=’ assignment operator, which appends to the value of the variable named on the left hand side. -
                                                    • Bash includes the POSIX pattern removal ‘%’, ‘#’, ‘%%’ -and ‘##’ expansions to remove leading or trailing substrings from -variable values (see Shell Parameter Expansion). +
                                                    • Bash includes the POSIX pattern removal ‘%’, ‘#’, ‘%%’ +and ‘##’ expansions to remove leading or trailing substrings from +variable values (see Shell Parameter Expansion). -
                                                    • The expansion ${#xx}, which returns the length of ${xx}, -is supported (see Shell Parameter Expansion). +
                                                    • The expansion ${#xx}, which returns the length of ${xx}, +is supported (see Shell Parameter Expansion). -
                                                    • The expansion ${var:offset[:length]}, -which expands to the substring of var’s value of length -length, beginning at offset, is present -(see Shell Parameter Expansion). +
                                                    • The expansion ${var:offset[:length]}, +which expands to the substring of var’s value of length +length, beginning at offset, is present +(see Shell Parameter Expansion). -
                                                    • The expansion -${var/[/]pattern[/replacement]}, -which matches pattern and replaces it with replacement in -the value of var, is available (see Shell Parameter Expansion). +
                                                    • The expansion +${var/[/]pattern[/replacement]}, +which matches pattern and replaces it with replacement in +the value of var, is available (see Shell Parameter Expansion). -
                                                    • The expansion ${!prefix*} expansion, which expands to -the names of all shell variables whose names begin with prefix, -is available (see Shell Parameter Expansion). +
                                                    • The expansion ${!prefix*} expansion, which expands to +the names of all shell variables whose names begin with prefix, +is available (see Shell Parameter Expansion). -
                                                    • Bash has indirect variable expansion using ${!word} -(see Shell Parameter Expansion). +
                                                    • Bash has indirect variable expansion using ${!word} +(see Shell Parameter Expansion). -
                                                    • Bash can expand positional parameters beyond $9 using -${num}. +
                                                    • Bash can expand positional parameters beyond $9 using +${num}. -
                                                    • The POSIX $() form of command substitution -is implemented (see Command Substitution), -and preferred to the Bourne shell’s `` (which +
                                                    • The POSIX $() form of command substitution +is implemented (see Command Substitution), +and preferred to the Bourne shell’s `` (which is also implemented for backwards compatibility). -
                                                    • Bash has process substitution (see Process Substitution). +
                                                    • Bash has process substitution (see Process Substitution). -
                                                    • Bash automatically assigns variables that provide information about the -current user (UID, EUID, and GROUPS), the current host -(HOSTTYPE, OSTYPE, MACHTYPE, and HOSTNAME), -and the instance of Bash that is running (BASH, -BASH_VERSION, and BASH_VERSINFO). See Bash Variables, +
                                                    • Bash automatically assigns variables that provide information about the +current user (UID, EUID, and GROUPS), the current host +(HOSTTYPE, OSTYPE, MACHTYPE, and HOSTNAME), +and the instance of Bash that is running (BASH, +BASH_VERSION, and BASH_VERSINFO). See Bash Variables, for details. -
                                                    • The IFS variable is used to split only the results of expansion, -not all words (see Word Splitting). +
                                                    • The IFS variable is used to split only the results of expansion, +not all words (see Word Splitting). This closes a longstanding shell security hole. -
                                                    • The filename expansion bracket expression code uses ‘!’ and ‘^’ +
                                                    • The filename expansion bracket expression code uses ‘!’ and ‘^’ to negate the set of characters between the brackets. -The Bourne shell uses only ‘!’. +The Bourne shell uses only ‘!’. -
                                                    • Bash implements the full set of POSIX filename expansion operators, +
                                                    • Bash implements the full set of POSIX filename expansion operators, including character classes, equivalence classes, and -collating symbols (see Filename Expansion). +collating symbols (see Filename Expansion). -
                                                    • Bash implements extended pattern matching features when the extglob -shell option is enabled (see Pattern Matching). +
                                                    • Bash implements extended pattern matching features when the extglob +shell option is enabled (see Pattern Matching). -
                                                    • It is possible to have a variable and a function with the same name; -sh does not separate the two name spaces. +
                                                    • It is possible to have a variable and a function with the same name; +sh does not separate the two name spaces. -
                                                    • Bash functions are permitted to have local variables using the -local builtin, and thus useful recursive functions may be written -(see Bash Builtin Commands). +
                                                    • Bash functions are permitted to have local variables using the +local builtin, and thus useful recursive functions may be written +(see Bash Builtin Commands). -
                                                    • Variable assignments preceding commands affect only that command, even -builtins and functions (see Environment). -In sh, all variable assignments +
                                                    • Variable assignments preceding commands affect only that command, even +builtins and functions (see Environment). +In sh, all variable assignments preceding commands are global unless the command is executed from the file system. -
                                                    • Bash performs filename expansion on filenames specified as operands -to input and output redirection operators (see Redirections). +
                                                    • Bash performs filename expansion on filenames specified as operands +to input and output redirection operators (see Redirections). -
                                                    • Bash contains the ‘<>’ redirection operator, allowing a file to be -opened for both reading and writing, and the ‘&>’ redirection +
                                                    • Bash contains the ‘<>’ redirection operator, allowing a file to be +opened for both reading and writing, and the ‘&>’ redirection operator, for directing standard output and standard error to the same -file (see Redirections). +file (see Redirections). -
                                                    • Bash includes the ‘<<<’ redirection operator, allowing a string to +
                                                    • Bash includes the ‘<<<’ redirection operator, allowing a string to be used as the standard input to a command. -
                                                    • Bash implements the ‘[n]<&word’ and ‘[n]>&word’ +
                                                    • Bash implements the ‘[n]<&word’ and ‘[n]>&word’ redirection operators, which move one file descriptor to another. -
                                                    • Bash treats a number of filenames specially when they are -used in redirection operators (see Redirections). +
                                                    • Bash treats a number of filenames specially when they are +used in redirection operators (see Redirections). -
                                                    • Bash can open network connections to arbitrary machines and services -with the redirection operators (see Redirections). +
                                                    • Bash can open network connections to arbitrary machines and services +with the redirection operators (see Redirections). -
                                                    • The noclobber option is available to avoid overwriting existing -files with output redirection (see The Set Builtin). -The ‘>|’ redirection operator may be used to override noclobber. +
                                                    • The noclobber option is available to avoid overwriting existing +files with output redirection (see The Set Builtin). +The ‘>|’ redirection operator may be used to override noclobber. -
                                                    • The Bash cd and pwd builtins (see Bourne Shell Builtins) -each take -L and -P options to switch between logical and +
                                                    • The Bash cd and pwd builtins (see Bourne Shell Builtins) +each take -L and -P options to switch between logical and physical modes. -
                                                    • Bash allows a function to override a builtin with the same name, and provides +
                                                    • Bash allows a function to override a builtin with the same name, and provides access to that builtin’s functionality within the function via the -builtin and command builtins (see Bash Builtin Commands). +builtin and command builtins (see Bash Builtin Commands). -
                                                    • The command builtin allows selective disabling of functions -when command lookup is performed (see Bash Builtin Commands). +
                                                    • The command builtin allows selective disabling of functions +when command lookup is performed (see Bash Builtin Commands). -
                                                    • Individual builtins may be enabled or disabled using the enable -builtin (see Bash Builtin Commands). +
                                                    • Individual builtins may be enabled or disabled using the enable +builtin (see Bash Builtin Commands). -
                                                    • The Bash exec builtin takes additional options that allow users +
                                                    • The Bash exec builtin takes additional options that allow users to control the contents of the environment passed to the executed command, and what the zeroth argument to the command is to be -(see Bourne Shell Builtins). +(see Bourne Shell Builtins). -
                                                    • Shell functions may be exported to children via the environment -using export -f (see Shell Functions). +
                                                    • Shell functions may be exported to children via the environment +using export -f (see Shell Functions). -
                                                    • The Bash export, readonly, and declare builtins can -take a -f option to act on shell functions, a -p option to +
                                                    • The Bash export, readonly, and declare builtins can +take a -f option to act on shell functions, a -p option to display variables with various attributes set in a format that can be -used as shell input, a -n option to remove various variable -attributes, and ‘name=value’ arguments to set variable attributes +used as shell input, a -n option to remove various variable +attributes, and ‘name=value’ arguments to set variable attributes and values simultaneously. -
                                                    • The Bash hash builtin allows a name to be associated with +
                                                    • The Bash hash builtin allows a name to be associated with an arbitrary filename, even when that filename cannot be found by -searching the $PATH, using ‘hash -p’ -(see Bourne Shell Builtins). +searching the $PATH, using ‘hash -p’ +(see Bourne Shell Builtins). -
                                                    • Bash includes a help builtin for quick reference to shell -facilities (see Bash Builtin Commands). +
                                                    • Bash includes a help builtin for quick reference to shell +facilities (see Bash Builtin Commands). -
                                                    • The printf builtin is available to display formatted output -(see Bash Builtin Commands). +
                                                    • The printf builtin is available to display formatted output +(see Bash Builtin Commands). -
                                                    • The Bash read builtin (see Bash Builtin Commands) -will read a line ending in ‘\’ with -the -r option, and will use the REPLY variable as a +
                                                    • The Bash read builtin (see Bash Builtin Commands) +will read a line ending in ‘\’ with +the -r option, and will use the REPLY variable as a default if no non-option arguments are supplied. -The Bash read builtin -also accepts a prompt string with the -p option and will use -Readline to obtain the line when given the -e or -E +The Bash read builtin +also accepts a prompt string with the -p option and will use +Readline to obtain the line when given the -e or -E options. -The read builtin also has additional options to control input: -the -s option will turn off echoing of input characters as -they are read, the -t option will allow read to time out +The read builtin also has additional options to control input: +the -s option will turn off echoing of input characters as +they are read, the -t option will allow read to time out if input does not arrive within a specified number of seconds, the --n option will allow reading only a specified number of -characters rather than a full line, and the -d option will read +-n option will allow reading only a specified number of +characters rather than a full line, and the -d option will read until a particular character rather than newline. -
                                                    • The return builtin may be used to abort execution of scripts -executed with the . or source builtins -(see Bourne Shell Builtins). +
                                                    • The return builtin may be used to abort execution of scripts +executed with the . or source builtins +(see Bourne Shell Builtins). -
                                                    • Bash includes the shopt builtin, for finer control of shell -optional capabilities (see The Shopt Builtin), and allows these options -to be set and unset at shell invocation (see Invoking Bash). +
                                                    • Bash includes the shopt builtin, for finer control of shell +optional capabilities (see The Shopt Builtin), and allows these options +to be set and unset at shell invocation (see Invoking Bash). -
                                                    • Bash has much more optional behavior controllable with the set -builtin (see The Set Builtin). +
                                                    • Bash has much more optional behavior controllable with the set +builtin (see The Set Builtin). -
                                                    • The ‘-x’ (xtrace) option displays commands other than +
                                                    • The ‘-x’ (xtrace) option displays commands other than simple commands when performing an execution trace -(see The Set Builtin). +(see The Set Builtin). -
                                                    • The test builtin (see Bourne Shell Builtins) -is slightly different, as it implements the POSIX algorithm, +
                                                    • The test builtin (see Bourne Shell Builtins) +is slightly different, as it implements the POSIX algorithm, which specifies the behavior based on the number of arguments. -
                                                    • Bash includes the caller builtin, which displays the context of +
                                                    • Bash includes the caller builtin, which displays the context of any active subroutine call (a shell function or a script executed with -the . or source builtins). This supports the Bash +the . or source builtins). This supports the Bash debugger. -
                                                    • The trap builtin (see Bourne Shell Builtins) allows a -DEBUG pseudo-signal specification, similar to EXIT. -Commands specified with a DEBUG trap are executed before every -simple command, for command, case command, -select command, every arithmetic for command, and before +
                                                    • The trap builtin (see Bourne Shell Builtins) allows a +DEBUG pseudo-signal specification, similar to EXIT. +Commands specified with a DEBUG trap are executed before every +simple command, for command, case command, +select command, every arithmetic for command, and before the first command executes in a shell function. -The DEBUG trap is not inherited by shell functions unless the -function has been given the trace attribute or the -functrace option has been enabled using the shopt builtin. -The extdebug shell option has additional effects on the -DEBUG trap. - -

                                                      The trap builtin (see Bourne Shell Builtins) allows an -ERR pseudo-signal specification, similar to EXIT and DEBUG. -Commands specified with an ERR trap are executed after a simple +The DEBUG trap is not inherited by shell functions unless the +function has been given the trace attribute or the +functrace option has been enabled using the shopt builtin. +The extdebug shell option has additional effects on the +DEBUG trap. + +

                                                      The trap builtin (see Bourne Shell Builtins) allows an +ERR pseudo-signal specification, similar to EXIT and DEBUG. +Commands specified with an ERR trap are executed after a simple command fails, with a few exceptions. -The ERR trap is not inherited by shell functions unless the --o errtrace option to the set builtin is enabled. +The ERR trap is not inherited by shell functions unless the +-o errtrace option to the set builtin is enabled.

                                                      -

                                                      The trap builtin (see Bourne Shell Builtins) allows a -RETURN pseudo-signal specification, similar to -EXIT and DEBUG. -Commands specified with a RETURN trap are executed before +

                                                      The trap builtin (see Bourne Shell Builtins) allows a +RETURN pseudo-signal specification, similar to +EXIT and DEBUG. +Commands specified with a RETURN trap are executed before execution resumes after a shell function or a shell script executed with -. or source returns. -The RETURN trap is not inherited by shell functions unless the -function has been given the trace attribute or the -functrace option has been enabled using the shopt builtin. +. or source returns. +The RETURN trap is not inherited by shell functions unless the +function has been given the trace attribute or the +functrace option has been enabled using the shopt builtin.

                                                      -
                                                    • The Bash type builtin is more extensive and gives more information -about the names it finds (see Bash Builtin Commands). +
                                                    • The Bash type builtin is more extensive and gives more information +about the names it finds (see Bash Builtin Commands). -
                                                    • The Bash umask builtin permits a -p option to cause -the output to be displayed in the form of a umask command -that may be reused as input (see Bourne Shell Builtins). +
                                                    • The Bash umask builtin permits a -p option to cause +the output to be displayed in the form of a umask command +that may be reused as input (see Bourne Shell Builtins). -
                                                    • Bash implements a csh-like directory stack, and provides the -pushd, popd, and dirs builtins to manipulate it -(see The Directory Stack). +
                                                    • Bash implements a csh-like directory stack, and provides the +pushd, popd, and dirs builtins to manipulate it +(see The Directory Stack). Bash also makes the directory stack visible as the value of the -DIRSTACK shell variable. +DIRSTACK shell variable. -
                                                    • Bash interprets special backslash-escaped characters in the prompt -strings when interactive (see Controlling the Prompt). +
                                                    • Bash interprets special backslash-escaped characters in the prompt +strings when interactive (see Controlling the Prompt). -
                                                    • The Bash restricted mode is more useful (see The Restricted Shell); +
                                                    • The Bash restricted mode is more useful (see The Restricted Shell); the SVR4.2 shell restricted mode is too limited. -
                                                    • The disown builtin can remove a job from the internal shell -job table (see Job Control Builtins) or suppress the sending -of SIGHUP to a job when the shell exits as the result of a -SIGHUP. +
                                                    • The disown builtin can remove a job from the internal shell +job table (see Job Control Builtins) or suppress the sending +of SIGHUP to a job when the shell exits as the result of a +SIGHUP. -
                                                    • Bash includes a number of features to support a separate debugger for +
                                                    • Bash includes a number of features to support a separate debugger for shell scripts. -
                                                    • The SVR4.2 shell has two privilege-related builtins -(mldmode and priv) not present in Bash. +
                                                    • The SVR4.2 shell has two privilege-related builtins +(mldmode and priv) not present in Bash. -
                                                    • Bash does not have the stop or newgrp builtins. +
                                                    • Bash does not have the stop or newgrp builtins. -
                                                    • Bash does not use the SHACCT variable or perform shell accounting. +
                                                    • Bash does not use the SHACCT variable or perform shell accounting. -
                                                    • The SVR4.2 sh uses a TIMEOUT variable like Bash uses -TMOUT. +
                                                    • The SVR4.2 sh uses a TIMEOUT variable like Bash uses +TMOUT.
                                                    -

                                                    More features unique to Bash may be found in Bash Features. +

                                                    More features unique to Bash may be found in Bash Features.

                                                    -
                                                      + -
                                                      -

                                                      B.1 Implementation Differences From The SVR4.2 Shell

                                                      +
                                                      +

                                                      B.1 Implementation Differences From The SVR4.2 Shell

                                                      Since Bash is a completely new implementation, it does not suffer from many of the limitations of the SVR4.2 shell. For instance:

                                                      -
                                                        -
                                                      • Bash does not fork a subshell when redirecting into or out of -a shell control structure such as an if or while +
                                                          +
                                                        • Bash does not fork a subshell when redirecting into or out of +a shell control structure such as an if or while statement. -
                                                        • Bash does not allow unbalanced quotes. The SVR4.2 shell will silently -insert a needed closing quote at EOF under certain circumstances. +
                                                        • Bash does not allow unbalanced quotes. The SVR4.2 shell will silently +insert a needed closing quote at EOF under certain circumstances. This can be the cause of some hard-to-find errors. -
                                                        • The SVR4.2 shell uses a baroque memory management scheme based on -trapping SIGSEGV. If the shell is started from a process with -SIGSEGV blocked (e.g., by using the system() C library +
                                                        • The SVR4.2 shell uses a baroque memory management scheme based on +trapping SIGSEGV. If the shell is started from a process with +SIGSEGV blocked (e.g., by using the system() C library function call), it misbehaves badly. -
                                                        • In a questionable attempt at security, the SVR4.2 shell, -when invoked without the -p option, will alter its real -and effective UID and GID if they are less than some +
                                                        • In a questionable attempt at security, the SVR4.2 shell, +when invoked without the -p option, will alter its real +and effective UID and GID if they are less than some magic threshold value, commonly 100. This can lead to unexpected results. -
                                                        • The SVR4.2 shell does not allow users to trap SIGSEGV, -SIGALRM, or SIGCHLD. +
                                                        • The SVR4.2 shell does not allow users to trap SIGSEGV, +SIGALRM, or SIGCHLD. -
                                                        • The SVR4.2 shell does not allow the IFS, MAILCHECK, -PATH, PS1, or PS2 variables to be unset. +
                                                        • The SVR4.2 shell does not allow the IFS, MAILCHECK, +PATH, PS1, or PS2 variables to be unset. -
                                                        • The SVR4.2 shell treats ‘^’ as the undocumented equivalent of -‘|’. +
                                                        • The SVR4.2 shell treats ‘^’ as the undocumented equivalent of +‘|’. -
                                                        • Bash allows multiple option arguments when it is invoked (-x -v); -the SVR4.2 shell allows only one option argument (-xv). In +
                                                        • Bash allows multiple option arguments when it is invoked (-x -v); +the SVR4.2 shell allows only one option argument (-xv). In fact, some versions of the shell dump core if the second argument begins -with a ‘-’. +with a ‘-’. -
                                                        • The SVR4.2 shell exits a script if any builtin fails; Bash exits -a script only if one of the POSIX special builtins fails, and -only for certain failures, as enumerated in the POSIX standard. +
                                                        • The SVR4.2 shell exits a script if any builtin fails; Bash exits +a script only if one of the POSIX special builtins fails, and +only for certain failures, as enumerated in the POSIX standard. -
                                                        • The SVR4.2 shell behaves differently when invoked as jsh +
                                                        • The SVR4.2 shell behaves differently when invoked as jsh (it turns on job control).

                                                      -
                                                      -
                                                      +
                                                      + -

                                                      Appendix C GNU Free Documentation License

                                                      +

                                                      Appendix C GNU Free Documentation License

                                                      -
                                                      Version 1.3, 3 November 2008 +
                                                      Version 1.3, 3 November 2008
                                                      -
                                                      Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
                                                      -http://fsf.org/
                                                      +
                                                      Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
                                                      +http://fsf.org/
                                                       
                                                       Everyone is permitted to copy and distribute verbatim copies
                                                       of this license document, but changing it is not allowed.
                                                       
                                                      -
                                                        +
                                                        1. PREAMBLE

                                                          The purpose of this License is to make a manual, textbook, or other -functional and useful document free in the sense of freedom: to +functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way @@ -14889,16 +14921,16 @@ An image format is not Transparent if used for any substantial amount of text. A copy that is not “Transparent” is called “Opaque”.

                                                          Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input -format, SGML or XML using a publicly available -DTD, and standard-conforming simple HTML, -PostScript or PDF designed for human modification. Examples -of transparent image formats include PNG, XCF and -JPG. Opaque formats include proprietary formats that can be -read and edited only by proprietary word processors, SGML or -XML for which the DTD and/or processing tools are -not generally available, and the machine-generated HTML, -PostScript or PDF produced by some word processors for +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for output purposes only.

                                                          The “Title Page” means, for a printed book, the title page itself, @@ -14987,7 +15019,7 @@ Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

                                                          -
                                                            +
                                                            1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section @@ -15187,7 +15219,7 @@ not give you any rights to use it. of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -http://www.gnu.org/copyleft/. +http://www.gnu.org/copyleft/.

                                                              Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this @@ -15233,30 +15265,30 @@ provided the MMC is eligible for relicensing.

                                                            -

                                                            ADDENDUM: How to use this License for your documents

                                                            +

                                                            ADDENDUM: How to use this License for your documents

                                                            To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:

                                                            -
                                                            -
                                                              Copyright (C)  year  your name.
                                                            +
                                                            +
                                                              Copyright (C)  year  your name.
                                                               Permission is granted to copy, distribute and/or modify this document
                                                               under the terms of the GNU Free Documentation License, Version 1.3
                                                               or any later version published by the Free Software Foundation;
                                                               with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
                                                               Texts.  A copy of the license is included in the section entitled ``GNU
                                                               Free Documentation License''.
                                                            -
                                                            +

                                                      If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with…Texts.” line with this:

                                                      -
                                                      -
                                                          with the Invariant Sections being list their titles, with
                                                      -    the Front-Cover Texts being list, and with the Back-Cover Texts
                                                      -    being list.
                                                      -
                                                      +
                                                      +
                                                          with the Invariant Sections being list their titles, with
                                                      +    the Front-Cover Texts being list, and with the Back-Cover Texts
                                                      +    being list.
                                                      +

                                                      If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the @@ -15271,15 +15303,15 @@ to permit their use in free software.


                                                      -
                                                      -
                                                      +
                                                      + -

                                                      Appendix D Indexes

                                                      +

                                                      Appendix D Indexes

                                                      -
                                                        +
                                                        -
                                                        -
                                                        +
                                                        + -

                                                        D.1 Index of Shell Builtin Commands

                                                        -
                                                        Jump to:   . +

                                                        D.1 Index of Shell Builtin Commands

                                                        +
                                                        +
                                                        Jump to:   :   -: +.   -[ +[  
                                                        -A +A   -B +B   -C +C   -D +D   -E +E   -F +F   -G +G   -H +H   -J +J   -K +K   -L +L   -M +M   -P +P   -R +R   -S +S   -T +T   -U +U   -W +W  
                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
                                                        Index Entry  Section

                                                        .
                                                        .: Bourne Shell Builtins

                                                        :
                                                        :: Bourne Shell Builtins

                                                        [
                                                        [: Bourne Shell Builtins

                                                        A
                                                        alias: Bash Builtins

                                                        B
                                                        bg: Job Control Builtins
                                                        bind: Bash Builtins
                                                        break: Bourne Shell Builtins
                                                        builtin: Bash Builtins

                                                        C
                                                        caller: Bash Builtins
                                                        cd: Bourne Shell Builtins
                                                        command: Bash Builtins
                                                        compgen: Programmable Completion Builtins
                                                        complete: Programmable Completion Builtins
                                                        compopt: Programmable Completion Builtins
                                                        continue: Bourne Shell Builtins

                                                        D
                                                        declare: Bash Builtins
                                                        dirs: Directory Stack Builtins
                                                        disown: Job Control Builtins

                                                        E
                                                        echo: Bash Builtins
                                                        enable: Bash Builtins
                                                        eval: Bourne Shell Builtins
                                                        exec: Bourne Shell Builtins
                                                        exit: Bourne Shell Builtins
                                                        export: Bourne Shell Builtins

                                                        F
                                                        false: Bourne Shell Builtins
                                                        fc: Bash History Builtins
                                                        fg: Job Control Builtins

                                                        G
                                                        getopts: Bourne Shell Builtins

                                                        H
                                                        hash: Bourne Shell Builtins
                                                        help: Bash Builtins
                                                        history: Bash History Builtins

                                                        J
                                                        jobs: Job Control Builtins

                                                        K
                                                        kill: Job Control Builtins

                                                        L
                                                        let: Bash Builtins
                                                        local: Bash Builtins
                                                        logout: Bash Builtins

                                                        M
                                                        mapfile: Bash Builtins

                                                        P
                                                        popd: Directory Stack Builtins
                                                        printf: Bash Builtins
                                                        pushd: Directory Stack Builtins
                                                        pwd: Bourne Shell Builtins

                                                        R
                                                        read: Bash Builtins
                                                        readarray: Bash Builtins
                                                        readonly: Bourne Shell Builtins
                                                        return: Bourne Shell Builtins

                                                        S
                                                        set: The Set Builtin
                                                        shift: Bourne Shell Builtins
                                                        shopt: The Shopt Builtin
                                                        source: Bash Builtins
                                                        suspend: Job Control Builtins

                                                        T
                                                        test: Bourne Shell Builtins
                                                        times: Bourne Shell Builtins
                                                        trap: Bourne Shell Builtins
                                                        true: Bourne Shell Builtins
                                                        type: Bash Builtins
                                                        typeset: Bash Builtins

                                                        U
                                                        ulimit: Bash Builtins
                                                        umask: Bourne Shell Builtins
                                                        unalias: Bash Builtins
                                                        unset: Bourne Shell Builtins

                                                        W
                                                        wait: Job Control Builtins

                                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                        Index EntrySection

                                                        :
                                                        :Bourne Shell Builtins

                                                        .
                                                        .Bourne Shell Builtins

                                                        [
                                                        [Bourne Shell Builtins

                                                        A
                                                        aliasBash Builtins

                                                        B
                                                        bgJob Control Builtins
                                                        bindBash Builtins
                                                        breakBourne Shell Builtins
                                                        builtinBash Builtins

                                                        C
                                                        callerBash Builtins
                                                        cdBourne Shell Builtins
                                                        commandBash Builtins
                                                        compgenProgrammable Completion Builtins
                                                        completeProgrammable Completion Builtins
                                                        compoptProgrammable Completion Builtins
                                                        continueBourne Shell Builtins

                                                        D
                                                        declareBash Builtins
                                                        dirsDirectory Stack Builtins
                                                        disownJob Control Builtins

                                                        E
                                                        echoBash Builtins
                                                        enableBash Builtins
                                                        evalBourne Shell Builtins
                                                        execBourne Shell Builtins
                                                        exitBourne Shell Builtins
                                                        exportBourne Shell Builtins

                                                        F
                                                        falseBourne Shell Builtins
                                                        fcBash History Builtins
                                                        fgJob Control Builtins

                                                        G
                                                        getoptsBourne Shell Builtins

                                                        H
                                                        hashBourne Shell Builtins
                                                        helpBash Builtins
                                                        historyBash History Builtins

                                                        J
                                                        jobsJob Control Builtins

                                                        K
                                                        killJob Control Builtins

                                                        L
                                                        letBash Builtins
                                                        localBash Builtins
                                                        logoutBash Builtins

                                                        M
                                                        mapfileBash Builtins

                                                        P
                                                        popdDirectory Stack Builtins
                                                        printfBash Builtins
                                                        pushdDirectory Stack Builtins
                                                        pwdBourne Shell Builtins

                                                        R
                                                        readBash Builtins
                                                        readarrayBash Builtins
                                                        readonlyBourne Shell Builtins
                                                        returnBourne Shell Builtins

                                                        S
                                                        setThe Set Builtin
                                                        shiftBourne Shell Builtins
                                                        shoptThe Shopt Builtin
                                                        sourceBash Builtins
                                                        suspendJob Control Builtins

                                                        T
                                                        testBourne Shell Builtins
                                                        timesBourne Shell Builtins
                                                        trapBourne Shell Builtins
                                                        trueBourne Shell Builtins
                                                        typeBash Builtins
                                                        typesetBash Builtins

                                                        U
                                                        ulimitBash Builtins
                                                        umaskBourne Shell Builtins
                                                        unaliasBash Builtins
                                                        unsetBourne Shell Builtins

                                                        W
                                                        waitJob Control Builtins

                                                        -
                                                        Jump to:   . + +
                                                        -
                                                        -
                                                        +
                                                        + -

                                                        D.2 Index of Shell Reserved Words

                                                        -
                                                        Jump to:   ! +

                                                        D.2 Index of Shell Reserved Words

                                                        +
                                                        +
                                                        Jump to:   !   -[ +[   -] +]   -{ +{   -} +}  
                                                        -C +C   -D +D   -E +E   -F +F   -I +I   -S +S   -T +T   -U +U   -W +W  
                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
                                                        Index Entry  Section

                                                        !
                                                        !: Pipelines

                                                        [
                                                        [[: Conditional Constructs

                                                        ]
                                                        ]]: Conditional Constructs

                                                        {
                                                        {: Command Grouping

                                                        }
                                                        }: Command Grouping

                                                        C
                                                        case: Conditional Constructs

                                                        D
                                                        do: Looping Constructs
                                                        done: Looping Constructs

                                                        E
                                                        elif: Conditional Constructs
                                                        else: Conditional Constructs
                                                        esac: Conditional Constructs

                                                        F
                                                        fi: Conditional Constructs
                                                        for: Looping Constructs
                                                        function: Shell Functions

                                                        I
                                                        if: Conditional Constructs
                                                        in: Conditional Constructs

                                                        S
                                                        select: Conditional Constructs

                                                        T
                                                        then: Conditional Constructs
                                                        time: Pipelines

                                                        U
                                                        until: Looping Constructs

                                                        W
                                                        while: Looping Constructs

                                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                        Index EntrySection

                                                        !
                                                        !Pipelines

                                                        [
                                                        [[Conditional Constructs

                                                        ]
                                                        ]]Conditional Constructs

                                                        {
                                                        {Command Grouping

                                                        }
                                                        }Command Grouping

                                                        C
                                                        caseConditional Constructs

                                                        D
                                                        doLooping Constructs
                                                        doneLooping Constructs

                                                        E
                                                        elifConditional Constructs
                                                        elseConditional Constructs
                                                        esacConditional Constructs

                                                        F
                                                        fiConditional Constructs
                                                        forLooping Constructs
                                                        functionShell Functions

                                                        I
                                                        ifConditional Constructs
                                                        inConditional Constructs

                                                        S
                                                        selectConditional Constructs

                                                        T
                                                        thenConditional Constructs
                                                        timePipelines

                                                        U
                                                        untilLooping Constructs

                                                        W
                                                        whileLooping Constructs

                                                        -
                                                        Jump to:   ! + +
                                                        -
                                                        -
                                                        +
                                                        + -

                                                        D.3 Parameter and Variable Index

                                                        -
                                                        Jump to:   ! +

                                                        D.3 Parameter and Variable Index

                                                        +
                                                        +
                                                        Jump to:   _   -# +-   -$ +!   -* +?   -- +@   -0 +*   -? +#   -@ +$   -_ +0  
                                                        -A +A   -B +B   -C +C   -D +D   -E +E   -F +F   -G +G   -H +H   -I +I   -K +K   -L +L   -M +M   -O +O   -P +P   -R +R   -S +S   -T +T   -U +U   -V +V  
                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
                                                        Index Entry  Section

                                                        !
                                                        !: Special Parameters

                                                        #
                                                        #: Special Parameters

                                                        $
                                                        $: Special Parameters
                                                        $!: Special Parameters
                                                        $#: Special Parameters
                                                        $$: Special Parameters
                                                        $*: Special Parameters
                                                        $-: Special Parameters
                                                        $0: Special Parameters
                                                        $?: Special Parameters
                                                        $@: Special Parameters
                                                        $_: Bash Variables

                                                        *
                                                        *: Special Parameters

                                                        -
                                                        -: Special Parameters

                                                        0
                                                        0: Special Parameters

                                                        ?
                                                        ?: Special Parameters

                                                        @
                                                        @: Special Parameters

                                                        _
                                                        _: Bash Variables

                                                        A
                                                        active-region-end-color: Readline Init File Syntax
                                                        active-region-start-color: Readline Init File Syntax
                                                        auto_resume: Job Control Variables

                                                        B
                                                        BASH: Bash Variables
                                                        BASHOPTS: Bash Variables
                                                        BASHPID: Bash Variables
                                                        BASH_ALIASES: Bash Variables
                                                        BASH_ARGC: Bash Variables
                                                        BASH_ARGV: Bash Variables
                                                        BASH_ARGV0: Bash Variables
                                                        BASH_CMDS: Bash Variables
                                                        BASH_COMMAND: Bash Variables
                                                        BASH_COMPAT: Bash Variables
                                                        BASH_ENV: Bash Variables
                                                        BASH_EXECUTION_STRING: Bash Variables
                                                        BASH_LINENO: Bash Variables
                                                        BASH_LOADABLES_PATH: Bash Variables
                                                        BASH_MONOSECONDS: Bash Variables
                                                        BASH_REMATCH: Bash Variables
                                                        BASH_SOURCE: Bash Variables
                                                        BASH_SUBSHELL: Bash Variables
                                                        BASH_TRAPSIG: Bash Variables
                                                        BASH_VERSINFO: Bash Variables
                                                        BASH_VERSION: Bash Variables
                                                        BASH_XTRACEFD: Bash Variables
                                                        bell-style: Readline Init File Syntax
                                                        bind-tty-special-chars: Readline Init File Syntax
                                                        blink-matching-paren: Readline Init File Syntax

                                                        C
                                                        CDPATH: Bourne Shell Variables
                                                        CHILD_MAX: Bash Variables
                                                        colored-completion-prefix: Readline Init File Syntax
                                                        colored-stats: Readline Init File Syntax
                                                        COLUMNS: Bash Variables
                                                        comment-begin: Readline Init File Syntax
                                                        completion-display-width: Readline Init File Syntax
                                                        completion-ignore-case: Readline Init File Syntax
                                                        completion-map-case: Readline Init File Syntax
                                                        completion-prefix-display-length: Readline Init File Syntax
                                                        completion-query-items: Readline Init File Syntax
                                                        COMPREPLY: Bash Variables
                                                        COMP_CWORD: Bash Variables
                                                        COMP_KEY: Bash Variables
                                                        COMP_LINE: Bash Variables
                                                        COMP_POINT: Bash Variables
                                                        COMP_TYPE: Bash Variables
                                                        COMP_WORDBREAKS: Bash Variables
                                                        COMP_WORDS: Bash Variables
                                                        convert-meta: Readline Init File Syntax
                                                        COPROC: Bash Variables

                                                        D
                                                        DIRSTACK: Bash Variables
                                                        disable-completion: Readline Init File Syntax

                                                        E
                                                        echo-control-characters: Readline Init File Syntax
                                                        editing-mode: Readline Init File Syntax
                                                        EMACS: Bash Variables
                                                        emacs-mode-string: Readline Init File Syntax
                                                        enable-active-region: Readline Init File Syntax
                                                        enable-bracketed-paste: Readline Init File Syntax
                                                        enable-keypad: Readline Init File Syntax
                                                        ENV: Bash Variables
                                                        EPOCHREALTIME: Bash Variables
                                                        EPOCHSECONDS: Bash Variables
                                                        EUID: Bash Variables
                                                        EXECIGNORE: Bash Variables
                                                        expand-tilde: Readline Init File Syntax

                                                        F
                                                        FCEDIT: Bash Variables
                                                        FIGNORE: Bash Variables
                                                        FUNCNAME: Bash Variables
                                                        FUNCNEST: Bash Variables

                                                        G
                                                        GLOBIGNORE: Bash Variables
                                                        GLOBSORT: Bash Variables
                                                        GROUPS: Bash Variables

                                                        H
                                                        histchars: Bash Variables
                                                        HISTCMD: Bash Variables
                                                        HISTCONTROL: Bash Variables
                                                        HISTFILE: Bash Variables
                                                        HISTFILESIZE: Bash Variables
                                                        HISTIGNORE: Bash Variables
                                                        history-preserve-point: Readline Init File Syntax
                                                        history-size: Readline Init File Syntax
                                                        HISTSIZE: Bash Variables
                                                        HISTTIMEFORMAT: Bash Variables
                                                        HOME: Bourne Shell Variables
                                                        horizontal-scroll-mode: Readline Init File Syntax
                                                        HOSTFILE: Bash Variables
                                                        HOSTNAME: Bash Variables
                                                        HOSTTYPE: Bash Variables

                                                        I
                                                        IFS: Bourne Shell Variables
                                                        IGNOREEOF: Bash Variables
                                                        input-meta: Readline Init File Syntax
                                                        INPUTRC: Bash Variables
                                                        INSIDE_EMACS: Bash Variables
                                                        isearch-terminators: Readline Init File Syntax

                                                        K
                                                        keymap: Readline Init File Syntax

                                                        L
                                                        LANG: Creating Internationalized Scripts
                                                        LANG: Bash Variables
                                                        LC_ALL: Bash Variables
                                                        LC_COLLATE: Bash Variables
                                                        LC_CTYPE: Bash Variables
                                                        LC_MESSAGES: Creating Internationalized Scripts
                                                        LC_MESSAGES: Bash Variables
                                                        LC_NUMERIC: Bash Variables
                                                        LC_TIME: Bash Variables
                                                        LINENO: Bash Variables
                                                        LINES: Bash Variables

                                                        M
                                                        MACHTYPE: Bash Variables
                                                        MAIL: Bourne Shell Variables
                                                        MAILCHECK: Bash Variables
                                                        MAILPATH: Bourne Shell Variables
                                                        MAPFILE: Bash Variables
                                                        mark-modified-lines: Readline Init File Syntax
                                                        mark-symlinked-directories: Readline Init File Syntax
                                                        match-hidden-files: Readline Init File Syntax
                                                        menu-complete-display-prefix: Readline Init File Syntax
                                                        meta-flag: Readline Init File Syntax

                                                        O
                                                        OLDPWD: Bash Variables
                                                        OPTARG: Bourne Shell Variables
                                                        OPTERR: Bash Variables
                                                        OPTIND: Bourne Shell Variables
                                                        OSTYPE: Bash Variables
                                                        output-meta: Readline Init File Syntax

                                                        P
                                                        page-completions: Readline Init File Syntax
                                                        PATH: Bourne Shell Variables
                                                        PIPESTATUS: Bash Variables
                                                        POSIXLY_CORRECT: Bash Variables
                                                        PPID: Bash Variables
                                                        PROMPT_COMMAND: Bash Variables
                                                        PROMPT_DIRTRIM: Bash Variables
                                                        PS0: Bash Variables
                                                        PS1: Bourne Shell Variables
                                                        PS2: Bourne Shell Variables
                                                        PS3: Bash Variables
                                                        PS4: Bash Variables
                                                        PWD: Bash Variables

                                                        R
                                                        RANDOM: Bash Variables
                                                        READLINE_ARGUMENT: Bash Variables
                                                        READLINE_LINE: Bash Variables
                                                        READLINE_MARK: Bash Variables
                                                        READLINE_POINT: Bash Variables
                                                        REPLY: Bash Variables
                                                        revert-all-at-newline: Readline Init File Syntax

                                                        S
                                                        search-ignore-case: Readline Init File Syntax
                                                        SECONDS: Bash Variables
                                                        SHELL: Bash Variables
                                                        SHELLOPTS: Bash Variables
                                                        SHLVL: Bash Variables
                                                        show-all-if-ambiguous: Readline Init File Syntax
                                                        show-all-if-unmodified: Readline Init File Syntax
                                                        show-mode-in-prompt: Readline Init File Syntax
                                                        skip-completed-text: Readline Init File Syntax
                                                        SRANDOM: Bash Variables

                                                        T
                                                        TEXTDOMAIN: Creating Internationalized Scripts
                                                        TEXTDOMAINDIR: Creating Internationalized Scripts
                                                        TIMEFORMAT: Bash Variables
                                                        TMOUT: Bash Variables
                                                        TMPDIR: Bash Variables

                                                        U
                                                        UID: Bash Variables

                                                        V
                                                        vi-cmd-mode-string: Readline Init File Syntax
                                                        vi-ins-mode-string: Readline Init File Syntax
                                                        visible-stats: Readline Init File Syntax

                                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                        Index EntrySection

                                                        _
                                                        _Bash Variables

                                                        -
                                                        -Special Parameters

                                                        !
                                                        !Special Parameters

                                                        ?
                                                        ?Special Parameters

                                                        @
                                                        @Special Parameters

                                                        *
                                                        *Special Parameters

                                                        #
                                                        #Special Parameters

                                                        $
                                                        $Special Parameters
                                                        $_Bash Variables
                                                        $-Special Parameters
                                                        $!Special Parameters
                                                        $?Special Parameters
                                                        $@Special Parameters
                                                        $*Special Parameters
                                                        $#Special Parameters
                                                        $$Special Parameters
                                                        $0Special Parameters

                                                        0
                                                        0Special Parameters

                                                        A
                                                        active-region-end-colorReadline Init File Syntax
                                                        active-region-start-colorReadline Init File Syntax
                                                        auto_resumeJob Control Variables

                                                        B
                                                        BASHBash Variables
                                                        BASH_ALIASESBash Variables
                                                        BASH_ARGCBash Variables
                                                        BASH_ARGVBash Variables
                                                        BASH_ARGV0Bash Variables
                                                        BASH_CMDSBash Variables
                                                        BASH_COMMANDBash Variables
                                                        BASH_COMPATBash Variables
                                                        BASH_ENVBash Variables
                                                        BASH_EXECUTION_STRINGBash Variables
                                                        BASH_LINENOBash Variables
                                                        BASH_LOADABLES_PATHBash Variables
                                                        BASH_MONOSECONDSBash Variables
                                                        BASH_REMATCHBash Variables
                                                        BASH_SOURCEBash Variables
                                                        BASH_SUBSHELLBash Variables
                                                        BASH_TRAPSIGBash Variables
                                                        BASH_VERSINFOBash Variables
                                                        BASH_VERSIONBash Variables
                                                        BASH_XTRACEFDBash Variables
                                                        BASHOPTSBash Variables
                                                        BASHPIDBash Variables
                                                        bell-styleReadline Init File Syntax
                                                        bind-tty-special-charsReadline Init File Syntax
                                                        blink-matching-parenReadline Init File Syntax

                                                        C
                                                        CDPATHBourne Shell Variables
                                                        CHILD_MAXBash Variables
                                                        colored-completion-prefixReadline Init File Syntax
                                                        colored-statsReadline Init File Syntax
                                                        COLUMNSBash Variables
                                                        comment-beginReadline Init File Syntax
                                                        COMP_CWORDBash Variables
                                                        COMP_KEYBash Variables
                                                        COMP_LINEBash Variables
                                                        COMP_POINTBash Variables
                                                        COMP_TYPEBash Variables
                                                        COMP_WORDBREAKSBash Variables
                                                        COMP_WORDSBash Variables
                                                        completion-display-widthReadline Init File Syntax
                                                        completion-ignore-caseReadline Init File Syntax
                                                        completion-map-caseReadline Init File Syntax
                                                        completion-prefix-display-lengthReadline Init File Syntax
                                                        completion-query-itemsReadline Init File Syntax
                                                        COMPREPLYBash Variables
                                                        convert-metaReadline Init File Syntax
                                                        COPROCBash Variables

                                                        D
                                                        DIRSTACKBash Variables
                                                        disable-completionReadline Init File Syntax

                                                        E
                                                        echo-control-charactersReadline Init File Syntax
                                                        editing-modeReadline Init File Syntax
                                                        EMACSBash Variables
                                                        emacs-mode-stringReadline Init File Syntax
                                                        enable-active-regionReadline Init File Syntax
                                                        enable-bracketed-pasteReadline Init File Syntax
                                                        enable-keypadReadline Init File Syntax
                                                        ENVBash Variables
                                                        EPOCHREALTIMEBash Variables
                                                        EPOCHSECONDSBash Variables
                                                        EUIDBash Variables
                                                        EXECIGNOREBash Variables
                                                        expand-tildeReadline Init File Syntax

                                                        F
                                                        FCEDITBash Variables
                                                        FIGNOREBash Variables
                                                        FUNCNAMEBash Variables
                                                        FUNCNESTBash Variables

                                                        G
                                                        GLOBIGNOREBash Variables
                                                        GLOBSORTBash Variables
                                                        GROUPSBash Variables

                                                        H
                                                        histcharsBash Variables
                                                        HISTCMDBash Variables
                                                        HISTCONTROLBash Variables
                                                        HISTFILEBash Variables
                                                        HISTFILESIZEBash Variables
                                                        HISTIGNOREBash Variables
                                                        history-preserve-pointReadline Init File Syntax
                                                        history-sizeReadline Init File Syntax
                                                        HISTSIZEBash Variables
                                                        HISTTIMEFORMATBash Variables
                                                        HOMEBourne Shell Variables
                                                        horizontal-scroll-modeReadline Init File Syntax
                                                        HOSTFILEBash Variables
                                                        HOSTNAMEBash Variables
                                                        HOSTTYPEBash Variables

                                                        I
                                                        IFSBourne Shell Variables
                                                        IGNOREEOFBash Variables
                                                        input-metaReadline Init File Syntax
                                                        INPUTRCBash Variables
                                                        INSIDE_EMACSBash Variables
                                                        isearch-terminatorsReadline Init File Syntax

                                                        K
                                                        keymapReadline Init File Syntax

                                                        L
                                                        LANGCreating Internationalized Scripts
                                                        LANGBash Variables
                                                        LC_ALLBash Variables
                                                        LC_COLLATEBash Variables
                                                        LC_CTYPEBash Variables
                                                        LC_MESSAGESCreating Internationalized Scripts
                                                        LC_MESSAGESBash Variables
                                                        LC_NUMERICBash Variables
                                                        LC_TIMEBash Variables
                                                        LINENOBash Variables
                                                        LINESBash Variables

                                                        M
                                                        MACHTYPEBash Variables
                                                        MAILBourne Shell Variables
                                                        MAILCHECKBash Variables
                                                        MAILPATHBourne Shell Variables
                                                        MAPFILEBash Variables
                                                        mark-modified-linesReadline Init File Syntax
                                                        mark-symlinked-directoriesReadline Init File Syntax
                                                        match-hidden-filesReadline Init File Syntax
                                                        menu-complete-display-prefixReadline Init File Syntax
                                                        meta-flagReadline Init File Syntax

                                                        O
                                                        OLDPWDBash Variables
                                                        OPTARGBourne Shell Variables
                                                        OPTERRBash Variables
                                                        OPTINDBourne Shell Variables
                                                        OSTYPEBash Variables
                                                        output-metaReadline Init File Syntax

                                                        P
                                                        page-completionsReadline Init File Syntax
                                                        PATHBourne Shell Variables
                                                        PIPESTATUSBash Variables
                                                        POSIXLY_CORRECTBash Variables
                                                        PPIDBash Variables
                                                        PROMPT_COMMANDBash Variables
                                                        PROMPT_DIRTRIMBash Variables
                                                        PS0Bash Variables
                                                        PS1Bourne Shell Variables
                                                        PS2Bourne Shell Variables
                                                        PS3Bash Variables
                                                        PS4Bash Variables
                                                        PWDBash Variables

                                                        R
                                                        RANDOMBash Variables
                                                        READLINE_ARGUMENTBash Variables
                                                        READLINE_LINEBash Variables
                                                        READLINE_MARKBash Variables
                                                        READLINE_POINTBash Variables
                                                        REPLYBash Variables
                                                        revert-all-at-newlineReadline Init File Syntax

                                                        S
                                                        search-ignore-caseReadline Init File Syntax
                                                        SECONDSBash Variables
                                                        SHELLBash Variables
                                                        SHELLOPTSBash Variables
                                                        SHLVLBash Variables
                                                        show-all-if-ambiguousReadline Init File Syntax
                                                        show-all-if-unmodifiedReadline Init File Syntax
                                                        show-mode-in-promptReadline Init File Syntax
                                                        skip-completed-textReadline Init File Syntax
                                                        SRANDOMBash Variables

                                                        T
                                                        TEXTDOMAINCreating Internationalized Scripts
                                                        TEXTDOMAINDIRCreating Internationalized Scripts
                                                        TIMEFORMATBash Variables
                                                        TMOUTBash Variables
                                                        TMPDIRBash Variables

                                                        U
                                                        UIDBash Variables

                                                        V
                                                        vi-cmd-mode-stringReadline Init File Syntax
                                                        vi-ins-mode-stringReadline Init File Syntax
                                                        visible-statsReadline Init File Syntax

                                                        -
                                                        Jump to:   ! + +
                                                        -
                                                        -
                                                        +
                                                        + -

                                                        D.4 Function Index

                                                        -
                                                        Jump to:   A +

                                                        D.4 Function Index

                                                        +
                                                        +
                                                        Jump to:   A   -B +B   -C +C   -D +D   -E +E   -F +F   -G +G   -H +H   -I +I   -K +K   -M +M   -N +N   -O +O   -P +P   -Q +Q   -R +R   -S +S   -T +T   -U +U   -Y +Y  
                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
                                                        Index Entry  Section

                                                        A
                                                        abort (C-g): Miscellaneous Commands
                                                        accept-line (Newline or Return): Commands For History
                                                        alias-expand-line (): Miscellaneous Commands

                                                        B
                                                        backward-char (C-b): Commands For Moving
                                                        backward-delete-char (Rubout): Commands For Text
                                                        backward-kill-line (C-x Rubout): Commands For Killing
                                                        backward-kill-word (M-DEL): Commands For Killing
                                                        backward-word (M-b): Commands For Moving
                                                        beginning-of-history (M-<): Commands For History
                                                        beginning-of-line (C-a): Commands For Moving
                                                        bracketed-paste-begin (): Commands For Text

                                                        C
                                                        call-last-kbd-macro (C-x e): Keyboard Macros
                                                        capitalize-word (M-c): Commands For Text
                                                        character-search (C-]): Miscellaneous Commands
                                                        character-search-backward (M-C-]): Miscellaneous Commands
                                                        clear-display (M-C-l): Commands For Moving
                                                        clear-screen (C-l): Commands For Moving
                                                        complete (TAB): Commands For Completion
                                                        complete-command (M-!): Commands For Completion
                                                        complete-filename (M-/): Commands For Completion
                                                        complete-hostname (M-@): Commands For Completion
                                                        complete-into-braces (M-{): Commands For Completion
                                                        complete-username (M-~): Commands For Completion
                                                        complete-variable (M-$): Commands For Completion
                                                        copy-backward-word (): Commands For Killing
                                                        copy-forward-word (): Commands For Killing
                                                        copy-region-as-kill (): Commands For Killing

                                                        D
                                                        dabbrev-expand (): Commands For Completion
                                                        delete-char (C-d): Commands For Text
                                                        delete-char-or-list (): Commands For Completion
                                                        delete-horizontal-space (): Commands For Killing
                                                        digit-argument (M-0, M-1, … M--): Numeric Arguments
                                                        display-shell-version (C-x C-v): Miscellaneous Commands
                                                        do-lowercase-version (M-A, M-B, M-x, …): Miscellaneous Commands
                                                        downcase-word (M-l): Commands For Text
                                                        dump-functions (): Miscellaneous Commands
                                                        dump-macros (): Miscellaneous Commands
                                                        dump-variables (): Miscellaneous Commands
                                                        dynamic-complete-history (M-TAB): Commands For Completion

                                                        E
                                                        edit-and-execute-command (C-x C-e): Miscellaneous Commands
                                                        end-kbd-macro (C-x )): Keyboard Macros
                                                        end-of-file (usually C-d): Commands For Text
                                                        end-of-history (M->): Commands For History
                                                        end-of-line (C-e): Commands For Moving
                                                        exchange-point-and-mark (C-x C-x): Miscellaneous Commands
                                                        execute-named-command (M-x): Miscellaneous Commands

                                                        F
                                                        fetch-history (): Commands For History
                                                        forward-backward-delete-char (): Commands For Text
                                                        forward-char (C-f): Commands For Moving
                                                        forward-search-history (C-s): Commands For History
                                                        forward-word (M-f): Commands For Moving

                                                        G
                                                        glob-complete-word (M-g): Miscellaneous Commands
                                                        glob-expand-word (C-x *): Miscellaneous Commands
                                                        glob-list-expansions (C-x g): Miscellaneous Commands

                                                        H
                                                        history-and-alias-expand-line (): Miscellaneous Commands
                                                        history-expand-line (M-^): Miscellaneous Commands
                                                        history-search-backward (): Commands For History
                                                        history-search-forward (): Commands For History
                                                        history-substring-search-backward (): Commands For History
                                                        history-substring-search-forward (): Commands For History

                                                        I
                                                        insert-comment (M-#): Miscellaneous Commands
                                                        insert-completions (M-*): Commands For Completion
                                                        insert-last-argument (M-. or M-_): Miscellaneous Commands

                                                        K
                                                        kill-line (C-k): Commands For Killing
                                                        kill-region (): Commands For Killing
                                                        kill-whole-line (): Commands For Killing
                                                        kill-word (M-d): Commands For Killing

                                                        M
                                                        magic-space (): Miscellaneous Commands
                                                        menu-complete (): Commands For Completion
                                                        menu-complete-backward (): Commands For Completion

                                                        N
                                                        next-history (C-n): Commands For History
                                                        next-screen-line (): Commands For Moving
                                                        non-incremental-forward-search-history (M-n): Commands For History
                                                        non-incremental-reverse-search-history (M-p): Commands For History

                                                        O
                                                        operate-and-get-next (C-o): Commands For History
                                                        overwrite-mode (): Commands For Text

                                                        P
                                                        possible-command-completions (C-x !): Commands For Completion
                                                        possible-completions (M-?): Commands For Completion
                                                        possible-filename-completions (C-x /): Commands For Completion
                                                        possible-hostname-completions (C-x @): Commands For Completion
                                                        possible-username-completions (C-x ~): Commands For Completion
                                                        possible-variable-completions (C-x $): Commands For Completion
                                                        prefix-meta (ESC): Miscellaneous Commands
                                                        previous-history (C-p): Commands For History
                                                        previous-screen-line (): Commands For Moving
                                                        print-last-kbd-macro (): Keyboard Macros

                                                        Q
                                                        quoted-insert (C-q or C-v): Commands For Text

                                                        R
                                                        re-read-init-file (C-x C-r): Miscellaneous Commands
                                                        redraw-current-line (): Commands For Moving
                                                        reverse-search-history (C-r): Commands For History
                                                        revert-line (M-r): Miscellaneous Commands

                                                        S
                                                        self-insert (a, b, A, 1, !, …): Commands For Text
                                                        set-mark (C-@): Miscellaneous Commands
                                                        shell-backward-kill-word (): Commands For Killing
                                                        shell-backward-word (M-C-b): Commands For Moving
                                                        shell-expand-line (M-C-e): Miscellaneous Commands
                                                        shell-forward-word (M-C-f): Commands For Moving
                                                        shell-kill-word (M-C-d): Commands For Killing
                                                        shell-transpose-words (M-C-t): Commands For Text
                                                        skip-csi-sequence (): Miscellaneous Commands
                                                        spell-correct-word (C-x s): Miscellaneous Commands
                                                        start-kbd-macro (C-x (): Keyboard Macros

                                                        T
                                                        tilde-expand (M-&): Miscellaneous Commands
                                                        transpose-chars (C-t): Commands For Text
                                                        transpose-words (M-t): Commands For Text

                                                        U
                                                        undo (C-_ or C-x C-u): Miscellaneous Commands
                                                        universal-argument (): Numeric Arguments
                                                        unix-filename-rubout (): Commands For Killing
                                                        unix-line-discard (C-u): Commands For Killing
                                                        unix-word-rubout (C-w): Commands For Killing
                                                        upcase-word (M-u): Commands For Text

                                                        Y
                                                        yank (C-y): Commands For Killing
                                                        yank-last-arg (M-. or M-_): Commands For History
                                                        yank-nth-arg (M-C-y): Commands For History
                                                        yank-pop (M-y): Commands For Killing

                                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                        Index EntrySection

                                                        A
                                                        abort (C-g)Miscellaneous Commands
                                                        accept-line (Newline or Return)Commands For History
                                                        alias-expand-line ()Miscellaneous Commands

                                                        B
                                                        backward-char (C-b)Commands For Moving
                                                        backward-delete-char (Rubout)Commands For Text
                                                        backward-kill-line (C-x Rubout)Commands For Killing
                                                        backward-kill-word (M-DEL)Commands For Killing
                                                        backward-word (M-b)Commands For Moving
                                                        beginning-of-history (M-<)Commands For History
                                                        beginning-of-line (C-a)Commands For Moving
                                                        bracketed-paste-begin ()Commands For Text

                                                        C
                                                        call-last-kbd-macro (C-x e)Keyboard Macros
                                                        capitalize-word (M-c)Commands For Text
                                                        character-search (C-])Miscellaneous Commands
                                                        character-search-backward (M-C-])Miscellaneous Commands
                                                        clear-display (M-C-l)Commands For Moving
                                                        clear-screen (C-l)Commands For Moving
                                                        complete (TAB)Commands For Completion
                                                        complete-command (M-!)Commands For Completion
                                                        complete-filename (M-/)Commands For Completion
                                                        complete-hostname (M-@)Commands For Completion
                                                        complete-into-braces (M-{)Commands For Completion
                                                        complete-username (M-~)Commands For Completion
                                                        complete-variable (M-$)Commands For Completion
                                                        copy-backward-word ()Commands For Killing
                                                        copy-forward-word ()Commands For Killing
                                                        copy-region-as-kill ()Commands For Killing

                                                        D
                                                        dabbrev-expand ()Commands For Completion
                                                        delete-char (C-d)Commands For Text
                                                        delete-char-or-list ()Commands For Completion
                                                        delete-horizontal-space ()Commands For Killing
                                                        digit-argument (M-0, M-1, … M--)Numeric Arguments
                                                        display-shell-version (C-x C-v)Miscellaneous Commands
                                                        do-lowercase-version (M-A, M-B, M-x, …)Miscellaneous Commands
                                                        downcase-word (M-l)Commands For Text
                                                        dump-functions ()Miscellaneous Commands
                                                        dump-macros ()Miscellaneous Commands
                                                        dump-variables ()Miscellaneous Commands
                                                        dynamic-complete-history (M-TAB)Commands For Completion

                                                        E
                                                        edit-and-execute-command (C-x C-e)Miscellaneous Commands
                                                        end-kbd-macro (C-x ))Keyboard Macros
                                                        end-of-file (usually C-d)Commands For Text
                                                        end-of-history (M->)Commands For History
                                                        end-of-line (C-e)Commands For Moving
                                                        exchange-point-and-mark (C-x C-x)Miscellaneous Commands
                                                        execute-named-command (M-x)Miscellaneous Commands

                                                        F
                                                        fetch-history ()Commands For History
                                                        forward-backward-delete-char ()Commands For Text
                                                        forward-char (C-f)Commands For Moving
                                                        forward-search-history (C-s)Commands For History
                                                        forward-word (M-f)Commands For Moving

                                                        G
                                                        glob-complete-word (M-g)Miscellaneous Commands
                                                        glob-expand-word (C-x *)Miscellaneous Commands
                                                        glob-list-expansions (C-x g)Miscellaneous Commands

                                                        H
                                                        history-and-alias-expand-line ()Miscellaneous Commands
                                                        history-expand-line (M-^)Miscellaneous Commands
                                                        history-search-backward ()Commands For History
                                                        history-search-forward ()Commands For History
                                                        history-substring-search-backward ()Commands For History
                                                        history-substring-search-forward ()Commands For History

                                                        I
                                                        insert-comment (M-#)Miscellaneous Commands
                                                        insert-completions (M-*)Commands For Completion
                                                        insert-last-argument (M-. or M-_)Miscellaneous Commands

                                                        K
                                                        kill-line (C-k)Commands For Killing
                                                        kill-region ()Commands For Killing
                                                        kill-whole-line ()Commands For Killing
                                                        kill-word (M-d)Commands For Killing

                                                        M
                                                        magic-space ()Miscellaneous Commands
                                                        menu-complete ()Commands For Completion
                                                        menu-complete-backward ()Commands For Completion

                                                        N
                                                        next-history (C-n)Commands For History
                                                        next-screen-line ()Commands For Moving
                                                        non-incremental-forward-search-history (M-n)Commands For History
                                                        non-incremental-reverse-search-history (M-p)Commands For History

                                                        O
                                                        operate-and-get-next (C-o)Commands For History
                                                        overwrite-mode ()Commands For Text

                                                        P
                                                        possible-command-completions (C-x !)Commands For Completion
                                                        possible-completions (M-?)Commands For Completion
                                                        possible-filename-completions (C-x /)Commands For Completion
                                                        possible-hostname-completions (C-x @)Commands For Completion
                                                        possible-username-completions (C-x ~)Commands For Completion
                                                        possible-variable-completions (C-x $)Commands For Completion
                                                        prefix-meta (ESC)Miscellaneous Commands
                                                        previous-history (C-p)Commands For History
                                                        previous-screen-line ()Commands For Moving
                                                        print-last-kbd-macro ()Keyboard Macros

                                                        Q
                                                        quoted-insert (C-q or C-v)Commands For Text

                                                        R
                                                        re-read-init-file (C-x C-r)Miscellaneous Commands
                                                        redraw-current-line ()Commands For Moving
                                                        reverse-search-history (C-r)Commands For History
                                                        revert-line (M-r)Miscellaneous Commands

                                                        S
                                                        self-insert (a, b, A, 1, !, …)Commands For Text
                                                        set-mark (C-@)Miscellaneous Commands
                                                        shell-backward-kill-word ()Commands For Killing
                                                        shell-backward-word (M-C-b)Commands For Moving
                                                        shell-expand-line (M-C-e)Miscellaneous Commands
                                                        shell-forward-word (M-C-f)Commands For Moving
                                                        shell-kill-word (M-C-d)Commands For Killing
                                                        shell-transpose-words (M-C-t)Commands For Text
                                                        skip-csi-sequence ()Miscellaneous Commands
                                                        spell-correct-word (C-x s)Miscellaneous Commands
                                                        start-kbd-macro (C-x ()Keyboard Macros

                                                        T
                                                        tilde-expand (M-&)Miscellaneous Commands
                                                        transpose-chars (C-t)Commands For Text
                                                        transpose-words (M-t)Commands For Text

                                                        U
                                                        undo (C-_ or C-x C-u)Miscellaneous Commands
                                                        universal-argument ()Numeric Arguments
                                                        unix-filename-rubout ()Commands For Killing
                                                        unix-line-discard (C-u)Commands For Killing
                                                        unix-word-rubout (C-w)Commands For Killing
                                                        upcase-word (M-u)Commands For Text

                                                        Y
                                                        yank (C-y)Commands For Killing
                                                        yank-last-arg (M-. or M-_)Commands For History
                                                        yank-nth-arg (M-C-y)Commands For History
                                                        yank-pop (M-y)Commands For Killing

                                                        -
                                                        Jump to:   A + +
                                                        -
                                                        -
                                                        +
                                                        + -

                                                        D.5 Concept Index

                                                        -
                                                        Jump to:   A +

                                                        D.5 Concept Index

                                                        +
                                                        +
                                                        Jump to:   A   -B +B   -C +C   -D +D   -E +E   -F +F   -H +H   -I +I   -J +J   -K +K   -L +L   -M +M   -N +N   -O +O   -P +P   -Q +Q   -R +R   -S +S   -T +T   -U +U   -V +V   -W +W   -Y +Y  
                                                        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
                                                        Index Entry  Section

                                                        A
                                                        alias expansion: Aliases
                                                        arithmetic evaluation: Shell Arithmetic
                                                        arithmetic expansion: Arithmetic Expansion
                                                        arithmetic operators: Shell Arithmetic
                                                        arithmetic, shell: Shell Arithmetic
                                                        arrays: Arrays

                                                        B
                                                        background: Job Control Basics
                                                        Bash configuration: Basic Installation
                                                        Bash installation: Basic Installation
                                                        binary arithmetic operators: Shell Arithmetic
                                                        bitwise arithmetic operators: Shell Arithmetic
                                                        Bourne shell: Basic Shell Features
                                                        brace expansion: Brace Expansion
                                                        builtin: Definitions

                                                        C
                                                        command editing: Readline Bare Essentials
                                                        command execution: Command Search and Execution
                                                        command expansion: Simple Command Expansion
                                                        command history: Bash History Facilities
                                                        command search: Command Search and Execution
                                                        command substitution: Command Substitution
                                                        command timing: Pipelines
                                                        commands, compound: Compound Commands
                                                        commands, conditional: Conditional Constructs
                                                        commands, grouping: Command Grouping
                                                        commands, lists: Lists
                                                        commands, looping: Looping Constructs
                                                        commands, pipelines: Pipelines
                                                        commands, shell: Shell Commands
                                                        commands, simple: Simple Commands
                                                        comments, shell: Comments
                                                        Compatibility Level: Shell Compatibility Mode
                                                        Compatibility Mode: Shell Compatibility Mode
                                                        completion builtins: Programmable Completion Builtins
                                                        conditional arithmetic operator: Shell Arithmetic
                                                        configuration: Basic Installation
                                                        control operator: Definitions
                                                        coprocess: Coprocesses

                                                        D
                                                        directory stack: The Directory Stack

                                                        E
                                                        editing command lines: Readline Bare Essentials
                                                        environment: Environment
                                                        evaluation, arithmetic: Shell Arithmetic
                                                        event designators: Event Designators
                                                        execution environment: Command Execution Environment
                                                        exit status: Definitions
                                                        exit status: Exit Status
                                                        expansion: Shell Expansions
                                                        expansion, arithmetic: Arithmetic Expansion
                                                        expansion, brace: Brace Expansion
                                                        expansion, filename: Filename Expansion
                                                        expansion, parameter: Shell Parameter Expansion
                                                        expansion, pathname: Filename Expansion
                                                        expansion, tilde: Tilde Expansion
                                                        expressions, arithmetic: Shell Arithmetic
                                                        expressions, conditional: Bash Conditional Expressions

                                                        F
                                                        field: Definitions
                                                        filename: Definitions
                                                        filename expansion: Filename Expansion
                                                        foreground: Job Control Basics
                                                        functions, shell: Shell Functions

                                                        H
                                                        history builtins: Bash History Builtins
                                                        history events: Event Designators
                                                        history expansion: History Interaction
                                                        history list: Bash History Facilities
                                                        History, how to use: A Programmable Completion Example

                                                        I
                                                        identifier: Definitions
                                                        initialization file, readline: Readline Init File
                                                        installation: Basic Installation
                                                        interaction, readline: Readline Interaction
                                                        interactive shell: Invoking Bash
                                                        interactive shell: Interactive Shells
                                                        internationalization: Locale Translation
                                                        internationalized scripts: Creating Internationalized Scripts

                                                        J
                                                        job: Definitions
                                                        job control: Definitions
                                                        job control: Job Control Basics

                                                        K
                                                        kill ring: Readline Killing Commands
                                                        killing text: Readline Killing Commands

                                                        L
                                                        localization: Locale Translation
                                                        login shell: Invoking Bash

                                                        M
                                                        matching, pattern: Pattern Matching
                                                        metacharacter: Definitions

                                                        N
                                                        name: Definitions
                                                        native languages: Locale Translation
                                                        notation, readline: Readline Bare Essentials

                                                        O
                                                        operator, shell: Definitions

                                                        P
                                                        parameter expansion: Shell Parameter Expansion
                                                        parameters: Shell Parameters
                                                        parameters, positional: Positional Parameters
                                                        parameters, special: Special Parameters
                                                        pathname expansion: Filename Expansion
                                                        pattern matching: Pattern Matching
                                                        pipeline: Pipelines
                                                        POSIX: Definitions
                                                        POSIX description: Bash POSIX Mode
                                                        POSIX Mode: Bash POSIX Mode
                                                        process group: Definitions
                                                        process group ID: Definitions
                                                        process substitution: Process Substitution
                                                        programmable completion: Programmable Completion
                                                        prompting: Controlling the Prompt

                                                        Q
                                                        quoting: Quoting
                                                        quoting, ANSI: ANSI-C Quoting

                                                        R
                                                        Readline, how to use: Job Control Variables
                                                        redirection: Redirections
                                                        reserved word: Definitions
                                                        reserved words: Reserved Words
                                                        restricted shell: The Restricted Shell
                                                        return status: Definitions

                                                        S
                                                        shell arithmetic: Shell Arithmetic
                                                        shell function: Shell Functions
                                                        shell script: Shell Scripts
                                                        shell variable: Shell Parameters
                                                        shell, interactive: Interactive Shells
                                                        signal: Definitions
                                                        signal handling: Signals
                                                        special builtin: Definitions
                                                        special builtin: Special Builtins
                                                        startup files: Bash Startup Files
                                                        string translations: Creating Internationalized Scripts
                                                        suspending jobs: Job Control Basics

                                                        T
                                                        tilde expansion: Tilde Expansion
                                                        token: Definitions
                                                        translation, native languages: Locale Translation

                                                        U
                                                        unary arithmetic operators: Shell Arithmetic

                                                        V
                                                        variable, shell: Shell Parameters
                                                        variables, readline: Readline Init File Syntax

                                                        W
                                                        word: Definitions
                                                        word splitting: Word Splitting

                                                        Y
                                                        yanking text: Readline Killing Commands

                                                        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                        Index EntrySection

                                                        A
                                                        alias expansionAliases
                                                        arithmetic evaluationShell Arithmetic
                                                        arithmetic expansionArithmetic Expansion
                                                        arithmetic operatorsShell Arithmetic
                                                        arithmetic, shellShell Arithmetic
                                                        arraysArrays

                                                        B
                                                        backgroundJob Control Basics
                                                        Bash configurationBasic Installation
                                                        Bash installationBasic Installation
                                                        binary arithmetic operatorsShell Arithmetic
                                                        bitwise arithmetic operatorsShell Arithmetic
                                                        Bourne shellBasic Shell Features
                                                        brace expansionBrace Expansion
                                                        builtinDefinitions

                                                        C
                                                        command editingReadline Bare Essentials
                                                        command executionCommand Search and Execution
                                                        command expansionSimple Command Expansion
                                                        command historyBash History Facilities
                                                        command searchCommand Search and Execution
                                                        command substitutionCommand Substitution
                                                        command timingPipelines
                                                        commands, compoundCompound Commands
                                                        commands, conditionalConditional Constructs
                                                        commands, groupingCommand Grouping
                                                        commands, listsLists
                                                        commands, loopingLooping Constructs
                                                        commands, pipelinesPipelines
                                                        commands, shellShell Commands
                                                        commands, simpleSimple Commands
                                                        comments, shellComments
                                                        Compatibility LevelShell Compatibility Mode
                                                        Compatibility ModeShell Compatibility Mode
                                                        completion builtinsProgrammable Completion Builtins
                                                        conditional arithmetic operatorShell Arithmetic
                                                        configurationBasic Installation
                                                        control operatorDefinitions
                                                        coprocessCoprocesses

                                                        D
                                                        directory stackThe Directory Stack

                                                        E
                                                        editing command linesReadline Bare Essentials
                                                        environmentEnvironment
                                                        evaluation, arithmeticShell Arithmetic
                                                        event designatorsEvent Designators
                                                        execution environmentCommand Execution Environment
                                                        exit statusDefinitions
                                                        exit statusExit Status
                                                        expansionShell Expansions
                                                        expansion, arithmeticArithmetic Expansion
                                                        expansion, braceBrace Expansion
                                                        expansion, filenameFilename Expansion
                                                        expansion, parameterShell Parameter Expansion
                                                        expansion, pathnameFilename Expansion
                                                        expansion, tildeTilde Expansion
                                                        expressions, arithmeticShell Arithmetic
                                                        expressions, conditionalBash Conditional Expressions

                                                        F
                                                        fieldDefinitions
                                                        filenameDefinitions
                                                        filename expansionFilename Expansion
                                                        foregroundJob Control Basics
                                                        functions, shellShell Functions

                                                        H
                                                        history builtinsBash History Builtins
                                                        history eventsEvent Designators
                                                        history expansionHistory Interaction
                                                        history listBash History Facilities
                                                        History, how to useA Programmable Completion Example

                                                        I
                                                        identifierDefinitions
                                                        initialization file, readlineReadline Init File
                                                        installationBasic Installation
                                                        interaction, readlineReadline Interaction
                                                        interactive shellInvoking Bash
                                                        interactive shellInteractive Shells
                                                        internationalizationLocale Translation
                                                        internationalized scriptsCreating Internationalized Scripts

                                                        J
                                                        jobDefinitions
                                                        job controlDefinitions
                                                        job controlJob Control Basics

                                                        K
                                                        kill ringReadline Killing Commands
                                                        killing textReadline Killing Commands

                                                        L
                                                        localizationLocale Translation
                                                        login shellInvoking Bash

                                                        M
                                                        matching, patternPattern Matching
                                                        metacharacterDefinitions

                                                        N
                                                        nameDefinitions
                                                        native languagesLocale Translation
                                                        notation, readlineReadline Bare Essentials

                                                        O
                                                        operator, shellDefinitions

                                                        P
                                                        parameter expansionShell Parameter Expansion
                                                        parametersShell Parameters
                                                        parameters, positionalPositional Parameters
                                                        parameters, specialSpecial Parameters
                                                        pathname expansionFilename Expansion
                                                        pattern matchingPattern Matching
                                                        pipelinePipelines
                                                        POSIXDefinitions
                                                        POSIX descriptionBash POSIX Mode
                                                        POSIX ModeBash POSIX Mode
                                                        process groupDefinitions
                                                        process group IDDefinitions
                                                        process substitutionProcess Substitution
                                                        programmable completionProgrammable Completion
                                                        promptingControlling the Prompt

                                                        Q
                                                        quotingQuoting
                                                        quoting, ANSIANSI-C Quoting

                                                        R
                                                        Readline, how to useJob Control Variables
                                                        redirectionRedirections
                                                        reserved wordDefinitions
                                                        reserved wordsReserved Words
                                                        restricted shellThe Restricted Shell
                                                        return statusDefinitions

                                                        S
                                                        shell arithmeticShell Arithmetic
                                                        shell functionShell Functions
                                                        shell scriptShell Scripts
                                                        shell variableShell Parameters
                                                        shell, interactiveInteractive Shells
                                                        signalDefinitions
                                                        signal handlingSignals
                                                        special builtinDefinitions
                                                        special builtinSpecial Builtins
                                                        startup filesBash Startup Files
                                                        string translationsCreating Internationalized Scripts
                                                        suspending jobsJob Control Basics

                                                        T
                                                        tilde expansionTilde Expansion
                                                        tokenDefinitions
                                                        translation, native languagesLocale Translation

                                                        U
                                                        unary arithmetic operatorsShell Arithmetic

                                                        V
                                                        variable, shellShell Parameters
                                                        variables, readlineReadline Init File Syntax

                                                        W
                                                        wordDefinitions
                                                        word splittingWord Splitting

                                                        Y
                                                        yanking textReadline Killing Commands

                                                        -
                                                        Jump to:   A + + diff --git a/doc/bashref.info b/doc/bashref.info index ea10cfec..b3c92877 100644 --- a/doc/bashref.info +++ b/doc/bashref.info @@ -1,13 +1,13 @@ -This is bashref.info, produced by makeinfo version 6.8 from +This is bashref.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, 14 December 2023). +Bash shell (version 5.3, 2 February 2024). - This is Edition 5.3, last updated 14 December 2023, of 'The GNU Bash -Reference Manual', for 'Bash', Version 5.3. + This is Edition 5.3, last updated 2 February 2024, of ‘The GNU Bash +Reference Manual’, for ‘Bash’, Version 5.3. - Copyright (C) 1988-2023 Free Software Foundation, Inc. + Copyright © 1988-2023 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -27,16 +27,16 @@ Bash Features ************* This text is a brief description of the features that are present in the -Bash shell (version 5.3, 14 December 2023). The Bash home page is +Bash shell (version 5.3, 2 February 2024). The Bash home page is . - This is Edition 5.3, last updated 14 December 2023, of 'The GNU Bash -Reference Manual', for 'Bash', Version 5.3. + This is Edition 5.3, last updated 2 February 2024, of ‘The GNU Bash +Reference Manual’, for ‘Bash’, Version 5.3. Bash contains features that appear in other popular shells, and some features that only appear in Bash. Some of the shells that Bash has -borrowed concepts from are the Bourne Shell ('sh'), the Korn Shell -('ksh'), and the C-shell ('csh' and its successor, 'tcsh'). The +borrowed concepts from are the Bourne Shell (‘sh’), the Korn Shell +(‘ksh’), and the C-shell (‘csh’ and its successor, ‘tcsh’). The following menu breaks the features up into categories, noting which features were inspired by other shells and which are specific to Bash. @@ -84,22 +84,22 @@ File: bashref.info, Node: What is Bash?, Next: What is a shell?, Up: Introduc ================= Bash is the shell, or command language interpreter, for the GNU -operating system. The name is an acronym for the 'Bourne-Again SHell', +operating system. The name is an acronym for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of the -current Unix shell 'sh', which appeared in the Seventh Edition Bell Labs +current Unix shell ‘sh’, which appeared in the Seventh Edition Bell Labs Research version of Unix. - Bash is largely compatible with 'sh' and incorporates useful features -from the Korn shell 'ksh' and the C shell 'csh'. It is intended to be a + Bash is largely compatible with ‘sh’ and incorporates useful features +from the Korn shell ‘ksh’ and the C shell ‘csh’. It is intended to be a conformant implementation of the IEEE POSIX Shell and Tools portion of the IEEE POSIX specification (IEEE Standard 1003.1). It offers -functional improvements over 'sh' for both interactive and programming +functional improvements over ‘sh’ for both interactive and programming use. While the GNU operating system provides other shells, including a -version of 'csh', Bash is the default shell. Like other GNU software, +version of ‘csh’, Bash is the default shell. Like other GNU software, Bash is quite portable. It currently runs on nearly every version of -Unix and a few other operating systems - independently-supported ports +Unix and a few other operating systems − independently-supported ports exist for MS-DOS, OS/2, and Windows platforms.  @@ -118,7 +118,7 @@ interface to the rich set of GNU utilities. The programming language features allow these utilities to be combined. Files containing commands can be created, and become commands themselves. These new commands have the same status as system commands in directories such as -'/bin', allowing users or groups to establish custom environments to +‘/bin’, allowing users or groups to establish custom environments to automate their common tasks. Shells may be used interactively or non-interactively. In @@ -129,15 +129,15 @@ executing non-interactively, shells execute commands read from a file. asynchronously. The shell waits for synchronous commands to complete before accepting more input; asynchronous commands continue to execute in parallel with the shell while it reads and executes additional -commands. The "redirection" constructs permit fine-grained control of +commands. The “redirection” constructs permit fine-grained control of the input and output of those commands. Moreover, the shell allows control over the contents of commands' environments. - Shells also provide a small set of built-in commands ("builtins") + Shells also provide a small set of built-in commands (“builtins”) implementing functionality impossible or inconvenient to obtain via -separate utilities. For example, 'cd', 'break', 'continue', and 'exec' +separate utilities. For example, ‘cd’, ‘break’, ‘continue’, and ‘exec’ cannot be implemented outside of the shell because they directly -manipulate the shell itself. The 'history', 'getopts', 'kill', or 'pwd' +manipulate the shell itself. The ‘history’, ‘getopts’, ‘kill’, or ‘pwd’ builtins, among others, could be implemented in separate utilities, but they are more convenient to use as builtin commands. All of the shell builtins are described in subsequent sections. @@ -160,90 +160,90 @@ File: bashref.info, Node: Definitions, Next: Basic Shell Features, Prev: Intr These definitions are used throughout the remainder of this manual. -'POSIX' +‘POSIX’ A family of open system standards based on Unix. Bash is primarily concerned with the Shell and Utilities portion of the POSIX 1003.1 standard. -'blank' +‘blank’ A space or tab character. -'builtin' +‘builtin’ A command that is implemented internally by the shell itself, rather than by an executable program somewhere in the file system. -'control operator' - A 'token' that performs a control function. It is a 'newline' or - one of the following: '||', '&&', '&', ';', ';;', ';&', ';;&', '|', - '|&', '(', or ')'. +‘control operator’ + A ‘token’ that performs a control function. It is a ‘newline’ or + one of the following: ‘||’, ‘&&’, ‘&’, ‘;’, ‘;;’, ‘;&’, ‘;;&’, ‘|’, + ‘|&’, ‘(’, or ‘)’. -'exit status' +‘exit status’ The value returned by a command to its caller. The value is restricted to eight bits, so the maximum value is 255. -'field' +‘field’ A unit of text that is the result of one of the shell expansions. After expansion, when executing a command, the resulting fields are used as the command name and arguments. -'filename' +‘filename’ A string of characters used to identify a file. -'job' +‘job’ A set of processes comprising a pipeline, and any processes descended from it, that are all in the same process group. -'job control' +‘job control’ A mechanism by which users can selectively stop (suspend) and restart (resume) execution of processes. -'metacharacter' +‘metacharacter’ A character that, when unquoted, separates words. A metacharacter - is a 'space', 'tab', 'newline', or one of the following characters: - '|', '&', ';', '(', ')', '<', or '>'. + is a ‘space’, ‘tab’, ‘newline’, or one of the following characters: + ‘|’, ‘&’, ‘;’, ‘(’, ‘)’, ‘<’, or ‘>’. -'name' - A 'word' consisting solely of letters, numbers, and underscores, - and beginning with a letter or underscore. 'Name's are used as +‘name’ + A ‘word’ consisting solely of letters, numbers, and underscores, + and beginning with a letter or underscore. ‘Name’s are used as shell variable and function names. Also referred to as an - 'identifier'. + ‘identifier’. -'operator' - A 'control operator' or a 'redirection operator'. *Note +‘operator’ + A ‘control operator’ or a ‘redirection operator’. *Note Redirections::, for a list of redirection operators. Operators - contain at least one unquoted 'metacharacter'. + contain at least one unquoted ‘metacharacter’. -'process group' +‘process group’ A collection of related processes each having the same process group ID. -'process group ID' - A unique identifier that represents a 'process group' during its +‘process group ID’ + A unique identifier that represents a ‘process group’ during its lifetime. -'reserved word' - A 'word' that has a special meaning to the shell. Most reserved - words introduce shell flow control constructs, such as 'for' and - 'while'. +‘reserved word’ + A ‘word’ that has a special meaning to the shell. Most reserved + words introduce shell flow control constructs, such as ‘for’ and + ‘while’. -'return status' - A synonym for 'exit status'. +‘return status’ + A synonym for ‘exit status’. -'signal' +‘signal’ A mechanism by which a process may be notified by the kernel of an event occurring in the system. -'special builtin' +‘special builtin’ A shell builtin command that has been classified as special by the POSIX standard. -'token' +‘token’ A sequence of characters considered a single unit by the shell. It - is either a 'word' or an 'operator'. + is either a ‘word’ or an ‘operator’. -'word' +‘word’ A sequence of characters treated as a unit by the shell. Words may - not include unquoted 'metacharacters'. + not include unquoted ‘metacharacters’.  File: bashref.info, Node: Basic Shell Features, Next: Shell Builtin Commands, Prev: Definitions, Up: Top @@ -251,7 +251,7 @@ File: bashref.info, Node: Basic Shell Features, Next: Shell Builtin Commands, 3 Basic Shell Features ********************** -Bash is an acronym for 'Bourne-Again SHell'. The Bourne shell is the +Bash is an acronym for ‘Bourne-Again SHell’. The Bourne shell is the traditional Unix shell originally written by Stephen Bourne. All of the Bourne shell builtin commands are available in Bash, The rules for evaluation and quoting are taken from the POSIX specification for the @@ -288,7 +288,7 @@ File: bashref.info, Node: Shell Syntax, Next: Shell Commands, Up: Basic Shell When the shell reads input, it proceeds through a sequence of operations. If the input indicates the beginning of a comment, the -shell ignores the comment symbol ('#'), and the rest of that line. +shell ignores the comment symbol (‘#’), and the rest of that line. Otherwise, roughly speaking, the shell reads its input and divides the input into words and operators, employing the quoting rules to @@ -310,12 +310,12 @@ The following is a brief description of the shell's operation when it reads and executes a command. Basically, the shell does the following: 1. Reads its input from a file (*note Shell Scripts::), from a string - supplied as an argument to the '-c' invocation option (*note + supplied as an argument to the ‘-c’ invocation option (*note Invoking Bash::), or from the user's terminal. 2. Breaks the input into words and operators, obeying the quoting rules described in *note Quoting::. These tokens are separated by - 'metacharacters'. Alias expansion is performed by this step (*note + ‘metacharacters’. Alias expansion is performed by this step (*note Aliases::). 3. Parses the tokens into simple and compound commands (*note Shell @@ -359,11 +359,11 @@ as such, and to prevent parameter expansion. Each of the shell metacharacters (*note Definitions::) 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 (*note -History Interaction::), the "history expansion" character, usually '!', +History Interaction::), the “history expansion” character, usually ‘!’, must be quoted to prevent history expansion. *Note Bash History Facilities::, for more details concerning history expansion. - There are three quoting mechanisms: the "escape character", single + There are three quoting mechanisms: the “escape character”, single quotes, and double quotes.  @@ -372,10 +372,10 @@ File: bashref.info, Node: Escape Character, Next: Single Quotes, Up: Quoting 3.1.2.1 Escape Character ........................ -A non-quoted backslash '\' is the Bash escape character. It preserves +A non-quoted backslash ‘\’ is the Bash escape character. It preserves the literal value of the next character that follows, with the exception -of 'newline'. If a '\newline' pair appears, and the backslash itself is -not quoted, the '\newline' is treated as a line continuation (that is, +of ‘newline’. If a ‘\newline’ pair appears, and the backslash itself is +not quoted, the ‘\newline’ is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).  @@ -384,7 +384,7 @@ File: bashref.info, Node: Single Quotes, Next: Double Quotes, Prev: Escape Ch 3.1.2.2 Single Quotes ..................... -Enclosing characters in single quotes (''') preserves the literal value +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. @@ -394,23 +394,23 @@ File: bashref.info, Node: Double Quotes, Next: ANSI-C Quoting, Prev: Single Q 3.1.2.3 Double Quotes ..................... -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 (*note Bash POSIX Mode::), the '!' has no special meaning +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 (*note Bash 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 +characters ‘$’ and ‘`’ retain their special meaning within double quotes (*note Shell Expansions::). The backslash retains its special meaning -only when followed by one of the following characters: '$', '`', '"', -'\', or 'newline'. Within double quotes, backslashes that are followed +only when followed by one of the following characters: ‘$’, ‘`’, ‘"’, +‘\’, or ‘newline’. Within double quotes, backslashes that are followed by one of these characters are removed. Backslashes preceding characters without a special meaning are left unmodified. A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion will be performed unless an -'!' appearing in double quotes is escaped using a backslash. The -backslash preceding the '!' is not removed. +‘!’ appearing in double quotes is escaped using a backslash. The +backslash preceding the ‘!’ is not removed. - The special parameters '*' and '@' have special meaning when in + The special parameters ‘*’ and ‘@’ have special meaning when in double quotes (*note Shell Parameter Expansion::).  @@ -419,50 +419,50 @@ File: bashref.info, Node: ANSI-C Quoting, Next: Locale Translation, Prev: Dou 3.1.2.4 ANSI-C Quoting ...................... -Character sequences of the form '$'STRING'' are treated as a special +Character sequences of the form ‘$'STRING'’ are treated as a special kind of single quotes. The sequence expands to STRING, with backslash-escaped characters in STRING replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows: -'\a' +‘\a’ alert (bell) -'\b' +‘\b’ backspace -'\e' -'\E' +‘\e’ +‘\E’ an escape character (not ANSI C) -'\f' +‘\f’ form feed -'\n' +‘\n’ newline -'\r' +‘\r’ carriage return -'\t' +‘\t’ horizontal tab -'\v' +‘\v’ vertical tab -'\\' +‘\\’ backslash -'\'' +‘\'’ single quote -'\"' +‘\"’ double quote -'\?' +‘\?’ question mark -'\NNN' +‘\NNN’ the eight-bit character whose value is the octal value NNN (one to three octal digits) -'\xHH' +‘\xHH’ the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) -'\uHHHH' +‘\uHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits) -'\UHHHHHHHH' +‘\UHHHHHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits) -'\cX' +‘\cX’ a control-X character The expanded result is single-quoted, as if the dollar sign had not been @@ -479,17 +479,17 @@ File: bashref.info, Node: Locale Translation, Prev: ANSI-C Quoting, Up: Quoti * Creating Internationalized Scripts:: How to use translations and different languages in your scripts. -Prefixing a double-quoted string with a dollar sign ('$'), such as +Prefixing a double-quoted string with a dollar sign (‘$’), such as $"hello, world", will cause the string to be translated according to the -current locale. The 'gettext' infrastructure performs the lookup and -translation, using the 'LC_MESSAGES', 'TEXTDOMAINDIR', and 'TEXTDOMAIN' +current locale. The ‘gettext’ infrastructure performs the lookup and +translation, using the ‘LC_MESSAGES’, ‘TEXTDOMAINDIR’, and ‘TEXTDOMAIN’ shell variables, as explained below. See the gettext documentation for -additional details not covered here. If the current locale is 'C' or -'POSIX', if there are no translations available, of if the string is not +additional details not covered here. If the current locale is ‘C’ or +‘POSIX’, if there are no translations available, of if the string is not translated, the dollar sign is ignored. Since this is a form of double quoting, the string remains double-quoted by default, whether or not it -is translated and replaced. If the 'noexpand_translation' option is -enabled using the 'shopt' builtin (*note The Shopt Builtin::), +is translated and replaced. If the ‘noexpand_translation’ option is +enabled using the ‘shopt’ builtin (*note The Shopt Builtin::), translated strings are single-quoted instead of double-quoted. The rest of this section is a brief overview of how you use gettext @@ -504,21 +504,21 @@ using $"...", you create a gettext "template" file using the command bash --dump-po-strings SCRIPTNAME > DOMAIN.pot -The DOMAIN is your "message domain". It's just an arbitrary string +The DOMAIN is your “message domain”. It's just an arbitrary string that's used to identify the files gettext needs, like a package or script name. It needs to be unique among all the message domains on systems where you install the translations, so gettext knows which translations correspond to your script. You'll use the template file to create translations for each target language. The template file -conventionally has the suffix '.pot'. +conventionally has the suffix ‘.pot’. You copy this template file to a separate file for each target language you want to support (called "PO" files, which use the suffix -'.po'). PO files use various naming conventions, but when you are +‘.po’). PO files use various naming conventions, but when you are working to translate a template file into a particular language, you first copy the template file to a file whose name is the language you -want to target, with the '.po' suffix. For instance, the Spanish -translations of your strings would be in a file named 'es.po', and to +want to target, with the ‘.po’ suffix. For instance, the Spanish +translations of your strings would be in a file named ‘es.po’, and to get started using a message domain named "example," you would run cp example.pot es.po @@ -535,7 +535,7 @@ be done manually. gettext tools to produce what are called "MO" files, which are compiled versions of the PO files the gettext tools use to look up translations efficiently. MO files are also called "message catalog" files. You use -the 'msgfmt' program to do this. For instance, if you had a file with +the ‘msgfmt’ program to do this. For instance, if you had a file with Spanish translations, you could run msgfmt -o es.mo es.po @@ -543,29 +543,29 @@ Spanish translations, you could run to produce the corresponding MO file. Once you have the MO files, you decide where to install them and use -the 'TEXTDOMAINDIR' shell variable to tell the gettext tools where they +the ‘TEXTDOMAINDIR’ shell variable to tell the gettext tools where they are. Make sure to use the same message domain to name the MO files as you did for the PO files when you install them. - Your users will use the 'LANG' or 'LC_MESSAGES' shell variables to + Your users will use the ‘LANG’ or ‘LC_MESSAGES’ shell variables to select the desired language. - You set the 'TEXTDOMAIN' variable to the script's message domain. As + You set the ‘TEXTDOMAIN’ variable to the script's message domain. As above, you use the message domain to name your translation files. - You, or possibly your users, set the 'TEXTDOMAINDIR' variable to the + You, or possibly your users, set the ‘TEXTDOMAINDIR’ variable to the name of a directory where the message catalog files are stored. If you install the message files into the system's standard message catalog directory, you don't need to worry about this variable. The directory where the message catalog files are stored varies between systems. Some use the message catalog selected by the -'LC_MESSAGES' shell variable. Others create the name of the message -catalog from the value of the 'TEXTDOMAIN' shell variable, possibly -adding the '.mo' suffix. If you use the 'TEXTDOMAIN' variable, you may -need to set the 'TEXTDOMAINDIR' variable to the location of the message +‘LC_MESSAGES’ shell variable. Others create the name of the message +catalog from the value of the ‘TEXTDOMAIN’ shell variable, possibly +adding the ‘.mo’ suffix. If you use the ‘TEXTDOMAIN’ variable, you may +need to set the ‘TEXTDOMAINDIR’ variable to the location of the message catalog files, as above. It's common to use both variables in this -fashion: '$TEXTDOMAINDIR'/'$LC_MESSAGES'/LC_MESSAGES/'$TEXTDOMAIN'.mo. +fashion: ‘$TEXTDOMAINDIR’/‘$LC_MESSAGES’/LC_MESSAGES/‘$TEXTDOMAIN’.mo. If you used that last convention, and you wanted to store the message catalog files with Spanish (es) and Esperanto (eo) translations into a @@ -580,7 +580,7 @@ local directory you use for custom translation files, you could run When all of this is done, and the message catalog files containing the compiled translations are installed in the correct location, your users will be able to see translated strings in any of the supported -languages by setting the 'LANG' or 'LC_MESSAGES' environment variables +languages by setting the ‘LANG’ or ‘LC_MESSAGES’ environment variables before running your script.  @@ -590,11 +590,11 @@ File: bashref.info, Node: Comments, Prev: Quoting, Up: Shell Syntax -------------- In a non-interactive shell, or an interactive shell in which the -'interactive_comments' option to the 'shopt' builtin is enabled (*note -The Shopt Builtin::), a word beginning with '#' causes that word and all +‘interactive_comments’ option to the ‘shopt’ builtin is enabled (*note +The Shopt Builtin::), a word beginning with ‘#’ causes that word and all remaining characters on that line to be ignored. An interactive shell -without the 'interactive_comments' option enabled does not allow -comments. The 'interactive_comments' option is on by default in +without the ‘interactive_comments’ option enabled does not allow +comments. The ‘interactive_comments’ option is on by default in interactive shells. *Note Interactive Shells::, for a description of what makes a shell interactive. @@ -604,7 +604,7 @@ File: bashref.info, Node: Shell Commands, Next: Shell Functions, Prev: Shell 3.2 Shell Commands ================== -A simple shell command such as 'echo a b c' consists of the command +A simple shell command such as ‘echo a b c’ consists of the command itself followed by arguments, separated by spaces. More complex shell commands are composed of simple commands arranged @@ -635,14 +635,14 @@ are used to begin and end the shell's compound commands. The following words are recognized as reserved when unquoted and the first word of a command (see below for exceptions): -'if' 'then' 'elif' 'else' 'fi' 'time' -'for' 'in' 'until' 'while' 'do' 'done' -'case' 'esac' 'coproc''select''function' -'{' '}' '[[' ']]' '!' +‘if’ ‘then’ ‘elif’ ‘else’ ‘fi’ ‘time’ +‘for’ ‘in’ ‘until’ ‘while’ ‘do’ ‘done’ +‘case’ ‘esac’ ‘coproc’‘select’‘function’ +‘{’ ‘}’ ‘[[’ ‘]]’ ‘!’ -'in' is recognized as a reserved word if it is the third word of a -'case' or 'select' command. 'in' and 'do' are recognized as reserved -words if they are the third word in a 'for' command. +‘in’ is recognized as a reserved word if it is the third word of a +‘case’ or ‘select’ command. ‘in’ and ‘do’ are recognized as reserved +words if they are the third word in a ‘for’ command.  File: bashref.info, Node: Simple Commands, Next: Pipelines, Prev: Reserved Words, Up: Shell Commands @@ -651,13 +651,13 @@ File: bashref.info, Node: Simple Commands, Next: Pipelines, Prev: Reserved Wo --------------------- A simple command is the kind of command encountered most often. It's -just a sequence of words separated by 'blank's, terminated by one of the +just a sequence of words separated by ‘blank’s, terminated by one of the shell's control operators (*note Definitions::). The first word generally specifies a command to be executed, with the rest of the words being that command's arguments. The return status (*note Exit Status::) of a simple command is its -exit status as provided by the POSIX 1003.1 'waitpid' function, or 128+N +exit status as provided by the POSIX 1003.1 ‘waitpid’ function, or 128+N if the command was terminated by signal N.  @@ -666,8 +666,8 @@ File: bashref.info, Node: Pipelines, Next: Lists, Prev: Simple Commands, Up: 3.2.3 Pipelines --------------- -A 'pipeline' is a sequence of one or more commands separated by one of -the control operators '|' or '|&'. +A ‘pipeline’ is a sequence of one or more commands separated by one of +the control operators ‘|’ or ‘|&’. The format for a pipeline is [time [-p]] [!] COMMAND1 [ | or |& COMMAND2 ] ... @@ -677,46 +677,46 @@ the input of the next command. That is, each command reads the previous command's output. This connection is performed before any redirections specified by COMMAND1. - If '|&' is used, COMMAND1's standard error, in addition to its + If ‘|&’ is used, COMMAND1's standard error, in addition to its standard output, is connected to COMMAND2's standard input through the -pipe; it is shorthand for '2>&1 |'. This implicit redirection of the +pipe; it is shorthand for ‘2>&1 |’. This implicit redirection of the standard error to the standard output is performed after any redirections specified by COMMAND1. - The reserved word 'time' causes timing statistics to be printed for + The reserved word ‘time’ causes timing statistics to be printed for the pipeline once it finishes. The statistics currently consist of elapsed (wall-clock) time and user and system time consumed by the -command's execution. The '-p' option changes the output format to that +command's execution. The ‘-p’ option changes the output format to that specified by POSIX. When the shell is in POSIX mode (*note Bash POSIX -Mode::), it does not recognize 'time' as a reserved word if the next -token begins with a '-'. The 'TIMEFORMAT' variable may be set to a +Mode::), it does not recognize ‘time’ as a reserved word if the next +token begins with a ‘-’. The ‘TIMEFORMAT’ variable may be set to a format string that specifies how the timing information should be displayed. *Note Bash Variables::, for a description of the available -formats. The use of 'time' as a reserved word permits the timing of -shell builtins, shell functions, and pipelines. An external 'time' +formats. The use of ‘time’ as a reserved word permits the timing of +shell builtins, shell functions, and pipelines. An external ‘time’ command cannot time these easily. - When the shell is in POSIX mode (*note Bash POSIX Mode::), 'time' may + When the shell is in POSIX mode (*note Bash POSIX Mode::), ‘time’ may be followed by a newline. In this case, the shell displays the total user and system time consumed by the shell and its children. The -'TIMEFORMAT' variable specifies the format of the time information. +‘TIMEFORMAT’ variable specifies the format of the time information. If the pipeline is not executed asynchronously (*note Lists::), the shell waits for all commands in the pipeline to complete. Each command in a multi-command pipeline, where pipes are created, is -executed in its own "subshell", which is a separate process (*note -Command Execution Environment::). If the 'lastpipe' option is enabled -using the 'shopt' builtin (*note The Shopt Builtin::), the last element +executed in its own “subshell”, which is a separate process (*note +Command Execution Environment::). If the ‘lastpipe’ option is enabled +using the ‘shopt’ builtin (*note The Shopt Builtin::), the last element of a pipeline may be run by the shell process when job control is not active. The exit status of a pipeline is the exit status of the last command -in the pipeline, unless the 'pipefail' option is enabled (*note The Set -Builtin::). If 'pipefail' is enabled, the pipeline's return status is +in the pipeline, unless the ‘pipefail’ option is enabled (*note The Set +Builtin::). If ‘pipefail’ 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 successfully. If the reserved word -'!' precedes the pipeline, the exit status is the logical negation of +‘!’ precedes the pipeline, the exit status is the logical negation of the exit status as described above. The shell waits for all commands in the pipeline to terminate before returning a value. @@ -726,31 +726,31 @@ File: bashref.info, Node: Lists, Next: Compound Commands, Prev: Pipelines, U 3.2.4 Lists of Commands ----------------------- -A 'list' is a sequence of one or more pipelines separated by one of the -operators ';', '&', '&&', or '||', and optionally terminated by one of -';', '&', or a 'newline'. +A ‘list’ is a sequence of one or more pipelines separated by one of the +operators ‘;’, ‘&’, ‘&&’, or ‘||’, and optionally terminated by one of +‘;’, ‘&’, or a ‘newline’. - Of these list operators, '&&' and '||' have equal precedence, -followed by ';' and '&', which have equal precedence. + 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 'list' to delimit + A sequence of one or more newlines may appear in a ‘list’ to delimit commands, equivalent to a semicolon. - If a command is terminated by the control operator '&', the shell + If a command is terminated by the control operator ‘&’, the shell executes the command asynchronously in a subshell. This is known as -executing the command in the "background", and these are referred to as -"asynchronous" commands. The shell does not wait for the command to +executing the command in the “background”, and these are referred to as +“asynchronous” commands. The shell does not wait for the command to finish, and the return status is 0 (true). When job control is not active (*note Job Control::), the standard input for asynchronous commands, in the absence of any explicit redirections, is redirected -from '/dev/null'. +from ‘/dev/null’. - Commands separated by a ';' are executed sequentially; the shell + Commands separated by a ‘;’ are executed sequentially; the shell waits for each command to terminate in turn. The return status is the exit status of the last command executed. AND and OR lists are sequences of one or more pipelines separated by -the control operators '&&' and '||', respectively. AND and OR lists are +the control operators ‘&&’ and ‘||’, respectively. AND and OR lists are executed with left associativity. An AND list has the form @@ -802,11 +802,11 @@ File: bashref.info, Node: Looping Constructs, Next: Conditional Constructs, U Bash supports the following looping constructs. - Note that wherever a ';' appears in the description of a command's + Note that wherever a ‘;’ appears in the description of a command's syntax, it may be replaced with one or more newlines. -'until' - The syntax of the 'until' command is: +‘until’ + The syntax of the ‘until’ command is: until TEST-COMMANDS; do CONSEQUENT-COMMANDS; done @@ -815,8 +815,8 @@ syntax, it may be replaced with one or more newlines. the last command executed in CONSEQUENT-COMMANDS, or zero if none was executed. -'while' - The syntax of the 'while' command is: +‘while’ + The syntax of the ‘while’ command is: while TEST-COMMANDS; do CONSEQUENT-COMMANDS; done @@ -825,23 +825,23 @@ syntax, it may be replaced with one or more newlines. command executed in CONSEQUENT-COMMANDS, or zero if none was executed. -'for' - The syntax of the 'for' command is: +‘for’ + The syntax of the ‘for’ command is: for NAME [ [in [WORDS ...] ] ; ] do COMMANDS; done Expand WORDS (*note Shell Expansions::), and execute COMMANDS once for each member in the resultant list, with NAME bound to the - current member. If 'in WORDS' is not present, the 'for' command + current member. If ‘in WORDS’ is not present, the ‘for’ command executes the COMMANDS once for each positional parameter that is - set, as if 'in "$@"' had been specified (*note Special + set, as if ‘in "$@"’ had been specified (*note Special Parameters::). The return status is the exit status of the last command that executes. If there are no items in the expansion of WORDS, no commands are executed, and the return status is zero. - An alternate form of the 'for' command is also supported: + An alternate form of the ‘for’ command is also supported: for (( EXPR1 ; EXPR2 ; EXPR3 )) ; do COMMANDS ; done @@ -855,7 +855,7 @@ syntax, it may be replaced with one or more newlines. command in COMMANDS that is executed, or false if any of the expressions is invalid. - The 'break' and 'continue' builtins (*note Bourne Shell Builtins::) + The ‘break’ and ‘continue’ builtins (*note Bourne Shell Builtins::) may be used to control loop execution.  @@ -864,8 +864,8 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre 3.2.5.2 Conditional Constructs .............................. -'if' - The syntax of the 'if' command is: +‘if’ + The syntax of the ‘if’ command is: if TEST-COMMANDS; then CONSEQUENT-COMMANDS; @@ -876,33 +876,33 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre The TEST-COMMANDS list is executed, and if its return status is zero, the CONSEQUENT-COMMANDS list is executed. If TEST-COMMANDS - returns a non-zero status, each 'elif' list is executed in turn, + returns a non-zero status, each ‘elif’ list is executed in turn, and if its exit status is zero, the corresponding MORE-CONSEQUENTS - is executed and the command completes. If 'else - ALTERNATE-CONSEQUENTS' is present, and the final command in the - final 'if' or 'elif' clause has a non-zero exit status, then + is executed and the command completes. If ‘else + ALTERNATE-CONSEQUENTS’ is present, and the final command in the + final ‘if’ or ‘elif’ clause has a non-zero exit status, then ALTERNATE-CONSEQUENTS is executed. The return status is the exit status of the last command executed, or zero if no condition tested true. -'case' - The syntax of the 'case' command is: +‘case’ + The syntax of the ‘case’ command is: case WORD in [ [(] PATTERN [| PATTERN]...) COMMAND-LIST ;;]... esac - 'case' will selectively execute the COMMAND-LIST corresponding to + ‘case’ will selectively execute the COMMAND-LIST corresponding to the first PATTERN that matches WORD. The match is performed according to the rules described below in *note Pattern Matching::. - If the 'nocasematch' shell option (see the description of 'shopt' + If the ‘nocasematch’ shell option (see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed - without regard to the case of alphabetic characters. The '|' is - used to separate multiple patterns, and the ')' operator terminates + without regard to the case of alphabetic characters. The ‘|’ is + used to separate multiple patterns, and the ‘)’ operator terminates a pattern list. A list of patterns and an associated command-list is known as a CLAUSE. - Each clause must be terminated with ';;', ';&', or ';;&'. The WORD + Each clause must be terminated with ‘;;’, ‘;&’, or ‘;;&’. The WORD undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal (*note Shell Parameter Expansion::) before matching is attempted. Each PATTERN @@ -910,13 +910,13 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre substitution, arithmetic expansion, process substitution, and quote removal. - There may be an arbitrary number of 'case' clauses, each terminated - by a ';;', ';&', or ';;&'. The first pattern that matches + There may be an arbitrary number of ‘case’ clauses, each terminated + by a ‘;;’, ‘;&’, or ‘;;&’. The first pattern that matches determines the command-list that is executed. It's a common idiom - to use '*' as the final pattern to define the default case, since + to use ‘*’ as the final pattern to define the default case, since that pattern will always match. - Here is an example using 'case' in a script that could be used to + Here is an example using ‘case’ in a script that could be used to describe one interesting feature of an animal: echo -n "Enter the name of an animal: " @@ -929,11 +929,10 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre esac echo " legs." - - If the ';;' operator is used, no subsequent matches are attempted - after the first pattern match. Using ';&' in place of ';;' causes + If the ‘;;’ operator is used, no subsequent matches are attempted + after the first pattern match. Using ‘;&’ in place of ‘;;’ causes execution to continue with the COMMAND-LIST associated with the - next clause, if any. Using ';;&' in place of ';;' causes the shell + next clause, if any. Using ‘;;&’ in place of ‘;;’ causes the shell to test the patterns in the next clause, if any, and execute any associated COMMAND-LIST on a successful match, continuing the case statement execution as if the pattern list had not matched. @@ -941,27 +940,27 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre The return status is zero if no PATTERN is matched. Otherwise, the return status is the exit status of the COMMAND-LIST executed. -'select' +‘select’ - The 'select' construct allows the easy generation of menus. It has - almost the same syntax as the 'for' command: + The ‘select’ construct allows the easy generation of menus. It has + almost the same syntax as the ‘for’ command: select NAME [in WORDS ...]; do COMMANDS; done - The list of words following 'in' is expanded, generating a list of + The list of words following ‘in’ is expanded, generating a list of items, and the set of expanded words is printed on the standard - error output stream, each preceded by a number. If the 'in WORDS' - is omitted, the positional parameters are printed, as if 'in "$@"' - had been specified. 'select' then displays the 'PS3' prompt and + error output stream, each preceded by a number. If the ‘in WORDS’ + is omitted, the positional parameters are printed, as if ‘in "$@"’ + had been specified. ‘select’ then displays the ‘PS3’ prompt and reads a line from the standard input. If the line consists of a number corresponding to one of the displayed words, then the value of NAME is set to that word. If the line is empty, the words and - prompt are displayed again. If 'EOF' is read, the 'select' command + prompt are displayed again. If ‘EOF’ is read, the ‘select’ command completes and returns 1. Any other value read causes NAME to be - set to null. The line read is saved in the variable 'REPLY'. + set to null. The line read is saved in the variable ‘REPLY’. - The COMMANDS are executed after each selection until a 'break' - command is executed, at which point the 'select' command completes. + The COMMANDS are executed after each selection until a ‘break’ + command is executed, at which point the ‘select’ command completes. Here is an example that allows the user to pick a filename from the current directory, and displays the name and index of the file @@ -973,7 +972,7 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre break; done -'((...))' +‘((...))’ (( EXPRESSION )) The arithmetic EXPRESSION is evaluated according to the rules @@ -983,47 +982,47 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre are removed. If the value of the expression is non-zero, the return status is 0; otherwise the return status is 1. -'[[...]]' +‘[[...]]’ [[ EXPRESSION ]] Return a status of 0 or 1 depending on the evaluation of the conditional expression EXPRESSION. Expressions are composed of the primaries described below in *note Bash Conditional Expressions::. - The words between the '[[' and ']]' do not undergo word splitting + The words between the ‘[[’ and ‘]]’ do not undergo word splitting and filename expansion. The shell performs tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal on those words (the expansions that would occur if the words were enclosed - in double quotes). Conditional operators such as '-f' must be + in double quotes). Conditional operators such as ‘-f’ must be unquoted to be recognized as primaries. - When used with '[[', the '<' and '>' operators sort + 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 in *note Pattern Matching::, as if the - 'extglob' shell option were enabled. The '=' operator is identical - to '=='. If the 'nocasematch' shell option (see the description of - 'shopt' in *note The Shopt Builtin::) is enabled, the match is + ‘extglob’ shell option were enabled. The ‘=’ operator is identical + to ‘==’. If the ‘nocasematch’ shell option (see the description of + ‘shopt’ in *note The Shopt Builtin::) 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. + return value is 0 if the string matches (‘==’) or does not match + (‘!=’) the pattern, and 1 otherwise. If you quote any part of the pattern, using any of the shell's quoting mechanisms, the quoted portion is matched literally. This means 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 you use '=~', the string to the + An additional binary operator, ‘=~’, is available, with the same + precedence as ‘==’ and ‘!=’. When you use ‘=~’, the string to the right of the operator is considered a POSIX extended regular expression pattern and matched accordingly (using the POSIX - 'regcomp' and 'regexec' interfaces usually described in regex(3)). + ‘regcomp’ and ‘regexec’ interfaces usually described in regex(3)). The return value is 0 if the string matches the pattern, and 1 if it does not. If the regular expression is syntactically incorrect, - the conditional expression returns 2. If the 'nocasematch' shell - option (see the description of 'shopt' in *note The Shopt + the conditional expression returns 2. If the ‘nocasematch’ shell + option (see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed without regard to the case of alphabetic characters. @@ -1035,39 +1034,39 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre The pattern will match if it matches any part of the string. If you want to force the pattern to match the entire string, anchor - the pattern using the '^' and '$' regular expression operators. + the pattern using the ‘^’ and ‘$’ regular expression operators. For example, the following will match a line (stored in the shell - variable 'line') if there is a sequence of characters anywhere in + variable ‘line’) if there is a sequence of characters anywhere in the value consisting of any number, including zero, of characters - in the 'space' character class, immediately followed by zero or one - instances of 'a', then a 'b': + in the ‘space’ character class, immediately followed by zero or one + instances of ‘a’, then a ‘b’: [[ $line =~ [[:space:]]*(a)?b ]] - That means values for 'line' like 'aab', ' aaaaaab', 'xaby', and ' - ab' will all match, as will a line containing a 'b' anywhere in its + That means values for ‘line’ like ‘aab’, ‘ aaaaaab’, ‘xaby’, and ‘ + ab’ will all match, as will a line containing a ‘b’ anywhere in its value. If you want to match a character that's special to the regular - expression grammar ('^$|[]()\.*+?'), it has to be quoted to remove - its special meaning. This means that in the pattern 'xxx.txt', the - '.' matches any character in the string (its usual regular - expression meaning), but in the pattern '"xxx.txt"', it can only - match a literal '.'. + expression grammar (‘^$|[]()\.*+?’), it has to be quoted to remove + its special meaning. This means that in the pattern ‘xxx.txt’, the + ‘.’ matches any character in the string (its usual regular + expression meaning), but in the pattern ‘"xxx.txt"’, it can only + match a literal ‘.’. Likewise, if you want to include a character in your pattern that has a special meaning to the regular expression grammar, you must make sure it's not quoted. If you want to anchor a pattern at the beginning or end of the string, for instance, you cannot quote the - '^' or '$' characters using any form of shell quoting. + ‘^’ or ‘$’ characters using any form of shell quoting. - If you want to match 'initial string' at the start of a line, the + If you want to match ‘initial string’ at the start of a line, the following will work: [[ $line =~ ^"initial string" ]] but this will not: [[ $line =~ "^initial string" ]] - because in the second example the '^' is quoted and doesn't have + because in the second example the ‘^’ is quoted and doesn't have its usual special meaning. It is sometimes difficult to specify a regular expression properly @@ -1105,13 +1104,13 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre The first two matches will succeed, but the second two will not, because in the second two the backslash will be part of the pattern to be matched. In the first two examples, the pattern passed to - the regular expression parser is '\.'. The backslash removes the - special meaning from '.', so the literal '.' matches. In the + the regular expression parser is ‘\.’. The backslash removes the + special meaning from ‘.’, so the literal ‘.’ matches. In the second two examples, the pattern passed to the regular expression - parser has the backslash quoted (e.g., '\\\.'), which will not + parser has the backslash quoted (e.g., ‘\\\.’), which will not match the string, since it does not contain a backslash. If the - string in the first examples were anything other than '.', say 'a', - the pattern would not match, because the quoted '.' in the pattern + string in the first examples were anything other than ‘.’, say ‘a’, + the pattern would not match, because the quoted ‘.’ in the pattern loses its special meaning of matching any single character. Bracket expressions in regular expressions can be sources of errors @@ -1122,7 +1121,7 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre purpose. Though it might seem like a strange way to write it, the following - pattern will match a '.' in the string: + pattern will match a ‘.’ in the string: [[ . =~ [.] ]] @@ -1135,35 +1134,35 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre twice as much as possible, so shell quoting should be sufficient to quote special pattern characters where that's necessary. - The array variable 'BASH_REMATCH' records which parts of the string - matched the pattern. The element of 'BASH_REMATCH' with index 0 + The array variable ‘BASH_REMATCH’ records which parts of the string + matched the pattern. The element of ‘BASH_REMATCH’ with index 0 contains the portion of the string matching the entire regular expression. Substrings matched by parenthesized subexpressions within the regular expression are saved in the remaining - 'BASH_REMATCH' indices. The element of 'BASH_REMATCH' with index N + ‘BASH_REMATCH’ indices. The element of ‘BASH_REMATCH’ with index N is the portion of the string matching the Nth parenthesized subexpression. - Bash sets 'BASH_REMATCH' in the global scope; declaring it as a + Bash sets ‘BASH_REMATCH’ in the global scope; declaring it as a local variable will lead to unexpected results. Expressions may be combined using the following operators, listed in decreasing order of precedence: - '( EXPRESSION )' + ‘( EXPRESSION )’ Returns the value of EXPRESSION. This may be used to override the normal precedence of operators. - '! EXPRESSION' + ‘! EXPRESSION’ True if EXPRESSION is false. - 'EXPRESSION1 && EXPRESSION2' + ‘EXPRESSION1 && EXPRESSION2’ True if both EXPRESSION1 and EXPRESSION2 are true. - 'EXPRESSION1 || EXPRESSION2' + ‘EXPRESSION1 || EXPRESSION2’ True if either EXPRESSION1 or EXPRESSION2 is true. - The '&&' and '||' operators do not evaluate EXPRESSION2 if the + The ‘&&’ and ‘||’ operators do not evaluate EXPRESSION2 if the value of EXPRESSION1 is sufficient to determine the return value of the entire conditional expression. @@ -1178,7 +1177,7 @@ unit. When commands are grouped, redirections may be applied to the entire command list. For example, the output of all the commands in the list may be redirected to a single stream. -'()' +‘()’ ( LIST ) Placing a list of commands between parentheses forces the shell to @@ -1187,7 +1186,7 @@ list may be redirected to a single stream. Since the LIST is executed in a subshell, variable assignments do not remain in effect after the subshell completes. -'{}' +‘{}’ { LIST; } Placing a list of commands between curly braces causes the list to @@ -1197,7 +1196,7 @@ list may be redirected to a single stream. In addition to the creation of a subshell, there is a subtle difference between these two constructs due to historical reasons. The braces are reserved words, so they must be separated from the LIST by -'blank's or other shell metacharacters. The parentheses are operators, +‘blank’s or other shell metacharacters. The parentheses are operators, and are recognized as separate tokens by the shell even if they are not separated from the LIST by whitespace. @@ -1210,9 +1209,9 @@ File: bashref.info, Node: Coprocesses, Next: GNU Parallel, Prev: Compound Com 3.2.6 Coprocesses ----------------- -A 'coprocess' is a shell command preceded by the 'coproc' reserved word. +A ‘coprocess’ is a shell command preceded by the ‘coproc’ 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 +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: @@ -1222,14 +1221,14 @@ established between the executing shell and the coprocess. This creates a coprocess named NAME. COMMAND may be either a simple command (*note Simple Commands::) or a compound command (*note Compound Commands::). NAME is a shell variable name. If NAME is not supplied, -the default name is 'COPROC'. +the default name is ‘COPROC’. The recommended form to use for a coprocess is coproc NAME { COMMAND; } This form is recommended because simple commands result in the coprocess -always being named 'COPROC', and it is simpler to use and more complete +always being named ‘COPROC’, and it is simpler to use and more complete than the other compound commands. There are other forms of coprocesses: @@ -1239,7 +1238,7 @@ than the other compound commands. coproc SIMPLE-COMMAND If COMMAND is a compound command, NAME is optional. The word following -'coproc' determines whether that word is interpreted as a variable name: +‘coproc’ determines whether that word is interpreted as a variable name: it is interpreted as NAME if it is not a reserved word that introduces a compound command. If COMMAND is a simple command, NAME is not allowed; this is to avoid confusion between NAME and the first word of the simple @@ -1259,11 +1258,11 @@ process substitutions, the file descriptors are not available in subshells. The process ID of the shell spawned to execute the coprocess is -available as the value of the variable 'NAME_PID'. The 'wait' builtin +available as the value of the variable ‘NAME_PID’. The ‘wait’ builtin command may be used to wait for the coprocess to terminate. Since the coprocess is created as an asynchronous command, the -'coproc' command always returns success. The return status of a +‘coproc’ command always returns success. The return status of a coprocess is the exit status of COMMAND.  @@ -1281,7 +1280,7 @@ arguments, whether they are filenames, usernames, hostnames, or lines read from files. GNU Parallel provides shorthand references to many of the most common operations (input lines, various portions of the input line, different ways to specify the input source, and so on). Parallel -can replace 'xargs' or feed commands from its input sources to several +can replace ‘xargs’ or feed commands from its input sources to several different instances of Bash. For a complete description, refer to the GNU Parallel documentation, @@ -1309,20 +1308,20 @@ new process is created to interpret them. function FNAME [()] COMPOUND-COMMAND [ REDIRECTIONS ] This defines a shell function named FNAME. The reserved word -'function' is optional. If the 'function' reserved word is supplied, -the parentheses are optional. The "body" of the function is the +‘function’ is optional. If the ‘function’ reserved word is supplied, +the parentheses are optional. The “body” of the function is the compound command COMPOUND-COMMAND (*note Compound Commands::). That command is usually a LIST enclosed between { and }, but may be any -compound command listed above. If the 'function' reserved word is used, +compound command listed above. If the ‘function’ reserved word is used, but the parentheses are not supplied, the braces are recommended. COMPOUND-COMMAND is executed whenever FNAME is specified as the name of a simple command. When the shell is in POSIX mode (*note Bash POSIX Mode::), FNAME must be a valid shell name and may not be the same as one of the special builtins (*note Special Builtins::). In default mode, a -function name can be any unquoted shell word that does not contain '$'. +function name can be any unquoted shell word that does not contain ‘$’. Any redirections (*note Redirections::) associated with the shell function are performed when the function is executed. A function -definition may be deleted using the '-f' option to the 'unset' builtin +definition may be deleted using the ‘-f’ option to the ‘unset’ builtin (*note Bourne Shell Builtins::). The exit status of a function definition is zero unless a syntax @@ -1332,55 +1331,55 @@ last command executed in the body. Note that for historical reasons, in the most common usage the curly braces that surround the body of the function must be separated from the -body by 'blank's or newlines. This is because the braces are reserved +body by ‘blank’s or newlines. This is because the braces are reserved words and are only recognized as such when they are separated from the command list by whitespace or another shell metacharacter. Also, when -using the braces, the LIST must be terminated by a semicolon, a '&', or +using the braces, the LIST must be terminated by a semicolon, a ‘&’, or a newline. When a function is executed, the arguments to the function become the positional parameters during its execution (*note Positional -Parameters::). The special parameter '#' that expands to the number of +Parameters::). The special parameter ‘#’ that expands to the number of positional parameters is updated to reflect the change. Special -parameter '0' is unchanged. The first element of the 'FUNCNAME' +parameter ‘0’ is unchanged. The first element of the ‘FUNCNAME’ variable is set to the name of the function while the function is executing. All other aspects of the shell execution environment are identical -between a function and its caller with these exceptions: the 'DEBUG' and -'RETURN' traps are not inherited unless the function has been given the -'trace' attribute using the 'declare' builtin or the '-o functrace' -option has been enabled with the 'set' builtin, (in which case all -functions inherit the 'DEBUG' and 'RETURN' traps), and the 'ERR' trap is -not inherited unless the '-o errtrace' shell option has been enabled. -*Note Bourne Shell Builtins::, for the description of the 'trap' +between a function and its caller with these exceptions: the ‘DEBUG’ and +‘RETURN’ traps are not inherited unless the function has been given the +‘trace’ attribute using the ‘declare’ builtin or the ‘-o functrace’ +option has been enabled with the ‘set’ builtin, (in which case all +functions inherit the ‘DEBUG’ and ‘RETURN’ traps), and the ‘ERR’ trap is +not inherited unless the ‘-o errtrace’ shell option has been enabled. +*Note Bourne Shell Builtins::, for the description of the ‘trap’ builtin. - The 'FUNCNEST' variable, if set to a numeric value greater than 0, + The ‘FUNCNEST’ variable, if set to a numeric value greater than 0, defines a maximum function nesting level. Function invocations that exceed the limit cause the entire command to abort. - If the builtin command 'return' is executed in a function, the + If the builtin command ‘return’ is executed in a function, the function completes and execution resumes with the next command after the -function call. Any command associated with the 'RETURN' trap is +function call. Any command associated with the ‘RETURN’ trap is executed before execution resumes. When a function completes, the -values of the positional parameters and the special parameter '#' are +values of the positional parameters and the special parameter ‘#’ are restored to the values they had prior to the function's execution. If a -numeric argument is given to 'return', that is the function's return +numeric argument is given to ‘return’, that is the function's return status; otherwise the function's return status is the exit status of the -last command executed before the 'return'. +last command executed before the ‘return’. - Variables local to the function may be declared with the 'local' -builtin ("local variables"). Ordinarily, variables and their values are + Variables local to the function may be declared with the ‘local’ +builtin (“local variables”). Ordinarily, variables and their values are shared between a function and its caller. These variables are visible only to the function and the commands it invokes. This is particularly important when a shell function calls other functions. - In the following description, the "current scope" is a currently- + In the following description, the “current scope” is a currently- executing function. Previous scopes consist of that function's caller and so on, back to the "global" scope, where the shell is not executing any shell function. Consequently, a local variable at the current local -scope is a variable declared using the 'local' or 'declare' builtins in +scope is a variable declared using the ‘local’ or ‘declare’ builtins in the function that is currently executing. Local variables "shadow" variables with the same name declared at @@ -1389,19 +1388,19 @@ hides a global variable of the same name: references and assignments refer to the local variable, leaving the global variable unmodified. When the function returns, the global variable is once again visible. - The shell uses "dynamic scoping" to control a variable's visibility + The shell uses “dynamic scoping” to control a variable's visibility within functions. With dynamic scoping, visible variables and their values are a result of the sequence of function calls that caused execution to reach the current function. The value of a variable that a function sees depends on its value within its caller, if any, whether -that caller is the "global" scope or another shell function. This is -also the value that a local variable declaration "shadows", and the -value that is restored when the function returns. +that caller is the global scope or another shell function. This is also +the value that a local variable declaration shadows, and the value that +is restored when the function returns. - For example, if a variable 'var' is declared as local in function -'func1', and 'func1' calls another function 'func2', references to 'var' -made from within 'func2' will resolve to the local variable 'var' from -'func1', shadowing any global variable named 'var'. + For example, if a variable ‘var’ is declared as local in function +‘func1’, and ‘func1’ calls another function ‘func2’, references to ‘var’ +made from within ‘func2’ will resolve to the local variable ‘var’ from +‘func1’, shadowing any global variable named ‘var’. The following script demonstrates this behavior. When executed, the script displays @@ -1422,8 +1421,8 @@ script displays var=global func1 - The 'unset' builtin also acts using the same dynamic scope: if a -variable is local to the current scope, 'unset' will unset it; otherwise + The ‘unset’ builtin also acts using the same dynamic scope: if a +variable is local to the current scope, ‘unset’ will unset it; otherwise the unset will refer to the variable found in any calling scope as described above. If a variable at the current local scope is unset, it will remain so (appearing as unset) until it is reset in that scope or @@ -1431,18 +1430,18 @@ until the function returns. Once the function returns, any instance of the variable at a previous scope will become 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 -'localvar_unset'shell option changes this behavior). +‘localvar_unset’shell option changes this behavior). - Function names and definitions may be listed with the '-f' option to -the 'declare' ('typeset') builtin command (*note Bash Builtins::). The -'-F' option to 'declare' or 'typeset' will list the function names only -(and optionally the source file and line number, if the 'extdebug' shell + Function names and definitions may be listed with the ‘-f’ option to +the ‘declare’ (‘typeset’) builtin command (*note Bash Builtins::). The +‘-F’ option to ‘declare’ or ‘typeset’ will list the function names only +(and optionally the source file and line number, if the ‘extdebug’ shell option is enabled). Functions may be exported so that child shell processes (those created when executing a separate shell invocation) -automatically have them defined with the '-f' option to the 'export' +automatically have them defined with the ‘-f’ option to the ‘export’ builtin (*note Bourne Shell Builtins::). - Functions may be recursive. The 'FUNCNEST' variable may be used to + Functions may be recursive. The ‘FUNCNEST’ variable may be used to limit the depth of the function call stack and restrict the number of function invocations. By default, no limit is placed on the number of recursive calls. @@ -1458,50 +1457,50 @@ File: bashref.info, Node: Shell Parameters, Next: Shell Expansions, Prev: She * Positional Parameters:: The shell's command-line arguments. * Special Parameters:: Parameters denoted by special characters. -A "parameter" is an entity that stores values. It can be a 'name', a -number, or one of the special characters listed below. A "variable" is -a parameter denoted by a 'name'. A variable has a 'value' and zero or -more 'attributes'. Attributes are assigned using the 'declare' builtin -command (see the description of the 'declare' builtin in *note Bash +A “parameter” is an entity that stores values. It can be a ‘name’, a +number, or one of the special characters listed below. A “variable” is +a parameter denoted by a ‘name’. A variable has a ‘value’ and zero or +more ‘attributes’. Attributes are assigned using the ‘declare’ builtin +command (see the description of the ‘declare’ builtin in *note Bash Builtins::). 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 -the 'unset' builtin command. +the ‘unset’ builtin command. A variable may be assigned to by a statement of the form NAME=[VALUE] If VALUE is not given, the variable is assigned the null string. All VALUEs undergo tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal (*note -Shell Parameter Expansion::). If the variable has its 'integer' +Shell Parameter Expansion::). If the variable has its ‘integer’ attribute set, then VALUE is evaluated as an arithmetic expression even -if the '$((...))' expansion is not used (*note Arithmetic Expansion::). +if the ‘$((...))’ expansion is not used (*note Arithmetic Expansion::). Word splitting and filename expansion are not performed. Assignment -statements may also appear as arguments to the 'alias', 'declare', -'typeset', 'export', 'readonly', and 'local' builtin commands -("declaration" commands). When in POSIX mode (*note Bash POSIX Mode::), +statements may also appear as arguments to the ‘alias’, ‘declare’, +‘typeset’, ‘export’, ‘readonly’, and ‘local’ builtin commands +(“declaration” commands). When in POSIX mode (*note Bash POSIX Mode::), these builtins may appear in a command after one or more instances of -the 'command' builtin and retain these assignment statement properties. +the ‘command’ 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 (*note Arrays::), the '+=' operator can +a shell variable or array index (*note Arrays::), the ‘+=’ operator can be used to append to or add to the variable's previous value. This -includes arguments to builtin commands such as 'declare' that accept -assignment statements (declaration commands). When '+=' is applied to a -variable for which the 'integer' attribute has been set, VALUE is +includes arguments to builtin commands such as ‘declare’ that accept +assignment statements (declaration commands). When ‘+=’ is applied to a +variable for which the ‘integer’ attribute has been set, VALUE is evaluated as an arithmetic expression and added to the variable's -current value, which is also evaluated. When '+=' is applied to an +current value, which is also evaluated. When ‘+=’ is applied to an array variable using compound assignment (*note Arrays::), the -variable's value is not unset (as it is when using '='), and new values +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. - A variable can be assigned the 'nameref' attribute using the '-n' -option to the 'declare' or 'local' builtin commands (*note Bash -Builtins::) to create a "nameref", or a reference to another variable. + A variable can be assigned the ‘nameref’ attribute using the ‘-n’ +option to the ‘declare’ or ‘local’ builtin commands (*note Bash +Builtins::) to create a “nameref”, or a reference to another variable. This allows variables to be manipulated indirectly. Whenever the nameref variable is referenced, assigned to, unset, or has its attributes modified (other than using or changing the nameref attribute @@ -1511,19 +1510,19 @@ shell functions to refer to a variable whose name is passed as an argument to the function. For instance, if a variable name is passed to a shell function as its first argument, running declare -n ref=$1 -inside the function creates a nameref variable 'ref' whose value is the +inside the function creates a nameref variable ‘ref’ whose value is the variable name passed as the first argument. References and assignments -to 'ref', and changes to its attributes, are treated as references, +to ‘ref’, and changes to its attributes, are treated as references, assignments, and attribute modifications to the variable whose name was -passed as '$1'. +passed as ‘$1’. - If the control variable in a 'for' loop has the nameref attribute, + If the control variable in a ‘for’ loop has the nameref attribute, the list of words can be a list of shell variables, and a name reference will be established for each word in the list, in turn, when the loop is executed. Array variables cannot be given the nameref attribute. However, nameref variables can reference array variables and subscripted -array variables. Namerefs can be unset using the '-n' option to the -'unset' builtin (*note Bourne Shell Builtins::). Otherwise, if 'unset' +array variables. Namerefs can be unset using the ‘-n’ option to the +‘unset’ builtin (*note Bourne Shell Builtins::). Otherwise, if ‘unset’ is executed with the name of a nameref variable as an argument, the variable referenced by the nameref variable will be unset. @@ -1533,13 +1532,13 @@ File: bashref.info, Node: Positional Parameters, Next: Special Parameters, Up 3.4.1 Positional Parameters --------------------------- -A "positional parameter" is a parameter denoted by one or more digits, -other than the single digit '0'. Positional parameters are assigned +A “positional parameter” is a parameter denoted by one or more digits, +other than the single digit ‘0’. Positional parameters are assigned from the shell's arguments when it is invoked, and may be reassigned -using the 'set' builtin command. Positional parameter 'N' may be -referenced as '${N}', or as '$N' when 'N' consists of a single digit. +using the ‘set’ builtin command. Positional parameter ‘N’ may be +referenced as ‘${N}’, or as ‘$N’ when ‘N’ consists of a single digit. Positional parameters may not be assigned to with assignment statements. -The 'set' and 'shift' builtins are used to set and unset them (*note +The ‘set’ and ‘shift’ builtins are used to set and unset them (*note Shell Builtin Commands::). The positional parameters are temporarily replaced when a shell function is executed (*note Shell Functions::). @@ -1555,20 +1554,20 @@ File: bashref.info, Node: Special Parameters, Prev: Positional Parameters, Up The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. -'*' +‘*’ ($*) Expands to the positional parameters, starting from one. When the expansion is not within double quotes, each positional parameter expands to a separate word. In contexts where it is performed, those words are subject to further word splitting and filename expansion. When the expansion occurs within double quotes, it expands to a single word with the value of each - parameter separated by the first character of the 'IFS' special - variable. That is, '"$*"' is equivalent to '"$1C$2C..."', where C - is the first character of the value of the 'IFS' variable. If - 'IFS' is unset, the parameters are separated by spaces. If 'IFS' + parameter separated by the first character of the ‘IFS’ special + variable. That is, ‘"$*"’ is equivalent to ‘"$1C$2C..."’, where C + is the first character of the value of the ‘IFS’ variable. If + ‘IFS’ is unset, the parameters are separated by spaces. If ‘IFS’ is null, the parameters are joined without intervening separators. -'@' +‘@’ ($@) Expands to the positional parameters, starting from one. In contexts where word splitting is performed, this expands each positional parameter to a separate word; if not within double @@ -1577,41 +1576,41 @@ only be referenced; assignment to them is not allowed. word with each positional parameter separated by a space. When the expansion occurs within double quotes, and word splitting is performed, each parameter expands to a separate word. That is, - '"$@"' is equivalent to '"$1" "$2" ...'. If the double-quoted + ‘"$@"’ is equivalent to ‘"$1" "$2" ...’. If the double-quoted expansion occurs within a word, the expansion of the first parameter is joined with the beginning part of the original word, and the expansion of the last parameter is joined with the last part of the original word. When there are no positional - parameters, '"$@"' and '$@' expand to nothing (i.e., they are + parameters, ‘"$@"’ and ‘$@’ expand to nothing (i.e., they are removed). -'#' +‘#’ ($#) Expands to the number of positional parameters in decimal. -'?' +‘?’ ($?) Expands to the exit status of the most recently executed foreground pipeline. -'-' +‘-’ ($-, a hyphen.) Expands to the current option flags as specified - upon invocation, by the 'set' builtin command, or those set by the - shell itself (such as the '-i' option). + upon invocation, by the ‘set’ builtin command, or those set by the + shell itself (such as the ‘-i’ option). -'$' +‘$’ ($$) Expands to the process ID of the shell. In a subshell, it expands to the process ID of the invoking shell, not the subshell. -'!' +‘!’ ($!) Expands to the process ID of the job most recently placed into the background, whether executed as an asynchronous command or - using the 'bg' builtin (*note Job Control Builtins::). + using the ‘bg’ builtin (*note Job Control Builtins::). -'0' +‘0’ ($0) Expands to the name of the shell or shell script. This is set at shell initialization. If Bash is invoked with a file of - commands (*note Shell Scripts::), '$0' is set to the name of that - file. If Bash is started with the '-c' option (*note Invoking - Bash::), then '$0' is set to the first argument after the string to + commands (*note Shell Scripts::), ‘$0’ is set to the name of that + file. If Bash is started with the ‘-c’ option (*note Invoking + Bash::), then ‘$0’ is set to the first argument after the string to be executed, if one is present. Otherwise, it is set to the filename used to invoke Bash, as given by argument zero. @@ -1622,15 +1621,16 @@ File: bashref.info, Node: Shell Expansions, Next: Redirections, Prev: Shell P ==================== Expansion is performed on the command line after it has been split into -'token's. There are seven kinds of expansion performed: +‘token’s. Bash performs these expansions: - * brace expansion - * tilde expansion - * parameter and variable expansion - * command substitution - * arithmetic expansion - * word splitting - * filename expansion + • brace expansion + • tilde expansion + • parameter and variable expansion + • command substitution + • arithmetic expansion + • word splitting + • filename expansion + • quote removal * Menu: @@ -1649,23 +1649,24 @@ Expansion is performed on the command line after it has been split into 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; and -filename expansion. +substitution (done in a left-to-right fashion); word splitting; filename +expansion; and quote removal. On systems that can support it, there is an additional expansion -available: "process substitution". This is performed at the same time +available: “process substitution”. This is performed at the same time as tilde, parameter, variable, and arithmetic expansion and command substitution. - After these expansions are performed, quote characters present in the -original word are removed unless they have been quoted themselves -("quote removal"). *Note Quote Removal:: for more details. + “Quote removal” 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. *Note +Quote Removal:: for more details. Only brace expansion, word splitting, and filename expansion can increase the number of words of the expansion; other expansions expand a single word to a single word. The only exceptions to this are the -expansions of '"$@"' and '$*' (*note Special Parameters::), and -'"${NAME[@]}"' and '${NAME[*]}' (*note Arrays::). +expansions of ‘"$@"’ and ‘$*’ (*note Special Parameters::), and +‘"${NAME[@]}"’ and ‘${NAME[*]}’ (*note Arrays::).  File: bashref.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Shell Expansions @@ -1674,7 +1675,7 @@ File: bashref.info, Node: Brace Expansion, Next: Tilde Expansion, Up: Shell E --------------------- Brace expansion is a mechanism by which arbitrary strings may be -generated. This mechanism is similar to "filename expansion" (*note +generated. This mechanism is similar to “filename expansion” (*note Filename Expansion::), but the filenames generated need not exist. Patterns to be brace expanded take the form of an optional PREAMBLE, followed by either a series of comma-separated strings or a sequence @@ -1688,18 +1689,17 @@ are not sorted; left to right order is preserved. For example, bash$ echo a{d,c,b}e ade ace abe - A sequence expression takes the form '{X..Y[..INCR]}', where X and Y + A sequence expression takes the form ‘{X..Y[..INCR]}’, where X and Y are either integers or letters, and INCR, an optional increment, is an integer. When integers are supplied, the expression expands to each -number between X and Y, inclusive. Supplied integers may be prefixed -with '0' to force each term to have the same width. 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. 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. Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It @@ -1710,10 +1710,10 @@ 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 '}'. +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: @@ -1727,62 +1727,62 @@ File: bashref.info, Node: Tilde Expansion, Next: Shell Parameter Expansion, P 3.5.2 Tilde Expansion --------------------- -If a word begins with an unquoted tilde character ('~'), all of the +If a word begins with an unquoted tilde character (‘~’), all of the characters up to the first unquoted slash (or all characters, if there -is no unquoted slash) are considered a "tilde-prefix". If none of the +is no unquoted slash) are considered a “tilde-prefix”. If none of the characters in the tilde-prefix are quoted, the characters in the -tilde-prefix following the tilde are treated as a possible "login name". +tilde-prefix following the tilde are treated as a possible “login name”. If this login name is the null string, the tilde is replaced with the -value of the 'HOME' shell variable. If 'HOME' is unset, the home +value of the ‘HOME’ shell variable. If ‘HOME’ is unset, the home directory of the user executing the shell is substituted instead. Otherwise, the tilde-prefix is replaced with the home directory associated with the specified login name. - If the tilde-prefix is '~+', the value of the shell variable 'PWD' -replaces the tilde-prefix. If the tilde-prefix is '~-', the value of -the shell variable 'OLDPWD', if it is set, is substituted. + If the tilde-prefix is ‘~+’, the value of the shell variable ‘PWD’ +replaces the tilde-prefix. If the tilde-prefix is ‘~-’, the value of +the shell variable ‘OLDPWD’, if it is set, is substituted. If the characters following the tilde in the tilde-prefix consist of -a number N, optionally prefixed by a '+' or a '-', the tilde-prefix is +a number N, optionally prefixed by a ‘+’ or a ‘-’, the tilde-prefix is replaced with the corresponding element from the directory stack, as it -would be displayed by the 'dirs' builtin invoked with the characters +would be displayed by the ‘dirs’ builtin invoked with the characters following tilde in the tilde-prefix as an argument (*note The Directory Stack::). If the tilde-prefix, sans the tilde, consists of a number -without a leading '+' or '-', '+' is assumed. +without a leading ‘+’ or ‘-’, ‘+’ is assumed. If the login name is invalid, or the tilde expansion fails, the word is left unchanged. Each variable assignment is checked for unquoted tilde-prefixes -immediately following a ':' or the first '='. In these cases, tilde +immediately following a ‘:’ or the first ‘=’. In these cases, tilde expansion is also performed. Consequently, one may use filenames with -tildes in assignments to 'PATH', 'MAILPATH', and 'CDPATH', and the shell +tildes in assignments to ‘PATH’, ‘MAILPATH’, and ‘CDPATH’, and the shell assigns the expanded value. The following table shows how Bash treats unquoted tilde-prefixes: -'~' - The value of '$HOME' -'~/foo' - '$HOME/foo' +‘~’ + The value of ‘$HOME’ +‘~/foo’ + ‘$HOME/foo’ -'~fred/foo' - The subdirectory 'foo' of the home directory of the user 'fred' +‘~fred/foo’ + The subdirectory ‘foo’ of the home directory of the user ‘fred’ -'~+/foo' - '$PWD/foo' +‘~+/foo’ + ‘$PWD/foo’ -'~-/foo' - '${OLDPWD-'~-'}/foo' +‘~-/foo’ + ‘${OLDPWD-'~-'}/foo’ -'~N' - The string that would be displayed by 'dirs +N' +‘~N’ + The string that would be displayed by ‘dirs +N’ -'~+N' - The string that would be displayed by 'dirs +N' +‘~+N’ + The string that would be displayed by ‘dirs +N’ -'~-N' - The string that would be displayed by 'dirs -N' +‘~-N’ + The string that would be displayed by ‘dirs -N’ Bash also performs tilde expansion on words satisfying the conditions of variable assignments (*note Shell Parameters::) when they appear as @@ -1795,13 +1795,13 @@ File: bashref.info, Node: Shell Parameter Expansion, Next: Command Substitutio 3.5.3 Shell Parameter Expansion ------------------------------- -The '$' character introduces parameter expansion, command substitution, +The ‘$’ character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name. - When braces are used, the matching ending brace is the first '}' not + When braces are used, the matching ending brace is the first ‘}’ not escaped by a backslash or within a quoted string, and not within an embedded arithmetic expansion, command substitution, or parameter expansion. @@ -1818,7 +1818,7 @@ PARAMETER is not a nameref, it introduces a level of indirection. Bash uses the value formed by expanding the rest of PARAMETER as the new PARAMETER; this is then expanded and that value is used in the rest of the expansion, rather than the expansion of the original PARAMETER. -This is known as 'indirect expansion'. The value is subject to tilde +This is known as ‘indirect expansion’. The value is subject to tilde expansion, parameter expansion, command substitution, and arithmetic expansion. If PARAMETER is a nameref, this expands to the name of the variable referenced by PARAMETER instead of performing the complete @@ -1830,13 +1830,13 @@ immediately follow the left brace in order to introduce indirection. parameter expansion, command substitution, and arithmetic expansion. When not performing substring expansion, using the forms described -below (e.g., ':-'), Bash tests for a parameter that is unset or null. +below (e.g., ‘:-’), Bash tests for a parameter that is unset or null. Omitting the colon results in a test only for a parameter that is unset. Put another way, if the colon is included, the operator tests for both PARAMETER's existence and that its value is not null; if the colon is omitted, the operator tests only for existence. -'${PARAMETER:-WORD}' +‘${PARAMETER:−WORD}’ If PARAMETER is unset or null, the expansion of WORD is substituted. Otherwise, the value of PARAMETER is substituted. @@ -1852,7 +1852,7 @@ omitted, the operator tests only for existence. $ echo ${v:-unset-or-null} unset-or-null -'${PARAMETER:=WORD}' +‘${PARAMETER:=WORD}’ If PARAMETER is unset or null, the expansion of WORD is assigned to PARAMETER. The value of PARAMETER is then substituted. Positional parameters and special parameters may not be assigned to in this @@ -1863,7 +1863,7 @@ omitted, the operator tests only for existence. $ echo $var DEFAULT -'${PARAMETER:?WORD}' +‘${PARAMETER:?WORD}’ If PARAMETER is null or unset, the expansion of WORD (or a message to that effect if WORD is not present) is written to the standard error and the shell, if it is not interactive, exits. Otherwise, @@ -1873,7 +1873,7 @@ omitted, the operator tests only for existence. $ : ${var:?var is unset or null} bash: var: var is unset or null -'${PARAMETER:+WORD}' +‘${PARAMETER:+WORD}’ If PARAMETER is null or unset, nothing is substituted, otherwise the expansion of WORD is substituted. @@ -1881,12 +1881,12 @@ omitted, the operator tests only for existence. $ echo ${var:+var is set and not null} var is set and not null -'${PARAMETER:OFFSET}' -'${PARAMETER:OFFSET:LENGTH}' +‘${PARAMETER:OFFSET}’ +‘${PARAMETER:OFFSET:LENGTH}’ This is referred to as Substring Expansion. It expands to up to LENGTH characters of the value of PARAMETER starting at the - character specified by OFFSET. If PARAMETER is '@' or '*', an - indexed array subscripted by '@' or '*', or an associative array + character specified by OFFSET. If PARAMETER is ‘@’ or ‘*’, an + indexed array subscripted by ‘@’ or ‘*’, or an associative array name, the results differ as described below. If LENGTH is omitted, it expands to the substring of the value of PARAMETER starting at the character specified by OFFSET and extending to the end of the @@ -1900,7 +1900,7 @@ omitted, the operator tests only for existence. rather than a number of characters, and the expansion is the characters between OFFSET and that result. Note that a negative offset must be separated from the colon by at least one space to - avoid being confused with the ':-' expansion. + avoid being confused with the ‘:-’ expansion. Here are some examples illustrating substring expansion on parameters and subscripted arrays: @@ -1957,7 +1957,7 @@ omitted, the operator tests only for existence. $ echo ${array[0]: -7:-2} bcdef - If PARAMETER is '@' or '*', the result is LENGTH positional + If PARAMETER is ‘@’ or ‘*’, the result is LENGTH positional parameters beginning at OFFSET. A negative OFFSET is taken relative to one greater than the greatest positional parameter, so an offset of -1 evaluates to the last positional parameter (or 0 if @@ -1985,9 +1985,9 @@ omitted, the operator tests only for existence. $ echo ${@: -7:0} - If PARAMETER is an indexed array name subscripted by '@' or '*', + If PARAMETER is an indexed array name subscripted by ‘@’ or ‘*’, the result is the LENGTH members of the array beginning with - '${PARAMETER[OFFSET]}'. A negative OFFSET is taken relative to one + ‘${PARAMETER[OFFSET]}’. A negative OFFSET is taken relative to one greater than the maximum index of the specified array. It is an expansion error if LENGTH evaluates to a number less than zero. @@ -2015,66 +2015,66 @@ omitted, the operator tests only for existence. Substring indexing is zero-based unless the positional parameters are used, in which case the indexing starts at 1 by default. If - OFFSET is 0, and the positional parameters are used, '$0' is + OFFSET is 0, and the positional parameters are used, ‘$0’ is prefixed to the list. -'${!PREFIX*}' -'${!PREFIX@}' +‘${!PREFIX*}’ +‘${!PREFIX@}’ Expands to the names of variables whose names begin with PREFIX, - separated by the first character of the 'IFS' special variable. - When '@' is used and the expansion appears within double quotes, + separated by the first character of the ‘IFS’ special variable. + When ‘@’ is used and the expansion appears within double quotes, each variable name expands to a separate word. -'${!NAME[@]}' -'${!NAME[*]}' +‘${!NAME[@]}’ +‘${!NAME[*]}’ If NAME is an array variable, expands to the list of array indices (keys) assigned in NAME. If NAME is not an array, expands to 0 if - NAME is set and null otherwise. When '@' is used and the expansion + NAME is set and null otherwise. When ‘@’ is used and the expansion appears within double quotes, each key expands to a separate word. -'${#PARAMETER}' +‘${#PARAMETER}’ The length in characters of the expanded value of PARAMETER is - substituted. If PARAMETER is '*' or '@', the value substituted is + substituted. If PARAMETER is ‘*’ or ‘@’, the value substituted is the number of positional parameters. If PARAMETER is an array name - subscripted by '*' or '@', the value substituted is the number of + subscripted by ‘*’ or ‘@’, the value substituted is the number of elements in the array. If PARAMETER is an indexed array name subscripted by a negative number, that number is interpreted as relative to one greater than the maximum index of PARAMETER, so negative indices count back from the end of the array, and an index of -1 references the last element. -'${PARAMETER#WORD}' -'${PARAMETER##WORD}' +‘${PARAMETER#WORD}’ +‘${PARAMETER##WORD}’ The WORD is expanded to produce a pattern and matched according to the rules described below (*note Pattern Matching::). If the pattern matches the beginning of the expanded value of PARAMETER, then the result of the expansion is the expanded value of PARAMETER - with the shortest matching pattern (the '#' case) or the longest - matching pattern (the '##' case) deleted. If PARAMETER is '@' or - '*', the pattern removal operation is applied to each positional + with the shortest matching pattern (the ‘#’ case) or the longest + matching pattern (the ‘##’ case) deleted. If PARAMETER is ‘@’ or + ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant list. If - PARAMETER is an array variable subscripted with '@' or '*', the + PARAMETER is an array variable subscripted with ‘@’ or ‘*’, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER%WORD}' -'${PARAMETER%%WORD}' +‘${PARAMETER%WORD}’ +‘${PARAMETER%%WORD}’ The WORD is expanded to produce a pattern and matched according to the rules described below (*note Pattern Matching::). If the pattern matches a trailing portion of the expanded value of PARAMETER, then the result of the expansion is the value of - PARAMETER with the shortest matching pattern (the '%' case) or the - longest matching pattern (the '%%' case) deleted. If PARAMETER is - '@' or '*', the pattern removal operation is applied to each + PARAMETER with the shortest matching pattern (the ‘%’ case) or the + longest matching pattern (the ‘%%’ case) deleted. If PARAMETER is + ‘@’ or ‘*’, the pattern removal operation is applied to each positional parameter in turn, and the expansion is the resultant - list. If PARAMETER is an array variable subscripted with '@' or - '*', the pattern removal operation is applied to each member of the + list. If PARAMETER is an array variable subscripted with ‘@’ or + ‘*’, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER/PATTERN/STRING}' -'${PARAMETER//PATTERN/STRING}' -'${PARAMETER/#PATTERN/STRING}' -'${PARAMETER/%PATTERN/STRING}' +‘${PARAMETER/PATTERN/STRING}’ +‘${PARAMETER//PATTERN/STRING}’ +‘${PARAMETER/#PATTERN/STRING}’ +‘${PARAMETER/%PATTERN/STRING}’ The PATTERN is expanded to produce a pattern just as in filename expansion. PARAMETER is expanded and the longest match of PATTERN against its value is replaced with STRING. STRING undergoes tilde @@ -2086,30 +2086,30 @@ omitted, the operator tests only for existence. In the first form above, only the first match is replaced. If there are two slashes separating PARAMETER and PATTERN (the second form above), all matches of PATTERN are replaced with STRING. If - PATTERN is preceded by '#' (the third form above), it must match at + PATTERN is preceded by ‘#’ (the third form above), it must match at the beginning of the expanded value of PARAMETER. If PATTERN is - preceded by '%' (the fourth form above), it must match at the end + preceded by ‘%’ (the fourth form above), it must match at the end of the expanded value of PARAMETER. If the expansion of STRING is null, matches of PATTERN are deleted. If STRING is null, matches - of PATTERN are deleted and the '/' following PATTERN may be + of PATTERN are deleted and the ‘/’ following PATTERN may be omitted. - If the 'patsub_replacement' shell option is enabled using 'shopt', - any unquoted instances of '&' in STRING are replaced with the + If the ‘patsub_replacement’ shell option is enabled using ‘shopt’, + any unquoted instances of ‘&’ in STRING are replaced with the matching portion of PATTERN. This is intended to duplicate a - common 'sed' idiom. + common ‘sed’ idiom. Quoting any part of STRING inhibits replacement in the expansion of the quoted portion, including replacement strings stored in shell - variables. Backslash will escape '&' in STRING; the backslash is - removed in order to permit a literal '&' in the replacement string. + variables. Backslash will escape ‘&’ in STRING; the backslash is + removed in order to permit a literal ‘&’ in the replacement string. Users should take care if STRING is double-quoted to avoid unwanted interactions between the backslash and double-quoting, since backslash has special meaning within double quotes. Pattern - substitution performs the check for unquoted '&' after expanding + substitution performs the check for unquoted ‘&’ after expanding STRING, so users should ensure to properly quote any occurrences of - '&' they want to be taken literally in the replacement and ensure - any instances of '&' they want to be replaced are unquoted. + ‘&’ they want to be taken literally in the replacement and ensure + any instances of ‘&’ they want to be replaced are unquoted. For instance, @@ -2136,33 +2136,33 @@ omitted, the operator tests only for existence. a context that doesn't take any enclosing double quotes into account. - Since backslash can escape '&', it can also escape a backslash in - the replacement string. This means that '\\' will insert a literal - backslash into the replacement, so these two 'echo' commands + Since backslash can escape ‘&’, it can also escape a backslash in + the replacement string. This means that ‘\\’ will insert a literal + backslash into the replacement, so these two ‘echo’ commands var=abcdef rep='\\&xyz' echo ${var/abc/\\&xyz} echo ${var/abc/$rep} - will both output '\abcxyzdef'. + will both output ‘\abcxyzdef’. It should rarely be necessary to enclose only STRING in double quotes. - If the 'nocasematch' shell option (see the description of 'shopt' + If the ‘nocasematch’ shell option (see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed without regard to the case of alphabetic characters. If PARAMETER - is '@' or '*', the substitution operation is applied to each + is ‘@’ or ‘*’, the substitution operation is applied to each positional parameter in turn, and the expansion is the resultant - list. If PARAMETER is an array variable subscripted with '@' or - '*', the substitution operation is applied to each member of the + list. If PARAMETER is an array variable subscripted with ‘@’ or + ‘*’, the substitution operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER^PATTERN}' -'${PARAMETER^^PATTERN}' -'${PARAMETER,PATTERN}' -'${PARAMETER,,PATTERN}' +‘${PARAMETER^PATTERN}’ +‘${PARAMETER^^PATTERN}’ +‘${PARAMETER,PATTERN}’ +‘${PARAMETER,,PATTERN}’ This expansion modifies the case of alphabetic characters in PARAMETER. The PATTERN is expanded to produce a pattern just as in filename expansion. Each character in the expanded value of @@ -2170,68 +2170,68 @@ omitted, the operator tests only for existence. pattern, its case is converted. The pattern should not attempt to match more than one character. - The '^' operator converts lowercase letters matching PATTERN to - uppercase; the ',' operator converts matching uppercase letters to - lowercase. The '^^' and ',,' expansions convert each matched - character in the expanded value; the '^' and ',' expansions match + The ‘^’ operator converts lowercase letters matching PATTERN to + uppercase; the ‘,’ operator converts matching uppercase letters to + lowercase. The ‘^^’ and ‘,,’ expansions convert each matched + character in the expanded value; the ‘^’ and ‘,’ expansions match and convert only the first character in the expanded value. If - PATTERN is omitted, it is treated like a '?', which matches every + PATTERN is omitted, it is treated like a ‘?’, which matches every character. - If PARAMETER is '@' or '*', the case modification operation is + If PARAMETER is ‘@’ or ‘*’, the case modification operation is applied to each positional parameter in turn, and the expansion is the resultant list. If PARAMETER is an array variable subscripted - with '@' or '*', the case modification operation is applied to each + with ‘@’ or ‘*’, the case modification operation is applied to each member of the array in turn, and the expansion is the resultant list. -'${PARAMETER@OPERATOR}' +‘${PARAMETER@OPERATOR}’ The expansion is either a transformation of the value of PARAMETER or information about PARAMETER itself, depending on the value of OPERATOR. Each OPERATOR is a single letter: - 'U' + ‘U’ The expansion is a string that is the value of PARAMETER with lowercase alphabetic characters converted to uppercase. - 'u' + ‘u’ The expansion is a string that is the value of PARAMETER with the first character converted to uppercase, if it is alphabetic. - 'L' + ‘L’ The expansion is a string that is the value of PARAMETER with uppercase alphabetic characters converted to lowercase. - 'Q' + ‘Q’ The expansion is a string that is the value of PARAMETER quoted in a format that can be reused as input. - 'E' + ‘E’ The expansion is a string that is the value of PARAMETER with - backslash escape sequences expanded as with the '$'...'' + backslash escape sequences expanded as with the ‘$'...'’ quoting mechanism. - 'P' + ‘P’ The expansion is a string that is the result of expanding the value of PARAMETER as if it were a prompt string (*note Controlling the Prompt::). - 'A' + ‘A’ The expansion is a string in the form of an assignment - statement or 'declare' command that, if evaluated, will + statement or ‘declare’ command that, if evaluated, will recreate PARAMETER with its attributes and value. - 'K' + ‘K’ Produces a possibly-quoted version of the value of PARAMETER, except that it prints the values of indexed and associative arrays as a sequence of quoted key-value pairs (*note Arrays::). - 'a' + ‘a’ The expansion is a string consisting of flag values representing PARAMETER's attributes. - 'k' - Like the 'K' transformation, but expands the keys and values + ‘k’ + Like the ‘K’ transformation, but expands the keys and values of indexed and associative arrays to separate words after word splitting. - If PARAMETER is '@' or '*', the operation is applied to each + If PARAMETER is ‘@’ or ‘*’, the operation is applied to each positional parameter in turn, and the expansion is the resultant - list. If PARAMETER is an array variable subscripted with '@' or - '*', the operation is applied to each member of the array in turn, + list. If PARAMETER is an array variable subscripted with ‘@’ or + ‘*’, the operation is applied to each member of the array in turn, and the expansion is the resultant list. The result of the expansion is subject to word splitting and @@ -2254,13 +2254,13 @@ Bash performs command substitution by executing COMMAND in a subshell environment and replacing the command substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. -The command substitution '$(cat FILE)' can be replaced by the equivalent -but faster '$(< FILE)'. +The command substitution ‘$(cat FILE)’ can be replaced by the equivalent +but faster ‘$(< FILE)’. With the old-style backquote form of substitution, backslash retains -its literal meaning except when followed by '$', '`', or '\'. The first +its literal meaning except when followed by ‘$’, ‘`’, or ‘\’. The first backquote not preceded by a backslash terminates the command -substitution. When using the '$(COMMAND)' form, all characters between +substitution. When using the ‘$(COMMAND)’ form, all characters between the parentheses make up the command; none are treated specially. There is an alternate form of command substitution: @@ -2271,7 +2271,7 @@ which executes COMMAND in the current execution environment and captures its output, again with trailing newlines removed. The character C following the open brace must be a space, tab, -newline, or '|', and the close brace must be in a position where a +newline, or ‘|’, and the close brace must be in a position where a reserved word may appear (i.e., preceded by a command terminator such as semicolon). Bash allows the close brace to be joined to the remaining characters in the word without being followed by a shell metacharacter @@ -2279,35 +2279,35 @@ as a reserved word would usually require. Any side effects of COMMAND take effect immediately in the current execution environment and persist in the current environment after the -command completes (e.g., the 'exit' builtin will exit the shell). +command completes (e.g., the ‘exit’ builtin will exit the shell). This type of command substitution superficially resembles executing an unnamed shell function: local variables are created as when a shell -function is executing, and the 'return' builtin forces COMMAND to +function is executing, and the ‘return’ builtin forces COMMAND to complete; however, the rest of the execution environment, including the positional parameters, is shared with the caller. - If the first character following the open brace is a '|', the -construct expands to the value of the 'REPLY' shell variable after + If the first character following the open brace is a ‘|’, the +construct expands to the value of the ‘REPLY’ shell variable after COMMAND executes, without removing any trailing newlines, and the standard output of COMMAND remains the same as in the calling shell. -Bash creates 'REPLY' as an initially-unset local variable when COMMAND -executes, and restores 'REPLY' to the value it had before the command +Bash creates ‘REPLY’ as an initially-unset local variable when COMMAND +executes, and restores ‘REPLY’ to the value it had before the command substitution after COMMAND completes, as with any local variable. - For example, this construct expands to '12345', and leaves the shell -variable 'X' unchanged in the current execution environment: + For example, this construct expands to ‘12345’, and leaves the shell +variable ‘X’ unchanged in the current execution environment: ${ local X=12345 ; echo $X; } -(not declaring 'X' as local would modify its value in the current +(not declaring ‘X’ as local would modify its value in the current environment, as with normal shell function execution), while this -construct does not require any output to expand to '12345': +construct does not require any output to expand to ‘12345’: ${| REPLY=12345; } -and restores 'REPLY' to the value it had before the command +and restores ‘REPLY’ to the value it had before the command substitution. Command substitutions may be nested. To nest when using the @@ -2353,13 +2353,13 @@ or >(LIST) The process LIST is run asynchronously, and its input or output appears as a filename. This filename is passed as an argument to the current -command as the result of the expansion. If the '>(LIST)' form is used, -writing to the file will provide input for LIST. If the '<(LIST)' form +command as the result of the expansion. If the ‘>(LIST)’ form is used, +writing to the file will provide input for LIST. If the ‘<(LIST)’ form is used, the file passed as an argument should be read to obtain the -output of LIST. Note that no space may appear between the '<' or '>' +output of LIST. Note that no space may appear between the ‘<’ or ‘>’ and the left parenthesis, otherwise the construct would be interpreted as a redirection. Process substitution is supported on systems that -support named pipes (FIFOs) or the '/dev/fd' method of naming open +support named pipes (FIFOs) or the ‘/dev/fd’ method of naming open files. When available, process substitution is performed simultaneously with @@ -2376,34 +2376,34 @@ The shell scans the results of parameter expansion, command substitution, and arithmetic expansion that did not occur within double quotes for word splitting. - The shell treats each character of '$IFS' as a delimiter, and splits + The shell treats each character of ‘$IFS’ as a delimiter, and splits the results of the other expansions into words using these characters as field terminators. - If 'IFS' is unset, or its value is exactly '', -the default, then sequences of 'space', 'tab', and 'newline' at the + If ‘IFS’ is unset, or its value is exactly ‘’, +the default, then sequences of ‘space’, ‘tab’, and ‘newline’ at the beginning and end of the results of the previous expansions are ignored, -and any sequence of 'IFS' characters not at the beginning or end serves -to delimit words. If 'IFS' has a value other than the default, then -sequences of the whitespace characters 'space', 'tab', and 'newline' are +and any sequence of ‘IFS’ characters not at the beginning or end serves +to delimit words. If ‘IFS’ has a value other than the default, then +sequences of the whitespace characters ‘space’, ‘tab’, and ‘newline’ are ignored at the beginning and end of the word, as long as the whitespace -character is in the value of 'IFS' (an 'IFS' whitespace character). Any -character in 'IFS' that is not 'IFS' whitespace, along with any adjacent -'IFS' whitespace characters, delimits a field. A sequence of 'IFS' +character is in the value of ‘IFS’ (an ‘IFS’ whitespace character). Any +character in ‘IFS’ that is not ‘IFS’ whitespace, along with any adjacent +‘IFS’ whitespace characters, delimits a field. A sequence of ‘IFS’ whitespace characters is also treated as a delimiter. - If the value of 'IFS' is null, no word splitting occurs. If 'IFS' is + If the value of ‘IFS’ is null, no word splitting occurs. If ‘IFS’ is unset, word splitting behaves as if it contained the default value -''. +‘’. - Explicit null arguments ('""' or '''') are retained and passed to + Explicit null arguments (‘""’ or ‘''’) are retained and passed to commands as empty strings. Unquoted implicit null arguments, resulting from the expansion of parameters that have no values, are removed. If a parameter with no value is expanded within double quotes, a null argument results and is retained and passed to a command as an empty string. When a quoted null argument appears as part of a word whose expansion is non-null, the null argument is removed. That is, the word -'-d''' becomes '-d' after word splitting and null argument removal. +‘-d''’ becomes ‘-d’ after word splitting and null argument removal. Note that if no expansion occurs, no splitting is performed. @@ -2417,26 +2417,26 @@ File: bashref.info, Node: Filename Expansion, Next: Quote Removal, Prev: Word * Pattern Matching:: How the shell matches patterns. -After word splitting, unless the '-f' option has been set (*note The Set -Builtin::), Bash scans each word for the characters '*', '?', and '['. +After word splitting, unless the ‘-f’ option has been set (*note The Set +Builtin::), Bash scans each word for the characters ‘*’, ‘?’, and ‘[’. If one of these characters appears, and is not quoted, then the word is regarded as a PATTERN, and replaced with an alphabetically sorted list of filenames matching the pattern (*note Pattern Matching::). If no -matching filenames are found, and the shell option 'nullglob' is -disabled, the word is left unchanged. If the 'nullglob' option is set, -and no matches are found, the word is removed. If the 'failglob' shell +matching filenames are found, and the shell option ‘nullglob’ is +disabled, the word is left unchanged. If the ‘nullglob’ option is set, +and no matches are found, the word is removed. If the ‘failglob’ shell option is set, and no matches are found, an error message is printed and -the command is not executed. If the shell option 'nocaseglob' is +the command is not executed. If the shell option ‘nocaseglob’ is enabled, the match is performed without regard to the case of alphabetic characters. - When a pattern is used for filename expansion, the character '.' at + When a pattern is used for filename expansion, the character ‘.’ at the start of a filename or immediately following a slash must be matched -explicitly, unless the shell option 'dotglob' is set. In order to match -the filenames '.' and '..', the pattern must begin with '.' (for -example, '.?'), even if 'dotglob' is set. If the 'globskipdots' shell -option is enabled, the filenames '.' and '..' are never matched, even if -the pattern begins with a '.'. When not matching filenames, the '.' +explicitly, unless the shell option ‘dotglob’ is set. In order to match +the filenames ‘.’ and ‘..’, the pattern must begin with ‘.’ (for +example, ‘.?’), even if ‘dotglob’ is set. If the ‘globskipdots’ shell +option is enabled, the filenames ‘.’ and ‘..’ never match, even if the +pattern begins with a ‘.’. When not matching filenames, the ‘.’ character is not treated specially. When matching a filename, the slash character must always be matched @@ -2444,25 +2444,25 @@ explicitly by a slash in the pattern, but in other matching contexts it can be matched by a special pattern character as described below (*note Pattern Matching::). - See the description of 'shopt' in *note The Shopt Builtin::, for a -description of the 'nocaseglob', 'nullglob', 'globskipdots', 'failglob', -and 'dotglob' options. - - The 'GLOBIGNORE' shell variable may be used to restrict the set of -file names matching a pattern. If 'GLOBIGNORE' is set, each matching -file name that also matches one of the patterns in 'GLOBIGNORE' is -removed from the list of matches. If the 'nocaseglob' option is set, -the matching against the patterns in 'GLOBIGNORE' is performed without -regard to case. The filenames '.' and '..' are always ignored when -'GLOBIGNORE' is set and not null. However, setting 'GLOBIGNORE' to a -non-null value has the effect of enabling the 'dotglob' shell option, so -all other filenames beginning with a '.' will match. To get the old -behavior of ignoring filenames beginning with a '.', make '.*' one of -the patterns in 'GLOBIGNORE'. The 'dotglob' option is disabled when -'GLOBIGNORE' is unset. + See the description of ‘shopt’ in *note The Shopt Builtin::, for a +description of the ‘nocaseglob’, ‘nullglob’, ‘globskipdots’, ‘failglob’, +and ‘dotglob’ options. + + The ‘GLOBIGNORE’ shell variable may be used to restrict the set of +file names matching a pattern. If ‘GLOBIGNORE’ is set, each matching +file name that also matches one of the patterns in ‘GLOBIGNORE’ is +removed from the list of matches. If the ‘nocaseglob’ option is set, +the matching against the patterns in ‘GLOBIGNORE’ is performed without +regard to case. The filenames ‘.’ and ‘..’ are always ignored when +‘GLOBIGNORE’ is set and not null. However, setting ‘GLOBIGNORE’ to a +non-null value has the effect of enabling the ‘dotglob’ shell option, so +all other filenames beginning with a ‘.’ will match. To get the old +behavior of ignoring filenames beginning with a ‘.’, make ‘.*’ one of +the patterns in ‘GLOBIGNORE’. The ‘dotglob’ option is disabled when +‘GLOBIGNORE’ is unset. After the pattern is expanded and matched against filenames, the -value of the 'GLOBSORT' variable controls how the results are sorted, as +value of the ‘GLOBSORT’ variable controls how the results are sorted, as described below (*note Bash Variables::).  @@ -2478,91 +2478,91 @@ escaping backslash is discarded when matching. The special pattern characters must be quoted if they are to be matched literally. The special pattern characters have the following meanings: -'*' - Matches any string, including the null string. When the 'globstar' - shell option is enabled, and '*' is used in a filename expansion - context, two adjacent '*'s used as a single pattern will match all +‘*’ + Matches any string, including the null string. When the ‘globstar’ + shell option is enabled, and ‘*’ is used in a filename expansion + context, two adjacent ‘*’s used as a single pattern will match all files and zero or more directories and subdirectories. If followed - by a '/', two adjacent '*'s will match only directories and + by a ‘/’, two adjacent ‘*’s will match only directories and subdirectories. -'?' +‘?’ Matches any single character. -'[...]' +‘[...]’ Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a RANGE EXPRESSION; any character that falls between those two characters, inclusive, using the current locale's collating sequence and character set, is matched. - If the first character following the '[' is a '!' or a '^' then any - character not enclosed is matched. A '-' may be matched by - including it as the first or last character in the set. A ']' may + If the first character following the ‘[’ is a ‘!’ or a ‘^’ then any + character not enclosed is matched. A ‘−’ may be matched by + including it as the first or last character in the set. A ‘]’ may be matched by including it as the first character in the set. The sorting order of characters in range expressions, and the characters included in the range, are determined by the current - locale and the values of the 'LC_COLLATE' and 'LC_ALL' shell + locale and the values of the ‘LC_COLLATE’ and ‘LC_ALL’ shell variables, if set. - For example, in the default C locale, '[a-dx-z]' is equivalent to - '[abcdxyz]'. Many locales sort characters in dictionary order, and - in these locales '[a-dx-z]' is typically not equivalent to - '[abcdxyz]'; it might be equivalent to '[aBbCcDdxYyZz]', for + For example, in the default C locale, ‘[a-dx-z]’ is equivalent to + ‘[abcdxyz]’. Many locales sort characters in dictionary order, and + in these locales ‘[a-dx-z]’ is typically not equivalent to + ‘[abcdxyz]’; it might be equivalent to ‘[aBbCcDdxYyZz]’, for example. To obtain the traditional interpretation of ranges in bracket expressions, you can force the use of the C locale by - setting the 'LC_COLLATE' or 'LC_ALL' environment variable to the - value 'C', or enable the 'globasciiranges' shell option. + setting the ‘LC_COLLATE’ or ‘LC_ALL’ environment variable to the + value ‘C’, or enable the ‘globasciiranges’ shell option. - Within '[' and ']', "character classes" can be specified using the - syntax '[:'CLASS':]', where CLASS is one of the following classes + Within ‘[’ and ‘]’, “character classes” can be specified using the + syntax ‘[:’CLASS‘:]’, where CLASS is one of the following classes defined in the POSIX standard: alnum alpha ascii blank cntrl digit graph lower print punct space upper word xdigit A character class matches any character belonging to that class. - The 'word' character class matches letters, digits, and the - character '_'. + The ‘word’ character class matches letters, digits, and the + character ‘_’. - Within '[' and ']', an "equivalence class" can be specified using - the syntax '[='C'=]', which matches all characters with the same + Within ‘[’ and ‘]’, an “equivalence class” can be specified using + the syntax ‘[=’C‘=]’, which matches all characters with the same collation weight (as defined by the current locale) as the character C. - Within '[' and ']', the syntax '[.'SYMBOL'.]' matches the collating + Within ‘[’ and ‘]’, the syntax ‘[.’SYMBOL‘.]’ matches the collating symbol SYMBOL. - If the 'extglob' shell option is enabled using the 'shopt' builtin, + If the ‘extglob’ shell option is enabled using the ‘shopt’ builtin, the shell recognizes several extended pattern matching operators. In the following description, a PATTERN-LIST is a list of one or more -patterns separated by a '|'. When matching filenames, the 'dotglob' +patterns separated by a ‘|’. When matching filenames, the ‘dotglob’ shell option determines the set of filenames that are tested, as described above. Composite patterns may be formed using one or more of the following sub-patterns: -'?(PATTERN-LIST)' +‘?(PATTERN-LIST)’ Matches zero or one occurrence of the given patterns. -'*(PATTERN-LIST)' +‘*(PATTERN-LIST)’ Matches zero or more occurrences of the given patterns. -'+(PATTERN-LIST)' +‘+(PATTERN-LIST)’ Matches one or more occurrences of the given patterns. -'@(PATTERN-LIST)' +‘@(PATTERN-LIST)’ Matches one of the given patterns. -'!(PATTERN-LIST)' +‘!(PATTERN-LIST)’ Matches anything except one of the given patterns. - The 'extglob' option changes the behavior of the parser, since the + The ‘extglob’ option changes the behavior of the parser, since the parentheses are normally treated as operators with syntactic meaning. To ensure that extended matching patterns are parsed correctly, make -sure that 'extglob' is enabled before parsing constructs containing the +sure that ‘extglob’ is enabled before parsing constructs containing the patterns, including shell functions and command substitutions. - When matching filenames, the 'dotglob' shell option determines the -set of filenames that are tested: when 'dotglob' is enabled, the set of -filenames includes all files beginning with '.', but the filenames '.' -and '..' must be matched by a pattern or sub-pattern that begins with a + When matching filenames, the ‘dotglob’ shell option determines the +set of filenames that are tested: when ‘dotglob’ is enabled, the set of +filenames includes all files beginning with ‘.’, but the filenames ‘.’ +and ‘..’ must be matched by a pattern or sub-pattern that begins with a dot; when it is disabled, the set does not include any filenames -beginning with "." unless the pattern or sub-pattern begins with a '.'. -As above, '.' only has a special meaning when matching filenames. +beginning with "." unless the pattern or sub-pattern begins with a ‘.’. +As above, ‘.’ only has a special meaning when matching filenames. Complicated extended pattern matching against long strings is slow, especially when the patterns contain alternations and the strings @@ -2577,7 +2577,7 @@ File: bashref.info, Node: Quote Removal, Prev: Filename Expansion, Up: Shell ------------------- After the preceding expansions, all unquoted occurrences of the -characters '\', ''', and '"' that did not result from one of the above +characters ‘\’, ‘'’, and ‘"’ that did not result from one of the above expansions are removed.  @@ -2586,8 +2586,8 @@ File: bashref.info, Node: Redirections, Next: Executing Commands, Prev: Shell 3.6 Redirections ================ -Before a command is executed, its input and output may be "redirected" -using a special notation interpreted by the shell. "Redirection" allows +Before a command is executed, its input and output may be “redirected” +using a special notation interpreted by the shell. “Redirection” allows commands' file handles to be duplicated, opened, closed, made to refer to different files, and can change the files the command reads from and writes to. Redirection may also be used to modify file handles in the @@ -2603,13 +2603,13 @@ file descriptor greater than 10 and assign it to {VARNAME}. If >&- or <&- is preceded by {VARNAME}, the value of VARNAME defines the file descriptor to close. If {VARNAME} is supplied, the redirection persists beyond the scope of the command, allowing the shell programmer to manage -the file descriptor's lifetime manually. The 'varredir_close' shell +the file descriptor's lifetime manually. The ‘varredir_close’ shell option manages this behavior (*note The Shopt Builtin::). In the following descriptions, if the file descriptor number is -omitted, and the first character of the redirection operator is '<', the +omitted, and the first character of the redirection operator is ‘<’, the redirection refers to the standard input (file descriptor 0). If the -first character of the redirection operator is '>', the redirection +first character of the redirection operator is ‘>’, the redirection refers to the standard output (file descriptor 1). The word following the redirection operator in the following @@ -2634,24 +2634,24 @@ system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with the behavior described below. -'/dev/fd/FD' +‘/dev/fd/FD’ If FD is a valid integer, file descriptor FD is duplicated. -'/dev/stdin' +‘/dev/stdin’ File descriptor 0 is duplicated. -'/dev/stdout' +‘/dev/stdout’ File descriptor 1 is duplicated. -'/dev/stderr' +‘/dev/stderr’ File descriptor 2 is duplicated. -'/dev/tcp/HOST/PORT' +‘/dev/tcp/HOST/PORT’ If HOST is a valid hostname or Internet address, and PORT is an integer port number or service name, Bash attempts to open the corresponding TCP socket. -'/dev/udp/HOST/PORT' +‘/dev/udp/HOST/PORT’ If HOST is a valid hostname or Internet address, and PORT is an integer port number or service name, Bash attempts to open the corresponding UDP socket. @@ -2666,8 +2666,8 @@ internally. ----------------------- Redirection of input causes the file whose name results from the -expansion of WORD to be opened for reading on file descriptor 'n', or -the standard input (file descriptor 0) if 'n' is not specified. +expansion of WORD to be opened for reading on file descriptor ‘n’, or +the standard input (file descriptor 0) if ‘n’ is not specified. The general format for redirecting input is: [N][|]WORD - If the redirection operator is '>', and the 'noclobber' option to the -'set' builtin has been enabled, the redirection will fail if the file + If the redirection operator is ‘>’, and the ‘noclobber’ option to the +‘set’ builtin has been enabled, the redirection will fail 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, the redirection is +file. If the redirection operator is ‘>|’, or the redirection operator +is ‘>’ and the ‘noclobber’ option is not enabled, the redirection is attempted even if the file named by WORD exists. 3.6.3 Appending Redirected Output @@ -2717,7 +2717,7 @@ and Of the two forms, the first is preferred. This is semantically equivalent to >WORD 2>&1 - When using the second form, WORD may not expand to a number or '-'. + When using the second form, WORD may not expand to a number or ‘-’. If it does, other redirection operators apply (see Duplicating File Descriptors below) for compatibility reasons. @@ -2744,7 +2744,7 @@ as the standard input (or file descriptor N if N is specified) for a command. The format of here-documents is: - [N]<<[-]WORD + [N]<<[−]WORD HERE-DOCUMENT DELIMITER @@ -2756,10 +2756,10 @@ removal on WORD, and the lines in the here-document are not expanded. If WORD is unquoted, DELIMITER is WORD itself, all lines of the here-document are subjected to parameter expansion, command substitution, and arithmetic expansion, the character sequence -'\newline' is ignored, and '\' must be used to quote the characters '\', -'$', and '`'. +‘\newline’ is ignored, and ‘\’ must be used to quote the characters ‘\’, +‘$’, and ‘`’. - If the redirection operator is '<<-', then all leading tab characters + If the redirection operator is ‘<<-’, then all leading tab characters are stripped from input lines and the line containing DELIMITER. This allows here-documents within shell scripts to be indented in a natural fashion. @@ -2785,7 +2785,7 @@ is used to duplicate input file descriptors. If WORD expands to one or more digits, the file descriptor denoted by N is made to be a copy of that file descriptor. If the digits in WORD do not specify a file descriptor open for input, a redirection error occurs. If WORD -evaluates to '-', file descriptor N is closed. If N is not specified, +evaluates to ‘-’, file descriptor N is closed. If N is not specified, the standard input (file descriptor 0) is used. The operator @@ -2793,9 +2793,9 @@ the standard input (file descriptor 0) is used. is used similarly to duplicate output file descriptors. If N is not specified, the standard output (file descriptor 1) is used. If the digits in WORD do not specify a file descriptor open for output, a -redirection error occurs. If WORD evaluates to '-', file descriptor N +redirection error occurs. If WORD evaluates to ‘-’, file descriptor N is closed. As a special case, if N is omitted, and WORD does not expand -to one or more digits or '-', the standard output and standard error are +to one or more digits or ‘-’, the standard output and standard error are redirected as described previously. 3.6.9 Moving File Descriptors @@ -2863,7 +2863,7 @@ following order. 3. Redirections are performed as described above (*note Redirections::). - 4. The text after the '=' in each variable assignment undergoes tilde + 4. The text after the ‘=’ in each variable assignment undergoes tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable. @@ -2906,14 +2906,14 @@ following actions. invoked. 3. If the name is neither a shell function nor a builtin, and contains - no slashes, Bash searches each element of '$PATH' for a directory + no slashes, Bash searches each element of ‘$PATH’ for a directory containing an executable file by that name. Bash uses a hash table to remember the full pathnames of executable files to avoid - multiple 'PATH' searches (see the description of 'hash' in *note + multiple ‘PATH’ searches (see the description of ‘hash’ in *note Bourne Shell Builtins::). A full search of the directories in - '$PATH' is performed only if the command is not found in the hash + ‘$PATH’ is performed only if the command is not found in the hash table. If the search is unsuccessful, the shell searches for a - defined shell function named 'command_not_found_handle'. If that + defined shell function named ‘command_not_found_handle’. If that function exists, it is invoked in a separate execution environment with the original command and the original command's arguments as its arguments, and the function's exit status becomes the exit @@ -2928,7 +2928,7 @@ following actions. 5. If this execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a - "shell script" and the shell executes it as described in *note + “shell script” and the shell executes it as described in *note Shell Scripts::. 6. If the command was not begun asynchronously, the shell waits for @@ -2940,59 +2940,59 @@ File: bashref.info, Node: Command Execution Environment, Next: Environment, P 3.7.3 Command Execution Environment ----------------------------------- -The shell has an "execution environment", which consists of the +The shell has an “execution environment”, which consists of the following: - * open files inherited by the shell at invocation, as modified by - redirections supplied to the 'exec' builtin + • open files inherited by the shell at invocation, as modified by + redirections supplied to the ‘exec’ builtin - * the current working directory as set by 'cd', 'pushd', or 'popd', + • the current working directory as set by ‘cd’, ‘pushd’, or ‘popd’, or inherited by the shell at invocation - * the file creation mode mask as set by 'umask' or inherited from the + • the file creation mode mask as set by ‘umask’ or inherited from the shell's parent - * current traps set by 'trap' + • current traps set by ‘trap’ - * shell parameters that are set by variable assignment or with 'set' + • shell parameters that are set by variable assignment or with ‘set’ or inherited from the shell's parent in the environment - * shell functions defined during execution or inherited from the + • shell functions defined during execution or inherited from the shell's parent in the environment - * options enabled at invocation (either by default or with - command-line arguments) or by 'set' + • options enabled at invocation (either by default or with + command-line arguments) or by ‘set’ - * options enabled by 'shopt' (*note The Shopt Builtin::) + • options enabled by ‘shopt’ (*note The Shopt Builtin::) - * shell aliases defined with 'alias' (*note Aliases::) + • shell aliases defined with ‘alias’ (*note Aliases::) - * various process IDs, including those of background jobs (*note - Lists::), the value of '$$', and the value of '$PPID' + • various process IDs, including those of background jobs (*note + Lists::), the value of ‘$$’, and the value of ‘$PPID’ When a simple command other than a builtin or shell function is to be executed, it is invoked in a separate execution environment that consists of the following. Unless otherwise noted, the values are inherited from the shell. - * the shell's open files, plus any modifications and additions + • the shell's open files, plus any modifications and additions specified by redirections to the command - * the current working directory + • the current working directory - * the file creation mode mask + • the file creation mode mask - * shell variables and functions marked for export, along with + • shell variables and functions marked for export, along with variables exported for the command, passed in the environment (*note Environment::) - * traps caught by the shell are reset to the values inherited from + • traps caught by the shell are reset to the values inherited from the shell's parent, and traps ignored by the shell are ignored A command invoked in this separate environment cannot affect the shell's execution environment. - A "subshell" is a copy of the shell process. + A “subshell” is a copy of the shell process. Command substitution, commands grouped with parentheses, and asynchronous commands are invoked in a subshell environment that is a @@ -3002,12 +3002,15 @@ at invocation. Builtin commands that are invoked as part of a pipeline are also executed in a subshell environment. Changes made to the subshell environment cannot affect the shell's execution environment. - Subshells spawned to execute command substitutions inherit the value -of the '-e' option from the parent shell. When not in POSIX mode, Bash -clears the '-e' option in such subshells. + When the shell is in POSIX mode, subshells spawned to execute command +substitutions inherit the value of the ‘-e’ option from the parent +shell. When not in POSIX mode, Bash clears the ‘-e’ option in such +subshells See the description of the ‘inherit_errexit’ shell option +(*note Bash Builtins::) for how to control this behavior when not in +POSIX mode. - If a command is followed by a '&' and job control is not active, the -default standard input for the command is the empty file '/dev/null'. + If a command is followed by a ‘&’ and job control is not active, the +default standard input for the command is the empty file ‘/dev/null’. Otherwise, the invoked command inherits the file descriptors of the calling shell as modified by redirections. @@ -3018,20 +3021,20 @@ File: bashref.info, Node: Environment, Next: Exit Status, Prev: Command Execu ----------------- When a program is invoked it is given an array of strings called the -"environment". This is a list of name-value pairs, of the form -'name=value'. +“environment”. This is a list of name-value pairs, of the form +‘name=value’. Bash provides several ways to manipulate the environment. On invocation, the shell scans its own environment and creates a parameter -for each name found, automatically marking it for 'export' to child -processes. Executed commands inherit the environment. The 'export' and -'declare -x' commands allow parameters and functions to be added to and +for each name found, automatically marking it for ‘export’ to child +processes. Executed commands inherit the environment. The ‘export’ and +‘declare -x’ commands allow parameters and functions to be added to and deleted from the environment. If the value of a parameter in the environment is modified, the new value becomes part of the environment, replacing the old. The environment inherited by any executed command consists of the shell's initial environment, whose values may be -modified in the shell, less any pairs removed by the 'unset' and 'export --n' commands, plus any additions via the 'export' and 'declare -x' +modified in the shell, less any pairs removed by the ‘unset’ and ‘export +-n’ commands, plus any additions via the ‘export’ and ‘declare -x’ commands. The environment for any simple command or function may be augmented @@ -3039,11 +3042,11 @@ temporarily by prefixing it with parameter assignments, as described in *note Shell Parameters::. These assignment statements affect only the environment seen by that command. - If the '-k' option is set (*note The Set Builtin::), then all + If the ‘-k’ option is set (*note The Set Builtin::), then all parameter assignments are placed in the environment for a command, not just those that precede the command name. - When Bash invokes an external command, the variable '$_' is set to + When Bash invokes an external command, the variable ‘$_’ is set to the full pathname of the command and passed to that command in its environment. @@ -3054,7 +3057,7 @@ File: bashref.info, Node: Exit Status, Next: Signals, Prev: Environment, Up: ----------------- The exit status of an executed command is the value returned by the -'waitpid' system call or equivalent function. Exit statuses fall +‘waitpid’ system call or equivalent function. Exit statuses fall between 0 and 255, though, as explained below, the shell may use values above 125 specially. Exit statuses from shell builtins and compound commands are also limited to this range. Under certain circumstances, @@ -3094,63 +3097,63 @@ File: bashref.info, Node: Signals, Prev: Exit Status, Up: Executing Commands ------------- When Bash is interactive, in the absence of any traps, it ignores -'SIGTERM' (so that 'kill 0' does not kill an interactive shell), and -'SIGINT' is caught and handled (so that the 'wait' builtin is -interruptible). When Bash receives a 'SIGINT', it breaks out of any -executing loops. In all cases, Bash ignores 'SIGQUIT'. If job control -is in effect (*note Job Control::), Bash ignores 'SIGTTIN', 'SIGTTOU', -and 'SIGTSTP'. +‘SIGTERM’ (so that ‘kill 0’ does not kill an interactive shell), and +‘SIGINT’ is caught and handled (so that the ‘wait’ builtin is +interruptible). When Bash receives a ‘SIGINT’, it breaks out of any +executing loops. In all cases, Bash ignores ‘SIGQUIT’. If job control +is in effect (*note Job Control::), Bash ignores ‘SIGTTIN’, ‘SIGTTOU’, +and ‘SIGTSTP’. Non-builtin commands started by Bash have signal handlers set to the values inherited by the shell from its parent. When job control is not -in effect, asynchronous commands ignore 'SIGINT' and 'SIGQUIT' in +in effect, asynchronous commands ignore ‘SIGINT’ and ‘SIGQUIT’ in addition to these inherited handlers. Commands run as a result of command substitution ignore the keyboard-generated job control signals -'SIGTTIN', 'SIGTTOU', and 'SIGTSTP'. +‘SIGTTIN’, ‘SIGTTOU’, and ‘SIGTSTP’. - The shell exits by default upon receipt of a 'SIGHUP'. Before -exiting, an interactive shell resends the 'SIGHUP' to all jobs, running -or stopped. Stopped jobs are sent 'SIGCONT' to ensure that they receive -the 'SIGHUP'. To prevent the shell from sending the 'SIGHUP' signal to + The shell exits by default upon receipt of a ‘SIGHUP’. Before +exiting, an interactive shell resends the ‘SIGHUP’ to all jobs, running +or stopped. Stopped jobs are sent ‘SIGCONT’ to ensure that they receive +the ‘SIGHUP’. To prevent the shell from sending the ‘SIGHUP’ signal to a particular job, it should be removed from the jobs table with the -'disown' builtin (*note Job Control Builtins::) or marked to not receive -'SIGHUP' using 'disown -h'. +‘disown’ builtin (*note Job Control Builtins::) or marked to not receive +‘SIGHUP’ using ‘disown -h’. - If the 'huponexit' shell option has been set with 'shopt' (*note The -Shopt Builtin::), Bash sends a 'SIGHUP' to all jobs when an interactive + If the ‘huponexit’ shell option has been set with ‘shopt’ (*note The +Shopt Builtin::), Bash sends a ‘SIGHUP’ to all jobs when an interactive login shell exits. If Bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes. When Bash is waiting for an asynchronous command via -the 'wait' builtin, the reception of a signal for which a trap has been -set will cause the 'wait' builtin to return immediately with an exit +the ‘wait’ builtin, the reception of a signal for which a trap has been +set will cause the ‘wait’ builtin to return immediately with an exit status greater than 128, immediately after which the trap is executed. When job control is not enabled, and Bash is waiting for a foreground command to complete, the shell receives keyboard-generated signals such -as 'SIGINT' (usually generated by '^C') that users commonly intend to +as ‘SIGINT’ (usually generated by ‘^C’) that users commonly intend to send to that command. This happens because the shell and the command -are in the same process group as the terminal, and '^C' sends 'SIGINT' +are in the same process group as the terminal, and ‘^C’ sends ‘SIGINT’ to all processes in that process group. See *note Job Control::, for a more in-depth discussion of process groups. When Bash is running without job control enabled and receives -'SIGINT' while waiting for a foreground command, it waits until that +‘SIGINT’ while waiting for a foreground command, it waits until that foreground command terminates and then decides what to do about the -'SIGINT': +‘SIGINT’: - 1. If the command terminates due to the 'SIGINT', Bash concludes that - the user meant to end the entire script, and acts on the 'SIGINT' - (e.g., by running a 'SIGINT' trap or exiting itself); + 1. If the command terminates due to the ‘SIGINT’, Bash concludes that + the user meant to end the entire script, and acts on the ‘SIGINT’ + (e.g., by running a ‘SIGINT’ trap or exiting itself); - 2. If the pipeline does not terminate due to 'SIGINT', the program - handled the 'SIGINT' itself and did not treat it as a fatal signal. - In that case, Bash does not treat 'SIGINT' as a fatal signal, - either, instead assuming that the 'SIGINT' was used as part of the - program's normal operation (e.g., 'emacs' uses it to abort editing + 2. If the pipeline does not terminate due to ‘SIGINT’, the program + handled the ‘SIGINT’ itself and did not treat it as a fatal signal. + In that case, Bash does not treat ‘SIGINT’ as a fatal signal, + either, instead assuming that the ‘SIGINT’ was used as part of the + program's normal operation (e.g., ‘emacs’ uses it to abort editing commands) or deliberately discarded. However, Bash will run any - trap set on 'SIGINT', as it does with any other trapped signal it + trap set on ‘SIGINT’, as it does with any other trapped signal it receives while it is waiting for the foreground command to complete, for compatibility. @@ -3162,38 +3165,38 @@ File: bashref.info, Node: Shell Scripts, Prev: Executing Commands, Up: Basic A shell script is a text file containing shell commands. When such a file is used as the first non-option argument when invoking Bash, and -neither the '-c' nor '-s' option is supplied (*note Invoking Bash::), +neither the ‘-c’ nor ‘-s’ option is supplied (*note Invoking Bash::), Bash reads and executes commands from the file, then exits. This mode of operation creates a non-interactive shell. The shell first searches for the file in the current directory, and looks in the directories in -'$PATH' if not found there. +‘$PATH’ if not found there. - When Bash runs a shell script, it sets the special parameter '0' to + When Bash runs a shell script, it sets the special parameter ‘0’ to the name of the file, rather than the name of the shell, and the positional parameters are set to the remaining arguments, if any are given. If no additional arguments are supplied, the positional parameters are unset. - A shell script may be made executable by using the 'chmod' command to + A shell script may be made executable by using the ‘chmod’ command to turn on the execute bit. When Bash finds such a file while searching -the '$PATH' for a command, it creates a new instance of itself to +the ‘$PATH’ for a command, it creates a new instance of itself to execute it. In other words, executing filename ARGUMENTS is equivalent to executing bash filename ARGUMENTS -if 'filename' is an executable shell script. This subshell +if ‘filename’ is an executable shell script. This subshell reinitializes itself, so that the effect is as if a new shell had been invoked to interpret the script, with the exception that the locations -of commands remembered by the parent (see the description of 'hash' in +of commands remembered by the parent (see the description of ‘hash’ in *note Bourne Shell Builtins::) are retained by the child. Most versions of Unix make this a part of the operating system's command execution mechanism. If the first line of a script begins with -the two characters '#!', the remainder of the line specifies an +the two characters ‘#!’, the remainder of the line specifies an interpreter for the program and, depending on the operating system, one or more optional arguments for that interpreter. Thus, you can specify -Bash, 'awk', Perl, or some other interpreter and write the rest of the +Bash, ‘awk’, Perl, or some other interpreter and write the rest of the script file in that language. The arguments to the interpreter consist of one or more optional @@ -3207,12 +3210,12 @@ older versions of Unix limit the interpreter name and a single argument to a maximum of 32 characters, so it's not portable to assume that using more than one argument will work. - Bash scripts often begin with '#! /bin/bash' (assuming that Bash has -been installed in '/bin'), since this ensures that Bash will be used to + Bash scripts often begin with ‘#! /bin/bash’ (assuming that Bash has +been installed in ‘/bin’), since this ensures that Bash will be used to interpret the script, even if it is executed under another shell. It's -a common idiom to use 'env' to find 'bash' even if it's been installed -in another directory: '#!/usr/bin/env bash' will find the first -occurrence of 'bash' in '$PATH'. +a common idiom to use ‘env’ to find ‘bash’ even if it's been installed +in another directory: ‘#!/usr/bin/env bash’ will find the first +occurrence of ‘bash’ in ‘$PATH’.  File: bashref.info, Node: Shell Builtin Commands, Next: Shell Variables, Prev: Basic Shell Features, Up: Top @@ -3251,14 +3254,14 @@ Completion Builtins::). Many of the builtins have been extended by POSIX or Bash. Unless otherwise noted, each builtin command documented as accepting -options preceded by '-' accepts '--' to signify the end of the options. -The ':', 'true', 'false', and 'test'/'[' builtins do not accept options -and do not treat '--' specially. The 'exit', 'logout', 'return', -'break', 'continue', 'let', and 'shift' builtins accept and process -arguments beginning with '-' without requiring '--'. Other builtins +options preceded by ‘-’ accepts ‘--’ to signify the end of the options. +The ‘:’, ‘true’, ‘false’, and ‘test’/‘[’ builtins do not accept options +and do not treat ‘--’ specially. The ‘exit’, ‘logout’, ‘return’, +‘break’, ‘continue’, ‘let’, and ‘shift’ 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 interpretation. +interpret arguments beginning with ‘-’ as invalid options and require +‘--’ to prevent this interpretation.  File: bashref.info, Node: Bourne Shell Builtins, Next: Bash Builtins, Up: Shell Builtin Commands @@ -3270,312 +3273,312 @@ The following shell builtin commands are inherited from the Bourne Shell. These commands are implemented as specified by the POSIX standard. -': (a colon)' +‘: (a colon)’ : [ARGUMENTS] Do nothing beyond expanding ARGUMENTS and performing redirections. The return status is zero. -'. (a period)' +‘. (a period)’ . FILENAME [ARGUMENTS] Read and execute commands from the FILENAME argument in the current - shell context. If FILENAME does not contain a slash, the 'PATH' + shell context. If FILENAME does not contain a slash, the ‘PATH’ variable is used to find FILENAME, but FILENAME does not need to be executable. When Bash is not in POSIX mode, it searches the - current directory if FILENAME is not found in '$PATH'. If any + current directory if FILENAME is not found in ‘$PATH’. If any ARGUMENTS are supplied, they become the positional parameters when FILENAME is executed. Otherwise the positional parameters are - unchanged. If the '-T' option is enabled, '.' inherits any trap on - 'DEBUG'; if it is not, any 'DEBUG' trap string is saved and - restored around the call to '.', and '.' unsets the 'DEBUG' trap - while it executes. If '-T' is not set, and the sourced file - changes the 'DEBUG' trap, the new value is retained when '.' + unchanged. If the ‘-T’ option is enabled, ‘.’ inherits any trap on + ‘DEBUG’; if it is not, any ‘DEBUG’ trap string is saved and + restored around the call to ‘.’, and ‘.’ unsets the ‘DEBUG’ trap + while it executes. If ‘-T’ is not set, and the sourced file + changes the ‘DEBUG’ trap, the new value is retained when ‘.’ completes. The return status is the exit status of the last command executed, or zero if no commands are executed. If FILENAME is not found, or cannot be read, the return status is non-zero. - This builtin is equivalent to 'source'. + This builtin is equivalent to ‘source’. -'break' +‘break’ break [N] - Exit from a 'for', 'while', 'until', or 'select' loop. If N is + Exit from a ‘for’, ‘while’, ‘until’, or ‘select’ loop. If N is supplied, the Nth enclosing loop is exited. N must be greater than or equal to 1. The return status is zero unless N is not greater than or equal to 1. -'cd' +‘cd’ cd [-L|[-P [-e]]] [-@] [DIRECTORY] Change the current working directory to DIRECTORY. If DIRECTORY is - not supplied, the value of the 'HOME' shell variable is used. If - the shell variable 'CDPATH' exists, it is used as a search path: - each directory name in 'CDPATH' is searched for DIRECTORY, with - alternative directory names in 'CDPATH' separated by a colon (':'). - If DIRECTORY begins with a slash, 'CDPATH' is not used. - - The '-P' option means to not follow symbolic links: symbolic links - are resolved while 'cd' is traversing DIRECTORY and before - processing an instance of '..' in DIRECTORY. - - By default, or when the '-L' option is supplied, symbolic links in - DIRECTORY are resolved after 'cd' processes an instance of '..' in + not supplied, the value of the ‘HOME’ shell variable is used. If + the shell variable ‘CDPATH’ exists, ‘cd’ uses it as a search path: + ‘cd’ searches each directory name in ‘CDPATH’ for DIRECTORY, with + alternative directory names in ‘CDPATH’ separated by a colon (‘:’). + If DIRECTORY begins with a slash, ‘CDPATH’ is not used. + + The ‘-P’ option means to not follow symbolic links: symbolic links + are resolved while ‘cd’ is traversing DIRECTORY and before + processing an instance of ‘..’ in DIRECTORY. + + By default, or when the ‘-L’ option is supplied, symbolic links in + DIRECTORY are resolved after ‘cd’ processes an instance of ‘..’ in DIRECTORY. - If '..' appears in DIRECTORY, it is processed by removing the + If ‘..’ appears in DIRECTORY, it is processed by removing the immediately preceding pathname component, back to a slash or the beginning of DIRECTORY. - If the '-e' option is supplied with '-P' and the current working + If the ‘-e’ option is supplied with ‘-P’ and the current working directory cannot be successfully determined after a successful - directory change, 'cd' will return an unsuccessful status. + directory change, ‘cd’ will return an unsuccessful 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. - If DIRECTORY is '-', it is converted to '$OLDPWD' before the + If DIRECTORY is ‘-’, it is converted to ‘$OLDPWD’ before the directory change is attempted. - If a non-empty directory name from 'CDPATH' is used, or if '-' is + If a non-empty directory name from ‘CDPATH’ is used, or if ‘-’ is the first argument, and the directory change is successful, the absolute pathname of the new working directory is written to the standard output. - If the directory change is successful, 'cd' sets the value of the - 'PWD' environment variable to the new directory name, and sets the - 'OLDPWD' environment variable to the value of the current working + If the directory change is successful, ‘cd’ sets the value of the + ‘PWD’ environment variable to the new directory name, and sets the + ‘OLDPWD’ environment variable to the value of the current working directory before the change. The return status is zero if the directory is successfully changed, non-zero otherwise. -'continue' +‘continue’ continue [N] - Resume the next iteration of an enclosing 'for', 'while', 'until', - or 'select' loop. If N is supplied, the execution of the Nth + Resume the next iteration of an enclosing ‘for’, ‘while’, ‘until’, + or ‘select’ loop. If N is supplied, the execution of the Nth enclosing loop is resumed. N must be greater than or equal to 1. The return status is zero unless N is not greater than or equal to 1. -'eval' +‘eval’ eval [ARGUMENTS] The arguments are concatenated together into a single command, which is then read and executed, and its exit status returned as - the exit status of 'eval'. If there are no arguments or only empty + the exit status of ‘eval’. If there are no arguments or only empty arguments, the return status is zero. -'exec' +‘exec’ exec [-cl] [-a NAME] [COMMAND [ARGUMENTS]] If COMMAND is supplied, it replaces the shell without creating a - new process. If the '-l' option is supplied, the shell places a + new process. If the ‘-l’ option is supplied, the shell places a dash at the beginning of the zeroth argument passed to COMMAND. - This is what the 'login' program does. The '-c' option causes - COMMAND to be executed with an empty environment. If '-a' is + This is what the ‘login’ program does. The ‘-c’ option causes + COMMAND to be executed with an empty environment. If ‘-a’ is supplied, the shell passes NAME as the zeroth argument to COMMAND. If COMMAND cannot be executed for some reason, a non-interactive - shell exits, unless the 'execfail' shell option is enabled. In + shell exits, unless the ‘execfail’ shell option is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed. A subshell exits - unconditionally if 'exec' fails. If no COMMAND is specified, + unconditionally if ‘exec’ fails. If no COMMAND is specified, redirections may be used to affect the current shell environment. If there are no redirection errors, the return status is zero; otherwise the return status is non-zero. -'exit' +‘exit’ exit [N] Exit the shell, returning a status of N to the shell's parent. If N is omitted, the exit status is that of the last command executed. - Any trap on 'EXIT' is executed before the shell terminates. + Any trap on ‘EXIT’ is executed before the shell terminates. -'export' +‘export’ export [-fn] [-p] [NAME[=VALUE]] Mark each NAME to be passed to child processes in the environment. - If the '-f' option is supplied, the NAMEs refer to shell functions; - otherwise the names refer to shell variables. The '-n' option + If the ‘-f’ option is supplied, the NAMEs refer to shell functions; + otherwise the names refer to shell variables. The ‘-n’ option means to no longer mark each NAME for export. If no NAMEs are - supplied, or if the '-p' option is given, a list of names of all - exported variables is displayed. The '-p' option displays output + supplied, or if the ‘-p’ option is given, a list of names of all + exported variables is displayed. The ‘-p’ option displays output in a form that may be reused as input. If a variable name is followed by =VALUE, the value of the variable is set to VALUE. The return status is zero unless an invalid option is supplied, one - of the names is not a valid shell variable name, or '-f' is + of the names is not a valid shell variable name, or ‘-f’ is supplied with a name that is not a shell function. -'false' +‘false’ false Does nothing, returns a non-zero status. -'getopts' +‘getopts’ getopts OPTSTRING NAME [ARG ...] - 'getopts' is used by shell scripts to parse positional parameters. + ‘getopts’ is used by shell scripts to parse positional parameters. OPTSTRING 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 whitespace. The - colon (':') and question mark ('?') may not be used as option - characters. Each time it is invoked, 'getopts' places the next + colon (‘:’) and question mark (‘?’) may not be used as option + characters. Each time it is invoked, ‘getopts’ places the next option in the shell variable NAME, initializing NAME if it does not exist, and the index of the next argument to be processed into the - variable 'OPTIND'. 'OPTIND' is initialized to 1 each time the + variable ‘OPTIND’. ‘OPTIND’ is initialized to 1 each time the shell or a shell script is invoked. When an option requires an - argument, 'getopts' places that argument into the variable - 'OPTARG'. The shell does not reset 'OPTIND' automatically; it must - be manually reset between multiple calls to 'getopts' within the + argument, ‘getopts’ places that argument into the variable + ‘OPTARG’. The shell does not reset ‘OPTIND’ automatically; it must + be manually reset between multiple calls to ‘getopts’ within the same shell invocation if a new set of parameters is to be used. - When the end of options is encountered, 'getopts' exits with a - return value greater than zero. 'OPTIND' is set to the index of - the first non-option argument, and NAME is set to '?'. + When the end of options is encountered, ‘getopts’ exits with a + return value greater than zero. ‘OPTIND’ is set to the index of + the first non-option argument, and NAME is set to ‘?’. - 'getopts' normally parses the positional parameters, but if more - arguments are supplied as ARG values, 'getopts' parses those + ‘getopts’ normally parses the positional parameters, but if more + arguments are supplied as ARG values, ‘getopts’ parses those instead. - 'getopts' can report errors in two ways. If the first character of + ‘getopts’ can report errors in two ways. If the first character of OPTSTRING is a colon, SILENT error reporting is used. In normal operation, diagnostic messages are printed when invalid options or - missing option arguments are encountered. If the variable 'OPTERR' + missing option arguments are encountered. If the variable ‘OPTERR’ is set to 0, no error messages will be displayed, even if the first - character of 'optstring' is not a colon. + character of ‘optstring’ is not a colon. - If an invalid option is seen, 'getopts' places '?' into NAME and, - if not silent, prints an error message and unsets 'OPTARG'. If - 'getopts' is silent, the option character found is placed in - 'OPTARG' and no diagnostic message is printed. + If ‘getopts’ detects an invalid option, it places ‘?’ into NAME + and, if not silent, prints an error message and unsets ‘OPTARG’. + If ‘getopts’ is silent, it assigns the option character found to + ‘OPTARG’ and does not print a diagnostic message. - If a required argument is not found, and 'getopts' is not silent, a - question mark ('?') is placed in NAME, 'OPTARG' is unset, and a - diagnostic message is printed. If 'getopts' is silent, then a - colon (':') is placed in NAME and 'OPTARG' is set to the option - character found. + If a required argument is not found, and ‘getopts’ is not silent, + it sets the value of NAME to a question mark (‘?’), unsets + ‘OPTARG’, and prints a diagnostic message. If ‘getopts’ is silent, + it sets the value of NAME to a colon (‘:’), and sets ‘OPTARG’ to + the option character found. -'hash' +‘hash’ hash [-r] [-p FILENAME] [-dt] [NAME] - Each time 'hash' is invoked, it remembers the full filenames of the + Each time ‘hash’ is invoked, it remembers the full filenames of the commands specified as NAME arguments, so they need not be searched for on subsequent invocations. The commands are found by searching - through the directories listed in '$PATH'. Any - previously-remembered filename is discarded. The '-p' option + through the directories listed in ‘$PATH’. Any + previously-remembered filename is discarded. The ‘-p’ option inhibits the path search, and FILENAME is used as the location of - NAME. The '-r' option causes the shell to forget all remembered - locations. Assigning to the 'PATH' variable also clears all hashed - filenames. The '-d' option causes the shell to forget the - remembered location of each NAME. If the '-t' option is supplied, + NAME. The ‘-r’ option causes the shell to forget all remembered + locations. Assigning to the ‘PATH’ variable also clears all hashed + filenames. The ‘-d’ option causes the shell to forget the + remembered location of each NAME. If the ‘-t’ option is supplied, the full pathname to which each NAME corresponds is printed. If - multiple NAME arguments are supplied with '-t', the NAME is printed - before the hashed full pathname. The '-l' option causes output to + multiple NAME arguments are supplied with ‘-t’, the NAME is printed + before the hashed full pathname. The ‘-l’ option causes output to be displayed in a format that may be reused as input. If no - arguments are given, or if only '-l' is supplied, information about - remembered commands is printed. The '-t', '-d', and '-p' options + arguments are given, or if only ‘-l’ is supplied, information about + remembered commands is printed. The ‘-t’, ‘-d’, and ‘-p’ options (the options that act on the NAME arguments) are mutually exclusive. Only one will be active. If more than one is supplied, - '-t' has higher priority than '-p', and both are higher priority - than '-d'. The return status is zero unless a NAME is not found or + ‘-t’ has higher priority than ‘-p’, and both are higher priority + than ‘-d’. The return status is zero unless a NAME is not found or an invalid option is supplied. -'pwd' +‘pwd’ pwd [-LP] Print the absolute pathname of the current working directory. If - the '-P' option is supplied, the pathname printed will not contain - symbolic links. If the '-L' option is supplied, the pathname + the ‘-P’ option is supplied, the pathname printed will not contain + symbolic links. If the ‘-L’ option is supplied, the pathname printed may contain symbolic links. The return status is zero unless an error is encountered while determining the name of the current directory or an invalid option is supplied. -'readonly' +‘readonly’ readonly [-aAf] [-p] [NAME[=VALUE]] ... Mark each NAME as readonly. The values of these names may not be - changed by subsequent assignment. If the '-f' option is supplied, - each NAME refers to a shell function. The '-a' option means each - NAME refers to an indexed array variable; the '-A' option means + changed by subsequent assignment. If the ‘-f’ option is supplied, + each NAME refers to a shell function. The ‘-a’ option means each + NAME refers to an indexed array variable; the ‘-A’ option means each NAME refers to an associative array variable. If both options - are supplied, '-A' takes precedence. If no NAME arguments are - given, or if the '-p' option is supplied, a list of all readonly + are supplied, ‘-A’ takes precedence. If no NAME arguments are + given, or if the ‘-p’ option is supplied, a list of all readonly names is printed. The other options may be used to restrict the - output to a subset of the set of readonly names. The '-p' option + output to a subset of the set of readonly names. The ‘-p’ option causes output to be displayed in a format that may be reused as input. If a variable name is followed by =VALUE, the value of the variable is set to VALUE. The return status is zero unless an invalid option is supplied, one of the NAME arguments is not a - valid shell variable or function name, or the '-f' option is + valid shell variable or function name, or the ‘-f’ option is supplied with a name that is not a shell function. -'return' +‘return’ return [N] Cause a shell function to stop executing and return the value N to its caller. If N is not supplied, the return value is the exit - status of the last command executed in the function. If 'return' + status of the last command executed in the function. If ‘return’ is executed by a trap handler, the last command used to determine the status is the last command executed before the trap handler. - If 'return' is executed during a 'DEBUG' trap, the last command + If ‘return’ is executed during a ‘DEBUG’ trap, the last command used to determine the status is the last command executed by the - trap handler before 'return' was invoked. 'return' may also be - used to terminate execution of a script being executed with the '.' - ('source') builtin, returning either N or the exit status of the + trap handler before ‘return’ was invoked. ‘return’ may also be + used to terminate execution of a script being executed with the ‘.’ + (‘source’) builtin, returning either N or the exit status of the last command executed within the script as the exit status of the script. If N is supplied, the return value is its least - significant 8 bits. Any command associated with the 'RETURN' trap + significant 8 bits. Any command associated with the ‘RETURN’ trap is executed before execution resumes after the function or script. - The return status is non-zero if 'return' is supplied a non-numeric + The return status is non-zero if ‘return’ is supplied a non-numeric argument or is used outside a function and not during the execution - of a script by '.' or 'source'. + of a script by ‘.’ or ‘source’. -'shift' +‘shift’ shift [N] Shift the positional parameters to the left by N. The positional - parameters from N+1 ... '$#' are renamed to '$1' ... '$#'-N. - Parameters represented by the numbers '$#' down to '$#'-N+1 are - unset. N must be a non-negative number less than or equal to '$#'. - If N is zero or greater than '$#', the positional parameters are + parameters from N+1 ... ‘$#’ are renamed to ‘$1’ ... ‘$#’-N. + Parameters represented by the numbers ‘$#’ down to ‘$#’-N+1 are + unset. N must be a non-negative number less than or equal to ‘$#’. + If N is zero or greater than ‘$#’, the positional parameters are not changed. If N is not supplied, it is assumed to be 1. The - return status is zero unless N is greater than '$#' or less than + return status is zero unless N is greater than ‘$#’ or less than zero, non-zero otherwise. -'test' -'[' +‘test’ +‘[’ test EXPR Evaluate a conditional expression EXPR and return a status of 0 (true) or 1 (false). Each operator and operand must be a separate argument. Expressions are composed of the primaries described - below in *note Bash Conditional Expressions::. 'test' does not + below in *note Bash Conditional Expressions::. ‘test’ does not accept any options, nor does it accept and ignore an argument of - '--' as signifying the end of options. + ‘--’ as signifying the end of options. - When the '[' form is used, the last argument to the command must be - a ']'. + When the ‘[’ form is used, the last argument to the command must be + a ‘]’. Expressions may be combined using the following operators, listed in decreasing order of precedence. The evaluation depends on the number of arguments; see below. Operator precedence is used when there are five or more arguments. - '! EXPR' + ‘! EXPR’ True if EXPR is false. - '( EXPR )' + ‘( EXPR )’ Returns the value of EXPR. This may be used to override the normal precedence of operators. - 'EXPR1 -a EXPR2' + ‘EXPR1 -a EXPR2’ True if both EXPR1 and EXPR2 are true. - 'EXPR1 -o EXPR2' + ‘EXPR1 -o EXPR2’ True if either EXPR1 or EXPR2 is true. - The 'test' and '[' builtins evaluate conditional expressions using + The ‘test’ and ‘[’ builtins evaluate conditional expressions using a set of rules based on the number of arguments. 0 arguments @@ -3586,7 +3589,7 @@ standard. null. 2 arguments - If the first argument is '!', the expression is true if and + If the first argument is ‘!’, the expression is true if and only if the second argument is null. If the first argument is one of the unary conditional operators (*note Bash Conditional Expressions::), the expression is true if the unary test is @@ -3600,24 +3603,24 @@ standard. operators (*note Bash Conditional Expressions::), the result of the expression is the result of the binary test using the first and third arguments as operands. The - '-a' and '-o' operators are considered binary operators + ‘-a’ and ‘-o’ operators are considered binary operators when there are three arguments. - 2. If the first argument is '!', the value is the negation + 2. If the first argument is ‘!’, the value is the negation of the two-argument test using the second and third arguments. - 3. If the first argument is exactly '(' and the third - argument is exactly ')', the result is the one-argument + 3. If the first argument is exactly ‘(’ and the third + argument is exactly ‘)’, the result is the one-argument test of the second argument. 4. Otherwise, the expression is false. 4 arguments The following conditions are applied in the order listed. - 1. If the first argument is '!', the result is the negation + 1. If the first argument is ‘!’, the result is the negation of the three-argument expression composed of the remaining arguments. - 2. If the first argument is exactly '(' and the fourth - argument is exactly ')', the result is the two-argument + 2. If the first argument is exactly ‘(’ and the fourth + argument is exactly ‘)’, the result is the two-argument test of the second and third arguments. 3. Otherwise, the expression is parsed and evaluated according to precedence using the rules listed above. @@ -3626,18 +3629,18 @@ standard. The expression is parsed and evaluated according to precedence using the rules listed above. - If the shell is not in POSIX mode, when used with 'test' or '[', - the '<' and '>' operators sort lexicographically using ASCII - ordering. If the shell is in POSIX mode, these operators use the - current locale. + If the shell is in POSIX mode, or if the expression is part of the + ‘[[’ command, the ‘<’ and ‘>’ operators sort using the current + locale. If the shell is not in POSIX mode, the ‘test’ and ‘[’ + 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 standard has deprecated the '-a' and '-o' + primaries. The POSIX standard has deprecated the ‘-a’ and ‘-o’ 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 '-a' - and '-o' with the shell's '&&' and '||' list operators. For + test invocations to a single primary, and to replace uses of ‘-a’ + and ‘-o’ with the shell's ‘&&’ and ‘||’ list operators. For example, use test -n string1 && test -n string2 @@ -3646,64 +3649,64 @@ standard. test -n string1 -a -n string2 -'times' +‘times’ times Print out the user and system times used by the shell and its children. The return status is zero. -'trap' +‘trap’ trap [-Plp] [ACTION] [SIGSPEC ...] The ACTION is a command that is read and executed when the shell receives signal SIGSPEC. If ACTION is absent (and there is a - single SIGSPEC) or equal to '-', each specified signal's + single SIGSPEC) or equal to ‘-’, each specified signal'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. - If no arguments are supplied, 'trap' prints the actions associated - with each trapped signal as a set of 'trap' commands that can be + If no arguments are supplied, ‘trap’ prints the actions associated + with each trapped signal as a set of ‘trap’ commands that can be reused as shell input to restore the current signal dispositions. - If ACTION is not present and '-p' has been supplied, 'trap' + If ACTION is not present and ‘-p’ has been supplied, ‘trap’ displays the trap commands associated with each SIGSPEC, or, if no - SIGSPECs are supplied, for all trapped signals, as a set of 'trap' + SIGSPECs are supplied, for all trapped signals, as a set of ‘trap’ commands that can be reused as shell input to restore the current - signal dispositions. The '-P' option behaves similarly, but + signal dispositions. The ‘-P’ option behaves similarly, but displays only the actions associated with each SIGSPEC argument. - '-P' requires at least one SIGSPEC argument. The '-P' or '-p' - options to 'trap' may be used in a subshell environment (e.g., - command substitution) and, as long as they are used before 'trap' + ‘-P’ requires at least one SIGSPEC argument. The ‘-P’ or ‘-p’ + options to ‘trap’ may be used in a subshell environment (e.g., + command substitution) and, as long as they are used before ‘trap’ is used to change a signal's handling, will display the state of its parent's traps. - The '-l' option causes 'trap' to print a list of signal names and + The ‘-l’ option causes ‘trap’ to print a list of signal names and their corresponding numbers. Each SIGSPEC is either a signal name or a signal number. Signal names are case insensitive and the - 'SIG' prefix is optional. + ‘SIG’ prefix is optional. - If a SIGSPEC is '0' or 'EXIT', ACTION is executed when the shell - exits. If a SIGSPEC is 'DEBUG', ACTION is executed before every - simple command, 'for' command, 'case' command, 'select' command, (( - arithmetic command, [[ conditional command, arithmetic 'for' + If a SIGSPEC is ‘0’ or ‘EXIT’, ACTION is executed when the shell + exits. If a SIGSPEC is ‘DEBUG’, ACTION is executed before every + simple command, ‘for’ command, ‘case’ command, ‘select’ command, (( + arithmetic command, [[ conditional command, arithmetic ‘for’ command, and before the first command executes in a shell function. - Refer to the description of the 'extdebug' option to the 'shopt' + Refer to the description of the ‘extdebug’ option to the ‘shopt’ builtin (*note The Shopt Builtin::) for details of its effect on - the 'DEBUG' trap. If a SIGSPEC is 'RETURN', ACTION is executed - each time a shell function or a script executed with the '.' or - 'source' builtins finishes executing. + the ‘DEBUG’ trap. If a SIGSPEC is ‘RETURN’, ACTION is executed + each time a shell function or a script executed with the ‘.’ or + ‘source’ builtins finishes executing. - If a SIGSPEC is 'ERR', ACTION is executed whenever a pipeline + If a SIGSPEC is ‘ERR’, ACTION 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 'ERR' trap is not executed if the failed + following conditions. The ‘ERR’ trap is not executed if the failed command is part of the command list immediately following an - 'until' or 'while' keyword, part of the test following the 'if' or - 'elif' reserved words, part of a command executed in a '&&' or '||' - list except the command following the final '&&' or '||', any + ‘until’ or ‘while’ keyword, part of the test following the ‘if’ or + ‘elif’ reserved words, part of a command executed in a ‘&&’ or ‘||’ + list except the command following the final ‘&&’ or ‘||’, any command in a pipeline but the last, or if the command's return - status is being inverted using '!'. These are the same conditions - obeyed by the 'errexit' ('-e') option. + status is being inverted using ‘!’. These are the same conditions + obeyed by the ‘errexit’ (‘-e’) option. Signals ignored upon entry to a non-interactive shell cannot be trapped or reset. Interactive shells permit trapping signals @@ -3714,39 +3717,39 @@ standard. The return status is zero unless a SIGSPEC does not specify a valid signal. -'true' +‘true’ true Does nothing, returns a 0 status. -'umask' +‘umask’ umask [-p] [-S] [MODE] Set the shell process's file creation mask to MODE. If MODE begins with a digit, it is interpreted as an octal number; if not, it is interpreted as a symbolic mode mask similar to that accepted by the - 'chmod' command. If MODE is omitted, the current value of the mask - is printed. If the '-S' option is supplied without a MODE - argument, the mask is printed in a symbolic format. If the '-p' + ‘chmod’ command. If MODE is omitted, the current value of the mask + is printed. If the ‘-S’ option is supplied without a MODE + argument, the mask is printed in a symbolic format. If the ‘-p’ option is supplied, and MODE is omitted, the output is in a form that may be reused as input. The return status is zero if the mode is successfully changed or if no MODE argument is supplied, and non-zero otherwise. Note that when the mode is interpreted as an octal number, each - number of the umask is subtracted from '7'. Thus, a umask of '022' - results in permissions of '755'. + number of the umask is subtracted from ‘7’. Thus, a umask of ‘022’ + results in permissions of ‘755’. -'unset' +‘unset’ unset [-fnv] [NAME] - Remove each variable or function NAME. If the '-v' option is + Remove each variable or function NAME. If the ‘-v’ option is given, each NAME refers to a shell variable and that variable is - removed. If the '-f' option is given, the NAMEs refer to shell - functions, and the function definition is removed. If the '-n' - option is supplied, and NAME is a variable with the 'nameref' + removed. If the ‘-f’ option is given, the NAMEs refer to shell + functions, and the function definition is removed. If the ‘-n’ + option is supplied, and NAME is a variable with the ‘nameref’ attribute, NAME will be unset rather than the variable it - references. '-n' has no effect if the '-f' option is supplied. If + references. ‘-n’ has no effect if the ‘-f’ option is supplied. If no options are supplied, each NAME refers to a variable; if there is no variable by that name, a function with that name, if any, is unset. Readonly variables and functions may not be unset. Some @@ -3765,17 +3768,17 @@ This section describes builtin commands which are unique to or have been extended in Bash. Some of these commands are specified in the POSIX standard. -'alias' +‘alias’ alias [-p] [NAME[=VALUE] ...] - Without arguments or with the '-p' option, 'alias' prints the list + Without arguments or with the ‘-p’ option, ‘alias’ prints the list of aliases on the standard output in a form that allows them to be reused as input. If arguments are supplied, an alias is defined for each NAME whose VALUE is given. If no VALUE is given, the name and value of the alias is printed. Aliases are described in *note Aliases::. -'bind' +‘bind’ bind [-m KEYMAP] [-lpsvPSVX] bind [-m KEYMAP] [-q FUNCTION] [-u FUNCTION] [-r KEYSEQ] bind [-m KEYMAP] -f FILENAME @@ -3789,60 +3792,60 @@ standard. macro, or set a Readline variable. Each non-option argument is a command as it would appear in a Readline initialization file (*note Readline Init File::), but each binding or command must be passed - as a separate argument; e.g., '"\C-x\C-r":re-read-init-file'. + as a separate argument; e.g., ‘"\C-x\C-r":re-read-init-file’. Options, if supplied, have the following meanings: - '-m KEYMAP' + ‘-m KEYMAP’ Use KEYMAP as the keymap to be affected by the subsequent - bindings. Acceptable KEYMAP names are 'emacs', - 'emacs-standard', 'emacs-meta', 'emacs-ctlx', 'vi', 'vi-move', - 'vi-command', and 'vi-insert'. 'vi' is equivalent to - 'vi-command' ('vi-move' is also a synonym); 'emacs' is - equivalent to 'emacs-standard'. + bindings. Acceptable KEYMAP names are ‘emacs’, + ‘emacs-standard’, ‘emacs-meta’, ‘emacs-ctlx’, ‘vi’, ‘vi-move’, + ‘vi-command’, and ‘vi-insert’. ‘vi’ is equivalent to + ‘vi-command’ (‘vi-move’ is also a synonym); ‘emacs’ is + equivalent to ‘emacs-standard’. - '-l' + ‘-l’ List the names of all Readline functions. - '-p' + ‘-p’ Display Readline function names and bindings in such a way - that they can be used as an argument to a subsequent 'bind' + that they can be used as an argument to a subsequent ‘bind’ command or in a Readline initialization file. - '-P' + ‘-P’ List current Readline function names and bindings. - '-v' + ‘-v’ Display Readline variable names and values in such a way that - they can be used as an argument to a subsequent 'bind' command + they can be used as an argument to a subsequent ‘bind’ command or in a Readline initialization file. - '-V' + ‘-V’ List current Readline variable names and values. - '-s' + ‘-s’ Display Readline 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 'bind' command or in a Readline initialization + to a subsequent ‘bind’ command or in a Readline initialization file. - '-S' + ‘-S’ Display Readline key sequences bound to macros and the strings they output. - '-f FILENAME' + ‘-f FILENAME’ Read key bindings from FILENAME. - '-q FUNCTION' + ‘-q FUNCTION’ Query about which keys invoke the named FUNCTION. - '-u FUNCTION' + ‘-u FUNCTION’ Unbind all keys bound to the named FUNCTION. - '-r KEYSEQ' + ‘-r KEYSEQ’ Remove any current binding for KEYSEQ. - '-x KEYSEQ:SHELL-COMMAND' + ‘-x KEYSEQ:SHELL-COMMAND’ Cause SHELL-COMMAND to be executed whenever KEYSEQ is entered. The separator between KEYSEQ and SHELL-COMMAND is either whitespace or a colon optionally followed by whitespace. If @@ -3854,26 +3857,26 @@ standard. before saving it. Since the entire key binding expression must be a single argument, it should be enclosed in 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 + ‘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 insertion point (the MARK), respectively. The shell assigns any numeric argument the user supplied to the - 'READLINE_ARGUMENT' variable. If there was no argument, that + ‘READLINE_ARGUMENT’ variable. If there was no argument, that variable is not set. If the executed command changes the - value of any of 'READLINE_LINE', 'READLINE_POINT', or - 'READLINE_MARK', those new values will be reflected in the + value of any of ‘READLINE_LINE’, ‘READLINE_POINT’, or + ‘READLINE_MARK’, those new values will be reflected in the editing state. - '-X' + ‘-X’ 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 'bind' command. + argument to a subsequent ‘bind’ command. The return status is zero unless an invalid option is supplied or an error occurs. -'builtin' +‘builtin’ builtin [SHELL-BUILTIN [ARGS]] Run a shell builtin, passing it ARGS, and return its exit status. @@ -3882,15 +3885,15 @@ standard. the function. The return status is non-zero if SHELL-BUILTIN is not a shell builtin command. -'caller' +‘caller’ caller [EXPR] Returns the context of any active subroutine call (a shell function - or a script executed with the '.' or 'source' builtins). + or a script executed with the ‘.’ or ‘source’ builtins). - Without EXPR, 'caller' displays the line number and source filename + Without EXPR, ‘caller’ displays the line number and source filename of the current subroutine call. If a non-negative integer is - supplied as EXPR, 'caller' displays the line number, subroutine + supplied as EXPR, ‘caller’ displays the line number, subroutine name, and source file corresponding to that position in the current execution call stack. This extra information may be used, for example, to print a stack trace. The current frame is frame 0. @@ -3899,316 +3902,316 @@ standard. subroutine call or EXPR does not correspond to a valid position in the call stack. -'command' +‘command’ command [-pVv] COMMAND [ARGUMENTS ...] Runs COMMAND with ARGUMENTS ignoring any shell function named COMMAND. Only shell builtin commands or commands found by - searching the 'PATH' are executed. If there is a shell function - named 'ls', running 'command ls' within the function will execute - the external command 'ls' instead of calling the function - recursively. The '-p' option means to use a default value for - 'PATH' that is guaranteed to find all of the standard utilities. + searching the ‘PATH’ are executed. If there is a shell function + named ‘ls’, running ‘command ls’ within the function will execute + the external command ‘ls’ instead of calling the function + recursively. The ‘-p’ option means to use a default value for + ‘PATH’ that is guaranteed to find all of the standard utilities. The return status in this case is 127 if COMMAND cannot be found or an error occurred, and the exit status of COMMAND otherwise. - If either the '-V' or '-v' option is supplied, a description of - COMMAND is printed. The '-v' option causes a single word + If either the ‘-V’ or ‘-v’ option is supplied, a description of + COMMAND is printed. The ‘-v’ option causes a single word indicating the command or file name used to invoke COMMAND to be - displayed; the '-V' option produces a more verbose description. In + displayed; the ‘-V’ option produces a more verbose description. In this case, the return status is zero if COMMAND is found, and non-zero if not. -'declare' +‘declare’ declare [-aAfFgiIlnrtux] [-p] [NAME[=VALUE] ...] Declare variables and give them attributes. If no NAMEs are given, then display the values of variables instead. - The '-p' option will display the attributes and values of each - NAME. When '-p' is used with NAME arguments, additional options, - other than '-f' and '-F', are ignored. + The ‘-p’ option will display the attributes and values of each + NAME. When ‘-p’ is used with NAME arguments, additional options, + other than ‘-f’ and ‘-F’, are ignored. - When '-p' is supplied without NAME arguments, 'declare' will + When ‘-p’ is supplied without NAME arguments, ‘declare’ will display the attributes and values of all variables having the attributes specified by the additional options. If no other - options are supplied with '-p', 'declare' will display the - attributes and values of all shell variables. The '-f' option will + options are supplied with ‘-p’, ‘declare’ will display the + attributes and values of all shell variables. The ‘-f’ option will restrict the display to shell functions. - The '-F' option inhibits the display of function definitions; only - the function name and attributes are printed. If the 'extdebug' - shell option is enabled using 'shopt' (*note The Shopt Builtin::), + The ‘-F’ option inhibits the display of function definitions; only + the function name and attributes are printed. If the ‘extdebug’ + shell option is enabled using ‘shopt’ (*note The Shopt Builtin::), the source file name and line number where each NAME is defined are - displayed as well. '-F' implies '-f'. + displayed as well. ‘-F’ implies ‘-f’. - The '-g' option forces variables to be created or modified at the - global scope, even when 'declare' is executed in a shell function. + The ‘-g’ option forces variables to be created or modified at the + global scope, even when ‘declare’ is executed in a shell function. It is ignored in all other cases. - The '-I' option causes local variables to inherit the attributes - (except the 'nameref' attribute) and value of any existing variable + The ‘-I’ option causes local variables to inherit the attributes + (except the ‘nameref’ attribute) and value of any existing variable with the same NAME 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 variables with the specified attributes or to give variables attributes: - '-a' + ‘-a’ Each NAME is an indexed array variable (*note Arrays::). - '-A' + ‘-A’ Each NAME is an associative array variable (*note Arrays::). - '-f' + ‘-f’ Use function names only. - '-i' + ‘-i’ The variable is to be treated as an integer; arithmetic evaluation (*note Shell Arithmetic::) is performed when the variable is assigned a value. - '-l' + ‘-l’ When the variable is assigned a value, all upper-case characters are converted to lower-case. The upper-case attribute is disabled. - '-n' - Give each NAME the 'nameref' attribute, making it a name + ‘-n’ + Give each NAME the ‘nameref’ attribute, making it a name reference to another variable. That other variable is defined by the value of NAME. All references, assignments, and attribute modifications to NAME, except for those using or - changing the '-n' attribute itself, are performed on the + changing the ‘-n’ attribute itself, are performed on the variable referenced by NAME's value. The nameref attribute cannot be applied to array variables. - '-r' + ‘-r’ Make NAMEs readonly. These names cannot then be assigned values by subsequent assignment statements or unset. - '-t' - Give each NAME the 'trace' attribute. Traced functions - inherit the 'DEBUG' and 'RETURN' traps from the calling shell. + ‘-t’ + Give each NAME the ‘trace’ attribute. Traced functions + inherit the ‘DEBUG’ and ‘RETURN’ traps from the calling shell. The trace attribute has no special meaning for variables. - '-u' + ‘-u’ When the variable is assigned a value, all lower-case characters are converted to upper-case. The lower-case attribute is disabled. - '-x' + ‘-x’ Mark each NAME for export to subsequent commands via the environment. - Using '+' instead of '-' turns off the attribute instead, with the - exceptions that '+a' and '+A' may not be used to destroy array - variables and '+r' will not remove the readonly attribute. When - used in a function, 'declare' makes each NAME local, as with the - 'local' command, unless the '-g' option is used. If a variable + Using ‘+’ instead of ‘-’ turns off the attribute instead, with the + exceptions that ‘+a’ and ‘+A’ may not be used to destroy array + variables and ‘+r’ will not remove the readonly attribute. When + used in a function, ‘declare’ makes each NAME local, as with the + ‘local’ command, unless the ‘-g’ option is used. If a variable name is followed by =VALUE, the value of the variable is set to VALUE. - When using '-a' or '-A' and the compound assignment syntax to + When using ‘-a’ or ‘-A’ and the compound assignment syntax to create array variables, additional attributes do not take effect until subsequent assignments. The return status is zero unless an invalid option is encountered, - an attempt is made to define a function using '-f foo=bar', an + 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 attempt is made to assign a value to an array variable without using the compound assignment syntax (*note Arrays::), one of the NAMEs 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 attempt - is made to display a non-existent function with '-f'. + is made to display a non-existent function with ‘-f’. -'echo' +‘echo’ echo [-neE] [ARG ...] Output the ARGs, separated by spaces, terminated with a newline. - The return status is 0 unless a write error occurs. If '-n' is - specified, the trailing newline is suppressed. If the '-e' option + The return status is 0 unless a write error occurs. If ‘-n’ is + specified, the trailing newline is suppressed. If the ‘-e’ option is given, interpretation of the following backslash-escaped - characters is enabled. The '-E' option disables the interpretation + characters is enabled. The ‘-E’ option disables the interpretation of these escape characters, even on systems where they are - interpreted by default. The 'xpg_echo' shell option may be used to - dynamically determine whether or not 'echo' interprets any options - and expands these escape characters by default. 'echo' does not - interpret '--' to mean the end of options. + interpreted by default. The ‘xpg_echo’ shell option may be used to + dynamically determine whether or not ‘echo’ interprets any options + and expands these escape characters by default. ‘echo’ does not + interpret ‘--’ to mean the end of options. - 'echo' interprets the following escape sequences: - '\a' + ‘echo’ interprets the following escape sequences: + ‘\a’ alert (bell) - '\b' + ‘\b’ backspace - '\c' + ‘\c’ suppress further output - '\e' - '\E' + ‘\e’ + ‘\E’ escape - '\f' + ‘\f’ form feed - '\n' + ‘\n’ new line - '\r' + ‘\r’ carriage return - '\t' + ‘\t’ horizontal tab - '\v' + ‘\v’ vertical tab - '\\' + ‘\\’ backslash - '\0NNN' + ‘\0NNN’ the eight-bit character whose value is the octal value NNN (zero to three octal digits) - '\xHH' + ‘\xHH’ the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) - '\uHHHH' + ‘\uHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits) - '\UHHHHHHHH' + ‘\UHHHHHHHH’ the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits) -'enable' +‘enable’ enable [-a] [-dnps] [-f FILENAME] [NAME ...] Enable and disable builtin shell commands. Disabling a builtin allows a disk command 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 disk commands. If '-n' + shell normally searches for builtins before disk commands. If ‘-n’ is used, the NAMEs become disabled. Otherwise NAMEs are enabled. - For example, to use the 'test' binary found via '$PATH' instead of - the shell builtin version, type 'enable -n test'. + For example, to use the ‘test’ binary found via ‘$PATH’ instead of + the shell builtin version, type ‘enable -n test’. - If the '-p' option is supplied, or no NAME arguments appear, a list + If the ‘-p’ option is supplied, or no NAME arguments appear, a list of shell builtins is printed. With no other arguments, the list - consists of all enabled shell builtins. The '-a' option means to + consists of all enabled shell builtins. The ‘-a’ option means to list each builtin with an indication of whether or not it is enabled. - The '-f' option means to load the new builtin command NAME from + The ‘-f’ option means to load the new builtin command NAME from shared object FILENAME, on systems that support dynamic loading. - Bash will use the value of the 'BASH_LOADABLES_PATH' variable as a + Bash will use the value of the ‘BASH_LOADABLES_PATH’ variable as a colon-separated list of directories in which to search for FILENAME, if FILENAME does not contain a slash. The default is system-dependent, and may include "." to force a search of the - current directory. The '-d' option will delete a builtin loaded - with '-f'. + current directory. The ‘-d’ option will delete a builtin loaded + with ‘-f’. If there are no options, a list of the shell builtins is displayed. - The '-s' option restricts 'enable' to the POSIX special builtins. - If '-s' is used with '-f', the new builtin becomes a special + The ‘-s’ option restricts ‘enable’ to the POSIX special builtins. + If ‘-s’ is used with ‘-f’, the new builtin becomes a 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, - as if the command were 'enable -f NAME NAME'. + ‘enable’ will attempt to load NAME from a shared object named NAME, + as if the command were ‘enable -f NAME NAME’. The return status is zero unless a NAME is not a shell builtin or there is an error loading a new builtin from a shared object. -'help' +‘help’ help [-dms] [PATTERN] Display helpful information about builtin commands. If PATTERN is - specified, 'help' gives detailed help on all commands matching + specified, ‘help’ gives detailed help on all commands matching PATTERN, otherwise a list of the builtins is printed. Options, if supplied, have the following meanings: - '-d' + ‘-d’ Display a short description of each PATTERN - '-m' + ‘-m’ Display the description of each PATTERN in a manpage-like format - '-s' + ‘-s’ Display only a short usage synopsis for each PATTERN The return status is zero unless no command matches PATTERN. -'let' +‘let’ let EXPRESSION [EXPRESSION ...] - The 'let' builtin allows arithmetic to be performed on shell + The ‘let’ builtin allows arithmetic to be performed on shell variables. Each EXPRESSION is evaluated according to the rules given below in *note Shell Arithmetic::. If the last EXPRESSION - evaluates to 0, 'let' returns 1; otherwise 0 is returned. + evaluates to 0, ‘let’ returns 1; otherwise 0 is returned. -'local' +‘local’ local [OPTION] NAME[=VALUE] ... For each argument, a local variable named NAME is created, and assigned VALUE. The OPTION can be any of the options accepted by - 'declare'. 'local' can only be used within a function; it makes + ‘declare’. ‘local’ can only be used within a function; it makes the variable NAME have a visible scope restricted to that function - and its children. If NAME is '-', the set of shell options is made - local to the function in which 'local' is invoked: shell options - changed using the 'set' builtin inside the function after the call - to 'local' are restored to their original values when the function - returns. The restore is effected as if a series of 'set' commands + and its children. If NAME is ‘-’, the set of shell options is made + local to the function in which ‘local’ is invoked: shell options + changed using the ‘set’ builtin inside the function after the call + to ‘local’ are restored to their original values when the function + returns. The restore is effected as if a series of ‘set’ commands were executed to restore the values that were in place before the - function. The return status is zero unless 'local' is used outside + function. The return status is zero unless ‘local’ is used outside a function, an invalid NAME is supplied, or NAME is a readonly variable. -'logout' +‘logout’ logout [N] Exit a login shell, returning a status of N to the shell's parent. -'mapfile' +‘mapfile’ mapfile [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY] Read lines from the standard input into the indexed array variable - ARRAY, or from file descriptor FD if the '-u' option is supplied. - The variable 'MAPFILE' is the default ARRAY. Options, if supplied, + ARRAY, or from file descriptor FD if the ‘-u’ option is supplied. + The variable ‘MAPFILE’ is the default ARRAY. Options, if supplied, have the following meanings: - '-d' + ‘-d’ The first character of DELIM is used to terminate each input line, rather than newline. If DELIM is the empty string, - 'mapfile' will terminate a line when it reads a NUL character. - '-n' + ‘mapfile’ will terminate a line when it reads a NUL character. + ‘-n’ Copy at most COUNT lines. If COUNT is 0, all lines are copied. - '-O' + ‘-O’ Begin assigning to ARRAY at index ORIGIN. The default index is 0. - '-s' + ‘-s’ Discard the first COUNT lines read. - '-t' + ‘-t’ Remove a trailing DELIM (default newline) from each line read. - '-u' + ‘-u’ Read lines from file descriptor FD instead of the standard input. - '-C' - Evaluate CALLBACK each time QUANTUM lines are read. The '-c' + ‘-C’ + Evaluate CALLBACK each time QUANTUM lines are read. The ‘-c’ option specifies QUANTUM. - '-c' + ‘-c’ Specify the number of lines read between each call to CALLBACK. - If '-C' is specified without '-c', the default quantum is 5000. + If ‘-C’ is specified without ‘-c’, the default quantum is 5000. When CALLBACK is evaluated, it is supplied the index of the next array element to be assigned and the line to be assigned to that element as additional arguments. CALLBACK is evaluated after the line is read but before the array element is assigned. - If not supplied with an explicit origin, 'mapfile' will clear ARRAY + If not supplied with an explicit origin, ‘mapfile’ will clear ARRAY before assigning to it. - 'mapfile' returns successfully unless an invalid option or option + ‘mapfile’ returns successfully unless an invalid option or option argument is supplied, ARRAY is invalid or unassignable, or ARRAY is not an indexed array. -'printf' +‘printf’ printf [-v VAR] FORMAT [ARGUMENTS] Write the formatted ARGUMENTS to the standard output under the - control of the FORMAT. The '-v' option causes the output to be + control of the FORMAT. The ‘-v’ option causes the output to be assigned to the variable VAR rather than being printed to the standard output. @@ -4217,35 +4220,35 @@ standard. output, character escape sequences, which are converted and copied to the standard output, and format specifications, each of which causes printing of the next successive ARGUMENT. In addition to - the standard 'printf(3)' format characters 'csndiouxXeEfFgGaA', - 'printf' interprets the following additional format specifiers: + the standard ‘printf(3)’ format characters ‘csndiouxXeEfFgGaA’, + ‘printf’ interprets the following additional format specifiers: - '%b' - Causes 'printf' to expand backslash escape sequences in the - corresponding ARGUMENT in the same way as 'echo -e' (*note + ‘%b’ + Causes ‘printf’ to expand backslash escape sequences in the + corresponding ARGUMENT in the same way as ‘echo -e’ (*note Bash Builtins::). - '%q' - Causes 'printf' to output the corresponding ARGUMENT in a - format that can be reused as shell input. '%q' and '%Q'P use + ‘%q’ + Causes ‘printf’ to output the corresponding ARGUMENT in a + format that can be reused as shell input. ‘%q’ and ‘%Q’P use the ANSI-C quoting style (*note ANSI-C Quoting::) if any characters in the argument string require it, and backslash - quoting otherwise. If the format string uses the 'printf' + quoting otherwise. If the format string uses the ‘printf’ ALTERNATE FORM, these two formats quote the argument string using single quotes. - '%Q' - like '%q', but applies any supplied precision to the ARGUMENT + ‘%Q’ + like ‘%q’, but applies any supplied precision to the ARGUMENT before quoting it. - '%(DATEFMT)T' - Causes 'printf' to output the date-time string resulting from - using DATEFMT as a format string for 'strftime'(3). The + ‘%(DATEFMT)T’ + Causes ‘printf’ to output the date-time string resulting from + using DATEFMT as a format string for ‘strftime’(3). The corresponding ARGUMENT is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. If no argument is specified, conversion behaves as if -1 had been given. This is an - exception to the usual 'printf' behavior. + exception to the usual ‘printf’ behavior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that @@ -4272,277 +4275,280 @@ standard. success, non-zero if an invalid option is supplied or a write or assignment error occurs. -'read' +‘read’ read [-Eers] [-a ANAME] [-d DELIM] [-i TEXT] [-n NCHARS] [-N NCHARS] [-p PROMPT] [-t TIMEOUT] [-u FD] [NAME ...] One line is read from the standard input, or from the file - descriptor FD supplied as an argument to the '-u' option, split + descriptor FD supplied as an argument to the ‘-u’ option, split into words as described above in *note Word Splitting::, and the first word is assigned to the first NAME, the second word to the second NAME, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned to the last NAME. If there are fewer words read from the input stream than names, the remaining names are assigned empty values. The - characters in the value of the 'IFS' variable are used to split the + characters in the value of the ‘IFS’ variable are used to split the line into words using the same rules the shell uses for expansion (described above in *note Word Splitting::). The backslash - character '\' may be used to remove any special meaning for the + character ‘\’ may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: - '-a ANAME' + ‘-a ANAME’ The words are assigned to sequential indices of the array variable ANAME, starting at 0. All elements are removed from ANAME before the assignment. Other NAME arguments are ignored. - '-d DELIM' + ‘-d DELIM’ The first character of DELIM is used to terminate the input line, rather than newline. If DELIM is the empty string, - 'read' will terminate a line when it reads a NUL character. + ‘read’ will terminate a line when it reads a NUL character. - '-e' + ‘-e’ Readline (*note Command Line Editing::) is used to obtain the line. Readline uses the current (or default, if line editing was not previously active) editing settings, but uses Readline's default filename completion. - '-E' + ‘-E’ Readline (*note Command Line Editing::) is used to obtain the line. Readline uses the current (or default, if line editing was not previously active) editing settings, but uses Bash's default completion, including programmable completion. - '-i TEXT' + ‘-i TEXT’ If Readline is being used to read the line, TEXT is placed into the editing buffer before editing begins. - '-n NCHARS' - 'read' returns after reading NCHARS characters rather than + ‘-n NCHARS’ + ‘read’ returns after reading NCHARS characters rather than waiting for a complete line of input, but honors a delimiter if fewer than NCHARS characters are read before the delimiter. - '-N NCHARS' - 'read' returns after reading exactly NCHARS characters rather + ‘-N NCHARS’ + ‘read’ returns after reading exactly NCHARS characters rather than waiting for a complete line of input, unless EOF is - encountered or 'read' times out. Delimiter characters + encountered or ‘read’ times out. Delimiter characters encountered in the input are not treated specially and do not - cause 'read' to return until NCHARS characters are read. The - result is not split on the characters in 'IFS'; the intent is + cause ‘read’ to return until NCHARS characters are read. The + result is not split on the characters in ‘IFS’; the intent is that the variable is assigned exactly the characters read - (with the exception of backslash; see the '-r' option below). + (with the exception of backslash; see the ‘-r’ option below). - '-p PROMPT' + ‘-p PROMPT’ Display PROMPT, without a trailing newline, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. - '-r' + ‘-r’ If this option is given, backslash does not act as an escape character. The backslash is considered to be part of the line. In particular, a backslash-newline pair may not then be used as a line continuation. - '-s' + ‘-s’ Silent mode. If input is coming from a terminal, characters are not echoed. - '-t TIMEOUT' - Cause 'read' to time out and return failure if a complete line + ‘-t TIMEOUT’ + Cause ‘read’ to time out and return failure if a complete line of input (or a specified number of characters) is not read within TIMEOUT seconds. TIMEOUT may be a decimal number with a fractional portion following the decimal point. This option - is only effective if 'read' is reading input from a terminal, + is only effective if ‘read’ is reading input from a terminal, pipe, or other special file; it has no effect when reading - from regular files. If 'read' times out, 'read' saves any + from regular files. If ‘read’ times out, ‘read’ saves any partial input read into the specified variable NAME. If - TIMEOUT is 0, 'read' returns immediately, without trying to + TIMEOUT is 0, ‘read’ returns immediately, without trying to read any data. The exit status is 0 if input is available on the specified file descriptor, or the read will return EOF, non-zero otherwise. The exit status is greater than 128 if the timeout is exceeded. - '-u FD' + ‘-u FD’ Read input from file descriptor FD. + Other than the case where DELIM is the empty string, ‘read’ ignores + any NUL characters in the input. + If no NAMEs are supplied, the line read, without the ending delimiter but otherwise unmodified, is assigned to the variable - 'REPLY'. The exit status is zero, unless end-of-file is - encountered, 'read' times out (in which case the status is greater + ‘REPLY’. The exit status is zero, unless end-of-file is + encountered, ‘read’ times out (in which case the status is greater than 128), a variable assignment error (such as assigning to a readonly variable) occurs, or an invalid file descriptor is - supplied as the argument to '-u'. + supplied as the argument to ‘-u’. -'readarray' +‘readarray’ readarray [-d DELIM] [-n COUNT] [-O ORIGIN] [-s COUNT] [-t] [-u FD] [-C CALLBACK] [-c QUANTUM] [ARRAY] Read lines from the standard input into the indexed array variable - ARRAY, or from file descriptor FD if the '-u' option is supplied. + ARRAY, or from file descriptor FD if the ‘-u’ option is supplied. - A synonym for 'mapfile'. + A synonym for ‘mapfile’. -'source' +‘source’ source FILENAME - A synonym for '.' (*note Bourne Shell Builtins::). + A synonym for ‘.’ (*note Bourne Shell Builtins::). -'type' +‘type’ type [-afptP] [NAME ...] For each NAME, indicate how it would be interpreted if used as a command name. - If the '-t' option is used, 'type' prints a single word which is - one of 'alias', 'keyword', 'function', 'builtin', or 'file', if + If the ‘-t’ option is used, ‘type’ prints a single word which is + one of ‘alias’, ‘keyword’, ‘function’, ‘builtin’, or ‘file’, if NAME is an alias, shell reserved word, shell function, shell builtin, or executable disk file, respectively. If the NAME is not - found, then nothing is printed, and 'type' returns a failure + found, then nothing is printed, and ‘type’ returns a failure status. - If the '-p' option is used, 'type' either returns the name of the - executable file that would be found by searching '$PATH', or - nothing if '-t' would not return 'file'. + If the ‘-p’ option is used, ‘type’ either returns the name of the + executable file that would be found by searching ‘$PATH’, or + nothing if ‘-t’ would not return ‘file’. - The '-P' option forces a path search for each NAME, even if '-t' - would not return 'file'. + The ‘-P’ option forces a path search for each NAME, even if ‘-t’ + would not return ‘file’. - If a NAME is present in the table of hashed commands, options '-p' - and '-P' print the hashed value, which is not necessarily the file - that appears first in '$PATH'. + If a NAME is present in the table of hashed commands, options ‘-p’ + and ‘-P’ print the hashed value, which is not necessarily the file + that appears first in ‘$PATH’. - If the '-a' option is used, 'type' returns all of the places that + If the ‘-a’ option is used, ‘type’ returns all of the places that contain a command named NAME. This includes aliases, reserved - words, functions, and builtins, but the path search options ('-p' - and '-P') can be supplied to restrict the output to executable - files. If '-a' is supplied with '-p', 'type' does not look in the - table of hashed commands, and only performs a 'PATH' search for + words, functions, and builtins, but the path search options (‘-p’ + and ‘-P’) can be supplied to restrict the output to executable + files. If ‘-a’ is supplied with ‘-p’, ‘type’ does not look in the + table of hashed commands, and only performs a ‘PATH’ search for NAME. - If the '-f' option is used, 'type' does not attempt to find shell - functions, as with the 'command' builtin. + If the ‘-f’ option is used, ‘type’ does not attempt to find shell + functions, as with the ‘command’ builtin. The return status is zero if all of the NAMEs are found, non-zero if any are not found. -'typeset' +‘typeset’ typeset [-afFgrxilnrtux] [-p] [NAME[=VALUE] ...] - The 'typeset' command is supplied for compatibility with the Korn - shell. It is a synonym for the 'declare' builtin command. + The ‘typeset’ command is supplied for compatibility with the Korn + shell. It is a synonym for the ‘declare’ builtin command. -'ulimit' +‘ulimit’ ulimit [-HS] -a ulimit [-HS] [-bcdefiklmnpqrstuvxPRT] [LIMIT] - 'ulimit' provides control over the resources available to processes + ‘ulimit’ provides control over the resources available to processes started by the shell, on systems that allow such control. If an option is given, it is interpreted as follows: - '-S' + ‘-S’ Change and report the soft limit associated with a resource. - '-H' + ‘-H’ Change and report the hard limit associated with a resource. - '-a' + ‘-a’ All current limits are reported; no limits are set. - '-b' + ‘-b’ The maximum socket buffer size. - '-c' + ‘-c’ The maximum size of core files created. - '-d' + ‘-d’ The maximum size of a process's data segment. - '-e' + ‘-e’ The maximum scheduling priority ("nice"). - '-f' + ‘-f’ The maximum size of files written by the shell and its children. - '-i' + ‘-i’ The maximum number of pending signals. - '-k' + ‘-k’ The maximum number of kqueues that may be allocated. - '-l' + ‘-l’ The maximum size that may be locked into memory. - '-m' + ‘-m’ The maximum resident set size (many systems do not honor this limit). - '-n' + ‘-n’ The maximum number of open file descriptors (most systems do not allow this value to be set). - '-p' + ‘-p’ The pipe buffer size. - '-q' + ‘-q’ The maximum number of bytes in POSIX message queues. - '-r' + ‘-r’ The maximum real-time scheduling priority. - '-s' + ‘-s’ The maximum stack size. - '-t' + ‘-t’ The maximum amount of cpu time in seconds. - '-u' + ‘-u’ The maximum number of processes available to a single user. - '-v' + ‘-v’ The maximum amount of virtual memory available to the shell, and, on some systems, to its children. - '-x' + ‘-x’ The maximum number of file locks. - '-P' + ‘-P’ The maximum number of pseudoterminals. - '-R' + ‘-R’ The maximum time a real-time process can run before blocking, in microseconds. - '-T' + ‘-T’ The maximum number of threads. - If LIMIT is given, and the '-a' option is not used, LIMIT is the + If LIMIT is given, and the ‘-a’ option is not used, LIMIT is the new value of the specified resource. The special LIMIT values - 'hard', 'soft', and 'unlimited' stand for the current hard limit, + ‘hard’, ‘soft’, and ‘unlimited’ stand for the current hard limit, the current soft limit, and no limit, respectively. 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. Otherwise, the current value of the soft limit for the specified resource is - printed, unless the '-H' option is supplied. When more than one + printed, unless the ‘-H’ option is supplied. When more than one resource is specified, the limit name and unit, if appropriate, are - printed before the value. When setting new limits, if neither '-H' - nor '-S' is supplied, both the hard and soft limits are set. If no - option is given, then '-f' is assumed. 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::), '-c' and '-f', which + printed before the value. When setting new limits, if neither ‘-H’ + nor ‘-S’ is supplied, both the hard and soft limits are set. If no + option is given, then ‘-f’ is assumed. 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::), ‘-c’ and ‘-f’, which are in 512-byte increments. The return status is zero unless an invalid option or argument is supplied, or an error occurs while setting a new limit. -'unalias' +‘unalias’ unalias [-a] [NAME ... ] - Remove each NAME from the list of aliases. If '-a' is supplied, + Remove each NAME from the list of aliases. If ‘-a’ is supplied, all aliases are removed. Aliases are described in *note Aliases::.  @@ -4563,17 +4569,17 @@ File: bashref.info, Node: The Set Builtin, Next: The Shopt Builtin, Up: Modif 4.3.1 The Set Builtin --------------------- -This builtin is so complicated that it deserves its own section. 'set' +This builtin is so complicated that it deserves its own section. ‘set’ allows you to change the values of shell options and set the positional parameters, or to display the names and values of shell variables. -'set' +‘set’ set [-abefhkmnptuvxBCEHPT] [-o OPTION-NAME] [--] [-] [ARGUMENT ...] set [+abefhkmnptuvxBCEHPT] [+o OPTION-NAME] [--] [-] [ARGUMENT ...] set -o set +o - If no options or arguments are supplied, 'set' displays the names + If no options or arguments are supplied, ‘set’ displays the names and values of all shell variables and functions, sorted according to the current locale, in a format that may be reused as input for setting or resetting the currently-set variables. Read-only @@ -4583,30 +4589,30 @@ parameters, or to display the names and values of shell variables. When options are supplied, they set or unset shell attributes. Options, if specified, have the following meanings: - '-a' + ‘-a’ Each variable or function that is created or modified is given the export attribute and marked for export to the environment of subsequent commands. - '-b' + ‘-b’ Cause the status of terminated background jobs to be reported immediately, rather than before printing the next primary prompt. - '-e' + ‘-e’ Exit immediately if a pipeline (*note Pipelines::), which may consist of a single simple command (*note Simple Commands::), a list (*note Lists::), or a compound command (*note Compound Commands::) returns a non-zero status. The shell does not exit if the command that fails is part of the command list - immediately following a 'while' or 'until' keyword, part of - the test in an 'if' statement, part of any command executed in - a '&&' or '||' list except the command following the final - '&&' or '||', any command in a pipeline but the last, or if - the command's return status is being inverted with '!'. If a + immediately following a ‘while’ or ‘until’ keyword, part of + the test in an ‘if’ statement, part of any command executed in + a ‘&&’ or ‘||’ list except the command following the final + ‘&&’ or ‘||’, any command in a pipeline but the last, or if + the command's return status is being inverted with ‘!’. If a compound command other than a subshell returns a non-zero - status because a command failed while '-e' was being ignored, - the shell does not exit. A trap on 'ERR', if set, is executed + status because a command failed while ‘-e’ was being ignored, + the shell does not exit. A trap on ‘ERR’, if set, is executed before the shell exits. This option applies to the shell environment and each subshell @@ -4615,237 +4621,237 @@ parameters, or to display the names and values of shell variables. executing all the commands in the subshell. If a compound command or shell function executes in a context - where '-e' is being ignored, none of the commands executed + where ‘-e’ is being ignored, none of the commands executed within the compound command or function body will be affected - by the '-e' setting, even if '-e' is set and a command returns + by the ‘-e’ setting, even if ‘-e’ is set and a command returns a failure status. If a compound command or shell function - sets '-e' while executing in a context where '-e' is ignored, + sets ‘-e’ while executing in a context where ‘-e’ is ignored, that setting will not have any effect until the compound command or the command containing the function call completes. - '-f' + ‘-f’ Disable filename expansion (globbing). - '-h' + ‘-h’ Locate and remember (hash) commands as they are looked up for execution. This option is enabled by default. - '-k' + ‘-k’ All arguments in the form of assignment statements are placed in the environment for a command, not just those that precede the command name. - '-m' + ‘-m’ Job control is enabled (*note Job Control::). All processes run in a separate process group. When a background job completes, the shell prints a line containing its exit status. - '-n' + ‘-n’ Read commands but do not execute them. This may be used to check a script for syntax errors. This option is ignored by interactive shells. - '-o OPTION-NAME' + ‘-o OPTION-NAME’ - Set the option corresponding to OPTION-NAME. If '-o' is - supplied with no OPTION-NAME, 'set' prints the current shell - options settings. If '+o' is supplied with no OPTION-NAME, - 'set' prints a series of 'set' commands to recreate the + Set the option corresponding to OPTION-NAME. If ‘-o’ is + supplied with no OPTION-NAME, ‘set’ prints the current shell + options settings. If ‘+o’ is supplied with no OPTION-NAME, + ‘set’ prints a series of ‘set’ commands to recreate the current option settings on the standard output. Valid option names are: - 'allexport' - Same as '-a'. + ‘allexport’ + Same as ‘-a’. - 'braceexpand' - Same as '-B'. + ‘braceexpand’ + Same as ‘-B’. - 'emacs' - Use an 'emacs'-style line editing interface (*note + ‘emacs’ + Use an ‘emacs’-style line editing interface (*note Command Line Editing::). This also affects the editing - interface used for 'read -e'. + interface used for ‘read -e’. - 'errexit' - Same as '-e'. + ‘errexit’ + Same as ‘-e’. - 'errtrace' - Same as '-E'. + ‘errtrace’ + Same as ‘-E’. - 'functrace' - Same as '-T'. + ‘functrace’ + Same as ‘-T’. - 'hashall' - Same as '-h'. + ‘hashall’ + Same as ‘-h’. - 'histexpand' - Same as '-H'. + ‘histexpand’ + Same as ‘-H’. - 'history' + ‘history’ Enable command history, as described in *note Bash History Facilities::. This option is on by default in interactive shells. - 'ignoreeof' + ‘ignoreeof’ An interactive shell will not exit upon reading EOF. - 'keyword' - Same as '-k'. + ‘keyword’ + Same as ‘-k’. - 'monitor' - Same as '-m'. + ‘monitor’ + Same as ‘-m’. - 'noclobber' - Same as '-C'. + ‘noclobber’ + Same as ‘-C’. - 'noexec' - Same as '-n'. + ‘noexec’ + Same as ‘-n’. - 'noglob' - Same as '-f'. + ‘noglob’ + Same as ‘-f’. - 'nolog' + ‘nolog’ Currently ignored. - 'notify' - Same as '-b'. + ‘notify’ + Same as ‘-b’. - 'nounset' - Same as '-u'. + ‘nounset’ + Same as ‘-u’. - 'onecmd' - Same as '-t'. + ‘onecmd’ + Same as ‘-t’. - 'physical' - Same as '-P'. + ‘physical’ + Same as ‘-P’. - 'pipefail' + ‘pipefail’ If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands in the pipeline exit successfully. This option is disabled by default. - 'posix' + ‘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. - 'privileged' - Same as '-p'. + ‘privileged’ + Same as ‘-p’. - 'verbose' - Same as '-v'. + ‘verbose’ + Same as ‘-v’. - 'vi' - Use a 'vi'-style line editing interface. This also - affects the editing interface used for 'read -e'. + ‘vi’ + Use a ‘vi’-style line editing interface. This also + affects the editing interface used for ‘read -e’. - 'xtrace' - Same as '-x'. + ‘xtrace’ + Same as ‘-x’. - '-p' - Turn on privileged mode. In this mode, the '$BASH_ENV' and - '$ENV' files are not processed, shell functions are not - inherited from the environment, and the 'SHELLOPTS', - 'BASHOPTS', 'CDPATH' and 'GLOBIGNORE' variables, if they + ‘-p’ + Turn on privileged mode. In this mode, the ‘$BASH_ENV’ and + ‘$ENV’ files are not processed, shell functions are not + inherited from the environment, and the ‘SHELLOPTS’, + ‘BASHOPTS’, ‘CDPATH’ and ‘GLOBIGNORE’ 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 '-p' option is not supplied, + real user (group) id, and the ‘-p’ option is not supplied, these actions are taken and the effective user id is set to - the real user id. If the '-p' option is supplied at startup, + the real user id. If the ‘-p’ option is supplied at startup, the effective user id is not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids. - '-r' + ‘-r’ Enable restricted shell mode (*note The Restricted Shell::). This option cannot be unset once it has been set. - '-t' + ‘-t’ Exit after reading and executing one command. - '-u' + ‘-u’ Treat unset variables and parameters other than the special - parameters '@' or '*', or array variables subscripted with '@' - or '*', as an error when performing parameter expansion. An + parameters ‘@’ or ‘*’, or array variables subscripted with ‘@’ + or ‘*’, as an error when performing parameter expansion. An error message will be written to the standard error, and a non-interactive shell will exit. - '-v' + ‘-v’ Print shell input lines as they are read. - '-x' - Print a trace of simple commands, 'for' commands, 'case' - commands, 'select' commands, and arithmetic 'for' commands and + ‘-x’ + Print a trace of simple commands, ‘for’ commands, ‘case’ + commands, ‘select’ commands, and arithmetic ‘for’ commands and their arguments or associated word lists to standard error after they are expanded and before they are executed. The - shell prints the expanded value of the 'PS4' variable before + shell prints the expanded value of the ‘PS4’ variable before the command and its expanded arguments. - '-B' + ‘-B’ The shell will perform brace expansion (*note Brace Expansion::). This option is on by default. - '-C' - Prevent output redirection using '>', '>&', and '<>' from + ‘-C’ + Prevent output redirection using ‘>’, ‘>&’, and ‘<>’ from overwriting existing files. - '-E' - If set, any trap on 'ERR' is inherited by shell functions, + ‘-E’ + If set, any trap on ‘ERR’ is inherited by shell functions, command substitutions, and commands executed in a subshell - environment. The 'ERR' trap is normally not inherited in such + environment. The ‘ERR’ trap is normally not inherited in such cases. - '-H' - Enable '!' style history substitution (*note History + ‘-H’ + Enable ‘!’ style history substitution (*note History Interaction::). This option is on by default for interactive shells. - '-P' + ‘-P’ If set, do not resolve symbolic links when performing commands - such as 'cd' which change the current directory. The physical + such as ‘cd’ which change the current directory. The physical directory is used instead. By default, Bash follows the logical chain of directories when performing commands which change the current directory. - For example, if '/usr/sys' is a symbolic link to - '/usr/local/sys' then: + For example, if ‘/usr/sys’ is a symbolic link to + ‘/usr/local/sys’ then: $ cd /usr/sys; echo $PWD /usr/sys $ cd ..; pwd /usr - If 'set -P' is on, then: + If ‘set -P’ is on, then: $ cd /usr/sys; echo $PWD /usr/local/sys $ cd ..; pwd /usr/local - '-T' - If set, any trap on 'DEBUG' and 'RETURN' are inherited by + ‘-T’ + If set, any trap on ‘DEBUG’ and ‘RETURN’ are inherited by shell functions, command substitutions, and commands executed - in a subshell environment. The 'DEBUG' and 'RETURN' traps are + in a subshell environment. The ‘DEBUG’ and ‘RETURN’ traps are normally not inherited in such cases. - '--' + ‘--’ If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters are set to the ARGUMENTS, even if some of them begin with a - '-'. + ‘-’. - '-' + ‘-’ Signal the end of options, cause all remaining ARGUMENTS to be - assigned to the positional parameters. The '-x' and '-v' + assigned to the positional parameters. The ‘-x’ and ‘-v’ options are turned off. If there are no arguments, the positional parameters remain unchanged. - Using '+' rather than '-' causes these options to be turned off. + Using ‘+’ rather than ‘-’ causes these options to be turned off. The options can also be used upon invocation of the shell. The - current set of options may be found in '$-'. + current set of options may be found in ‘$-’. The remaining N ARGUMENTS are positional parameters and are - assigned, in order, to '$1', '$2', ... '$N'. The special parameter - '#' is set to N. + assigned, in order, to ‘$1’, ‘$2’, ... ‘$N’. The special parameter + ‘#’ is set to N. The return status is always zero unless an invalid option is supplied. @@ -4858,39 +4864,39 @@ File: bashref.info, Node: The Shopt Builtin, Prev: The Set Builtin, Up: Modif This builtin allows you to change additional shell optional behavior. -'shopt' +‘shopt’ shopt [-pqsu] [-o] [OPTNAME ...] Toggle the values of settings controlling optional shell behavior. - The settings can be either those listed below, or, if the '-o' - option is used, those available with the '-o' option to the 'set' + The settings can be either those listed below, or, if the ‘-o’ + option is used, those available with the ‘-o’ option to the ‘set’ builtin command (*note The Set Builtin::). With no options, or - with the '-p' option, a list of all settable options is displayed, + with the ‘-p’ option, a list of all settable options is displayed, with an indication of whether or not each is set; if OPTNAMEs are - supplied, the output is restricted to those options. The '-p' + supplied, the output is restricted to those options. The ‘-p’ option causes output to be displayed in a form that may be reused as input. Other options have the following meanings: - '-s' + ‘-s’ Enable (set) each OPTNAME. - '-u' + ‘-u’ Disable (unset) each OPTNAME. - '-q' + ‘-q’ Suppresses normal output; the return status indicates whether the OPTNAME is set or unset. If multiple OPTNAME arguments - are given with '-q', the return status is zero if all OPTNAMEs + are given with ‘-q’, the return status is zero if all OPTNAMEs are enabled; non-zero otherwise. - '-o' + ‘-o’ Restricts the values of OPTNAME to be those defined for the - '-o' option to the 'set' builtin (*note The Set Builtin::). + ‘-o’ option to the ‘set’ builtin (*note The Set Builtin::). - If either '-s' or '-u' is used with no OPTNAME arguments, 'shopt' + If either ‘-s’ or ‘-u’ is used with no OPTNAME arguments, ‘shopt’ shows only those options which are set or unset, respectively. - Unless otherwise noted, the 'shopt' options are disabled (off) by + Unless otherwise noted, the ‘shopt’ options are disabled (off) by default. The return status when listing options is zero if all OPTNAMEs are @@ -4898,42 +4904,42 @@ This builtin allows you to change additional shell optional behavior. the return status is zero unless an OPTNAME is not a valid shell option. - The list of 'shopt' options is: + The list of ‘shopt’ options is: - 'array_expand_once' + ‘array_expand_once’ If set, the shell suppresses multiple evaluation of associative and indexed array subscripts during arithmetic expression evaluation, while executing builtins that can perform variable assignments, and while executing builtins that perform array dereferencing. - 'assoc_expand_once' - Deprecated; a synonym for 'array_expand_once'. + ‘assoc_expand_once’ + Deprecated; a synonym for ‘array_expand_once’. - 'autocd' + ‘autocd’ If set, a command name that is the name of a directory is - executed as if it were the argument to the 'cd' command. This + executed as if it were the argument to the ‘cd’ command. This option is only used by interactive shells. - 'cdable_vars' - If this is set, an argument to the 'cd' builtin command that + ‘cdable_vars’ + If this is set, an argument to the ‘cd’ builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to. - 'cdspell' + ‘cdspell’ If set, minor errors in the spelling of a directory component - in a 'cd' command will be corrected. The errors checked for + in a ‘cd’ command will be corrected. The errors checked for are transposed characters, a missing character, and a character too many. If a correction is found, the corrected path is printed, and the command proceeds. This option is only used by interactive shells. - 'checkhash' + ‘checkhash’ If this is set, Bash checks that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal path search is performed. - 'checkjobs' + ‘checkjobs’ If set, Bash lists the status of any stopped and running jobs before exiting an interactive shell. If any jobs are running, this causes the exit to be deferred until a second exit is @@ -4941,29 +4947,29 @@ This builtin allows you to change additional shell optional behavior. Control::). The shell always postpones exiting if any jobs are stopped. - 'checkwinsize' + ‘checkwinsize’ If set, Bash checks the window size after each external (non-builtin) command and, if necessary, updates the values of - 'LINES' and 'COLUMNS'. This option is enabled by default. + ‘LINES’ and ‘COLUMNS’. This option is enabled by default. - 'cmdhist' + ‘cmdhist’ If set, Bash 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 (*note Bash History Facilities::). - 'compat31' - 'compat32' - 'compat40' - 'compat41' - 'compat42' - 'compat43' - 'compat44' + ‘compat31’ + ‘compat32’ + ‘compat40’ + ‘compat41’ + ‘compat42’ + ‘compat43’ + ‘compat44’ These control aspects of the shell's compatibility mode (*note Shell Compatibility Mode::). - 'complete_fullquote' + ‘complete_fullquote’ If set, Bash quotes all shell metacharacters in filenames and directory names when performing completion. If not set, Bash removes metacharacters such as the dollar sign from the set of @@ -4977,254 +4983,254 @@ This builtin allows you to change additional shell optional behavior. set by default, which is the default Bash behavior in versions through 4.2. - 'direxpand' + ‘direxpand’ If set, Bash replaces directory names with the results of word expansion when performing filename completion. This changes the contents of the Readline editing buffer. If not set, Bash attempts to preserve what the user typed. - 'dirspell' + ‘dirspell’ If set, Bash attempts spelling correction on directory names during word completion if the directory name initially supplied does not exist. - 'dotglob' + ‘dotglob’ If set, Bash includes filenames beginning with a '.' in the - results of filename expansion. The filenames '.' and '..' - must always be matched explicitly, even if 'dotglob' is set. + results of filename expansion. The filenames ‘.’ and ‘..’ + must always be matched explicitly, even if ‘dotglob’ is set. - 'execfail' + ‘execfail’ If this is set, a non-interactive shell will not exit if it - cannot execute the file specified as an argument to the 'exec' - builtin command. An interactive shell does not exit if 'exec' + cannot execute the file specified as an argument to the ‘exec’ + builtin command. An interactive shell does not exit if ‘exec’ fails. - 'expand_aliases' + ‘expand_aliases’ If set, aliases are expanded as described below under Aliases, *note Aliases::. This option is enabled by default for interactive shells. - 'extdebug' + ‘extdebug’ If set at shell invocation, or in a shell startup file, arrange to execute the debugger profile before the shell - starts, identical to the '--debugger' option. If set after + starts, identical to the ‘--debugger’ option. If set after invocation, behavior intended for use by debuggers is enabled: - 1. The '-F' option to the 'declare' builtin (*note Bash + 1. The ‘-F’ option to the ‘declare’ builtin (*note Bash Builtins::) displays the source file name and line number corresponding to each function name supplied as an argument. - 2. If the command run by the 'DEBUG' trap returns a non-zero + 2. If the command run by the ‘DEBUG’ trap returns a non-zero value, the next command is skipped and not executed. - 3. If the command run by the 'DEBUG' trap returns a value of + 3. If the command run by the ‘DEBUG’ trap returns a value of 2, and the shell is executing in a subroutine (a shell - function or a shell script executed by the '.' or - 'source' builtins), the shell simulates a call to - 'return'. + function or a shell script executed by the ‘.’ or + ‘source’ builtins), the shell simulates a call to + ‘return’. - 4. 'BASH_ARGC' and 'BASH_ARGV' are updated as described in + 4. ‘BASH_ARGC’ and ‘BASH_ARGV’ are updated as described in their descriptions (*note Bash Variables::). 5. Function tracing is enabled: command substitution, shell - functions, and subshells invoked with '( COMMAND )' - inherit the 'DEBUG' and 'RETURN' traps. + functions, and subshells invoked with ‘( COMMAND )’ + inherit the ‘DEBUG’ and ‘RETURN’ traps. 6. Error tracing is enabled: command substitution, shell - functions, and subshells invoked with '( COMMAND )' - inherit the 'ERR' trap. + functions, and subshells invoked with ‘( COMMAND )’ + inherit the ‘ERR’ trap. - 'extglob' + ‘extglob’ If set, the extended pattern matching features described above (*note Pattern Matching::) are enabled. - 'extquote' - If set, '$'STRING'' and '$"STRING"' quoting is performed - within '${PARAMETER}' expansions enclosed in double quotes. + ‘extquote’ + If set, ‘$'STRING'’ and ‘$"STRING"’ quoting is performed + within ‘${PARAMETER}’ expansions enclosed in double quotes. This option is enabled by default. - 'failglob' + ‘failglob’ If set, patterns which fail to match filenames during filename expansion result in an expansion error. - 'force_fignore' - If set, the suffixes specified by the 'FIGNORE' shell variable + ‘force_fignore’ + If set, the suffixes specified by the ‘FIGNORE’ shell variable cause words to be ignored when performing word completion even if the ignored words are the only possible completions. *Note - Bash Variables::, for a description of 'FIGNORE'. This option + Bash Variables::, for a description of ‘FIGNORE’. This option is enabled by default. - 'globasciiranges' + ‘globasciiranges’ If set, range expressions used in pattern matching bracket expressions (*note Pattern Matching::) behave as if in the traditional C locale when performing comparisons. That is, the current locale's collating sequence is not taken into - account, so 'b' will not collate between 'A' and 'B', and + account, so ‘b’ will not collate between ‘A’ and ‘B’, and upper-case and lower-case ASCII characters will collate together. - 'globskipdots' - If set, filename expansion will never match the filenames '.' - and '..', even if the pattern begins with a '.'. This option + ‘globskipdots’ + If set, filename expansion will never match the filenames ‘.’ + and ‘..’, even if the pattern begins with a ‘.’. This option is enabled by default. - 'globstar' - If set, the pattern '**' used in a filename expansion context + ‘globstar’ + If set, the pattern ‘**’ used in a filename expansion context will match all files and zero or more directories and - subdirectories. If the pattern is followed by a '/', only + subdirectories. If the pattern is followed by a ‘/’, only directories and subdirectories match. - 'gnu_errfmt' + ‘gnu_errfmt’ If set, shell error messages are written in the standard GNU error message format. - 'histappend' + ‘histappend’ If set, the history list is appended to the file named by the - value of the 'HISTFILE' variable when the shell exits, rather + value of the ‘HISTFILE’ variable when the shell exits, rather than overwriting the file. - 'histreedit' + ‘histreedit’ If set, and Readline is being used, a user is given the opportunity to re-edit a failed history substitution. - 'histverify' + ‘histverify’ If set, and Readline is being used, the results of history substitution are not immediately passed to the shell parser. Instead, the resulting line is loaded into the Readline editing buffer, allowing further modification. - 'hostcomplete' + ‘hostcomplete’ If set, and Readline is being used, Bash will attempt to - perform hostname completion when a word containing a '@' is + perform hostname completion when a word containing a ‘@’ is being completed (*note Commands For Completion::). This option is enabled by default. - 'huponexit' - If set, Bash will send 'SIGHUP' to all jobs when an + ‘huponexit’ + If set, Bash will send ‘SIGHUP’ to all jobs when an interactive login shell exits (*note Signals::). - 'inherit_errexit' + ‘inherit_errexit’ If set, command substitution inherits the value of the - 'errexit' option, instead of unsetting it in the subshell + ‘errexit’ option, instead of unsetting it in the subshell environment. This option is enabled when POSIX mode is enabled. - 'interactive_comments' - Allow a word beginning with '#' to cause that word and all + ‘interactive_comments’ + Allow a word beginning with ‘#’ to cause that word and all remaining characters on that line to be ignored in an interactive shell. This option is enabled by default. - 'lastpipe' + ‘lastpipe’ If set, and job control is not active, the shell runs the last command of a pipeline not executed in the background in the current shell environment. - 'lithist' - If enabled, and the 'cmdhist' option is enabled, multi-line + ‘lithist’ + If enabled, and the ‘cmdhist’ option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible. - 'localvar_inherit' + ‘localvar_inherit’ If set, local variables inherit the value and attributes of a variable of the same name that exists at a previous scope - before any new value is assigned. The 'nameref' attribute is + before any new value is assigned. The ‘nameref’ attribute is not inherited. - 'localvar_unset' - If set, calling 'unset' on local variables in previous + ‘localvar_unset’ + If set, calling ‘unset’ on local variables in previous function scopes marks them so subsequent lookups find them unset until that function returns. This is identical to the behavior of unsetting local variables at the current function scope. - 'login_shell' + ‘login_shell’ The shell sets this option if it is started as a login shell (*note Invoking Bash::). The value may not be changed. - 'mailwarn' + ‘mailwarn’ If set, and a file that Bash is checking for mail has been - accessed since the last time it was checked, the message '"The - mail in MAILFILE has been read"' is displayed. + accessed since the last time it was checked, the message ‘"The + mail in MAILFILE has been read"’ is displayed. - 'no_empty_cmd_completion' + ‘no_empty_cmd_completion’ If set, and Readline is being used, Bash will not attempt to - search the 'PATH' for possible completions when completion is + search the ‘PATH’ for possible completions when completion is attempted on an empty line. - 'nocaseglob' + ‘nocaseglob’ If set, Bash matches filenames in a case-insensitive fashion when performing filename expansion. - 'nocasematch' + ‘nocasematch’ If set, Bash matches patterns in a case-insensitive fashion - when performing matching while executing 'case' or '[[' + when performing matching while executing ‘case’ or ‘[[’ conditional commands (*note Conditional Constructs::, when performing pattern substitution word expansions, or when filtering possible completions as part of programmable completion. - 'noexpand_translation' + ‘noexpand_translation’ If set, Bash encloses the translated results of $"..." quoting in single quotes instead of double quotes. If the string is not translated, this has no effect. - 'nullglob' + ‘nullglob’ If set, filename expansion patterns which match no files (*note Filename Expansion::) expand to nothing and are removed, rather than expanding to themselves. - 'patsub_replacement' - If set, Bash expands occurrences of '&' in the replacement + ‘patsub_replacement’ + If set, Bash expands occurrences of ‘&’ in the replacement string of pattern substitution to the text matched by the pattern, as described above (*note Shell Parameter Expansion::). This option is enabled by default. - 'progcomp' + ‘progcomp’ If set, the programmable completion facilities (*note Programmable Completion::) are enabled. This option is enabled by default. - 'progcomp_alias' + ‘progcomp_alias’ If set, and programmable completion is enabled, Bash treats a command name that doesn't have any completions as a possible alias and attempts alias expansion. If it has an alias, Bash attempts programmable completion using the command word resulting from the expanded alias. - 'promptvars' + ‘promptvars’ If set, prompt strings undergo parameter expansion, command substitution, arithmetic expansion, and quote removal after being expanded as described below (*note Controlling the Prompt::). This option is enabled by default. - 'restricted_shell' + ‘restricted_shell’ The shell sets this option if it is started in restricted mode (*note The Restricted Shell::). The value may not be changed. This is not reset when the startup files are executed, allowing the startup files to discover whether or not a shell is restricted. - 'shift_verbose' - If this is set, the 'shift' builtin prints an error message + ‘shift_verbose’ + If this is set, the ‘shift’ builtin prints an error message when the shift count exceeds the number of positional parameters. - 'sourcepath' - If set, the '.' ('source') builtin uses the value of 'PATH' to + ‘sourcepath’ + If set, the ‘.’ (‘source’) builtin uses the value of ‘PATH’ to find the directory containing the file supplied as an argument. This option is enabled by default. - 'varredir_close' + ‘varredir_close’ If set, the shell automatically closes file descriptors - assigned using the '{varname}' redirection syntax (*note + assigned using the ‘{varname}’ redirection syntax (*note Redirections::) instead of leaving them open when the command completes. - 'xpg_echo' - If set, the 'echo' builtin expands backslash-escape sequences - by default. If the 'posix' shell option (*note The Set - Builtin::) is also enabled, 'echo' does not interpret any + ‘xpg_echo’ + If set, the ‘echo’ builtin expands backslash-escape sequences + by default. If the ‘posix’ shell option (*note The Set + Builtin::) is also enabled, ‘echo’ does not interpret any options.  @@ -5279,53 +5285,53 @@ File: bashref.info, Node: Bourne Shell Variables, Next: Bash Variables, Up: S Bash uses certain shell variables in the same way as the Bourne shell. In some cases, Bash assigns a default value to the variable. -'CDPATH' +‘CDPATH’ A colon-separated list of directories used as a search path for the - 'cd' builtin command. + ‘cd’ builtin command. -'HOME' - The current user's home directory; the default for the 'cd' builtin +‘HOME’ + The current user's home directory; the default for the ‘cd’ builtin command. The value of this variable is also used by tilde expansion (*note Tilde Expansion::). -'IFS' +‘IFS’ A list of characters that separate fields; used when the shell splits words as part of expansion. -'MAIL' +‘MAIL’ If this parameter is set to a filename or directory name and the - 'MAILPATH' variable is not set, Bash informs the user of the + ‘MAILPATH’ variable is not set, Bash informs the user of the arrival of mail in the specified file or Maildir-format directory. -'MAILPATH' +‘MAILPATH’ A colon-separated list of filenames which the shell periodically checks for new mail. Each list entry can specify the message that is printed when new mail arrives in the mail file by separating the - filename from the message with a '?'. When used in the text of the - message, '$_' expands to the name of the current mail file. + filename from the message with a ‘?’. When used in the text of the + message, ‘$_’ expands to the name of the current mail file. -'OPTARG' - The value of the last option argument processed by the 'getopts' +‘OPTARG’ + The value of the last option argument processed by the ‘getopts’ builtin. -'OPTIND' - The index of the last option argument processed by the 'getopts' +‘OPTIND’ + The index of the last option argument processed by the ‘getopts’ builtin. -'PATH' +‘PATH’ A colon-separated list of directories in which the shell looks for commands. A zero-length (null) directory name in the value of - 'PATH' indicates the current directory. A null directory name may + ‘PATH’ indicates the current directory. A null directory name may appear as two adjacent colons, or as an initial or trailing colon. -'PS1' - The primary prompt string. The default value is '\s-\v\$ '. *Note +‘PS1’ + The primary prompt string. The default value is ‘\s-\v\$ ’. *Note Controlling the Prompt::, for the complete list of escape sequences - that are expanded before 'PS1' is displayed. + that are expanded before ‘PS1’ is displayed. -'PS2' - The secondary prompt string. The default value is '> '. 'PS2' is - expanded in the same way as 'PS1' before being displayed. +‘PS2’ + The secondary prompt string. The default value is ‘> ’. ‘PS2’ is + expanded in the same way as ‘PS1’ before being displayed.  File: bashref.info, Node: Bash Variables, Prev: Bourne Shell Variables, Up: Shell Variables @@ -5340,7 +5346,7 @@ normally treat them specially. variables for controlling the job control facilities (*note Job Control Variables::). -'_' +‘_’ ($_, an underscore.) At shell startup, set to the pathname used to invoke the shell or shell script being executed as passed in the environment or argument list. Subsequently, expands to the last @@ -5350,431 +5356,431 @@ Variables::). command. When checking mail, this parameter holds the name of the mail file. -'BASH' +‘BASH’ The full pathname used to execute the current instance of Bash. -'BASHOPTS' +‘BASHOPTS’ A colon-separated list of enabled shell options. Each word in the - list is a valid argument for the '-s' option to the 'shopt' builtin + list is a valid argument for the ‘-s’ option to the ‘shopt’ builtin command (*note The Shopt Builtin::). The options appearing in - 'BASHOPTS' are those reported as 'on' by 'shopt'. If this variable + ‘BASHOPTS’ are those reported as ‘on’ by ‘shopt’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files. This variable is readonly. -'BASHPID' +‘BASHPID’ Expands to the process ID of the current Bash process. This - differs from '$$' under certain circumstances, such as subshells + differs from ‘$$’ under certain circumstances, such as subshells that do not require Bash to be re-initialized. Assignments to - 'BASHPID' have no effect. If 'BASHPID' is unset, it loses its + ‘BASHPID’ have no effect. If ‘BASHPID’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_ALIASES' +‘BASH_ALIASES’ An associative array variable whose members correspond to the - internal list of aliases as maintained by the 'alias' builtin. + internal list of aliases as maintained by the ‘alias’ builtin. (*note Bourne Shell Builtins::). Elements added to this array appear in the alias list; however, unsetting array elements currently does not cause aliases to be removed from the alias list. - If 'BASH_ALIASES' is unset, it loses its special properties, even + If ‘BASH_ALIASES’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_ARGC' +‘BASH_ARGC’ An array variable whose values are the number of parameters in each frame of the current Bash execution call stack. The number of parameters to the current subroutine (shell function or script - executed with '.' or 'source') is at the top of the stack. When a + executed with ‘.’ or ‘source’) is at the top of the stack. When a subroutine is executed, the number of parameters passed is pushed - onto 'BASH_ARGC'. The shell sets 'BASH_ARGC' only when in extended + onto ‘BASH_ARGC’. The shell sets ‘BASH_ARGC’ only when in extended debugging mode (see *note The Shopt Builtin:: for a description of - the 'extdebug' option to the 'shopt' builtin). Setting 'extdebug' + the ‘extdebug’ option to the ‘shopt’ builtin). Setting ‘extdebug’ after the shell has started to execute a script, or referencing - this variable when 'extdebug' is not set, may result in - inconsistent values. Assignments to 'BASH_ARGC' have no effect, + this variable when ‘extdebug’ is not set, may result in + inconsistent values. Assignments to ‘BASH_ARGC’ have no effect, and it may not be unset. -'BASH_ARGV' +‘BASH_ARGV’ An array variable containing all of the parameters in the current Bash execution call stack. The final parameter of the last subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is executed, - the parameters supplied are pushed onto 'BASH_ARGV'. The shell - sets 'BASH_ARGV' only when in extended debugging mode (see *note - The Shopt Builtin:: for a description of the 'extdebug' option to - the 'shopt' builtin). Setting 'extdebug' after the shell has + the parameters supplied are pushed onto ‘BASH_ARGV’. The shell + sets ‘BASH_ARGV’ only when in extended debugging mode (see *note + The Shopt Builtin:: for a description of the ‘extdebug’ option to + the ‘shopt’ builtin). Setting ‘extdebug’ after the shell has started to execute a script, or referencing this variable when - 'extdebug' is not set, may result in inconsistent values. - Assignments to 'BASH_ARGV' have no effect, and it may not be unset. + ‘extdebug’ is not set, may result in inconsistent values. + Assignments to ‘BASH_ARGV’ have no effect, and it may not be unset. -'BASH_ARGV0' +‘BASH_ARGV0’ When referenced, this variable expands to the name of the shell or - shell script (identical to '$0'; *Note Special Parameters::, for + shell script (identical to ‘$0’; *Note Special Parameters::, for the description of special parameter 0). Assignment to - 'BASH_ARGV0' causes the value assigned to also be assigned to '$0'. - If 'BASH_ARGV0' is unset, it loses its special properties, even if + ‘BASH_ARGV0’ causes the value assigned to also be assigned to ‘$0’. + If ‘BASH_ARGV0’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_CMDS' +‘BASH_CMDS’ An associative array variable whose members correspond to the - internal hash table of commands as maintained by the 'hash' builtin + internal hash table of commands as maintained by the ‘hash’ builtin (*note Bourne Shell Builtins::). Elements added to this array appear in the hash table; however, unsetting array elements currently does not cause command names to be removed from the hash - table. If 'BASH_CMDS' is unset, it loses its special properties, + table. If ‘BASH_CMDS’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_COMMAND' +‘BASH_COMMAND’ The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, in which case it is the command executing at the time of the trap. If - 'BASH_COMMAND' is unset, it loses its special properties, even if + ‘BASH_COMMAND’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_COMPAT' +‘BASH_COMPAT’ The value is used to set the shell's compatibility level. *Note Shell Compatibility Mode::, for a description of the various compatibility levels and their effects. The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) corresponding to the - desired compatibility level. If 'BASH_COMPAT' is unset or set to + desired compatibility level. If ‘BASH_COMPAT’ is unset or set to the empty string, the compatibility level is set to the default for - the current version. If 'BASH_COMPAT' is set to a value that is + the current version. If ‘BASH_COMPAT’ is set to a value that is not one of the valid compatibility levels, the shell prints an error message and sets the compatibility level to the default for - the current version. The valid values correspond to the - compatibility levels described below (*note Shell Compatibility + the current version. A subset of the valid values correspond to + the compatibility levels described below (*note Shell Compatibility Mode::). For example, 4.2 and 42 are valid values that correspond - to the 'compat42' 'shopt' option and set the compatibility level to + to the ‘compat42’ ‘shopt’ option and set the compatibility level to 42. The current version is also a valid value. -'BASH_ENV' +‘BASH_ENV’ If this variable is set when Bash is invoked to execute a shell script, its value is expanded and used as the name of a startup file to read before executing the script. *Note Bash Startup Files::. -'BASH_EXECUTION_STRING' - The command argument to the '-c' invocation option. +‘BASH_EXECUTION_STRING’ + The command argument to the ‘-c’ invocation option. -'BASH_LINENO' +‘BASH_LINENO’ An array variable whose members are the line numbers in source - files where each corresponding member of 'FUNCNAME' was invoked. - '${BASH_LINENO[$i]}' is the line number in the source file - ('${BASH_SOURCE[$i+1]}') where '${FUNCNAME[$i]}' was called (or - '${BASH_LINENO[$i-1]}' if referenced within another shell - function). Use 'LINENO' to obtain the current line number. - Assignments to 'BASH_LINENO' have no effect, and it may not be + files where each corresponding member of ‘FUNCNAME’ was invoked. + ‘${BASH_LINENO[$i]}’ is the line number in the source file + (‘${BASH_SOURCE[$i+1]}’) where ‘${FUNCNAME[$i]}’ was called (or + ‘${BASH_LINENO[$i-1]}’ if referenced within another shell + function). Use ‘LINENO’ to obtain the current line number. + Assignments to ‘BASH_LINENO’ have no effect, and it may not be unset. -'BASH_LOADABLES_PATH' +‘BASH_LOADABLES_PATH’ A colon-separated list of directories in which the shell looks for - dynamically loadable builtins specified by the 'enable' command. + dynamically loadable builtins specified by the ‘enable’ command. -'BASH_MONOSECONDS' +‘BASH_MONOSECONDS’ Each time this variable is referenced, it expands to the value returned by the system's monotonic clock, if one is available. If - there is no monotonic clock, this is equivalent to 'EPOCHSECONDS'. - If 'BASH_MONOSECONDS' is unset, it loses its special properties, + there is no monotonic clock, this is equivalent to ‘EPOCHSECONDS’. + If ‘BASH_MONOSECONDS’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_REMATCH' - An array variable whose members are assigned by the '=~' binary - operator to the '[[' conditional command (*note Conditional +‘BASH_REMATCH’ + An array variable whose members are assigned by the ‘=~’ binary + operator to the ‘[[’ conditional command (*note Conditional Constructs::). The element with index 0 is the portion of the string matching the entire regular expression. The element with index N is the portion of the string matching the Nth parenthesized subexpression. -'BASH_SOURCE' +‘BASH_SOURCE’ An array variable whose members are the source filenames where the - corresponding shell function names in the 'FUNCNAME' array variable - are defined. The shell function '${FUNCNAME[$i]}' is defined in - the file '${BASH_SOURCE[$i]}' and called from - '${BASH_SOURCE[$i+1]}' Assignments to 'BASH_SOURCE' have no effect, + corresponding shell function names in the ‘FUNCNAME’ array variable + are defined. The shell function ‘${FUNCNAME[$i]}’ is defined in + the file ‘${BASH_SOURCE[$i]}’ and called from + ‘${BASH_SOURCE[$i+1]}’ Assignments to ‘BASH_SOURCE’ have no effect, and it may not be unset. -'BASH_SUBSHELL' +‘BASH_SUBSHELL’ Incremented by one within each subshell or subshell environment when the shell begins executing in that environment. The initial - value is 0. If 'BASH_SUBSHELL' is unset, it loses its special + value is 0. If ‘BASH_SUBSHELL’ is unset, it loses its special properties, even if it is subsequently reset. -'BASH_TRAPSIG' +‘BASH_TRAPSIG’ Set to the signal number corresponding to the trap action being - executed during its execution. See the description of 'trap' + executed during its execution. See the description of ‘trap’ (*note Bourne Shell Builtins::) for information about signal numbers and trap execution. -'BASH_VERSINFO' +‘BASH_VERSINFO’ A readonly array variable (*note Arrays::) whose members hold version information for this instance of Bash. The values assigned to the array members are as follows: - 'BASH_VERSINFO[0]' - The major version number (the "release"). + ‘BASH_VERSINFO[0]’ + The major version number (the “release”). - 'BASH_VERSINFO[1]' - The minor version number (the "version"). + ‘BASH_VERSINFO[1]’ + The minor version number (the “version”). - 'BASH_VERSINFO[2]' + ‘BASH_VERSINFO[2]’ The patch level. - 'BASH_VERSINFO[3]' + ‘BASH_VERSINFO[3]’ The build version. - 'BASH_VERSINFO[4]' - The release status (e.g., 'beta1'). + ‘BASH_VERSINFO[4]’ + The release status (e.g., ‘beta’). - 'BASH_VERSINFO[5]' - The value of 'MACHTYPE'. + ‘BASH_VERSINFO[5]’ + The value of ‘MACHTYPE’. -'BASH_VERSION' +‘BASH_VERSION’ The version number of the current instance of Bash. -'BASH_XTRACEFD' +‘BASH_XTRACEFD’ If set to an integer corresponding to a valid file descriptor, Bash - will write the trace output generated when 'set -x' is enabled to + will write the trace output generated when ‘set -x’ is enabled to that file descriptor. This allows tracing output to be separated from diagnostic and error messages. The file descriptor is closed - when 'BASH_XTRACEFD' is unset or assigned a new value. Unsetting - 'BASH_XTRACEFD' or assigning it the empty string causes the trace + when ‘BASH_XTRACEFD’ is unset or assigned a new value. Unsetting + ‘BASH_XTRACEFD’ or assigning it the empty string causes the trace output to be sent to the standard error. Note that setting - 'BASH_XTRACEFD' to 2 (the standard error file descriptor) and then + ‘BASH_XTRACEFD’ to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed. -'CHILD_MAX' +‘CHILD_MAX’ 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. The minimum value is system-dependent. -'COLUMNS' - Used by the 'select' command to determine the terminal width when - printing selection lists. Automatically set if the 'checkwinsize' +‘COLUMNS’ + Used by the ‘select’ command to determine the terminal width when + printing selection lists. Automatically set if the ‘checkwinsize’ option is enabled (*note The Shopt Builtin::), or in an interactive - shell upon receipt of a 'SIGWINCH'. + shell upon receipt of a ‘SIGWINCH’. -'COMP_CWORD' - An index into '${COMP_WORDS}' of the word containing the current +‘COMP_CWORD’ + An index into ‘${COMP_WORDS}’ of the word containing the current cursor position. This variable is available only in shell functions invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_LINE' +‘COMP_LINE’ The current command line. This variable is available only in shell functions and external commands invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_POINT' +‘COMP_POINT’ The index of the current cursor position relative to the beginning of the current command. If the current cursor position is at the end of the current command, the value of this variable is equal to - '${#COMP_LINE}'. This variable is available only in shell + ‘${#COMP_LINE}’. This variable is available only in shell functions and external commands invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_TYPE' +‘COMP_TYPE’ Set to an integer value corresponding to the type of completion attempted that caused a completion function to be called: , - for normal completion, '?', for listing completions after - successive tabs, '!', for listing alternatives on partial word - completion, '@', to list completions if the word is not unmodified, - or '%', for menu completion. This variable is available only in + for normal completion, ‘?’, for listing completions after + successive tabs, ‘!’, for listing alternatives on partial word + completion, ‘@’, to list completions if the word is not unmodified, + or ‘%’, for menu completion. This variable is available only in shell functions and external commands invoked by the programmable completion facilities (*note Programmable Completion::). -'COMP_KEY' +‘COMP_KEY’ The key (or final key of a key sequence) used to invoke the current completion function. -'COMP_WORDBREAKS' +‘COMP_WORDBREAKS’ The set of characters that the Readline library treats as word - separators when performing word completion. If 'COMP_WORDBREAKS' + separators when performing word completion. If ‘COMP_WORDBREAKS’ is unset, it loses its special properties, even if it is subsequently reset. -'COMP_WORDS' +‘COMP_WORDS’ An array variable consisting of the individual words in the current command line. The line is split into words as Readline would split - it, using 'COMP_WORDBREAKS' as described above. This variable is + it, using ‘COMP_WORDBREAKS’ as described above. This variable is available only in shell functions invoked by the programmable completion facilities (*note Programmable Completion::). -'COMPREPLY' +‘COMPREPLY’ An array variable from which Bash reads the possible completions generated by a shell function invoked by the programmable completion facility (*note Programmable Completion::). Each array element contains one possible completion. -'COPROC' +‘COPROC’ An array variable created to hold the file descriptors for output from and input to an unnamed coprocess (*note Coprocesses::). -'DIRSTACK' +‘DIRSTACK’ An array variable containing the current contents of the directory stack. Directories appear in the stack in the order they are - displayed by the 'dirs' builtin. Assigning to members of this + displayed by the ‘dirs’ builtin. Assigning to members of this array variable may be used to modify directories already in the - stack, but the 'pushd' and 'popd' builtins must be used to add and + stack, but the ‘pushd’ and ‘popd’ builtins must be used to add and remove directories. Assignment to this variable will not change - the current directory. If 'DIRSTACK' is unset, it loses its + the current directory. If ‘DIRSTACK’ is unset, it loses its special properties, even if it is subsequently reset. -'EMACS' +‘EMACS’ If Bash finds this variable in the environment when the shell - starts with value 't', it assumes that the shell is running in an + starts with value ‘t’, it assumes that the shell is running in an Emacs shell buffer and disables line editing. -'ENV' - Expanded and executed similarly to 'BASH_ENV' (*note Bash Startup +‘ENV’ + Expanded and executed similarly to ‘BASH_ENV’ (*note Bash Startup Files::) when an interactive shell is invoked in POSIX Mode (*note Bash POSIX Mode::). -'EPOCHREALTIME' +‘EPOCHREALTIME’ Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch as a floating point value with micro-second granularity (see the documentation for the C library - function 'time' for the definition of Epoch). Assignments to - 'EPOCHREALTIME' are ignored. If 'EPOCHREALTIME' is unset, it loses + function ‘time’ for the definition of Epoch). Assignments to + ‘EPOCHREALTIME’ are ignored. If ‘EPOCHREALTIME’ is unset, it loses its special properties, even if it is subsequently reset. -'EPOCHSECONDS' +‘EPOCHSECONDS’ Each time this parameter is referenced, it expands to the number of seconds since the Unix Epoch (see the documentation for the C - library function 'time' for the definition of Epoch). Assignments - to 'EPOCHSECONDS' are ignored. If 'EPOCHSECONDS' is unset, it + library function ‘time’ for the definition of Epoch). Assignments + to ‘EPOCHSECONDS’ are ignored. If ‘EPOCHSECONDS’ is unset, it loses its special properties, even if it is subsequently reset. -'EUID' +‘EUID’ The numeric effective user id of the current user. This variable is readonly. -'EXECIGNORE' +‘EXECIGNORE’ A colon-separated list of shell patterns (*note Pattern Matching::) defining the list of filenames to be ignored by command search - using 'PATH'. Files whose full pathnames match one of these + using ‘PATH’. Files whose full pathnames match one of these patterns are not considered executable files for the purposes of - completion and command execution via 'PATH' lookup. This does not - affect the behavior of the '[', 'test', and '[[' commands. Full + completion and command execution via ‘PATH’ lookup. This does not + affect the behavior of the ‘[’, ‘test’, and ‘[[’ commands. Full pathnames in the command hash table are not subject to - 'EXECIGNORE'. Use this variable to ignore shared library files + ‘EXECIGNORE’. Use this variable to ignore shared library files that have the executable bit set, but are not executable files. - The pattern matching honors the setting of the 'extglob' shell + The pattern matching honors the setting of the ‘extglob’ shell option. -'FCEDIT' - The editor used as a default by the '-e' option to the 'fc' builtin +‘FCEDIT’ + The editor used as a default by the ‘-e’ option to the ‘fc’ builtin command. -'FIGNORE' +‘FIGNORE’ A colon-separated list of suffixes to ignore when performing filename completion. A filename whose suffix matches one of the - entries in 'FIGNORE' is excluded from the list of matched - filenames. A sample value is '.o:~' + entries in ‘FIGNORE’ is excluded from the list of matched + filenames. A sample value is ‘.o:~’ -'FUNCNAME' +‘FUNCNAME’ An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The - bottom-most element (the one with the highest index) is '"main"'. + bottom-most element (the one with the highest index) is ‘"main"’. This variable exists only when a shell function is executing. - Assignments to 'FUNCNAME' have no effect. If 'FUNCNAME' is unset, + Assignments to ‘FUNCNAME’ have no effect. If ‘FUNCNAME’ is unset, it loses its special properties, even if it is subsequently reset. - This variable can be used with 'BASH_LINENO' and 'BASH_SOURCE'. - Each element of 'FUNCNAME' has corresponding elements in - 'BASH_LINENO' and 'BASH_SOURCE' to describe the call stack. For - instance, '${FUNCNAME[$i]}' was called from the file - '${BASH_SOURCE[$i+1]}' at line number '${BASH_LINENO[$i]}'. The - 'caller' builtin displays the current call stack using this + This variable can be used with ‘BASH_LINENO’ and ‘BASH_SOURCE’. + Each element of ‘FUNCNAME’ has corresponding elements in + ‘BASH_LINENO’ and ‘BASH_SOURCE’ to describe the call stack. For + instance, ‘${FUNCNAME[$i]}’ was called from the file + ‘${BASH_SOURCE[$i+1]}’ at line number ‘${BASH_LINENO[$i]}’. The + ‘caller’ builtin displays the current call stack using this information. -'FUNCNEST' +‘FUNCNEST’ If set to a numeric value greater than 0, defines a maximum function nesting level. Function invocations that exceed this nesting level will cause the current command to abort. -'GLOBIGNORE' +‘GLOBIGNORE’ A colon-separated list of patterns defining the set of file names to be ignored by filename expansion. If a file name matched by a filename expansion pattern also matches one of the patterns in - 'GLOBIGNORE', it is removed from the list of matches. The pattern - matching honors the setting of the 'extglob' shell option. + ‘GLOBIGNORE’, it is removed from the list of matches. The pattern + matching honors the setting of the ‘extglob’ shell option. -'GLOBSORT' +‘GLOBSORT’ Control how the results of filename expansion are sorted. The value of this variable specifies the sort criteria and sort order for the results of filename expansion. If this variable is unset or set to the null string, filename expansion uses the historical behavior of sorting by name. If set, a valid value begins with an - optional '+', which is ignored, or '-', which reverses the sort + optional ‘+’, which is ignored, or ‘-’, which reverses the sort order from ascending to descending, followed by a sort specifier. - The valid sort specifiers are 'name', 'size', 'mtime', 'atime', - 'ctime', and 'blocks', which sort the files on name, file size, + The valid sort specifiers are ‘name’, ‘size’, ‘mtime’, ‘atime’, + ‘ctime’, and ‘blocks’, which sort the files on name, file size, modification time, access time, inode change time, and number of blocks, respectively. - For example, a value of '-mtime' sorts the results in descending + For example, a value of ‘-mtime’ sorts the results in descending order by modification time (newest first). - A sort specifier of 'nosort' disables sorting completely; the + A sort specifier of ‘nosort’ disables sorting completely; the results are returned in the order they are read from the file system,. If the sort specifier is missing, it defaults to NAME, so a value - of '+' is equivalent to the null string, and a value of '-' sorts + 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. -'GROUPS' +‘GROUPS’ An array variable containing the list of groups of which the - current user is a member. Assignments to 'GROUPS' have no effect. - If 'GROUPS' is unset, it loses its special properties, even if it + current user is a member. Assignments to ‘GROUPS’ have no effect. + If ‘GROUPS’ is unset, it loses its special properties, even if it is subsequently reset. -'histchars' +‘histchars’ Up to three characters which control history expansion, quick substitution, and tokenization (*note History Interaction::). The - first character is the "history expansion" character, that is, the + first character is the “history expansion” character, that is, the character which signifies the start of a history expansion, - normally '!'. The second character is the character which + normally ‘!’. The second character is the character which signifies "quick substitution" when seen as the first character on - a line, normally '^'. The optional third character is the + a line, normally ‘^’. 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 '#'. + comment when found as the first character of a word, usually ‘#’. The history comment character causes history substitution to be skipped 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' +‘HISTCMD’ The history number, or index in the history list, of the current - command. Assignments to 'HISTCMD' are ignored. If 'HISTCMD' is + command. Assignments to ‘HISTCMD’ are ignored. If ‘HISTCMD’ is unset, it loses its special properties, even if it is subsequently reset. -'HISTCONTROL' +‘HISTCONTROL’ A colon-separated list of values controlling how commands are saved - on the history list. If the list of values includes 'ignorespace', + on the history list. If the list of values includes ‘ignorespace’, lines which begin with a space character are not saved in the - history list. A value of 'ignoredups' causes lines which match the - previous history entry to not be saved. A value of 'ignoreboth' is - shorthand for 'ignorespace' and 'ignoredups'. A value of - 'erasedups' causes all previous lines matching the current line to + history list. A value of ‘ignoredups’ causes lines which match the + previous history entry to not be saved. A value of ‘ignoreboth’ is + shorthand for ‘ignorespace’ and ‘ignoredups’. A value of + ‘erasedups’ 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 'HISTCONTROL' is unset, + value not in the above list is ignored. If ‘HISTCONTROL’ is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of - 'HISTIGNORE'. The second and subsequent lines of a multi-line + ‘HISTIGNORE’. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history - regardless of the value of 'HISTCONTROL'. + regardless of the value of ‘HISTCONTROL’. -'HISTFILE' +‘HISTFILE’ The name of the file to which the command history is saved. Bash - assigns a default value of '~/.bash_history'. If 'HISTFILE' is + assigns a default value of ‘~/.bash_history’. If ‘HISTFILE’ is unset or null, the command history is not saved when a shell exits. -'HISTFILESIZE' +‘HISTFILESIZE’ The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if necessary, to contain no more than that number of lines by @@ -5782,287 +5788,288 @@ Variables::). this size after writing it when a shell exits. If the value is 0, the history file is truncated to zero size. Non-numeric values and numeric values less than zero inhibit truncation. The shell sets - the default value to the value of 'HISTSIZE' after reading any + the default value to the value of ‘HISTSIZE’ after reading any startup files. -'HISTIGNORE' +‘HISTIGNORE’ A colon-separated list of patterns used to decide which command lines should be saved on the history list. Each pattern is anchored at the beginning of the line and must match the complete - line (no implicit '*' is appended). Each pattern is tested against - the line after the checks specified by 'HISTCONTROL' are applied. - In addition to the normal shell pattern matching characters, '&' - matches the previous history line. '&' may be escaped using a - backslash; the backslash is removed before attempting a match. The - second and subsequent lines of a multi-line compound command are - not tested, and are added to the history regardless of the value of - 'HISTIGNORE'. The pattern matching honors the setting of the - 'extglob' shell option. - - 'HISTIGNORE' subsumes the function of 'HISTCONTROL'. A pattern of - '&' is identical to 'ignoredups', and a pattern of '[ ]*' is - identical to 'ignorespace'. Combining these two patterns, + line (Bash will not implicitly append a ‘*’). Each pattern is + tested against the line after the checks specified by ‘HISTCONTROL’ + are applied. In addition to the normal shell pattern matching + characters, ‘&’ matches the previous history line. ‘&’ may be + escaped using a backslash; the backslash is removed before + attempting a match. The second and subsequent lines of a + multi-line compound command are not tested, and are added to the + history regardless of the value of ‘HISTIGNORE’. The pattern + matching honors the setting of the ‘extglob’ shell option. + + ‘HISTIGNORE’ subsumes the function of ‘HISTCONTROL’. A pattern of + ‘&’ is identical to ‘ignoredups’, and a pattern of ‘[ ]*’ is + identical to ‘ignorespace’. Combining these two patterns, separating them with a colon, provides the functionality of - 'ignoreboth'. + ‘ignoreboth’. -'HISTSIZE' +‘HISTSIZE’ The maximum number of commands to remember on the history list. If the value is 0, commands are not saved in the history list. Numeric values less than zero result in every command being saved on the history list (there is no limit). The shell sets the default value to 500 after reading any startup files. -'HISTTIMEFORMAT' +‘HISTTIMEFORMAT’ If this variable is set and not null, its value is used as a format - string for 'strftime' to print the time stamp associated with each - history entry displayed by the 'history' builtin. If this variable - is set, time stamps are written to the history file so they may be - preserved across shell sessions. This uses the history comment - character to distinguish timestamps from other history lines. - -'HOSTFILE' - Contains the name of a file in the same format as '/etc/hosts' that + string for ‘strftime’(3) to print the time stamp associated with + each history entry displayed by the ‘history’ builtin. If this + variable is set, time stamps are written to the history file so + they may be preserved across shell sessions. This uses the history + comment character to distinguish timestamps from other history + lines. + +‘HOSTFILE’ + Contains the name of a file in the same format as ‘/etc/hosts’ that should be read when the shell needs to complete a hostname. The list of possible hostname completions may be changed while the shell is running; the next time hostname completion is attempted after the value is changed, Bash adds the contents of the new file - to the existing list. If 'HOSTFILE' is set, but has no value, or - does not name a readable file, Bash attempts to read '/etc/hosts' + to the existing list. If ‘HOSTFILE’ is set, but has no value, or + does not name a readable file, Bash attempts to read ‘/etc/hosts’ to obtain the list of possible hostname completions. When - 'HOSTFILE' is unset, the hostname list is cleared. + ‘HOSTFILE’ is unset, the hostname list is cleared. -'HOSTNAME' +‘HOSTNAME’ The name of the current host. -'HOSTTYPE' +‘HOSTTYPE’ A string describing the machine Bash is running on. -'IGNOREEOF' - Controls the action of the shell on receipt of an 'EOF' character +‘IGNOREEOF’ + Controls the action of the shell on receipt of an ‘EOF’ character as the sole input. If set, the value denotes the number of - consecutive 'EOF' characters that can be read as the first + consecutive ‘EOF’ characters that can be read as the first character on an input line before the shell will exit. If the variable exists but does not have a numeric value, or has no value, - then the default is 10. If the variable does not exist, then 'EOF' + then the default is 10. If the variable does not exist, then ‘EOF’ signifies the end of input to the shell. This is only in effect for interactive shells. -'INPUTRC' +‘INPUTRC’ The name of the Readline initialization file, overriding the - default of '~/.inputrc'. + default of ‘~/.inputrc’. -'INSIDE_EMACS' +‘INSIDE_EMACS’ If Bash finds this variable in the environment when the shell starts, it assumes that the shell is running in an Emacs shell buffer and may disable line editing depending on the value of - 'TERM'. + ‘TERM’. -'LANG' +‘LANG’ Used to determine the locale category for any category not - specifically selected with a variable starting with 'LC_'. + specifically selected with a variable starting with ‘LC_’. -'LC_ALL' - This variable overrides the value of 'LANG' and any other 'LC_' +‘LC_ALL’ + This variable overrides the value of ‘LANG’ and any other ‘LC_’ variable specifying a locale category. -'LC_COLLATE' +‘LC_COLLATE’ This variable determines the collation order used when sorting the results of filename expansion, and determines the behavior of range expressions, equivalence classes, and collating sequences within filename expansion and pattern matching (*note Filename Expansion::). -'LC_CTYPE' +‘LC_CTYPE’ This variable determines the interpretation of characters and the behavior of character classes within filename expansion and pattern matching (*note Filename Expansion::). -'LC_MESSAGES' +‘LC_MESSAGES’ This variable determines the locale used to translate double-quoted - strings preceded by a '$' (*note Locale Translation::). + strings preceded by a ‘$’ (*note Locale Translation::). -'LC_NUMERIC' +‘LC_NUMERIC’ This variable determines the locale category used for number formatting. -'LC_TIME' +‘LC_TIME’ This variable determines the locale category used for data and time formatting. -'LINENO' +‘LINENO’ The line number in the script or shell function currently - executing. If 'LINENO' is unset, it loses its special properties, + executing. If ‘LINENO’ is unset, it loses its special properties, even if it is subsequently reset. -'LINES' - Used by the 'select' command to determine the column length for - printing selection lists. Automatically set if the 'checkwinsize' +‘LINES’ + Used by the ‘select’ command to determine the column length for + printing selection lists. Automatically set if the ‘checkwinsize’ option is enabled (*note The Shopt Builtin::), or in an interactive - shell upon receipt of a 'SIGWINCH'. + shell upon receipt of a ‘SIGWINCH’. -'MACHTYPE' +‘MACHTYPE’ A string that fully describes the system type on which Bash is executing, in the standard GNU CPU-COMPANY-SYSTEM format. -'MAILCHECK' +‘MAILCHECK’ How often (in seconds) that the shell should check for mail in the - files specified in the 'MAILPATH' or 'MAIL' variables. The default + files specified in the ‘MAILPATH’ or ‘MAIL’ variables. The default 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. -'MAPFILE' - An array variable created to hold the text read by the 'mapfile' +‘MAPFILE’ + An array variable created to hold the text read by the ‘mapfile’ builtin when no variable name is supplied. -'OLDPWD' - The previous working directory as set by the 'cd' builtin. +‘OLDPWD’ + The previous working directory as set by the ‘cd’ builtin. -'OPTERR' +‘OPTERR’ If set to the value 1, Bash displays error messages generated by - the 'getopts' builtin command. + the ‘getopts’ builtin command. -'OSTYPE' +‘OSTYPE’ A string describing the operating system Bash is running on. -'PIPESTATUS' +‘PIPESTATUS’ An array variable (*note Arrays::) containing a list of exit status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command). -'POSIXLY_CORRECT' +‘POSIXLY_CORRECT’ If this variable is in the environment when Bash starts, the shell enters POSIX mode (*note Bash POSIX Mode::) before reading the - startup files, as if the '--posix' invocation option had been + startup files, as if the ‘--posix’ invocation option had been supplied. If it is set while the shell is running, Bash 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. -'PPID' +‘PPID’ The process ID of the shell's parent process. This variable is readonly. -'PROMPT_COMMAND' +‘PROMPT_COMMAND’ If this variable is set, and is an array, the value of each set element is interpreted as a command to execute before printing the - primary prompt ('$PS1'). If this is set but not an array variable, + primary prompt (‘$PS1’). If this is set but not an array variable, its value is used as a command to execute instead. -'PROMPT_DIRTRIM' +‘PROMPT_DIRTRIM’ If set to a number greater than zero, the value is used as the number of trailing directory components to retain when expanding - the '\w' and '\W' prompt string escapes (*note Controlling the + the ‘\w’ and ‘\W’ prompt string escapes (*note Controlling the Prompt::). Characters removed are replaced with an ellipsis. -'PS0' - The value of this parameter is expanded like 'PS1' and displayed by +‘PS0’ + The value of this parameter is expanded like ‘PS1’ and displayed by interactive shells after reading a command and before the command is executed. -'PS3' - The value of this variable is used as the prompt for the 'select' - command. If this variable is not set, the 'select' command prompts - with '#? ' +‘PS3’ + The value of this variable is used as the prompt for the ‘select’ + command. If this variable is not set, the ‘select’ command prompts + with ‘#? ’ -'PS4' - The value of this parameter is expanded like 'PS1' and the expanded +‘PS4’ + The value of this parameter is expanded like ‘PS1’ and the expanded value is the prompt printed before the command line is echoed when - the '-x' option is set (*note The Set Builtin::). The first + the ‘-x’ option is set (*note The Set Builtin::). The first character of the expanded value is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default - is '+ '. + is ‘+ ’. -'PWD' - The current working directory as set by the 'cd' builtin. +‘PWD’ + The current working directory as set by the ‘cd’ builtin. -'RANDOM' +‘RANDOM’ Each time this parameter is referenced, it expands to a random integer between 0 and 32767. Assigning a value to this variable - seeds the random number generator. If 'RANDOM' is unset, it loses + seeds the random number generator. If ‘RANDOM’ is unset, it loses its special properties, even if it is subsequently reset. -'READLINE_ARGUMENT' +‘READLINE_ARGUMENT’ Any numeric argument given to a Readline command that was defined - using 'bind -x' (*note Bash Builtins:: when it was invoked. + using ‘bind -x’ (*note Bash Builtins:: when it was invoked. -'READLINE_LINE' - The contents of the Readline line buffer, for use with 'bind -x' +‘READLINE_LINE’ + The contents of the Readline line buffer, for use with ‘bind -x’ (*note Bash Builtins::). -'READLINE_MARK' - The position of the "mark" (saved insertion point) in the Readline - line buffer, for use with 'bind -x' (*note Bash Builtins::). The +‘READLINE_MARK’ + The position of the “mark” (saved insertion point) in the Readline + line buffer, for use with ‘bind -x’ (*note Bash Builtins::). The characters between the insertion point and the mark are often - called the "region". + called the “region”. -'READLINE_POINT' +‘READLINE_POINT’ The position of the insertion point in the Readline line buffer, - for use with 'bind -x' (*note Bash Builtins::). + for use with ‘bind -x’ (*note Bash Builtins::). -'REPLY' - The default variable for the 'read' builtin. +‘REPLY’ + The default variable for the ‘read’ builtin. -'SECONDS' +‘SECONDS’ This variable expands to the number of seconds since the shell was started. Assignment to this variable resets the count to the value assigned, and the expanded value becomes the value assigned plus the number of seconds since the assignment. The number of seconds at shell invocation and the current time are always determined by - querying the system clock. If 'SECONDS' is unset, it loses its + querying the system clock. If ‘SECONDS’ is unset, it loses its special properties, even if it is subsequently reset. -'SHELL' +‘SHELL’ This environment variable expands to the full pathname to the shell. If it is not set when the shell starts, Bash assigns to it the full pathname of the current user's login shell. -'SHELLOPTS' +‘SHELLOPTS’ A colon-separated list of enabled shell options. Each word in the - list is a valid argument for the '-o' option to the 'set' builtin + list is a valid argument for the ‘-o’ option to the ‘set’ builtin command (*note The Set Builtin::). The options appearing in - 'SHELLOPTS' are those reported as 'on' by 'set -o'. If this + ‘SHELLOPTS’ are those reported as ‘on’ by ‘set -o’. If this variable is in the environment when Bash starts up, each shell option in the list will be enabled before reading any startup files. This variable is readonly. -'SHLVL' +‘SHLVL’ Incremented by one each time a new instance of Bash is started. This is intended to be a count of how deeply your Bash shells are nested. -'SRANDOM' +‘SRANDOM’ This variable expands to a 32-bit pseudo-random number each time it is referenced. The random number generator is not linear on - systems that support '/dev/urandom' or 'arc4random', so each + systems that support ‘/dev/urandom’ or ‘arc4random’, so each returned number has no relationship to the numbers preceding it. The random number generator cannot be seeded, so assignments to - this variable have no effect. If 'SRANDOM' is unset, it loses its + this variable have no effect. If ‘SRANDOM’ is unset, it loses its special properties, even if it is subsequently reset. -'TIMEFORMAT' +‘TIMEFORMAT’ The value of this parameter is used as a format string specifying - how the timing information for pipelines prefixed with the 'time' - reserved word should be displayed. The '%' character introduces an + how the timing information for pipelines prefixed with the ‘time’ + reserved word should be displayed. The ‘%’ character introduces an escape sequence that is expanded to a time value or other information. The escape sequences and their meanings are as - follows; the braces denote optional portions. + follows; the brackets denote optional portions. - '%%' - A literal '%'. + ‘%%’ + A literal ‘%’. - '%[P][l]R' + ‘%[P][l]R’ The elapsed time in seconds. - '%[P][l]U' + ‘%[P][l]U’ The number of CPU seconds spent in user mode. - '%[P][l]S' + ‘%[P][l]S’ The number of CPU seconds spent in system mode. - '%P' + ‘%P’ The CPU percentage, computed as (%U + %S) / %R. The optional P is a digit specifying the precision, the number of @@ -6071,7 +6078,7 @@ Variables::). the decimal point may be specified; values of P greater than 6 are changed to 6. If P is not specified, the value 3 is used. - The optional 'l' specifies a longer format, including minutes, of + The optional ‘l’ specifies a longer format, including minutes, of the form MMmSS.FFs. The value of P determines whether or not the fraction is included. @@ -6080,11 +6087,11 @@ Variables::). If the value is null, Bash does not display any timing information. A trailing newline is added when the format string is displayed. -'TMOUT' - If set to a value greater than zero, 'TMOUT' is treated as the - default timeout for the 'read' builtin (*note Bash Builtins::). - The 'select' command (*note Conditional Constructs::) terminates if - input does not arrive after 'TMOUT' seconds when input is coming +‘TMOUT’ + If set to a value greater than zero, ‘TMOUT’ is treated as the + default timeout for the ‘read’ builtin (*note Bash Builtins::). + The ‘select’ command (*note Conditional Constructs::) terminates if + input does not arrive after ‘TMOUT’ seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of @@ -6092,11 +6099,11 @@ Variables::). prompt. Bash terminates after waiting for that number of seconds if a complete line of input does not arrive. -'TMPDIR' +‘TMPDIR’ If set, Bash uses its value as the name of a directory in which Bash creates temporary files for the shell's use. -'UID' +‘UID’ The numeric real user id of the current user. This variable is readonly. @@ -6115,7 +6122,7 @@ This chapter describes features unique to Bash. * Bash Startup Files:: When and how Bash executes scripts. * Interactive Shells:: What an interactive shell is. * Bash Conditional Expressions:: Primitives used in composing expressions for - the 'test' builtin. + the ‘test’ builtin. * Shell Arithmetic:: Arithmetic on shell variables. * Aliases:: Substituting one command for another. * Arrays:: Array Variables. @@ -6140,139 +6147,139 @@ File: bashref.info, Node: Invoking Bash, Next: Bash Startup Files, Up: Bash F bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o OPTION] [-O SHOPT_OPTION] [ARGUMENT ...] - All of the single-character options used with the 'set' builtin + All of the single-character options used with the ‘set’ builtin (*note The Set Builtin::) can be used as options when the shell is invoked. In addition, there are several multi-character options that you can use. These options must appear on the command line before the single-character options to be recognized. -'--debugger' +‘--debugger’ Arrange for the debugger profile to be executed before the shell starts. Turns on extended debugging mode (see *note The Shopt - Builtin:: for a description of the 'extdebug' option to the 'shopt' + Builtin:: for a description of the ‘extdebug’ option to the ‘shopt’ builtin). -'--dump-po-strings' - A list of all double-quoted strings preceded by '$' is printed on - the standard output in the GNU 'gettext' PO (portable object) file - format. Equivalent to '-D' except for the output format. +‘--dump-po-strings’ + A list of all double-quoted strings preceded by ‘$’ is printed on + the standard output in the GNU ‘gettext’ PO (portable object) file + format. Equivalent to ‘-D’ except for the output format. -'--dump-strings' - Equivalent to '-D'. +‘--dump-strings’ + Equivalent to ‘-D’. -'--help' +‘--help’ Display a usage message on standard output and exit successfully. -'--init-file FILENAME' -'--rcfile FILENAME' - Execute commands from FILENAME (instead of '~/.bashrc') in an +‘--init-file FILENAME’ +‘--rcfile FILENAME’ + Execute commands from FILENAME (instead of ‘~/.bashrc’) in an interactive shell. -'--login' - Equivalent to '-l'. +‘--login’ + Equivalent to ‘-l’. -'--noediting' +‘--noediting’ Do not use the GNU Readline library (*note Command Line Editing::) to read command lines when the shell is interactive. -'--noprofile' - Don't load the system-wide startup file '/etc/profile' or any of - the personal initialization files '~/.bash_profile', - '~/.bash_login', or '~/.profile' when Bash is invoked as a login +‘--noprofile’ + Don't load the system-wide startup file ‘/etc/profile’ or any of + the personal initialization files ‘~/.bash_profile’, + ‘~/.bash_login’, or ‘~/.profile’ when Bash is invoked as a login shell. -'--norc' - Don't read the '~/.bashrc' initialization file in an interactive - shell. This is on by default if the shell is invoked as 'sh'. +‘--norc’ + Don't read the ‘~/.bashrc’ initialization file in an interactive + shell. This is on by default if the shell is invoked as ‘sh’. -'--posix' +‘--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. -'--restricted' - Equivalent to '-r'. Make the shell a restricted shell (*note The +‘--restricted’ + Equivalent to ‘-r’. Make the shell a restricted shell (*note The Restricted Shell::). -'--verbose' - Equivalent to '-v'. Print shell input lines as they're read. +‘--verbose’ + Equivalent to ‘-v’. Print shell input lines as they're read. -'--version' +‘--version’ Show version information for this instance of Bash on the standard output and exit successfully. There are several single-character options that may be supplied at -invocation which are not available with the 'set' builtin. +invocation which are not available with the ‘set’ builtin. -'-c' +‘-c’ Read and execute commands from the first non-option argument COMMAND_STRING, then exit. If there are arguments after the - COMMAND_STRING, the first argument is assigned to '$0' and any + COMMAND_STRING, the first argument is assigned to ‘$0’ and any remaining arguments are assigned to the positional parameters. The - assignment to '$0' sets the name of the shell, which is used in + assignment to ‘$0’ sets the name of the shell, which is used in warning and error messages. -'-i' +‘-i’ Force the shell to run interactively. Interactive shells are described in *note Interactive Shells::. -'-l' +‘-l’ Make this shell act as if it had been directly invoked by login. When the shell is interactive, this is equivalent to starting a - login shell with 'exec -l bash'. When the shell is not - interactive, the login shell startup files will be executed. 'exec - bash -l' or 'exec bash --login' will replace the current shell with + login shell with ‘exec -l bash’. When the shell is not + interactive, the login shell startup files will be executed. ‘exec + bash -l’ or ‘exec bash --login’ will replace the current shell with a Bash login shell. *Note Bash Startup Files::, for a description of the special behavior of a login shell. -'-r' +‘-r’ Make the shell a restricted shell (*note The Restricted Shell::). -'-s' +‘-s’ If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell or when reading input through a pipe. -'-D' - A list of all double-quoted strings preceded by '$' is printed on +‘-D’ + A list of all double-quoted strings preceded by ‘$’ is printed on the standard output. These are the strings that are subject to - language translation when the current locale is not 'C' or 'POSIX' - (*note Locale Translation::). This implies the '-n' option; no + language translation when the current locale is not ‘C’ or ‘POSIX’ + (*note Locale Translation::). This implies the ‘-n’ option; no commands will be executed. -'[-+]O [SHOPT_OPTION]' - SHOPT_OPTION is one of the shell options accepted by the 'shopt' +‘[-+]O [SHOPT_OPTION]’ + SHOPT_OPTION is one of the shell options accepted by the ‘shopt’ builtin (*note The Shopt Builtin::). If SHOPT_OPTION is present, - '-O' sets the value of that option; '+O' unsets it. If + ‘-O’ sets the value of that option; ‘+O’ unsets it. If SHOPT_OPTION is not supplied, the names and values of the shell - options accepted by 'shopt' are printed on the standard output. If - the invocation option is '+O', the output is displayed in a format + options accepted by ‘shopt’ are printed on the standard output. If + the invocation option is ‘+O’, 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 +‘--’ + A ‘--’ signals the end of options and disables further option + processing. Any arguments after the ‘--’ are treated as a shell script filename (*note Shell Scripts::) and arguments passed to that script. -'-' - Equivalent to '--'. +‘-’ + Equivalent to ‘--’. - A _login_ shell is one whose first character of argument zero is '-', -or one invoked with the '--login' option. + 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, -unless '-s' is specified, without specifying the '-c' option, and whose +unless ‘-s’ is specified, without specifying the ‘-c’ option, and whose input and output are both connected to terminals (as determined by -'isatty(3)'), or one started with the '-i' option. *Note Interactive +‘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 + 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 +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 @@ -6291,32 +6298,32 @@ Tilde Expansion::). Interactive shells are described in *note Interactive Shells::. -Invoked as an interactive login shell, or with '--login' +Invoked as an interactive login shell, or with ‘--login’ ........................................................ When Bash is invoked as an interactive login shell, or as a -non-interactive shell with the '--login' option, it first reads and -executes commands from the file '/etc/profile', if that file exists. -After reading that file, it looks for '~/.bash_profile', -'~/.bash_login', and '~/.profile', in that order, and reads and executes +non-interactive shell with the ‘--login’ option, it first reads and +executes commands from the file ‘/etc/profile’, if that file exists. +After reading that file, it looks for ‘~/.bash_profile’, +‘~/.bash_login’, and ‘~/.profile’, in that order, and reads and executes commands from the first one that exists and is readable. The -'--noprofile' option may be used when the shell is started to inhibit +‘--noprofile’ 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 'exit' builtin command, Bash reads and executes -commands from the file '~/.bash_logout', if it exists. +shell executes the ‘exit’ builtin command, Bash reads and executes +commands from the file ‘~/.bash_logout’, if it exists. Invoked as an interactive non-login shell ......................................... When an interactive shell that is not a login shell is started, Bash -reads and executes commands from '~/.bashrc', if that file exists. This -may be inhibited by using the '--norc' option. The '--rcfile FILE' +reads and executes commands from ‘~/.bashrc’, if that file exists. This +may be inhibited by using the ‘--norc’ option. The ‘--rcfile FILE’ option will force Bash to read and execute commands from FILE instead of -'~/.bashrc'. +‘~/.bashrc’. - So, typically, your '~/.bash_profile' contains the line + So, typically, your ‘~/.bash_profile’ contains the line if [ -f ~/.bashrc ]; then . ~/.bashrc; fi after (or before) any login-specific initializations. @@ -6324,46 +6331,46 @@ Invoked non-interactively ......................... When Bash is started non-interactively, to run a shell script, for -example, it looks for the variable 'BASH_ENV' in the environment, +example, it looks for the variable ‘BASH_ENV’ 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. Bash behaves as if the following command were executed: if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi -but the value of the 'PATH' variable is not used to search for the +but the value of the ‘PATH’ variable is not used to search for the filename. As noted above, if a non-interactive shell is invoked with the -'--login' option, Bash attempts to read and execute commands from the +‘--login’ option, Bash attempts to read and execute commands from the login shell startup files. -Invoked with name 'sh' +Invoked with name ‘sh’ ...................... -If Bash is invoked with the name 'sh', it tries to mimic the startup -behavior of historical versions of 'sh' as closely as possible, while +If Bash is invoked with the name ‘sh’, it tries to mimic the startup +behavior of historical versions of ‘sh’ as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or as a non-interactive -shell with the '--login' option, it first attempts to read and execute -commands from '/etc/profile' and '~/.profile', in that order. The -'--noprofile' option may be used to inhibit this behavior. When invoked -as an interactive shell with the name 'sh', Bash looks for the variable -'ENV', expands its value if it is defined, and uses the expanded value +shell with the ‘--login’ option, it first attempts to read and execute +commands from ‘/etc/profile’ and ‘~/.profile’, in that order. The +‘--noprofile’ option may be used to inhibit this behavior. When invoked +as an interactive shell with the name ‘sh’, Bash looks for the variable +‘ENV’, 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 -'sh' does not attempt to read and execute commands from any other -startup files, the '--rcfile' option has no effect. A non-interactive -shell invoked with the name 'sh' does not attempt to read any other +‘sh’ does not attempt to read and execute commands from any other +startup files, the ‘--rcfile’ option has no effect. A non-interactive +shell invoked with the name ‘sh’ does not attempt to read any other startup files. - When invoked as 'sh', Bash enters POSIX mode after the startup files + When invoked as ‘sh’, Bash enters POSIX mode after the startup files are read. Invoked in POSIX mode ..................... -When Bash is started in POSIX mode, as with the '--posix' command line +When Bash is started in POSIX mode, as with the ‘--posix’ command line option, it follows the POSIX standard for startup files. In this mode, -interactive shells expand the 'ENV' variable and commands are read and +interactive shells expand the ‘ENV’ variable and commands are read and executed from the file whose name is the expanded value. No other startup files are read. @@ -6372,12 +6379,12 @@ Invoked by remote shell daemon Bash attempts to determine when it is being run with its standard input connected to a network connection, as when executed by the historical -remote shell daemon, usually 'rshd', or the secure shell daemon 'sshd'. +remote shell daemon, usually ‘rshd’, or the secure shell daemon ‘sshd’. If Bash determines it is being run non-interactively in this fashion, it -reads and executes commands from '~/.bashrc', if that file exists and is -readable. It will not do this if invoked as 'sh'. The '--norc' option -may be used to inhibit this behavior, and the '--rcfile' option may be -used to force another file to be read, but neither 'rshd' nor 'sshd' +reads and executes commands from ‘~/.bashrc’, if that file exists and is +readable. It will not do this if invoked as ‘sh’. The ‘--norc’ option +may be used to inhibit this behavior, and the ‘--rcfile’ option may be +used to force another file to be read, but neither ‘rshd’ nor ‘sshd’ generally invoke the shell with those options or allow them to be specified. @@ -6385,11 +6392,11 @@ Invoked with unequal effective and real UID/GIDs ................................................ If Bash is started with the effective user (group) id not equal to the -real user (group) id, and the '-p' option is not supplied, no startup +real user (group) id, and the ‘-p’ option is not supplied, no startup files are read, shell functions are not inherited from the environment, -the 'SHELLOPTS', 'BASHOPTS', 'CDPATH', and 'GLOBIGNORE' variables, if +the ‘SHELLOPTS’, ‘BASHOPTS’, ‘CDPATH’, and ‘GLOBIGNORE’ variables, if they appear in the environment, are ignored, and the effective user id -is set to the real user id. If the '-p' option is supplied at +is set to the real user id. If the ‘-p’ option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset. @@ -6412,14 +6419,14 @@ File: bashref.info, Node: What is an Interactive Shell?, Next: Is this Shell I ----------------------------------- An interactive shell is one started without non-option arguments (unless -'-s' is specified) and without specifying the '-c' option, whose input +‘-s’ is specified) and without specifying the ‘-c’ option, whose input and error output are both connected to terminals (as determined by -'isatty(3)'), or one started with the '-i' option. +‘isatty(3)’), or one started with the ‘-i’ option. An interactive shell generally reads from and writes to a user's terminal. - The '-s' invocation option may be used to set the positional + The ‘-s’ invocation option may be used to set the positional parameters when an interactive shell is started.  @@ -6429,15 +6436,15 @@ File: bashref.info, Node: Is this Shell Interactive?, Next: Interactive Shell -------------------------------- To determine within a startup script whether or not Bash is running -interactively, test the value of the '-' special parameter. It contains -'i' when the shell is interactive. For example: +interactively, test the value of the ‘-’ special parameter. It contains +‘i’ when the shell is interactive. For example: case "$-" in *i*) echo This shell is interactive ;; *) echo This shell is not interactive ;; esac - Alternatively, startup scripts may examine the variable 'PS1'; it is + Alternatively, startup scripts may examine the variable ‘PS1’; it is unset in non-interactive shells, and set in interactive shells. Thus: if [ -z "$PS1" ]; then @@ -6460,55 +6467,55 @@ several ways. 2. Job Control (*note Job Control::) is enabled by default. When job control is in effect, Bash ignores the keyboard-generated job - control signals 'SIGTTIN', 'SIGTTOU', and 'SIGTSTP'. + control signals ‘SIGTTIN’, ‘SIGTTOU’, and ‘SIGTSTP’. - 3. Bash expands and displays 'PS1' before reading the first line of a - command, and expands and displays 'PS2' before reading the second + 3. Bash expands and displays ‘PS1’ before reading the first line of a + command, and expands and displays ‘PS2’ before reading the second and subsequent lines of a multi-line command. Bash expands and - displays 'PS0' after it reads a command but before executing it. + displays ‘PS0’ after it reads a command but before executing it. See *note Controlling the Prompt::, for a complete list of prompt string escape sequences. 4. Bash executes the values of the set elements of the - 'PROMPT_COMMAND' array variable as commands before printing the - primary prompt, '$PS1' (*note Bash Variables::). + ‘PROMPT_COMMAND’ array variable as commands before printing the + primary prompt, ‘$PS1’ (*note Bash Variables::). 5. Readline (*note Command Line Editing::) is used to read commands from the user's terminal. - 6. Bash inspects the value of the 'ignoreeof' option to 'set -o' - instead of exiting immediately when it receives an 'EOF' on its + 6. Bash inspects the value of the ‘ignoreeof’ option to ‘set -o’ + instead of exiting immediately when it receives an ‘EOF’ on its standard input when reading a command (*note The Set Builtin::). 7. Command history (*note Bash History Facilities::) and history expansion (*note History Interaction::) are enabled by default. - Bash will save the command history to the file named by '$HISTFILE' + Bash will save the command history to the file named by ‘$HISTFILE’ when a shell with history enabled exits. 8. Alias expansion (*note Aliases::) is performed by default. - 9. In the absence of any traps, Bash ignores 'SIGTERM' (*note + 9. In the absence of any traps, Bash ignores ‘SIGTERM’ (*note Signals::). - 10. In the absence of any traps, 'SIGINT' is caught and handled (*note - Signals::). 'SIGINT' will interrupt some shell builtins. + 10. In the absence of any traps, ‘SIGINT’ is caught and handled (*note + Signals::). ‘SIGINT’ will interrupt some shell builtins. - 11. An interactive login shell sends a 'SIGHUP' to all jobs on exit if - the 'huponexit' shell option has been enabled (*note Signals::). + 11. An interactive login shell sends a ‘SIGHUP’ to all jobs on exit if + the ‘huponexit’ shell option has been enabled (*note Signals::). - 12. The '-n' invocation option is ignored, and 'set -n' has no effect + 12. The ‘-n’ invocation option is ignored, and ‘set -n’ has no effect (*note The Set Builtin::). 13. Bash will check for mail periodically, depending on the values of - the 'MAIL', 'MAILPATH', and 'MAILCHECK' shell variables (*note Bash + the ‘MAIL’, ‘MAILPATH’, and ‘MAILCHECK’ shell variables (*note Bash Variables::). 14. Expansion errors due to references to unbound shell variables - after 'set -u' has been enabled will not cause the shell to exit + after ‘set -u’ has been enabled will not cause the shell to exit (*note The Set Builtin::). 15. The shell will not exit on expansion errors caused by VAR being - unset or null in '${VAR:?WORD}' expansions (*note Shell Parameter + unset or null in ‘${VAR:?WORD}’ expansions (*note Shell Parameter Expansion::). 16. Redirection errors encountered by shell builtins will not cause @@ -6517,20 +6524,20 @@ several ways. 17. When running in POSIX mode, a special builtin returning an error status will not cause the shell to exit (*note Bash POSIX Mode::). - 18. A failed 'exec' will not cause the shell to exit (*note Bourne + 18. A failed ‘exec’ will not cause the shell to exit (*note Bourne Shell Builtins::). 19. Parser syntax errors will not cause the shell to exit. - 20. If the 'cdspell' shell option is enabled, the shell will attempt - simple spelling correction for directory arguments to the 'cd' - builtin (see the description of the 'cdspell' option to the 'shopt' - builtin in *note The Shopt Builtin::). The 'cdspell' option is + 20. If the ‘cdspell’ shell option is enabled, the shell will attempt + simple spelling correction for directory arguments to the ‘cd’ + builtin (see the description of the ‘cdspell’ option to the ‘shopt’ + builtin in *note The Shopt Builtin::). The ‘cdspell’ option is only effective in interactive shells. - 21. The shell will check the value of the 'TMOUT' variable and exit if + 21. The shell will check the value of the ‘TMOUT’ variable and exit if a command is not read within the specified number of seconds after - printing '$PS1' (*note Bash Variables::). + printing ‘$PS1’ (*note Bash Variables::).  File: bashref.info, Node: Bash Conditional Expressions, Next: Shell Arithmetic, Prev: Interactive Shells, Up: Bash Features @@ -6538,9 +6545,9 @@ File: bashref.info, Node: Bash Conditional Expressions, Next: Shell Arithmetic 6.4 Bash Conditional Expressions ================================ -Conditional expressions are used by the '[[' compound command (*note -Conditional Constructs::) and the 'test' and '[' builtin commands (*note -Bourne Shell Builtins::). The 'test' and '[' commands determine their +Conditional expressions are used by the ‘[[’ compound command (*note +Conditional Constructs::) and the ‘test’ and ‘[’ builtin commands (*note +Bourne Shell Builtins::). The ‘test’ and ‘[’ commands determine their behavior based on the number of arguments; see the descriptions of those commands for any other command-specific actions. @@ -6551,137 +6558,137 @@ well. Bash handles several filenames specially when they are used in expressions. If the operating system on which Bash is running provides these special files, Bash will use them; otherwise it will emulate them internally with this behavior: If the FILE argument to one of the -primaries is of the form '/dev/fd/N', then file descriptor N is checked. -If the FILE argument to one of the primaries is one of '/dev/stdin', -'/dev/stdout', or '/dev/stderr', file descriptor 0, 1, or 2, +primaries is of the form ‘/dev/fd/N’, then file descriptor N is checked. +If the FILE argument to one of the primaries is one of ‘/dev/stdin’, +‘/dev/stdout’, or ‘/dev/stderr’, file descriptor 0, 1, or 2, respectively, is checked. - When used with '[[', the '<' and '>' operators sort lexicographically -using the current locale. The 'test' command uses ASCII ordering. + When used with ‘[[’, the ‘<’ and ‘>’ operators sort lexicographically +using the current locale. The ‘test’ command uses ASCII ordering. Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself. -'-a FILE' +‘-a FILE’ True if FILE exists. -'-b FILE' +‘-b FILE’ True if FILE exists and is a block special file. -'-c FILE' +‘-c FILE’ True if FILE exists and is a character special file. -'-d FILE' +‘-d FILE’ True if FILE exists and is a directory. -'-e FILE' +‘-e FILE’ True if FILE exists. -'-f FILE' +‘-f FILE’ True if FILE exists and is a regular file. -'-g FILE' +‘-g FILE’ True if FILE exists and its set-group-id bit is set. -'-h FILE' +‘-h FILE’ True if FILE exists and is a symbolic link. -'-k FILE' +‘-k FILE’ True if FILE exists and its "sticky" bit is set. -'-p FILE' +‘-p FILE’ True if FILE exists and is a named pipe (FIFO). -'-r FILE' +‘-r FILE’ True if FILE exists and is readable. -'-s FILE' +‘-s FILE’ True if FILE exists and has a size greater than zero. -'-t FD' +‘-t FD’ True if file descriptor FD is open and refers to a terminal. -'-u FILE' +‘-u FILE’ True if FILE exists and its set-user-id bit is set. -'-w FILE' +‘-w FILE’ True if FILE exists and is writable. -'-x FILE' +‘-x FILE’ True if FILE exists and is executable. -'-G FILE' +‘-G FILE’ True if FILE exists and is owned by the effective group id. -'-L FILE' +‘-L FILE’ True if FILE exists and is a symbolic link. -'-N FILE' +‘-N FILE’ True if FILE exists and has been modified since it was last read. -'-O FILE' +‘-O FILE’ True if FILE exists and is owned by the effective user id. -'-S FILE' +‘-S FILE’ True if FILE exists and is a socket. -'FILE1 -ef FILE2' +‘FILE1 -ef FILE2’ True if FILE1 and FILE2 refer to the same device and inode numbers. -'FILE1 -nt FILE2' +‘FILE1 -nt FILE2’ True if FILE1 is newer (according to modification date) than FILE2, or if FILE1 exists and FILE2 does not. -'FILE1 -ot FILE2' +‘FILE1 -ot FILE2’ True if FILE1 is older than FILE2, or if FILE2 exists and FILE1 does not. -'-o OPTNAME' +‘-o OPTNAME’ True if the shell option OPTNAME is enabled. The list of options - appears in the description of the '-o' option to the 'set' builtin + appears in the description of the ‘-o’ option to the ‘set’ builtin (*note The Set Builtin::). -'-v VARNAME' +‘-v VARNAME’ True if the shell variable VARNAME is set (has been assigned a value). If VARNAME is an indexed array variable name subscripted - by '@' or '*', this returns true if the array has any set elements. - If VARNAME is an associative array variable name subscripted by '@' - or '*', this returns true if an element with that key is set. + by ‘@’ or ‘*’, this returns true if the array has any set elements. + If VARNAME is an associative array variable name subscripted by ‘@’ + or ‘*’, this returns true if an element with that key is set. -'-R VARNAME' +‘-R VARNAME’ True if the shell variable VARNAME is set and is a name reference. -'-z STRING' +‘-z STRING’ True if the length of STRING is zero. -'-n STRING' -'STRING' +‘-n STRING’ +‘STRING’ True if the length of STRING is non-zero. -'STRING1 == STRING2' -'STRING1 = STRING2' - True if the strings are equal. When used with the '[[' command, +‘STRING1 == STRING2’ +‘STRING1 = STRING2’ + True if the strings are equal. When used with the ‘[[’ command, this performs pattern matching as described above (*note Conditional Constructs::). - '=' should be used with the 'test' command for POSIX conformance. + ‘=’ should be used with the ‘test’ command for POSIX conformance. -'STRING1 != STRING2' +‘STRING1 != STRING2’ True if the strings are not equal. -'STRING1 < STRING2' +‘STRING1 < STRING2’ True if STRING1 sorts before STRING2 lexicographically. -'STRING1 > STRING2' +‘STRING1 > STRING2’ True if STRING1 sorts after STRING2 lexicographically. -'ARG1 OP ARG2' - 'OP' is one of '-eq', '-ne', '-lt', '-le', '-gt', or '-ge'. These +‘ARG1 OP ARG2’ + ‘OP’ is one of ‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. These arithmetic binary operators return true if ARG1 is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to ARG2, respectively. ARG1 and ARG2 may be - positive or negative integers. When used with the '[[' command, + positive or negative integers. When used with the ‘[[’ command, ARG1 and ARG2 are evaluated as arithmetic expressions (*note Shell Arithmetic::). @@ -6692,8 +6699,8 @@ File: bashref.info, Node: Shell Arithmetic, Next: Aliases, Prev: Bash Conditi ==================== The shell allows arithmetic expressions to be evaluated, as one of the -shell expansions or by using the '((' compound command, the 'let' -builtin, or the '-i' option to the 'declare' builtin. +shell expansions or by using the ‘((’ compound command, the ‘let’ +builtin, or the ‘-i’ option to the ‘declare’ builtin. Evaluation is done in fixed-width integers with no check for overflow, though division by 0 is trapped and flagged as an error. The @@ -6702,58 +6709,58 @@ as in the C language. The following list of operators is grouped into levels of equal-precedence operators. The levels are listed in order of decreasing precedence. -'ID++ ID--' +‘ID++ ID--’ variable post-increment and post-decrement -'++ID --ID' +‘++ID --ID’ variable pre-increment and pre-decrement -'- +' +‘- +’ unary minus and plus -'! ~' +‘! ~’ logical and bitwise negation -'**' +‘**’ exponentiation -'* / %' +‘* / %’ multiplication, division, remainder -'+ -' +‘+ -’ addition, subtraction -'<< >>' +‘<< >>’ left and right bitwise shifts -'<= >= < >' +‘<= >= < >’ comparison -'== !=' +‘== !=’ equality and inequality -'&' +‘&’ bitwise AND -'^' +‘^’ bitwise exclusive OR -'|' +‘|’ bitwise OR -'&&' +‘&&’ logical AND -'||' +‘||’ logical OR -'expr ? if-true-expr : if-false-expr' +‘expr ? if-true-expr : if-false-expr’ conditional operator -'= *= /= %= += -= <<= >>= &= ^= |=' +‘= *= /= %= += -= <<= >>= &= ^= |=’ assignment -'expr1 , expr2' +‘expr1 , expr2’ comma Shell variables are allowed as operands; parameter expansion is @@ -6763,19 +6770,19 @@ parameter expansion syntax. A shell variable that is null or unset evaluates to 0 when referenced by name without using the parameter expansion syntax. The value of a variable is evaluated as an arithmetic expression when it is referenced, or when a variable which has been -given the 'integer' attribute using 'declare -i' is assigned a value. A -null value evaluates to 0. A shell variable need not have its 'integer' +given the ‘integer’ attribute using ‘declare -i’ is assigned a value. A +null value evaluates to 0. A shell variable need not have its ‘integer’ attribute turned on to be used in an expression. Integer constants follow the C language definition, without suffixes or character constants. Constants with a leading 0 are interpreted as -octal numbers. A leading '0x' or '0X' denotes hexadecimal. Otherwise, -numbers take the form [BASE'#']N, where the optional BASE is a decimal +octal numbers. A leading ‘0x’ or ‘0X’ denotes hexadecimal. Otherwise, +numbers take the form [BASE‘#’]N, where the optional BASE is a decimal number between 2 and 64 representing the arithmetic base, and N is a -number in that base. If BASE'#' is omitted, then base 10 is used. When +number in that base. If BASE‘#’ is omitted, then base 10 is used. When specifying N, if a non-digit is required, the digits greater than 9 are -represented by the lowercase letters, the uppercase letters, '@', and -'_', in that order. If BASE is less than or equal to 36, lowercase and +represented by the lowercase letters, the uppercase letters, ‘@’, and +‘_’, in that order. If BASE is less than or equal to 36, lowercase and uppercase letters may be used interchangeably to represent numbers between 10 and 35. @@ -6789,10 +6796,10 @@ File: bashref.info, Node: Aliases, Next: Arrays, Prev: Shell Arithmetic, Up: 6.6 Aliases =========== -"Aliases" allow a string to be substituted for a word that is in a +“Aliases” allow a string to be substituted for a word that is in a position in the input where it can be the first word of a simple command. Aliases have names and corresponding values that are set and -unset using the 'alias' and 'unalias' builtin commands (*note Shell +unset using the ‘alias’ and ‘unalias’ builtin commands (*note Shell Builtin Commands::). If the shell reads an unquoted word in the right position, it checks @@ -6801,27 +6808,27 @@ replaces the word with the alias value, and reads that value as if it had been read instead of the word. The shell doesn't look at any characters following the word before attempting alias substitution. - The characters '/', '$', '`', '=' and any of the shell metacharacters + The characters ‘/’, ‘$’, ‘`’, ‘=’ and any of the shell metacharacters or quoting characters listed above may not appear in an alias name. The replacement text may contain any valid shell input, including shell metacharacters. The first word of the replacement text is tested for aliases, but a word that is identical to an alias being expanded is not -expanded a second time. This means that one may alias 'ls' to '"ls --F"', for instance, and Bash does not try to recursively expand the +expanded a second time. This means that one may alias ‘ls’ to ‘"ls +-F"’, for instance, and Bash does not try to recursively expand the replacement text. - If the last character of the alias value is a 'blank', then the next + If the last character of the alias value is a ‘blank’, then the next command word following the alias is also checked for alias expansion. - Aliases are created and listed with the 'alias' command, and removed -with the 'unalias' command. + Aliases are created and listed with the ‘alias’ command, and removed +with the ‘unalias’ command. There is no mechanism for using arguments in the replacement text, as -in 'csh'. If arguments are needed, use a shell function (*note Shell +in ‘csh’. If arguments are needed, use a shell function (*note Shell Functions::) instead. Aliases are not expanded when the shell is not interactive, unless -the 'expand_aliases' shell option is set using 'shopt' (*note The Shopt +the ‘expand_aliases’ shell option is set using ‘shopt’ (*note The Shopt Builtin::). The rules concerning the definition and use of aliases are somewhat @@ -6837,7 +6844,7 @@ expanded when a function definition is read, not when the function is executed, because a function definition is itself a command. As a consequence, aliases defined in a function are not available until after that function is executed. To be safe, always put alias definitions on -a separate line, and do not use 'alias' in compound commands. +a separate line, and do not use ‘alias’ in compound commands. For almost every purpose, shell functions are preferred over aliases. @@ -6848,7 +6855,7 @@ File: bashref.info, Node: Arrays, Next: The Directory Stack, Prev: Aliases, ========== Bash provides one-dimensional indexed and associative array variables. -Any variable may be used as an indexed array; the 'declare' builtin will +Any variable may be used as an indexed array; the ‘declare’ builtin will explicitly declare an array. 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 integers (including @@ -6870,13 +6877,13 @@ is also accepted; the SUBSCRIPT is ignored. Associative arrays are created using declare -A NAME - Attributes may be specified for an array variable using the 'declare' -and 'readonly' builtins. Each attribute applies to all members of an + Attributes may be specified for an array variable using the ‘declare’ +and ‘readonly’ builtins. Each attribute applies to all members of an array. Arrays are assigned to using compound assignments of the form NAME=(VALUE1 VALUE2 ... ) -where each VALUE may be of the form '[SUBSCRIPT]='STRING. Indexed array +where each VALUE may be of the form ‘[SUBSCRIPT]=’STRING. Indexed array assignments do not require anything but STRING. When assigning to indexed arrays, if the optional subscript is supplied, that index is assigned to; otherwise the index of the element assigned is the last @@ -6897,8 +6904,8 @@ interpreted; all assignments in a list must be of the same type. When using key/value pairs, the keys may not be missing or empty; a final missing value is treated like the empty string. - This syntax is also accepted by the 'declare' builtin. Individual -array elements may be assigned to using the 'NAME[SUBSCRIPT]=VALUE' + This syntax is also accepted by the ‘declare’ builtin. Individual +array elements may be assigned to using the ‘NAME[SUBSCRIPT]=VALUE’ syntax introduced above. When assigning to an indexed array, if NAME is subscripted by a @@ -6906,26 +6913,26 @@ negative number, that number is interpreted as relative to one greater than the maximum index of NAME, so negative indices count back from the end of the array, and an index of -1 references the last element. - The '+=' operator will append to an array variable when assigning + The ‘+=’ operator will append to an array variable when assigning using the compound assignment syntax; see *note Shell Parameters:: above. - Any element of an array may be referenced using '${NAME[SUBSCRIPT]}'. + Any element of an array may be referenced using ‘${NAME[SUBSCRIPT]}’. The braces are required to avoid conflicts with the shell's filename -expansion operators. If the SUBSCRIPT is '@' or '*', the word expands +expansion operators. If the SUBSCRIPT is ‘@’ or ‘*’, the word expands to all members of the array NAME, unless otherwise 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 -double-quoted, '${NAME[*]}' expands to a single word with the value of -each array member separated by the first character of the 'IFS' -variable, and '${NAME[@]}' expands each element of NAME to a separate -word. When there are no array members, '${NAME[@]}' expands to nothing. +double-quoted, ‘${NAME[*]}’ expands to a single word with the value of +each array member separated by the first character of the ‘IFS’ +variable, and ‘${NAME[@]}’ expands each element of NAME to a separate +word. When there are no array members, ‘${NAME[@]}’ 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 original word, and the expansion of the last parameter is joined with the last part of the original word. This is analogous to the expansion of the -special parameters '@' and '*'. '${#NAME[SUBSCRIPT]}' expands to the -length of '${NAME[SUBSCRIPT]}'. If SUBSCRIPT is '@' or '*', the +special parameters ‘@’ and ‘*’. ‘${#NAME[SUBSCRIPT]}’ expands to the +length of ‘${NAME[SUBSCRIPT]}’. If SUBSCRIPT is ‘@’ or ‘*’, the expansion is the number of elements in the array. If the SUBSCRIPT used to reference an element of an indexed array evaluates to a number less than zero, it is interpreted as relative to one greater than the maximum @@ -6942,32 +6949,32 @@ 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. ${!NAME[@]} and ${!NAME[*]} expand to the indices assigned in array variable NAME. The treatment when in double quotes is similar -to the expansion of the special parameters '@' and '*' within double +to the expansion of the special parameters ‘@’ and ‘*’ within double quotes. - The 'unset' builtin is used to destroy arrays. 'unset -NAME[SUBSCRIPT]' destroys the array element at index SUBSCRIPT. + The ‘unset’ builtin is used to destroy arrays. ‘unset +NAME[SUBSCRIPT]’ destroys the array element at index SUBSCRIPT. Negative subscripts to indexed arrays are interpreted as described above. Unsetting the last element of an array variable does not unset -the variable. 'unset NAME', where NAME is an array, removes the entire -array. 'unset NAME[SUBSCRIPT]' behaves differently depending on the -array type when given a subscript of '*' or '@'. When NAME is an -associative array, it removes the element with key '*' or '@'. If NAME -is an indexed array, 'unset' removes all of the elements, but does not +the variable. ‘unset NAME’, where NAME is an array, removes the entire +array. ‘unset NAME[SUBSCRIPT]’ behaves differently depending on the +array type when given a subscript of ‘*’ or ‘@’. When NAME is an +associative array, it removes the element with key ‘*’ or ‘@’. If NAME +is an indexed array, ‘unset’ removes all of the elements, but does not remove the array itself. When using a variable name with a subscript as an argument to a -command, such as with 'unset', without using the word expansion syntax +command, such as with ‘unset’, without using the word expansion syntax described above, the argument is subject to the shell's filename expansion. If filename expansion is not desired, the argument should be quoted. - The 'declare', 'local', and 'readonly' builtins each accept a '-a' -option to specify an indexed array and a '-A' option to specify an -associative array. If both options are supplied, '-A' takes precedence. -The 'read' builtin accepts a '-a' option to assign a list of words read + The ‘declare’, ‘local’, and ‘readonly’ builtins each accept a ‘-a’ +option to specify an indexed array and a ‘-A’ option to specify an +associative array. If both options are supplied, ‘-A’ takes precedence. +The ‘read’ builtin accepts a ‘-a’ option to assign a list of words read from the standard input to an array, and can read values from the -standard input into individual array elements. The 'set' and 'declare' +standard input into individual array elements. The ‘set’ and ‘declare’ builtins display array values in a way that allows them to be reused as input. @@ -6983,14 +6990,14 @@ File: bashref.info, Node: The Directory Stack, Next: Controlling the Prompt, the directory stack. The directory stack is a list of recently-visited directories. The -'pushd' builtin adds directories to the stack as it changes the current -directory, and the 'popd' builtin removes specified directories from the +‘pushd’ builtin adds directories to the stack as it changes the current +directory, and the ‘popd’ builtin removes specified directories from the stack and changes the current directory to the directory removed. The -'dirs' builtin displays the contents of the directory stack. The +‘dirs’ builtin displays the contents of the directory stack. The current directory is always the "top" of the directory stack. The contents of the directory stack are also visible as the value of -the 'DIRSTACK' shell variable. +the ‘DIRSTACK’ shell variable.  File: bashref.info, Node: Directory Stack Builtins, Up: The Directory Stack @@ -6998,105 +7005,105 @@ File: bashref.info, Node: Directory Stack Builtins, Up: The Directory Stack 6.8.1 Directory Stack Builtins ------------------------------ -'dirs' +‘dirs’ dirs [-clpv] [+N | -N] Display the list of currently remembered directories. Directories - are added to the list with the 'pushd' command; the 'popd' command + are added to the list with the ‘pushd’ command; the ‘popd’ command removes directories from the list. The current directory is always the first directory in the stack. - '-c' + ‘-c’ Clears the directory stack by deleting all of the elements. - '-l' + ‘-l’ Produces a listing using full pathnames; the default listing format uses a tilde to denote the home directory. - '-p' - Causes 'dirs' to print the directory stack with one entry per + ‘-p’ + Causes ‘dirs’ to print the directory stack with one entry per line. - '-v' - Causes 'dirs' to print the directory stack with one entry per + ‘-v’ + Causes ‘dirs’ to print the directory stack with one entry per line, prefixing each entry with its index in the stack. - '+N' + ‘+N’ Displays the Nth directory (counting from the left of the list - printed by 'dirs' when invoked without options), starting with + printed by ‘dirs’ when invoked without options), starting with zero. - '-N' + ‘-N’ Displays the Nth directory (counting from the right of the - list printed by 'dirs' when invoked without options), starting + list printed by ‘dirs’ when invoked without options), starting with zero. -'popd' +‘popd’ popd [-n] [+N | -N] Removes elements from the directory stack. The elements are - numbered from 0 starting at the first directory listed by 'dirs'; - that is, 'popd' is equivalent to 'popd +0'. + numbered from 0 starting at the first directory listed by ‘dirs’; + that is, ‘popd’ is equivalent to ‘popd +0’. - When no arguments are given, 'popd' removes the top directory from + When no arguments are given, ‘popd’ removes the top directory from the stack and changes to the new top directory. Arguments, if supplied, have the following meanings: - '-n' + ‘-n’ Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. - '+N' + ‘+N’ Removes the Nth directory (counting from the left of the list - printed by 'dirs'), starting with zero, from the stack. - '-N' + printed by ‘dirs’), starting with zero, from the stack. + ‘-N’ Removes the Nth directory (counting from the right of the list - printed by 'dirs'), starting with zero, from the stack. + printed by ‘dirs’), starting with zero, from the stack. - If the top element of the directory stack is modified, and the '-n' - option was not supplied, 'popd' uses the 'cd' builtin to change to - the directory at the top of the stack. If the 'cd' fails, 'popd' + If the top element of the directory stack is modified, and the ‘-n’ + option was not supplied, ‘popd’ uses the ‘cd’ builtin to change to + the directory at the top of the stack. If the ‘cd’ fails, ‘popd’ returns a non-zero value. - Otherwise, 'popd' returns an unsuccessful status if an invalid + Otherwise, ‘popd’ returns an unsuccessful status if an invalid option is encountered, the directory stack is empty, or a non-existent directory stack entry is specified. - If the 'popd' command is successful, Bash runs 'dirs' to show the + If the ‘popd’ command is successful, Bash runs ‘dirs’ to show the final contents of the directory stack, and the return status is 0. -'pushd' +‘pushd’ pushd [-n] [+N | -N | DIR] Adds a directory to the top of the directory stack, or rotates the stack, making the new top of the stack the current working - directory. With no arguments, 'pushd' exchanges the top two + directory. With no arguments, ‘pushd’ exchanges the top two elements of the directory stack. Arguments, if supplied, have the following meanings: - '-n' + ‘-n’ Suppresses the normal change of directory when rotating or adding directories to the stack, so that only the stack is manipulated. - '+N' + ‘+N’ Brings the Nth directory (counting from the left of the list - printed by 'dirs', starting with zero) to the top of the list + printed by ‘dirs’, starting with zero) to the top of the list by rotating the stack. - '-N' + ‘-N’ Brings the Nth directory (counting from the right of the list - printed by 'dirs', starting with zero) to the top of the list + printed by ‘dirs’, starting with zero) to the top of the list by rotating the stack. - 'DIR' + ‘DIR’ Makes DIR be the top of the stack. - After the stack has been modified, if the '-n' option was not - supplied, 'pushd' uses the 'cd' builtin to change to the directory - at the top of the stack. If the 'cd' fails, 'pushd' returns a + After the stack has been modified, if the ‘-n’ option was not + supplied, ‘pushd’ uses the ‘cd’ builtin to change to the directory + at the top of the stack. If the ‘cd’ fails, ‘pushd’ returns a non-zero value. - Otherwise, if no arguments are supplied, 'pushd' returns 0 unless + Otherwise, if no arguments are supplied, ‘pushd’ returns 0 unless the directory stack is empty. When rotating the directory stack, - 'pushd' returns 0 unless the directory stack is empty or a + ‘pushd’ returns 0 unless the directory stack is empty or a non-existent directory stack element is specified. - If the 'pushd' command is successful, Bash runs 'dirs' to show the + If the ‘pushd’ command is successful, Bash runs ‘dirs’ to show the final contents of the directory stack.  @@ -7105,72 +7112,72 @@ File: bashref.info, Node: Controlling the Prompt, Next: The Restricted Shell, 6.9 Controlling the Prompt ========================== -Bash examines the value of the array variable 'PROMPT_COMMAND' just +Bash examines the value of the array variable ‘PROMPT_COMMAND’ just before printing each primary prompt. If any elements in -'PROMPT_COMMAND' are set and non-null, Bash executes each value, in +‘PROMPT_COMMAND’ are set and non-null, Bash executes each value, in numeric order, just as if it had been typed on the command line. In addition, the following table describes the special characters -which can appear in the prompt variables 'PS0', 'PS1', 'PS2', and 'PS4': +which can appear in the prompt variables ‘PS0’, ‘PS1’, ‘PS2’, and ‘PS4’: -'\a' +‘\a’ A bell character. -'\d' +‘\d’ The date, in "Weekday Month Date" format (e.g., "Tue May 26"). -'\D{FORMAT}' - The FORMAT is passed to 'strftime'(3) and the result is inserted +‘\D{FORMAT}’ + The FORMAT is passed to ‘strftime’(3) and the result is inserted into the prompt string; an empty FORMAT results in a locale-specific time representation. The braces are required. -'\e' +‘\e’ An escape character. -'\h' +‘\h’ The hostname, up to the first '.'. -'\H' +‘\H’ The hostname. -'\j' +‘\j’ The number of jobs currently managed by the shell. -'\l' +‘\l’ The basename of the shell's terminal device name. -'\n' +‘\n’ A newline. -'\r' +‘\r’ A carriage return. -'\s' - The name of the shell, the basename of '$0' (the portion following +‘\s’ + The name of the shell, the basename of ‘$0’ (the portion following the final slash). -'\t' +‘\t’ The time, in 24-hour HH:MM:SS format. -'\T' +‘\T’ The time, in 12-hour HH:MM:SS format. -'\@' +‘\@’ The time, in 12-hour am/pm format. -'\A' +‘\A’ The time, in 24-hour HH:MM format. -'\u' +‘\u’ The username of the current user. -'\v' +‘\v’ The version of Bash (e.g., 2.00) -'\V' +‘\V’ The release of Bash, version + patchlevel (e.g., 2.00.0) -'\w' - The value of the 'PWD' shell variable ('$PWD'), with '$HOME' - abbreviated with a tilde (uses the '$PROMPT_DIRTRIM' variable). -'\W' - The basename of '$PWD', with '$HOME' abbreviated with a tilde. -'\!' +‘\w’ + The value of the ‘PWD’ shell variable (‘$PWD’), with ‘$HOME’ + abbreviated with a tilde (uses the ‘$PROMPT_DIRTRIM’ variable). +‘\W’ + The basename of ‘$PWD’, with ‘$HOME’ abbreviated with a tilde. +‘\!’ The history number of this command. -'\#' +‘\#’ The command number of this command. -'\$' - If the effective uid is 0, '#', otherwise '$'. -'\NNN' +‘\$’ + If the effective uid is 0, ‘#’, otherwise ‘$’. +‘\NNN’ The character whose ASCII code is the octal value NNN. -'\\' +‘\\’ A backslash. -'\[' +‘\[’ Begin a sequence of non-printing characters. This could be used to embed a terminal control sequence into the prompt. -'\]' +‘\]’ End a sequence of non-printing characters. The command number and the history number are usually different: the @@ -7181,7 +7188,7 @@ of commands executed during the current shell session. After the string is decoded, it is expanded via parameter expansion, command substitution, arithmetic expansion, and quote removal, subject -to the value of the 'promptvars' shell option (*note The Shopt +to the value of the ‘promptvars’ shell option (*note The Shopt Builtin::). This can have unwanted side effects if escaped portions of the string appear within command substitution or contain characters special to word expansion. @@ -7192,54 +7199,54 @@ File: bashref.info, Node: The Restricted Shell, Next: Bash POSIX Mode, Prev: 6.10 The Restricted Shell ========================= -If Bash is started with the name 'rbash', or the '--restricted' or '-r' +If Bash is started with the name ‘rbash’, or the ‘--restricted’ or ‘-r’ option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than -the standard shell. A restricted shell behaves identically to 'bash' +the standard shell. A restricted shell behaves identically to ‘bash’ with the exception that the following are disallowed or not performed: - * Changing directories with the 'cd' builtin. - * Setting or unsetting the values of the 'SHELL', 'PATH', 'HISTFILE', - 'ENV', or 'BASH_ENV' variables. - * Specifying command names containing slashes. - * Specifying a filename containing a slash as an argument to the '.' + • Changing directories with the ‘cd’ builtin. + • Setting or unsetting the values of the ‘SHELL’, ‘PATH’, ‘HISTFILE’, + ‘ENV’, or ‘BASH_ENV’ variables. + • Specifying command names containing slashes. + • Specifying a filename containing a slash as an argument to the ‘.’ builtin command. - * Specifying a filename containing a slash as an argument to the - 'history' builtin command. - * Specifying a filename containing a slash as an argument to the '-p' - option to the 'hash' builtin command. - * Importing function definitions from the shell environment at + • Specifying a filename containing a slash as an argument to the + ‘history’ builtin command. + • Specifying a filename containing a slash as an argument to the ‘-p’ + option to the ‘hash’ builtin command. + • Importing function definitions from the shell environment at startup. - * Parsing the value of 'SHELLOPTS' from the shell environment at + • Parsing the value of ‘SHELLOPTS’ from the shell environment at startup. - * Redirecting output using the '>', '>|', '<>', '>&', '&>', and '>>' + • Redirecting output using the ‘>’, ‘>|’, ‘<>’, ‘>&’, ‘&>’, and ‘>>’ redirection operators. - * Using the 'exec' builtin to replace the shell with another command. - * Adding or deleting builtin commands with the '-f' and '-d' options - to the 'enable' builtin. - * Using the 'enable' builtin command to enable disabled shell + • Using the ‘exec’ builtin to replace the shell with another command. + • Adding or deleting builtin commands with the ‘-f’ and ‘-d’ options + to the ‘enable’ builtin. + • Using the ‘enable’ builtin command to enable disabled shell builtins. - * Specifying the '-p' option to the 'command' builtin. - * Turning off restricted mode with 'set +r' or 'shopt -u - restricted_shell'. + • Specifying the ‘-p’ option to the ‘command’ builtin. + • Turning off restricted mode with ‘set +r’ or ‘shopt -u + restricted_shell’. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed (*note -Shell Scripts::), 'rbash' turns off any restrictions in the shell +Shell Scripts::), ‘rbash’ turns off any restrictions in the shell spawned to execute the script. The restricted shell mode is only one component of a useful -restricted environment. It should be accompanied by setting 'PATH' to a +restricted environment. It should be accompanied by setting ‘PATH’ to a value that allows execution of only a few verified commands (commands that allow shell escapes are particularly vulnerable), changing the -current directory to a non-writable directory other than '$HOME' after +current directory to a non-writable directory other than ‘$HOME’ after login, not allowing the restricted shell to execute shell scripts, and cleaning the environment of variables that cause some commands to modify -their behavior (e.g., 'VISUAL' or 'PAGER'). +their behavior (e.g., ‘VISUAL’ or ‘PAGER’). Modern systems provide more secure ways to implement a restricted -environment, such as 'jails', 'zones', or 'containers'. +environment, such as ‘jails’, ‘zones’, or ‘containers’.  File: bashref.info, Node: Bash POSIX Mode, Next: Shell Compatibility Mode, Prev: The Restricted Shell, Up: Bash Features @@ -7278,10 +7285,10 @@ variable expansion, and quoting. The special builtins, which must be implemented as part of the shell to provide the desired functionality, are specified as being part of the -shell; examples of these are 'eval' and 'export'. Other utilities +shell; examples of these are ‘eval’ and ‘export’. Other utilities appear in the sections of POSIX not devoted to the shell which are commonly (and in some cases must be) implemented as builtin commands, -such as 'read' and 'test'. POSIX also specifies aspects of the shell's +such as ‘read’ and ‘test’. POSIX also specifies aspects of the shell's interactive behavior, including job control and command line editing. Only vi-style line editing commands have been standardized; emacs editing commands were left out due to objections. @@ -7291,35 +7298,35 @@ 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 +specification. The Bash “posix mode” changes the Bash behavior in these areas so that it conforms to the standard more closely. - Starting Bash with the '--posix' command-line option or executing -'set -o posix' while Bash is running will cause Bash to conform more + Starting Bash with the ‘--posix’ command-line option or executing +‘set -o posix’ while Bash is running will cause Bash to conform more closely to the POSIX standard by changing the behavior to match that specified by POSIX in areas where the Bash default differs. - When invoked as 'sh', Bash enters POSIX mode after reading the + 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: - 1. Bash ensures that the 'POSIXLY_CORRECT' variable is set. + 1. Bash ensures that the ‘POSIXLY_CORRECT’ variable is set. 2. When a command in the hash table no longer exists, Bash will - re-search '$PATH' to find the new location. This is also available - with 'shopt -s checkhash'. + re-search ‘$PATH’ to find the new location. This is also available + with ‘shopt -s checkhash’. 3. Bash will not insert a command without the execute bit set into the command hash table, even if it returns it as a (last-ditch) result - from a '$PATH' search. + from a ‘$PATH’ search. 4. The message printed by the job control code and builtins when a job exits with a non-zero status is 'Done(status)'. 5. The message printed by the job control code and builtins when a job is stopped is 'Stopped(SIGNAME)', where SIGNAME is, for example, - 'SIGTSTP'. + ‘SIGTSTP’. 6. Alias expansion is always enabled, even in non-interactive shells. @@ -7333,19 +7340,19 @@ startup files. the command substitution is initially parsed (e.g., as part of a function definition). - 9. The POSIX 'PS1' and 'PS2' expansions of '!' to the history number - and '!!' to '!' are enabled, and parameter expansion is performed - on the values of 'PS1' and 'PS2' regardless of the setting of the - 'promptvars' option. + 9. The POSIX ‘PS1’ and ‘PS2’ expansions of ‘!’ to the history number + and ‘!!’ to ‘!’ are enabled, and parameter expansion is performed + on the values of ‘PS1’ and ‘PS2’ regardless of the setting of the + ‘promptvars’ option. - 10. The POSIX startup files are executed ('$ENV') rather than the + 10. The POSIX startup files are executed (‘$ENV’) rather than the normal Bash files. 11. Tilde expansion is only performed on assignments preceding a command name, rather than on all assignment statements on the line. - 12. The default history file is '~/.sh_history' (this is the default - value the shell assigns to '$HISTFILE'). + 12. The default history file is ‘~/.sh_history’ (this is the default + value the shell assigns to ‘$HISTFILE’). 13. Redirection operators do not perform filename expansion on the word in the redirection unless the shell is interactive. @@ -7353,7 +7360,7 @@ startup files. 14. Redirection operators do not perform word splitting on the word in the redirection. - 15. Function names must be valid shell 'name's. That is, they may not + 15. Function names must be valid shell ‘name’s. That is, they may not contain characters other than letters, digits, and underscores, and may not start with a digit. Declaring a function with an invalid name causes a fatal syntax error in non-interactive shells. @@ -7366,19 +7373,19 @@ startup files. whose name contains one or more slashes. 18. POSIX special builtins are found before shell functions during - command lookup, including output printed by the 'type' and - 'command' builtins. + command lookup, including output printed by the ‘type’ and + ‘command’ builtins. - 19. When printing shell function definitions (e.g., by 'type'), Bash - does not print the 'function' keyword. + 19. When printing shell function definitions (e.g., by ‘type’), Bash + does not print the ‘function’ keyword. 20. Literal tildes that appear as the first character in elements of - the 'PATH' variable are not expanded as described above under *note + the ‘PATH’ variable are not expanded as described above under *note Tilde Expansion::. - 21. The 'time' reserved word may be used by itself as a command. When + 21. The ‘time’ reserved word may be used by itself as a command. When used in this way, it displays timing statistics for the shell and - its completed children. The 'TIMEFORMAT' variable controls the + its completed children. The ‘TIMEFORMAT’ variable controls the format of the timing information. 22. When parsing and expanding a ${...} expansion that appears within @@ -7387,11 +7394,11 @@ startup files. the operator is one of those defined to perform pattern removal. In this case, they do not have to appear as matched pairs. - 23. The parser does not recognize 'time' as a reserved word if the - next token begins with a '-'. + 23. The parser does not recognize ‘time’ as a reserved word if the + next token begins with a ‘-’. - 24. The '!' character does not introduce history expansion within a - double-quoted string, even if the 'histexpand' option is enabled. + 24. The ‘!’ character does not introduce history expansion within a + double-quoted string, even if the ‘histexpand’ option is enabled. 25. If a POSIX special builtin returns an error status, a non-interactive shell exits. The fatal errors are those listed in @@ -7399,13 +7406,13 @@ startup files. options, redirection errors, variable assignment errors for assignments preceding the command name, and so on. - 26. The 'unset' builtin with the '-v' option specified returns a fatal - error if it attempts to unset a 'readonly' or 'non-unsettable' + 26. The ‘unset’ builtin with the ‘-v’ option specified returns a fatal + error if it attempts to unset a ‘readonly’ or ‘non-unsettable’ variable, or encounters a variable name argument that is an invalid identifier, which causes a non-interactive shell to exit. 27. When asked to unset a variable that appears in an assignment - statement preceding the command, the 'unset' builtin attempts to + statement preceding the command, the ‘unset’ builtin attempts to unset a variable of the same name in the current or previous scope as well. This implements the required "if an assigned variable is further modified by the utility, the modifications made by the @@ -7425,11 +7432,11 @@ startup files. occurred"). 30. A non-interactive shell exits with an error status if the - iteration variable in a 'for' statement or the selection variable - in a 'select' statement is a readonly variable or has an invalid + iteration variable in a ‘for’ statement or the selection variable + in a ‘select’ statement is a readonly variable or has an invalid name. - 31. Non-interactive shells exit if FILENAME in '.' FILENAME is not + 31. Non-interactive shells exit if FILENAME in ‘.’ FILENAME is not found. 32. Non-interactive shells exit if a syntax error in an arithmetic @@ -7438,151 +7445,151 @@ startup files. 33. Non-interactive shells exit if a parameter expansion error occurs. 34. Non-interactive shells exit if there is a syntax error in a script - read with the '.' or 'source' builtins, or in a string processed by - the 'eval' builtin. + read with the ‘.’ or ‘source’ builtins, or in a string processed by + the ‘eval’ builtin. 35. While variable indirection is available, it may not be applied to - the '#' and '?' special parameters. + the ‘#’ and ‘?’ special parameters. - 36. Expanding the '*' special parameter in a pattern context where the - expansion is double-quoted does not treat the '$*' as if it were + 36. Expanding the ‘*’ special parameter in a pattern context where the + expansion is double-quoted does not treat the ‘$*’ as if it were double-quoted. 37. Assignment statements preceding POSIX special builtins persist in the shell environment after the builtin completes. - 38. The 'command' builtin does not prevent builtins that take + 38. The ‘command’ builtin does not prevent builtins that take assignment statements as arguments from expanding them as assignment statements; when not in POSIX mode, assignment builtins lose their assignment statement expansion properties when preceded - by 'command'. + by ‘command’. - 39. The 'bg' builtin uses the required format to describe each job + 39. The ‘bg’ builtin uses the required format to describe each job placed in the background, which does not include an indication of whether the job is the current or previous job. - 40. The output of 'kill -l' prints all the signal names on a single - line, separated by spaces, without the 'SIG' prefix. + 40. The output of ‘kill -l’ prints all the signal names on a single + line, separated by spaces, without the ‘SIG’ prefix. - 41. The 'kill' builtin does not accept signal names with a 'SIG' + 41. The ‘kill’ builtin does not accept signal names with a ‘SIG’ prefix. - 42. The 'export' and 'readonly' builtin commands display their output + 42. The ‘export’ and ‘readonly’ builtin commands display their output in the format required by POSIX. - 43. If the 'export' and 'readonly' builtin commands get an argument + 43. If the ‘export’ and ‘readonly’ builtin commands get an argument that is not a valid identifier, and they are not operating on shell functions, they return an error. This will cause a non-interactive shell to exit because these are special builtins. - 44. The 'trap' builtin displays signal names without the leading - 'SIG'. + 44. The ‘trap’ builtin displays signal names without the leading + ‘SIG’. - 45. The 'trap' builtin doesn't check the first argument for a possible + 45. The ‘trap’ builtin doesn't check the first argument for a possible signal specification and revert the signal handling to the original disposition if it is, unless that argument consists solely of digits and is a valid signal number. If users want to reset the handler for a given signal to the original disposition, they should - use '-' as the first argument. + use ‘-’ as the first argument. - 46. 'trap -p' without arguments displays signals whose dispositions + 46. ‘trap -p’ without arguments displays signals whose dispositions are set to SIG_DFL and those that were ignored when the shell started, not just trapped signals. - 47. The '.' and 'source' builtins do not search the current directory - for the filename argument if it is not found by searching 'PATH'. + 47. The ‘.’ and ‘source’ builtins do not search the current directory + for the filename argument if it is not found by searching ‘PATH’. 48. Enabling POSIX mode has the effect of setting the - 'inherit_errexit' option, so subshells spawned to execute command - substitutions inherit the value of the '-e' option from the parent - shell. When the 'inherit_errexit' option is not enabled, Bash - clears the '-e' option in such subshells. + ‘inherit_errexit’ option, so subshells spawned to execute command + substitutions inherit the value of the ‘-e’ option from the parent + shell. When the ‘inherit_errexit’ option is not enabled, Bash + clears the ‘-e’ option in such subshells. - 49. Enabling POSIX mode has the effect of setting the 'shift_verbose' - option, so numeric arguments to 'shift' that exceed the number of + 49. Enabling POSIX mode has the effect of setting the ‘shift_verbose’ + option, so numeric arguments to ‘shift’ that exceed the number of positional parameters will result in an error message. - 50. When the 'alias' builtin displays alias definitions, it does not - display them with a leading 'alias ' unless the '-p' option is + 50. When the ‘alias’ builtin displays alias definitions, it does not + display them with a leading ‘alias ’ unless the ‘-p’ option is supplied. - 51. When the 'set' builtin is invoked without options, it does not + 51. When the ‘set’ builtin is invoked without options, it does not display shell function names and definitions. - 52. When the 'set' builtin is invoked without options, it displays + 52. When the ‘set’ builtin is invoked without options, it displays variable values without quotes, unless they contain shell metacharacters, even if the result contains nonprinting characters. - 53. When the 'cd' builtin is invoked in logical mode, and the pathname - constructed from '$PWD' and the directory name supplied as an - argument does not refer to an existing directory, 'cd' will fail + 53. When the ‘cd’ builtin is invoked in logical mode, and the pathname + constructed from ‘$PWD’ and the directory name supplied as an + argument does not refer to an existing directory, ‘cd’ will fail instead of falling back to physical mode. - 54. When the 'cd' builtin cannot change a directory because the length - of the pathname constructed from '$PWD' and the directory name - supplied as an argument exceeds 'PATH_MAX' when all symbolic links - are expanded, 'cd' will fail instead of attempting to use only the + 54. When the ‘cd’ builtin cannot change a directory because the length + of the pathname constructed from ‘$PWD’ and the directory name + supplied as an argument exceeds ‘PATH_MAX’ when all symbolic links + are expanded, ‘cd’ will fail instead of attempting to use only the supplied directory name. - 55. The 'pwd' builtin verifies that the value it prints is the same as + 55. The ‘pwd’ builtin verifies that the value it prints is the same as the current directory, even if it is not asked to check the file - system with the '-P' option. + system with the ‘-P’ option. - 56. When listing the history, the 'fc' builtin does not include an + 56. When listing the history, the ‘fc’ builtin does not include an indication of whether or not a history entry has been modified. - 57. The default editor used by 'fc' is 'ed'. + 57. The default editor used by ‘fc’ is ‘ed’. - 58. If there are too many arguments supplied to 'fc -s', 'fc' prints + 58. If there are too many arguments supplied to ‘fc -s’, ‘fc’ prints an error message and returns failure. - 59. The 'type' and 'command' builtins will not report a non-executable + 59. The ‘type’ and ‘command’ builtins will not report a non-executable file as having been found, though the shell will attempt to execute - such a file if it is the only so-named file found in '$PATH'. + such a file if it is the only so-named file found in ‘$PATH’. - 60. The 'vi' editing mode will invoke the 'vi' editor directly when - the 'v' command is run, instead of checking '$VISUAL' and - '$EDITOR'. + 60. The ‘vi’ editing mode will invoke the ‘vi’ editor directly when + the ‘v’ command is run, instead of checking ‘$VISUAL’ and + ‘$EDITOR’. - 61. When the 'xpg_echo' option is enabled, Bash does not attempt to - interpret any arguments to 'echo' as options. Each argument is + 61. When the ‘xpg_echo’ option is enabled, Bash does not attempt to + interpret any arguments to ‘echo’ as options. Each argument is displayed, after escape characters are converted. - 62. The 'ulimit' builtin uses a block size of 512 bytes for the '-c' - and '-f' options. + 62. The ‘ulimit’ builtin uses a block size of 512 bytes for the ‘-c’ + and ‘-f’ options. - 63. The arrival of 'SIGCHLD' when a trap is set on 'SIGCHLD' does not - interrupt the 'wait' builtin and cause it to return immediately. + 63. The arrival of ‘SIGCHLD’ when a trap is set on ‘SIGCHLD’ does not + interrupt the ‘wait’ builtin and cause it to return immediately. The trap command is run once for each child that exits. - 64. The 'read' builtin may be interrupted by a signal for which a trap + 64. The ‘read’ builtin may be interrupted by a signal for which a trap has been set. If Bash receives a trapped signal while executing - 'read', the trap handler executes and 'read' returns an exit status + ‘read’, the trap handler executes and ‘read’ returns an exit status greater than 128. - 65. The 'printf' builtin uses 'double' (via 'strtod') to convert + 65. The ‘printf’ builtin uses ‘double’ (via ‘strtod’) to convert arguments corresponding to floating point conversion specifiers, - instead of 'long double' if it's available. The 'L' length - modifier forces 'printf' to use 'long double' if it's available. + instead of ‘long double’ if it's available. The ‘L’ length + modifier forces ‘printf’ to use ‘long double’ if it's available. 66. Bash removes an exited background process's status from the list - of such statuses after the 'wait' builtin is used to obtain it. + of such statuses after the ‘wait’ builtin is used to obtain it. - 67. A double quote character ('"') is treated specially when it + 67. A double quote character (‘"’) is treated specially when it appears in a backquoted command substitution in the body of a here-document that undergoes expansion. That means, for example, that a backslash preceding a double quote character will escape it and the backslash will be removed. - 68. The 'test' builtin compares strings using the current locale when - processing the '<' and '>' binary operators. + 68. The ‘test’ builtin compares strings using the current locale when + processing the ‘<’ and ‘>’ binary operators. - 69. The 'test' builtin's '-t' unary primary requires an argument. - Historical versions of 'test' made the argument optional in certain + 69. The ‘test’ builtin's ‘-t’ unary primary requires an argument. + Historical versions of ‘test’ made the argument optional in certain cases, and Bash attempts to accommodate those for backwards compatibility. - 70. Command substitutions don't set the '?' special parameter. The + 70. Command substitutions don't set the ‘?’ special parameter. The exit status of a simple command without a command word is still the exit status of the last command substitution that occurred while evaluating the variable assignments and redirections in that @@ -7592,19 +7599,19 @@ startup files. There is other POSIX behavior that Bash does not implement by default even when in POSIX mode. Specifically: - 1. The 'fc' builtin checks '$EDITOR' as a program to edit history - entries if 'FCEDIT' is unset, rather than defaulting directly to - 'ed'. 'fc' uses 'ed' if 'EDITOR' is unset. + 1. The ‘fc’ builtin checks ‘$EDITOR’ as a program to edit history + entries if ‘FCEDIT’ is unset, rather than defaulting directly to + ‘ed’. ‘fc’ uses ‘ed’ if ‘EDITOR’ is unset. 2. A non-interactive shell does not exit if a variable assignment - preceding the 'command' builtin or another non-special builtin + preceding the ‘command’ builtin or another non-special builtin fails. - 3. As noted above, Bash requires the 'xpg_echo' option to be enabled - for the 'echo' builtin to be fully conformant. + 3. As noted above, Bash requires the ‘xpg_echo’ option to be enabled + for the ‘echo’ builtin to be fully conformant. Bash can be configured to be POSIX-conformant by default, by -specifying the '--enable-strict-posix-default' to 'configure' when +specifying the ‘--enable-strict-posix-default’ to ‘configure’ when building (*note Optional Features::).  @@ -7613,9 +7620,9 @@ File: bashref.info, Node: Shell Compatibility Mode, Prev: Bash POSIX Mode, Up 6.12 Shell Compatibility Mode ============================= -Bash-4.0 introduced the concept of a "shell compatibility level", -specified as a set of options to the shopt builtin ('compat31', -'compat32', 'compat40', 'compat41', and so on). There is only one +Bash-4.0 introduced the concept of a “shell compatibility level”, +specified as a set of options to the shopt builtin (‘compat31’, +‘compat32’, ‘compat40’, ‘compat41’, 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 @@ -7623,138 +7630,138 @@ migrate scripts to use current features and behavior. It's intended to be a temporary solution. This section does not mention behavior that is standard for a -particular version (e.g., setting 'compat32' means that quoting the rhs +particular version (e.g., setting ‘compat32’ means that quoting the rhs of the regexp matching operator quotes special regexp characters in the word, which is default behavior in bash-3.2 and subsequent versions). - If a user enables, say, 'compat32', it may affect the behavior of + If a user enables, say, ‘compat32’, 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 Bash, 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 'compat32' will enable +comparisons with the ‘[[’ command came in bash-4.1, and earlier versions +used ASCII-based comparisons, so enabling ‘compat32’ will enable ASCII-based comparisons as well. That granularity may not be sufficient 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: 'BASH_COMPAT'. The value + Bash-4.3 introduced a new shell variable: ‘BASH_COMPAT’. The value assigned to this variable (a decimal version number like 4.2, or an -integer corresponding to the 'compat'NN option, like 42) determines the +integer corresponding to the ‘compat’NN option, like 42) determines the compatibility level. Starting with bash-4.4, Bash has begun deprecating older compatibility levels. Eventually, the options will be removed in favor -of 'BASH_COMPAT'. +of ‘BASH_COMPAT’. Bash-5.0 was the final version for which there will be an individual shopt option for the previous version. Users should control the -compatibility level with 'BASH_COMPAT'. +compatibility level with ‘BASH_COMPAT’. The following table describes the behavior changes controlled by each -compatibility level setting. The 'compat'NN tag is used as shorthand +compatibility level setting. The ‘compat’NN tag is used as shorthand for setting the compatibility level to NN using one of the following mechanisms. For versions prior to bash-5.0, the compatibility level may -be set using the corresponding 'compat'NN shopt option. For bash-4.3 -and later versions, the 'BASH_COMPAT' variable is preferred, and it is +be set using the corresponding ‘compat’NN shopt option. For bash-4.3 +and later versions, the ‘BASH_COMPAT’ variable is preferred, and it is required for bash-5.1 and later versions. -'compat31' - * quoting the rhs of the '[[' command's regexp matching operator +‘compat31’ + • quoting the rhs of the ‘[[’ command's regexp matching operator (=~) has no special effect -'compat40' - * the '<' and '>' operators to the '[[' command do not consider +‘compat40’ + • the ‘<’ and ‘>’ operators to the ‘[[’ command do not consider the current locale when comparing strings; they use ASCII ordering. Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); bash-4.1 and later use the current locale's collation sequence and strcoll(3). -'compat41' - * in posix mode, 'time' may be followed by options and still be +‘compat41’ + • 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 (this is POSIX interpretation 221) -'compat42' - * the replacement string in double-quoted pattern substitution +‘compat42’ + • 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); in later versions, single quotes are not special within double-quoted word expansions -'compat43' - * the shell does not print a warning message if an attempt is +‘compat43’ + • the shell does not print a warning message if an attempt is made to use a quoted compound assignment as an argument to declare (e.g., declare -a foo='(1 2)'). Later versions warn that this usage is deprecated - * word expansion errors are considered non-fatal errors that + • 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) - * when executing a shell function, the loop state - (while/until/etc.) is not reset, so 'break' or 'continue' in + • when executing a shell function, the loop state + (while/until/etc.) is not reset, so ‘break’ or ‘continue’ in that function will break or continue loops in the calling context. Bash-4.4 and later reset the loop state to prevent this -'compat44' - * the shell sets up the values used by 'BASH_ARGV' and - 'BASH_ARGC' so they can expand to the shell's positional +‘compat44’ + • the shell sets up the values used by ‘BASH_ARGV’ and + ‘BASH_ARGC’ so they can expand to the shell's positional parameters even if extended debugging mode is not enabled - * a subshell inherits loops from its parent context, so 'break' - or 'continue' will cause the subshell to exit. Bash-5.0 and + • a subshell inherits loops from its parent context, so ‘break’ + or ‘continue’ will cause the subshell to exit. Bash-5.0 and later reset the loop state to prevent the exit - * variable assignments preceding builtins like 'export' and - 'readonly' that set attributes continue to affect variables + • 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 -'compat50 (set using BASH_COMPAT)' - * Bash-5.1 changed the way '$RANDOM' is generated to introduce +‘compat50 (set using BASH_COMPAT)’ + • Bash-5.1 changed the way ‘$RANDOM’ is generated to introduce slightly more randomness. If the shell compatibility level is set to 50 or lower, it reverts to the method from bash-5.0 and previous versions, so seeding the random number generator by - assigning a value to 'RANDOM' will produce the same sequence + assigning a value to ‘RANDOM’ will produce the same sequence as in bash-5.0 - * If the command hash table is empty, Bash versions prior to + • If the command hash table is empty, Bash versions prior to bash-5.1 printed an informational message to that effect, even when producing output that can be reused as input. Bash-5.1 - suppresses that message when the '-l' option is supplied. + suppresses that message when the ‘-l’ option is supplied. -'compat51 (set using BASH_COMPAT)' - * The 'unset' builtin will unset the array 'a' given an argument - like 'a[@]'. Bash-5.2 will unset an element with key '@' +‘compat51 (set using BASH_COMPAT)’ + • The ‘unset’ builtin will unset the array ‘a’ given an argument + like ‘a[@]’. Bash-5.2 will unset an element with key ‘@’ (associative arrays) or remove all the elements without unsetting the array (indexed arrays) - * arithmetic commands ( ((...)) ) and the expressions in an + • arithmetic commands ( ((...)) ) and the expressions in an arithmetic for statement can be expanded more than once - * expressions used as arguments to arithmetic operators in the - '[[' conditional command can be expanded more than once - * the expressions in substring parameter brace expansion can be + • expressions used as arguments to arithmetic operators in the + ‘[[’ conditional command can be expanded more than once + • the expressions in substring parameter brace expansion can be expanded more than once - * the expressions in the $(( ... )) word expansion can be + • the expressions in the $(( ... )) word expansion can be expanded more than once - * arithmetic expressions used as indexed array subscripts can be + • arithmetic expressions used as indexed array subscripts can be expanded more than once - * 'test -v', when given an argument of 'A[@]', where A is an + • ‘test -v’, when given an argument of ‘A[@]’, where A is an existing associative array, will return true if the array has any set elements. Bash-5.2 will look for and report on a key - named '@' - * the ${PARAMETER[:]=VALUE} word expansion will return VALUE, + named ‘@’ + • the ${PARAMETER[:]=VALUE} word expansion will return VALUE, 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. - * Parsing command substitutions will behave as if extended + • Parsing command substitutions will behave as if extended globbing (*note The Shopt Builtin::) is enabled, so that parsing a command substitution containing an extglob pattern (say, as part of a shell function) will not fail. This @@ -7793,7 +7800,7 @@ interface supplied jointly by the operating system kernel's terminal driver and Bash. The shell associates a JOB with each pipeline. It keeps a table of -currently executing jobs, which may be listed with the 'jobs' command. +currently executing jobs, which may be listed with the ‘jobs’ command. When Bash starts a job asynchronously, it prints a line that looks like: [1] 25647 indicating that this job is job number 1 and that the process ID of the @@ -7805,71 +7812,71 @@ uses the JOB abstraction as the basis for job control. control, the operating system maintains the notion of a current terminal process group ID. Members of this process group (processes whose process group ID is equal to the current terminal process group ID) -receive keyboard-generated signals such as 'SIGINT'. These processes +receive keyboard-generated signals such as ‘SIGINT’. These processes are said to be in the foreground. Background processes are those whose process group ID differs from the terminal's; such processes are immune to keyboard-generated signals. Only foreground processes are allowed to -read from or, if the user so specifies with 'stty tostop', write to the +read from or, if the user so specifies with ‘stty tostop’, write to the terminal. Background processes which attempt to read from (write to -when 'stty tostop' is in effect) the terminal are sent a 'SIGTTIN' -('SIGTTOU') signal by the kernel's terminal driver, which, unless +when ‘tostop’ is in effect) the terminal are sent a ‘SIGTTIN’ +(‘SIGTTOU’) signal by the kernel's terminal driver, which, unless caught, suspends the process. If the operating system on which Bash is running supports job -control, Bash contains facilities to use it. Typing the "suspend" -character (typically '^Z', Control-Z) while a process is running causes +control, Bash contains facilities to use it. Typing the “suspend” +character (typically ‘^Z’, Control-Z) while a process is running causes that process to be stopped and returns control to Bash. Typing the -"delayed suspend" character (typically '^Y', Control-Y) causes the +“delayed suspend” character (typically ‘^Y’, Control-Y) causes the process to be stopped when it attempts to read input from the terminal, and control to be returned to Bash. The user then manipulates the state -of this job, using the 'bg' command to continue it in the background, -the 'fg' command to continue it in the foreground, or the 'kill' command -to kill it. A '^Z' takes effect immediately, and has the additional +of this job, using the ‘bg’ command to continue it in the background, +the ‘fg’ command to continue it in the foreground, or the ‘kill’ command +to kill it. A ‘^Z’ takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded. There are a number of ways to refer to a job in the shell. The -character '%' introduces a job specification ("jobspec"). +character ‘%’ introduces a job specification (“jobspec”). - Job number 'n' may be referred to as '%n'. The symbols '%%' and '%+' + Job number ‘n’ may be referred to as ‘%n’. The symbols ‘%%’ and ‘%+’ refer to the shell's notion of the current job, which is the last job stopped while it was in the foreground or started in the background. A -single '%' (with no accompanying job specification) also refers to the -current job. The previous job may be referenced using '%-'. If there -is only a single job, '%+' and '%-' can both be used to refer to that -job. In output pertaining to jobs (e.g., the output of the 'jobs' -command), the current job is always flagged with a '+', and the previous -job with a '-'. +single ‘%’ (with no accompanying job specification) also refers to the +current job. The previous job may be referenced using ‘%-’. If there +is only a single job, ‘%+’ and ‘%-’ can both be used to refer to that +job. In output pertaining to jobs (e.g., the output of the ‘jobs’ +command), the current job is always flagged with a ‘+’, and the previous +job with a ‘-’. A job may also be referred to using a prefix of the name used to start it, or using a substring that appears in its command line. For -example, '%ce' refers to a stopped job whose command name begins with -'ce'. Using '%?ce', on the other hand, refers to any job containing the -string 'ce' in its command line. If the prefix or substring matches +example, ‘%ce’ refers to a stopped job whose command name begins with +‘ce’. Using ‘%?ce’, on the other hand, refers to any job containing the +string ‘ce’ in its command line. If the prefix or substring matches more than one job, Bash reports an error. - Simply naming a job can be used to bring it into the foreground: '%1' -is a synonym for 'fg %1', bringing job 1 from the background into the -foreground. Similarly, '%1 &' resumes job 1 in the background, -equivalent to 'bg %1' + Simply naming a job can be used to bring it into the foreground: ‘%1’ +is a synonym for ‘fg %1’, bringing job 1 from the background into the +foreground. Similarly, ‘%1 &’ resumes job 1 in the background, +equivalent to ‘bg %1’ The shell learns immediately whenever a job changes state. Normally, Bash waits until it is about to print a prompt before reporting changes -in a job's status so as to not interrupt any other output. If the '-b' -option to the 'set' builtin is enabled, Bash reports such changes -immediately (*note The Set Builtin::). Any trap on 'SIGCHLD' is +in a job's status so as to not interrupt any other output. If the ‘-b’ +option to the ‘set’ builtin is enabled, Bash reports such changes +immediately (*note The Set Builtin::). Any trap on ‘SIGCHLD’ is executed for each child process that exits. If an attempt to exit Bash is made while jobs are stopped, (or -running, if the 'checkjobs' option is enabled - see *note The Shopt -Builtin::), the shell prints a warning message, and if the 'checkjobs' -option is enabled, lists the jobs and their statuses. The 'jobs' +running, if the ‘checkjobs’ option is enabled - see *note The Shopt +Builtin::), the shell prints a warning message, and if the ‘checkjobs’ +option is enabled, lists the jobs and their statuses. The ‘jobs’ command may then be used to inspect their status. If a second attempt to exit is made without an intervening command, Bash does not print another warning, and any stopped jobs are terminated. - When the shell is waiting for a job or process using the 'wait' -builtin, and job control is enabled, 'wait' will return when the job -changes state. The '-f' option causes 'wait' to wait until the job or + When the shell is waiting for a job or process using the ‘wait’ +builtin, and job control is enabled, ‘wait’ will return when the job +changes state. The ‘-f’ option causes ‘wait’ to wait until the job or process terminates before returning.  @@ -7878,17 +7885,17 @@ File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables, 7.2 Job Control Builtins ======================== -'bg' +‘bg’ bg [JOBSPEC ...] Resume each suspended job JOBSPEC in the background, as if it had - been started with '&'. If JOBSPEC is not supplied, the current job + been started with ‘&’. If JOBSPEC is not supplied, the current job is used. The return status is zero unless it is run when job control is not enabled, or, when run with job control enabled, any JOBSPEC was not found or specifies a job that was started without job control. -'fg' +‘fg’ fg [JOBSPEC] Resume the job JOBSPEC in the foreground and make it the current @@ -7898,106 +7905,106 @@ File: bashref.info, Node: Job Control Builtins, Next: Job Control Variables, control enabled, JOBSPEC does not specify a valid job or JOBSPEC specifies a job that was started without job control. -'jobs' +‘jobs’ jobs [-lnprs] [JOBSPEC] jobs -x COMMAND [ARGUMENTS] The first form lists the active jobs. The options have the following meanings: - '-l' + ‘-l’ List process IDs in addition to the normal information. - '-n' + ‘-n’ Display information only about jobs that have changed status since the user was last notified of their status. - '-p' + ‘-p’ List only the process ID of the job's process group leader. - '-r' + ‘-r’ Display only running jobs. - '-s' + ‘-s’ Display only stopped jobs. If JOBSPEC is given, output is restricted to information about that job. If JOBSPEC is not supplied, the status of all jobs is listed. - If the '-x' option is supplied, 'jobs' replaces any JOBSPEC found + If the ‘-x’ option is supplied, ‘jobs’ replaces any JOBSPEC found in COMMAND or ARGUMENTS with the corresponding process group ID, and executes COMMAND, passing it ARGUMENTs, returning its exit status. -'kill' +‘kill’ kill [-s SIGSPEC] [-n SIGNUM] [-SIGSPEC] JOBSPEC or PID kill -l|-L [EXIT_STATUS] Send a signal specified by SIGSPEC or SIGNUM to the process named by job specification JOBSPEC or process ID PID. SIGSPEC is either - a case-insensitive signal name such as 'SIGINT' (with or without - the 'SIG' prefix) or a signal number; SIGNUM is a signal number. - If SIGSPEC and SIGNUM are not present, 'SIGTERM' is used. The '-l' + a case-insensitive signal name such as ‘SIGINT’ (with or without + the ‘SIG’ prefix) or a signal number; SIGNUM is a signal number. + If SIGSPEC and SIGNUM are not present, ‘SIGTERM’ is used. The ‘-l’ option lists the signal names. If any arguments are supplied when - '-l' is given, the names of the signals corresponding to the + ‘-l’ is given, the names of the signals corresponding to the arguments are listed, and the return status is zero. EXIT_STATUS is a number specifying a signal number or the exit status of a - process terminated by a signal. The '-L' option is equivalent to - '-l'. The return status is zero if at least one signal was + process terminated by a signal. The ‘-L’ option is equivalent to + ‘-l’. The return status is zero if at least one signal was successfully sent, or non-zero if an error occurs or an invalid option is encountered. -'wait' +‘wait’ wait [-fn] [-p VARNAME] [JOBSPEC or PID ...] Wait until the child process specified by each process ID PID or job specification JOBSPEC exits and return the exit status of the last command waited for. If a job spec is given, all processes in - the job are waited for. If no arguments are given, 'wait' waits + the job are waited for. If no arguments are given, ‘wait’ 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 '-n' option is supplied, 'wait' waits for a + status is zero. If the ‘-n’ option is supplied, ‘wait’ waits for a single job from the list of PIDs or JOBSPECs or, if no arguments are supplied, any job, to complete and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the shell has no unwaited-for children, - the exit status is 127. If the '-p' option is supplied, the + the exit status is 127. If the ‘-p’ option is supplied, the process or job identifier of the job for which the exit status is returned is assigned to the variable VARNAME named by the option argument. The variable will be unset initially, before any - assignment. This is useful only when the '-n' option is supplied. - Supplying the '-f' option, when job control is enabled, forces - 'wait' to wait for each PID or JOBSPEC to terminate before + assignment. This is useful only when the ‘-n’ option is supplied. + Supplying the ‘-f’ option, when job control is enabled, forces + ‘wait’ to wait for each PID or JOBSPEC to terminate before returning its status, instead of returning when it changes status. If neither JOBSPEC nor PID specifies an active child process of the - shell, the return status is 127. If 'wait' is interrupted by a + shell, the return status is 127. If ‘wait’ is interrupted by a signal, the return status will be greater than 128, as described above (*note Signals::). Otherwise, the return status is the exit status of the last process or job waited for. -'disown' +‘disown’ disown [-ar] [-h] [JOBSPEC ... | PID ... ] Without options, remove each JOBSPEC from the table of active jobs. - If the '-h' option is given, the job is not removed from the table, - but is marked so that 'SIGHUP' is not sent to the job if the shell - receives a 'SIGHUP'. If JOBSPEC is not present, and neither the - '-a' nor the '-r' option is supplied, the current job is used. If - no JOBSPEC is supplied, the '-a' option means to remove or mark all - jobs; the '-r' option without a JOBSPEC argument restricts + If the ‘-h’ option is given, the job is not removed from the table, + but is marked so that ‘SIGHUP’ is not sent to the job if the shell + receives a ‘SIGHUP’. If JOBSPEC is not present, and neither the + ‘-a’ nor the ‘-r’ option is supplied, the current job is used. If + no JOBSPEC is supplied, the ‘-a’ option means to remove or mark all + jobs; the ‘-r’ option without a JOBSPEC argument restricts operation to running jobs. -'suspend' +‘suspend’ suspend [-f] - Suspend the execution of this shell until it receives a 'SIGCONT' + Suspend the execution of this shell until it receives a ‘SIGCONT’ signal. A login shell, or a shell without job control enabled, - cannot be suspended; the '-f' option can be used to override this + cannot be suspended; the ‘-f’ option can be used to 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 '-f' is not + is a login shell or job control is not enabled and ‘-f’ is not supplied. - When job control is not active, the 'kill' and 'wait' builtins do not + When job control is not active, the ‘kill’ and ‘wait’ builtins do not accept JOBSPEC arguments. They must be supplied process IDs.  @@ -8006,7 +8013,7 @@ File: bashref.info, Node: Job Control Variables, Prev: Job Control Builtins, 7.3 Job Control Variables ========================= -'auto_resume' +‘auto_resume’ This variable controls how the shell interacts with the user and job control. If this variable exists then single word simple commands without redirections are treated as candidates for @@ -8014,14 +8021,14 @@ File: bashref.info, Node: Job Control Variables, Prev: Job Control Builtins, there is more than one job beginning with the string typed, then the most recently accessed job will be selected. The name of a stopped job, in this context, is the command line used to start it. - If this variable is set to the value 'exact', the string supplied + If this variable is set to the value ‘exact’, the string supplied must match the name of a stopped job exactly; if set to - 'substring', the string supplied needs to match a substring of the - name of a stopped job. The 'substring' value provides - functionality analogous to the '%?' job ID (*note Job Control + ‘substring’, the string supplied needs to match a substring of the + name of a stopped job. The ‘substring’ value provides + functionality analogous to the ‘%?’ job ID (*note Job Control Basics::). If set to any other value, the supplied string must be a prefix of a stopped job's name; this provides functionality - analogous to the '%' job ID. + analogous to the ‘%’ job ID.  File: bashref.info, Node: Command Line Editing, Next: Using History Interactively, Prev: Job Control, Up: Top @@ -8033,14 +8040,14 @@ This chapter describes the basic features of the GNU command line editing interface. Command line editing is provided by the Readline library, which is used by several different programs, including Bash. Command line editing is enabled by default when using an interactive -shell, unless the '--noediting' option is supplied at shell invocation. -Line editing is also used when using the '-e' option to the 'read' +shell, unless the ‘--noediting’ option is supplied at shell invocation. +Line editing is also used when using the ‘-e’ option to the ‘read’ builtin command (*note Bash Builtins::). By default, the line editing commands are similar to those of Emacs. A vi-style line editing interface is also available. Line editing can be enabled at any time -using the '-o emacs' or '-o vi' options to the 'set' builtin command -(*note The Set Builtin::), or disabled using the '+o emacs' or '+o vi' -options to 'set'. +using the ‘-o emacs’ or ‘-o vi’ options to the ‘set’ builtin command +(*note The Set Builtin::), or disabled using the ‘+o emacs’ or ‘+o vi’ +options to ‘set’. * Menu: @@ -8067,10 +8074,10 @@ File: bashref.info, Node: Introduction and Notation, Next: Readline Interactio The following paragraphs describe the notation used to represent keystrokes. - The text 'C-k' is read as 'Control-K' and describes the character + The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. - The text 'M-k' is read as 'Meta-K' and describes the character + The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the key is pressed. The Meta key is labeled on many keyboards. On keyboards with two keys labeled (usually to either side of the @@ -8081,11 +8088,11 @@ Compose key for typing accented characters. If you do not have a Meta or key, or another key working as a Meta key, the identical keystroke can be generated by typing -_first_, and then typing . Either process is known as "metafying" +_first_, and then typing . Either process is known as “metafying” the key. - The text 'M-C-k' is read as 'Meta-Control-k' and describes the -character produced by "metafying" 'C-k'. + The text ‘M-C-k’ is read as 'Meta-Control-k' and describes the +character produced by “metafying” ‘C-k’. In addition, several keys have their own names. Specifically, , , , , , and all stand for themselves when seen @@ -8132,8 +8139,8 @@ character to back up and delete the mistyped character. Sometimes you may mistype a character, and not notice the error until you have typed several other characters. In that case, you can type -'C-b' to move the cursor to the left, and then correct your mistake. -Afterwards, you can move the cursor to the right with 'C-f'. +‘C-b’ to move the cursor to the left, and then correct your mistake. +Afterwards, you can move the cursor to the right with ‘C-f’. When you add text in the middle of a line, you will notice that characters to the right of the cursor are 'pushed over' to make room for @@ -8142,23 +8149,23 @@ the cursor, characters to the right of the cursor are 'pulled back' to fill in the blank space created by the removal of the text. A list of the bare essentials for editing the text of an input line follows. -'C-b' +‘C-b’ Move back one character. -'C-f' +‘C-f’ Move forward one character. or Delete the character to the left of the cursor. -'C-d' +‘C-d’ Delete the character underneath the cursor. Printing characters Insert the character into the line at the cursor. -'C-_' or 'C-x C-u' +‘C-_’ or ‘C-x C-u’ Undo the last editing command. You can undo all the way back to an empty line. (Depending on your configuration, the key might be set to delete the character to the left of the cursor and the key set to -delete the character underneath the cursor, like 'C-d', rather than the +delete the character underneath the cursor, like ‘C-d’, rather than the character to the left of the cursor.)  @@ -8169,22 +8176,22 @@ File: bashref.info, Node: Readline Movement Commands, Next: Readline Killing C The above table describes the most basic keystrokes that you need in order to do editing of the input line. For your convenience, many other -commands have been added in addition to 'C-b', 'C-f', 'C-d', and . +commands have been added in addition to ‘C-b’, ‘C-f’, ‘C-d’, and . Here are some commands for moving more rapidly about the line. -'C-a' +‘C-a’ Move to the start of the line. -'C-e' +‘C-e’ Move to the end of the line. -'M-f' +‘M-f’ Move forward a word, where a word is composed of letters and digits. -'M-b' +‘M-b’ Move backward a word. -'C-l' +‘C-l’ Clear the screen, reprinting the current line at the top. - Notice how 'C-f' moves forward a character, while 'M-f' moves forward + Notice how ‘C-f’ moves forward a character, while ‘M-f’ moves forward a word. It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words. @@ -8194,15 +8201,15 @@ File: bashref.info, Node: Readline Killing Commands, Next: Readline Arguments, 8.2.3 Readline Killing Commands ------------------------------- -"Killing" text means to delete the text from the line, but to save it -away for later use, usually by "yanking" (re-inserting) it back into the +“Killing” text means to delete the text from the line, but to save it +away for later use, usually by “yanking” (re-inserting) it back into the line. ('Cut' and 'paste' are more recent jargon for 'kill' and 'yank'.) If the description for a command says that it 'kills' text, then you can be sure that you can get the text back in a different (or the same) place later. - When you use a kill command, the text is saved in a "kill-ring". Any + When you use a kill command, the text is saved in a “kill-ring”. Any number of consecutive kills save all of the killed text together, so that when you yank it back, you get it all. The kill ring is not line specific; the text that you killed on a previously typed line is @@ -8210,34 +8217,34 @@ available to be yanked back later, when you are typing another line. Here is the list of commands for killing text. -'C-k' +‘C-k’ Kill the text from the current cursor position to the end of the line. -'M-d' +‘M-d’ Kill from the cursor 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 'M-f'. + as those used by ‘M-f’. -'M-' +‘M-’ Kill from the cursor to the start of the current word, or, if between words, to the start of the previous word. Word boundaries - are the same as those used by 'M-b'. + are the same as those used by ‘M-b’. -'C-w' +‘C-w’ Kill from the cursor to the previous whitespace. This is different - than 'M-' because the word boundaries differ. + than ‘M-’ because the word boundaries differ. - Here is how to "yank" the text back into the line. Yanking means to + Here is how to “yank” the text back into the line. Yanking means to copy the most-recently-killed text from the kill buffer. -'C-y' +‘C-y’ Yank the most recently killed text back into the buffer at the cursor. -'M-y' +‘M-y’ Rotate the kill-ring, and yank the new top. You can only do this - if the prior command is 'C-y' or 'M-y'. + if the prior command is ‘C-y’ or ‘M-y’.  File: bashref.info, Node: Readline Arguments, Next: Searching, Prev: Readline Killing Commands, Up: Readline Interaction @@ -8250,14 +8257,14 @@ argument acts as a repeat count, other times it is the sign of the argument that is significant. If you pass a negative argument to a command which normally acts in a forward direction, that command will act in a backward direction. For example, to kill text back to the -start of the line, you might type 'M-- C-k'. +start of the line, you might type ‘M-- C-k’. The general way to pass numeric arguments to a command is to type meta digits before the command. If the first 'digit' typed is a minus -sign ('-'), then the sign of the argument will be negative. Once you +sign (‘-’), then the sign of the argument will be negative. Once you have typed one meta digit to get the argument started, you can type the remainder of the digits, and then the command. For example, to give the -'C-d' command an argument of 10, you could type 'M-1 0 C-d', which will +‘C-d’ command an argument of 10, you could type ‘M-1 0 C-d’, which will delete the next ten characters on the input line.  @@ -8268,25 +8275,25 @@ File: bashref.info, Node: Searching, Prev: Readline Arguments, Up: Readline I Readline provides commands for searching through the command history (*note Bash History Facilities::) for lines containing a specified -string. There are two search modes: "incremental" and -"non-incremental". +string. There are two search modes: “incremental” and +“non-incremental”. Incremental searches begin before the user has finished typing the search string. As each character of the search string is typed, Readline 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. To search backward in the -history for a particular string, type 'C-r'. Typing 'C-s' searches +history for a particular string, type ‘C-r’. Typing ‘C-s’ searches forward through the history. The characters present in the value of the -'isearch-terminators' variable are used to terminate an incremental +‘isearch-terminators’ variable are used to terminate an incremental search. If that variable has not been assigned a value, the and -'C-J' characters will terminate an incremental search. 'C-g' will abort +‘C-J’ characters will terminate an incremental search. ‘C-g’ will abort an incremental search and restore 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 'C-r' or -'C-s' as appropriate. This will search backward or forward in the + To find other matching entries in the history list, type ‘C-r’ or +‘C-s’ as appropriate. This will search backward or forward in the history for the next entry matching the search string typed so far. Any other key sequence bound to a Readline command will terminate the search and execute that command. For instance, a will terminate the @@ -8294,9 +8301,9 @@ search and accept the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing. - Readline remembers the last incremental search string. If two 'C-r's + Readline remembers the last incremental search string. If two ‘C-r’s are typed without any intervening characters defining a new search -string, any remembered search string is used. +string, Readline uses any remembered search string. Non-incremental searches read the entire search string before starting to search for matching history lines. The search string may be @@ -8311,18 +8318,18 @@ File: bashref.info, Node: Readline Init File, Next: Bindable Readline Commands Although the Readline library comes with a set of Emacs-like keybindings installed by default, it is possible to use a different set of keybindings. Any user can customize programs that use Readline by -putting commands in an "inputrc" file, conventionally in their home +putting commands in an “inputrc” file, conventionally in their home directory. The name of this file is taken from the value of the shell -variable 'INPUTRC'. If that variable is unset, the default is -'~/.inputrc'. If that file does not exist or cannot be read, the -ultimate default is '/etc/inputrc'. The 'bind' builtin command can also +variable ‘INPUTRC’. If that variable is unset, the default is +‘~/.inputrc’. If that file does not exist or cannot be read, the +ultimate default is ‘/etc/inputrc’. The ‘bind’ builtin command can also be used to set Readline keybindings and variables. *Note Bash Builtins::. When a program which uses the Readline library starts up, the init file is read, and the key bindings are set. - In addition, the 'C-x C-r' command re-reads this init file, thus + In addition, the ‘C-x C-r’ command re-reads this init file, thus incorporating any changes that you might have made to it. * Menu: @@ -8340,20 +8347,20 @@ File: bashref.info, Node: Readline Init File Syntax, Next: Conditional Init Co ------------------------------- There are only a few basic constructs allowed in the Readline init file. -Blank lines are ignored. Lines beginning with a '#' are comments. -Lines beginning with a '$' indicate conditional constructs (*note +Blank lines are ignored. Lines beginning with a ‘#’ are comments. +Lines beginning with a ‘$’ indicate conditional constructs (*note Conditional Init Constructs::). Other lines denote variable settings and key bindings. Variable Settings You can modify the run-time behavior of Readline by altering the - values of variables in Readline using the 'set' command within the + values of variables in Readline using the ‘set’ command within the init file. The syntax is simple: set VARIABLE VALUE Here, for example, is how to change from the default Emacs-like key - binding to use 'vi' line editing commands: + binding to use ‘vi’ line editing commands: set editing-mode vi @@ -8364,16 +8371,16 @@ Variable Settings on if the value is null or empty, ON (case-insensitive), or 1. Any other value results in the variable being set to off. - The 'bind -V' command lists the current Readline variable names and + The ‘bind -V’ command lists the current Readline variable names and values. *Note Bash Builtins::. A great deal of run-time behavior is changeable with the following variables. - 'active-region-start-color' + ‘active-region-start-color’ A string variable that controls the text color and background when displaying the text in the active region (see the - description of 'enable-active-region' below). This string + description of ‘enable-active-region’ below). This string must not take up any physical character positions on the display, so it should consist only of terminal escape sequences. It is output to the terminal before displaying the @@ -8381,11 +8388,11 @@ Variable Settings default value whenever the terminal type changes. The default value is the string that puts the terminal in standout mode, as obtained from the terminal's terminfo description. A - sample value might be '\e[01;33m'. + sample value might be ‘\e[01;33m’. - 'active-region-end-color' + ‘active-region-end-color’ A string variable that "undoes" the effects of - 'active-region-start-color' and restores "normal" terminal + ‘active-region-start-color’ and restores "normal" terminal display appearance after displaying text in the active region. This string must not take up any physical character positions on the display, so it should consist only of terminal escape @@ -8394,75 +8401,75 @@ Variable Settings default value whenever the terminal type changes. The default value is the string that restores the terminal from standout mode, as obtained from the terminal's terminfo description. A - sample value might be '\e[0m'. + sample value might be ‘\e[0m’. - 'bell-style' + ‘bell-style’ Controls what happens when Readline wants to ring the terminal - bell. If set to 'none', Readline never rings the bell. If - set to 'visible', Readline uses a visible bell if one is - available. If set to 'audible' (the default), Readline + bell. If set to ‘none’, Readline never rings the bell. If + set to ‘visible’, Readline uses a visible bell if one is + available. If set to ‘audible’ (the default), Readline attempts to ring the terminal's bell. - 'bind-tty-special-chars' - If set to 'on' (the default), Readline attempts to bind the + ‘bind-tty-special-chars’ + If set to ‘on’ (the default), Readline attempts to bind the control characters that are treated specially by the kernel's terminal driver to their Readline equivalents. These override - the default Readline bindings described here. Type 'stty -a' + the default Readline bindings described here. Type ‘stty -a’ at a Bash prompt to see your current terminal settings, - including the special control characters (usually 'cchars'). + including the special control characters (usually ‘cchars’). - 'blink-matching-paren' - If set to 'on', Readline attempts to briefly move the cursor + ‘blink-matching-paren’ + If set to ‘on’, Readline attempts to briefly move the cursor to an opening parenthesis when a closing parenthesis is - inserted. The default is 'off'. + inserted. The default is ‘off’. - 'colored-completion-prefix' - If set to 'on', when listing completions, Readline displays + ‘colored-completion-prefix’ + If set to ‘on’, when listing completions, Readline displays the common prefix of the set of possible completions using a different color. The color definitions are taken from the - value of the 'LS_COLORS' environment variable. If there is a - color definition in 'LS_COLORS' for the custom suffix - 'readline-colored-completion-prefix', Readline uses this color + value of the ‘LS_COLORS’ environment variable. If there is a + color definition in ‘LS_COLORS’ for the custom suffix + ‘readline-colored-completion-prefix’, Readline uses this color for the common prefix instead of its default. The default is - 'off'. + ‘off’. - 'colored-stats' - If set to 'on', Readline displays possible completions using + ‘colored-stats’ + If set to ‘on’, Readline displays possible completions using different colors to indicate their file type. The color - definitions are taken from the value of the 'LS_COLORS' - environment variable. The default is 'off'. + definitions are taken from the value of the ‘LS_COLORS’ + environment variable. The default is ‘off’. - 'comment-begin' + ‘comment-begin’ The string to insert at the beginning of the line when the - 'insert-comment' command is executed. The default value is - '"#"'. + ‘insert-comment’ command is executed. The default value is + ‘"#"’. - 'completion-display-width' + ‘completion-display-width’ The number of screen columns used to display possible matches when performing completion. The value is ignored if it is less than 0 or greater than the terminal screen width. A value of 0 will cause matches to be displayed one per line. The default value is -1. - 'completion-ignore-case' - If set to 'on', Readline performs filename matching and + ‘completion-ignore-case’ + If set to ‘on’, Readline performs filename matching and completion in a case-insensitive fashion. The default value - is 'off'. + is ‘off’. - 'completion-map-case' - If set to 'on', and COMPLETION-IGNORE-CASE is enabled, - Readline treats hyphens ('-') and underscores ('_') as + ‘completion-map-case’ + If set to ‘on’, and COMPLETION-IGNORE-CASE is enabled, + Readline treats hyphens (‘-’) and underscores (‘_’) as equivalent when performing case-insensitive filename matching - and completion. The default value is 'off'. + and completion. The default value is ‘off’. - 'completion-prefix-display-length' + ‘completion-prefix-display-length’ The length in characters of the common prefix of a list of possible completions that is displayed without modification. When set to a value greater than zero, common prefixes longer than this value are replaced with an ellipsis when displaying possible completions. - 'completion-query-items' + ‘completion-query-items’ The number of possible completions that determines when the user is asked whether the list of possibilities should be displayed. If the number of possible completions is greater @@ -8471,88 +8478,88 @@ Variable Settings listed. This variable must be set to an integer value greater than or equal to zero. A zero value means Readline should never ask; negative values are treated as zero. The default - limit is '100'. + limit is ‘100’. - 'convert-meta' - If set to 'on', Readline will convert characters with the + ‘convert-meta’ + If set to ‘on’, Readline will convert characters with the eighth bit set to an ASCII key sequence by stripping the eighth bit and prefixing an character, converting them - to a meta-prefixed key sequence. The default value is 'on', - but will be set to 'off' if the locale is one that contains + to a meta-prefixed key sequence. The default value is ‘on’, + but will be set to ‘off’ if the locale is one that contains eight-bit characters. This variable is dependent on the - 'LC_CTYPE' locale category, and may change if the locale is + ‘LC_CTYPE’ locale category, and may change if the locale is changed. - 'disable-completion' - If set to 'On', Readline will inhibit word completion. + ‘disable-completion’ + If set to ‘On’, Readline will inhibit word completion. Completion characters will be inserted into the line as if - they had been mapped to 'self-insert'. The default is 'off'. + they had been mapped to ‘self-insert’. The default is ‘off’. - 'echo-control-characters' - When set to 'on', on operating systems that indicate they + ‘echo-control-characters’ + When set to ‘on’, on operating systems that indicate they support it, Readline echoes a character corresponding to a - signal generated from the keyboard. The default is 'on'. + signal generated from the keyboard. The default is ‘on’. - 'editing-mode' - The 'editing-mode' variable controls which default set of key + ‘editing-mode’ + The ‘editing-mode’ variable controls which default set of key bindings is used. By default, Readline starts up in Emacs editing mode, where the keystrokes are most similar to Emacs. - This variable can be set to either 'emacs' or 'vi'. + This variable can be set to either ‘emacs’ or ‘vi’. - 'emacs-mode-string' + ‘emacs-mode-string’ If the SHOW-MODE-IN-PROMPT variable is enabled, this string is displayed immediately before the last line of the primary prompt when emacs editing mode is active. The value is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences is available. - Use the '\1' and '\2' escapes to begin and end sequences of + Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal - control sequence into the mode string. The default is '@'. + control sequence into the mode string. The default is ‘@’. - 'enable-active-region' - The "point" is the current cursor position, and "mark" refers + ‘enable-active-region’ + The “point” is the current cursor position, and “mark” refers to a saved cursor position (*note Commands For Moving::). The text between the point and mark is referred to as the - "region". When this variable is set to 'On', Readline allows - certain commands to designate the region as "active". When + “region”. When this variable is set to ‘On’, Readline allows + certain commands to designate the region as “active”. When the region is active, Readline highlights the text in the - region using the value of the 'active-region-start-color', + region using the value of the ‘active-region-start-color’, which defaults to the string that enables the terminal's standout mode. The active region shows the text inserted by bracketed-paste and any matching text found by incremental and - non-incremental history searches. The default is 'On'. + non-incremental history searches. The default is ‘On’. - 'enable-bracketed-paste' - When set to 'On', Readline configures the terminal to insert + ‘enable-bracketed-paste’ + When set to ‘On’, Readline configures the terminal to insert each paste into the editing buffer as a single string of characters, instead of treating each character as if it had been read from the keyboard. This is called putting the - terminal into "bracketed paste mode"; it prevents Readline + terminal into “bracketed paste mode”; it prevents Readline from executing any editing commands bound to key sequences - appearing in the pasted text. The default is 'On'. + appearing in the pasted text. The default is ‘On’. - 'enable-keypad' - When set to 'on', Readline will try to enable the application + ‘enable-keypad’ + When set to ‘on’, Readline will try to enable the application keypad when it is called. Some systems need this to enable - the arrow keys. The default is 'off'. + the arrow keys. The default is ‘off’. - 'enable-meta-key' - When set to 'on', Readline will try to enable any meta + ‘enable-meta-key’ + When set to ‘on’, Readline will try to enable any meta modifier key the terminal claims to support when it is called. On many terminals, the meta key is used to send eight-bit - characters. The default is 'on'. + characters. The default is ‘on’. - 'expand-tilde' - If set to 'on', tilde expansion is performed when Readline - attempts word completion. The default is 'off'. + ‘expand-tilde’ + If set to ‘on’, tilde expansion is performed when Readline + attempts word completion. The default is ‘off’. - 'history-preserve-point' - If set to 'on', the history code attempts to place the point + ‘history-preserve-point’ + If set to ‘on’, the history code attempts to place the point (the current cursor position) at the same location on each - history line retrieved with 'previous-history' or - 'next-history'. The default is 'off'. + history line retrieved with ‘previous-history’ or + ‘next-history’. The default is ‘off’. - 'history-size' + ‘history-size’ Set the maximum number of history entries saved in the history list. If set to zero, any existing history entries are deleted and no new entries are saved. If set to a value less @@ -8561,43 +8568,43 @@ Variable Settings attempt is made to set HISTORY-SIZE to a non-numeric value, the maximum number of history entries will be set to 500. - 'horizontal-scroll-mode' - This variable can be set to either 'on' or 'off'. Setting it - to 'on' means that the text of the lines being edited will + ‘horizontal-scroll-mode’ + This variable can be set to either ‘on’ or ‘off’. Setting it + to ‘on’ means that the text of the lines being edited will scroll horizontally on a single screen line when they are longer than the width of the screen, instead of wrapping onto - a new screen line. This variable is automatically set to 'on' + a new screen line. This variable is automatically set to ‘on’ for terminals of height 1. By default, this variable is set - to 'off'. + to ‘off’. - 'input-meta' - If set to 'on', Readline will enable eight-bit input (it will + ‘input-meta’ + If set to ‘on’, Readline will enable eight-bit input (it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The - default value is 'off', but Readline will set it to 'on' if + default value is ‘off’, but Readline will set it to ‘on’ if the locale contains eight-bit characters. The name - 'meta-flag' is a synonym for this variable. This variable is - dependent on the 'LC_CTYPE' locale category, and may change if + ‘meta-flag’ is a synonym for this variable. This variable is + dependent on the ‘LC_CTYPE’ locale category, and may change if the locale is changed. - 'isearch-terminators' + ‘isearch-terminators’ The string of characters that should terminate an incremental search without subsequently executing the character as a command (*note Searching::). If this variable has not been - given a value, the characters and 'C-J' will terminate + given a value, the characters and ‘C-J’ will terminate an incremental search. - 'keymap' + ‘keymap’ Sets Readline's idea of the current keymap for key binding - commands. Built-in 'keymap' names are 'emacs', - 'emacs-standard', 'emacs-meta', 'emacs-ctlx', 'vi', 'vi-move', - 'vi-command', and 'vi-insert'. 'vi' is equivalent to - 'vi-command' ('vi-move' is also a synonym); 'emacs' is - equivalent to 'emacs-standard'. Applications may add - additional names. The default value is 'emacs'. The value of - the 'editing-mode' variable also affects the default keymap. - - 'keyseq-timeout' + commands. Built-in ‘keymap’ names are ‘emacs’, + ‘emacs-standard’, ‘emacs-meta’, ‘emacs-ctlx’, ‘vi’, ‘vi-move’, + ‘vi-command’, and ‘vi-insert’. ‘vi’ is equivalent to + ‘vi-command’ (‘vi-move’ is also a synonym); ‘emacs’ is + equivalent to ‘emacs-standard’. Applications may add + additional names. The default value is ‘emacs’. The value of + the ‘editing-mode’ variable also affects the default keymap. + + ‘keyseq-timeout’ Specifies the duration Readline 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 @@ -8605,130 +8612,130 @@ Variable Settings input is received within the timeout, Readline will use the shorter but complete key sequence. Readline uses this value to determine whether or not input is available on the current - input source ('rl_instream' by default). The value is + input source (‘rl_instream’ by default). The value is specified in milliseconds, so a value of 1000 means that Readline 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, Readline will wait until another key is pressed to decide which key sequence to complete. The default - value is '500'. + value is ‘500’. - 'mark-directories' - If set to 'on', completed directory names have a slash - appended. The default is 'on'. + ‘mark-directories’ + If set to ‘on’, completed directory names have a slash + appended. The default is ‘on’. - 'mark-modified-lines' - This variable, when set to 'on', causes Readline to display an - asterisk ('*') at the start of history lines which have been - modified. This variable is 'off' by default. + ‘mark-modified-lines’ + This variable, when set to ‘on’, causes Readline to display an + asterisk (‘*’) at the start of history lines which have been + modified. This variable is ‘off’ by default. - 'mark-symlinked-directories' - If set to 'on', completed names which are symbolic links to + ‘mark-symlinked-directories’ + If set to ‘on’, completed names which are symbolic links to directories have a slash appended (subject to the value of - 'mark-directories'). The default is 'off'. + ‘mark-directories’). The default is ‘off’. - 'match-hidden-files' - This variable, when set to 'on', causes Readline to match - files whose names begin with a '.' (hidden files) when - performing filename completion. If set to 'off', the leading - '.' must be supplied by the user in the filename to be - completed. This variable is 'on' by default. + ‘match-hidden-files’ + This variable, when set to ‘on’, forces Readline to match + files whose names begin with a ‘.’ (hidden files) when + performing filename completion. If set to ‘off’, the user + must include the leading ‘.’ in the filename to be completed. + This variable is ‘on’ by default. - 'menu-complete-display-prefix' - If set to 'on', menu completion displays the common prefix of + ‘menu-complete-display-prefix’ + If set to ‘on’, menu completion displays the common prefix of the list of possible completions (which may be empty) before - cycling through the list. The default is 'off'. + cycling through the list. The default is ‘off’. - 'output-meta' - If set to 'on', Readline will display characters with the + ‘output-meta’ + If set to ‘on’, Readline will display characters with the eighth bit set directly rather than as a meta-prefixed escape - sequence. The default is 'off', but Readline will set it to - 'on' if the locale contains eight-bit characters. This - variable is dependent on the 'LC_CTYPE' locale category, and + sequence. The default is ‘off’, but Readline will set it to + ‘on’ if the locale contains eight-bit characters. This + variable is dependent on the ‘LC_CTYPE’ locale category, and may change if the locale is changed. - 'page-completions' - If set to 'on', Readline uses an internal 'more'-like pager to + ‘page-completions’ + If set to ‘on’, Readline uses an internal ‘more’-like pager to display a screenful of possible completions at a time. This - variable is 'on' by default. + variable is ‘on’ by default. - 'print-completions-horizontally' - If set to 'on', Readline will display completions with matches + ‘print-completions-horizontally’ + If set to ‘on’, Readline will display completions with matches sorted horizontally in alphabetical order, rather than down - the screen. The default is 'off'. + the screen. The default is ‘off’. - 'revert-all-at-newline' - If set to 'on', Readline will undo all changes to history - lines before returning when 'accept-line' is executed. By + ‘revert-all-at-newline’ + If set to ‘on’, Readline will undo all changes to history + lines before returning when ‘accept-line’ is executed. By default, history lines may be modified and retain individual - undo lists across calls to 'readline()'. The default is - 'off'. + undo lists across calls to ‘readline()’. The default is + ‘off’. - 'search-ignore-case' - If set to 'on', Readline performs incremental and + ‘search-ignore-case’ + If set to ‘on’, Readline performs incremental and non-incremental history list searches in a case-insensitive - fashion. The default value is 'off'. + fashion. The default value is ‘off’. - 'show-all-if-ambiguous' + ‘show-all-if-ambiguous’ This alters the default behavior of the completion functions. - If set to 'on', words which have more than one possible + If set to ‘on’, words which have more than one possible completion cause the matches to be listed immediately instead - of ringing the bell. The default value is 'off'. + of ringing the bell. The default value is ‘off’. - 'show-all-if-unmodified' + ‘show-all-if-unmodified’ This alters the default behavior of the completion functions in a fashion similar to SHOW-ALL-IF-AMBIGUOUS. If set to - 'on', words which have more than one possible completion + ‘on’, words which have more than one possible completion without any possible partial completion (the possible completions don't share a common prefix) cause the matches to be listed immediately instead of ringing the bell. The - default value is 'off'. + default value is ‘off’. - 'show-mode-in-prompt' - If set to 'on', add a string to the beginning of the prompt + ‘show-mode-in-prompt’ + If set to ‘on’, add a string to the beginning of the prompt indicating the editing mode: emacs, vi command, or vi insertion. The mode strings are user-settable (e.g., - EMACS-MODE-STRING). The default value is 'off'. + EMACS-MODE-STRING). The default value is ‘off’. - 'skip-completed-text' - If set to 'on', this alters the default completion behavior + ‘skip-completed-text’ + If set to ‘on’, 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, Readline 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. For instance, if this is enabled, attempting - completion when the cursor is after the 'e' in 'Makefile' will - result in 'Makefile' rather than 'Makefilefile', assuming + completion when the cursor is after the ‘e’ in ‘Makefile’ will + result in ‘Makefile’ rather than ‘Makefilefile’, assuming there is a single possible completion. The default value is - 'off'. + ‘off’. - 'vi-cmd-mode-string' + ‘vi-cmd-mode-string’ If the SHOW-MODE-IN-PROMPT 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 is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences - is available. Use the '\1' and '\2' escapes to begin and end + is available. Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The - default is '(cmd)'. + default is ‘(cmd)’. - 'vi-ins-mode-string' + ‘vi-ins-mode-string’ If the SHOW-MODE-IN-PROMPT 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. Use the '\1' and '\2' escapes to begin and end + is available. Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The - default is '(ins)'. + default is ‘(ins)’. - 'visible-stats' - If set to 'on', a character denoting a file's type is appended + ‘visible-stats’ + If set to ‘on’, a character denoting a file's type is appended to the filename when listing possible completions. The - default is 'off'. + default is ‘off’. Key Bindings The syntax for controlling key bindings in the init file is simple. @@ -8747,7 +8754,7 @@ Key Bindings In addition to command names, Readline allows keys to be bound to a string that is inserted when the key is pressed (a MACRO). - The 'bind -p' command displays Readline function names and bindings + The ‘bind -p’ command displays Readline function names and bindings in a format that can be put directly into an initialization file. *Note Bash Builtins::. @@ -8758,11 +8765,11 @@ Key Bindings Meta-Rubout: backward-kill-word Control-o: "> output" - In the example above, 'C-u' is bound to the function - 'universal-argument', 'M-DEL' is bound to the function - 'backward-kill-word', and 'C-o' is bound to run the macro + In the example above, ‘C-u’ is bound to the function + ‘universal-argument’, ‘M-DEL’ is bound to the function + ‘backward-kill-word’, and ‘C-o’ is bound to run the macro expressed on the right hand side (that is, to insert the text - '> output' into the line). + ‘> output’ into the line). A number of symbolic character names are recognized while processing this key binding syntax: DEL, ESC, ESCAPE, LFD, @@ -8779,51 +8786,51 @@ Key Bindings "\C-x\C-r": re-read-init-file "\e[11~": "Function Key 1" - In the above example, 'C-u' is again bound to the function - 'universal-argument' (just as it was in the first example), - ''C-x' 'C-r'' is bound to the function 're-read-init-file', - and ' <[> <1> <1> <~>' is bound to insert the text - 'Function Key 1'. + In the above example, ‘C-u’ is again bound to the function + ‘universal-argument’ (just as it was in the first example), + ‘‘C-x’ ‘C-r’’ is bound to the function ‘re-read-init-file’, + and ‘ <[> <1> <1> <~>’ is bound to insert the text + ‘Function Key 1’. The following GNU Emacs style escape sequences are available when specifying key sequences: - '\C-' + ‘\C-’ control prefix - '\M-' + ‘\M-’ meta prefix - '\e' + ‘\e’ an escape character - '\\' + ‘\\’ backslash - '\"' + ‘\"’ <">, a double quotation mark - '\'' + ‘\'’ <'>, a single quote or apostrophe In addition to the GNU Emacs style escape sequences, a second set of backslash escapes is available: - '\a' + ‘\a’ alert (bell) - '\b' + ‘\b’ backspace - '\d' + ‘\d’ delete - '\f' + ‘\f’ form feed - '\n' + ‘\n’ newline - '\r' + ‘\r’ carriage return - '\t' + ‘\t’ horizontal tab - '\v' + ‘\v’ vertical tab - '\NNN' + ‘\NNN’ the eight-bit character whose value is the octal value NNN (one to three digits) - '\xHH' + ‘\xHH’ the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) @@ -8831,8 +8838,8 @@ Key Bindings used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. 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 + character in the macro text, including ‘"’ and ‘'’. For example, + the following binding will make ‘‘C-x’ \’ insert a single ‘\’ into the line: "\C-x\\": "\\" @@ -8847,45 +8854,45 @@ 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 used. -'$if' - The '$if' construct allows bindings to be made based on the editing +‘$if’ + The ‘$if’ construct allows bindings to be made based on the editing mode, the terminal being used, or the application using Readline. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it. - 'mode' - The 'mode=' form of the '$if' directive is used to test - whether Readline is in 'emacs' or 'vi' mode. This may be used - in conjunction with the 'set keymap' command, for instance, to - set bindings in the 'emacs-standard' and 'emacs-ctlx' keymaps - only if Readline is starting out in 'emacs' mode. + ‘mode’ + The ‘mode=’ form of the ‘$if’ directive is used to test + whether Readline is in ‘emacs’ or ‘vi’ mode. This may be used + in conjunction with the ‘set keymap’ command, for instance, to + set bindings in the ‘emacs-standard’ and ‘emacs-ctlx’ keymaps + only if Readline is starting out in ‘emacs’ mode. - 'term' - The 'term=' form may be used to include terminal-specific key + ‘term’ + The ‘term=’ 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 terminal and - the portion of the terminal name before the first '-'. This - allows 'sun' to match both 'sun' and 'sun-cmd', for instance. + ‘=’ is tested against both the full name of the terminal and + the portion of the terminal name before the first ‘-’. This + allows ‘sun’ to match both ‘sun’ and ‘sun-cmd’, for instance. - 'version' - The 'version' test may be used to perform comparisons against - specific Readline versions. The 'version' expands to the + ‘version’ + The ‘version’ test may be used to perform comparisons against + specific Readline versions. The ‘version’ expands to the current Readline version. The set of comparison operators - includes '=' (and '=='), '!=', '<=', '>=', '<', and '>'. The + includes ‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, and ‘>’. The version number supplied on the right side of the operator consists of a major version number, an optional decimal point, - and an optional minor version (e.g., '7.1'). If the minor - version is omitted, it is assumed to be '0'. The operator may - be separated from the string 'version' and from the version + and an optional minor version (e.g., ‘7.1’). If the minor + version is omitted, it is assumed to be ‘0’. The operator may + be separated from the string ‘version’ and from the version number argument by whitespace. The following example sets a variable if the Readline version being used is 7.0 or newer: $if version >= 7.0 set show-mode-in-prompt on $endif - 'application' + ‘application’ The APPLICATION construct is used to include application-specific settings. Each program using the Readline library sets the APPLICATION NAME, and you can test @@ -8898,32 +8905,32 @@ four parser directives used. "\C-xq": "\eb\"\ef\"" $endif - 'variable' + ‘variable’ The VARIABLE construct provides simple equality tests for Readline variables and values. The permitted comparison - operators are '=', '==', and '!='. The variable name must be + 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. Both string and boolean variables may be tested. Boolean variables must be tested against the values ON and OFF. The following example is equivalent to the - 'mode=emacs' test described above: + ‘mode=emacs’ test described above: $if editing-mode == emacs set show-mode-in-prompt on $endif -'$endif' - This command, as seen in the previous example, terminates an '$if' +‘$endif’ + This command, as seen in the previous example, terminates an ‘$if’ command. -'$else' - Commands in this branch of the '$if' directive are executed if the +‘$else’ + Commands in this branch of the ‘$if’ directive are executed if the test fails. -'$include' +‘$include’ This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following - directive reads from '/etc/inputrc': + directive reads from ‘/etc/inputrc’: $include /etc/inputrc  @@ -9053,15 +9060,15 @@ File: bashref.info, Node: Bindable Readline Commands, Next: Readline vi Mode, * Miscellaneous Commands:: Other miscellaneous commands. This section describes Readline commands that may be bound to key -sequences. You can list your key bindings by executing 'bind -P' or, -for a more terse format, suitable for an INPUTRC file, 'bind -p'. +sequences. You can list your key bindings by executing ‘bind -P’ or, +for a more terse format, suitable for an INPUTRC file, ‘bind -p’. (*Note Bash Builtins::.) Command names without an accompanying key sequence are unbound by default. - In the following descriptions, "point" refers to the current cursor -position, and "mark" refers to a cursor position saved by the 'set-mark' + In the following descriptions, “point” refers to the current cursor +position, and “mark” refers to a cursor position saved by the ‘set-mark’ command. The text between the point and mark is referred to as the -"region". +“region”.  File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up: Bindable Readline Commands @@ -9069,58 +9076,58 @@ File: bashref.info, Node: Commands For Moving, Next: Commands For History, Up 8.4.1 Commands For Moving ------------------------- -'beginning-of-line (C-a)' +‘beginning-of-line (C-a)’ Move to the start of the current line. -'end-of-line (C-e)' +‘end-of-line (C-e)’ Move to the end of the line. -'forward-char (C-f)' +‘forward-char (C-f)’ Move forward a character. -'backward-char (C-b)' +‘backward-char (C-b)’ Move back a character. -'forward-word (M-f)' +‘forward-word (M-f)’ Move forward to the end of the next word. Words are composed of letters and digits. -'backward-word (M-b)' +‘backward-word (M-b)’ Move back to the start of the current or previous word. Words are composed of letters and digits. -'shell-forward-word (M-C-f)' +‘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 (M-C-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. -'previous-screen-line ()' +‘previous-screen-line ()’ 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 Readline 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. -'next-screen-line ()' +‘next-screen-line ()’ Attempt to move point to the same physical screen column on the next physical screen line. This will not have the desired effect if the current Readline line does not take up more than one physical line or if the length of the current Readline line is not greater than the length of the prompt plus the screen width. -'clear-display (M-C-l)' +‘clear-display (M-C-l)’ 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. -'clear-screen (C-l)' +‘clear-screen (C-l)’ Clear the screen, then redraw the current line, leaving the current line at the top of the screen. -'redraw-current-line ()' +‘redraw-current-line ()’ Refresh the current line. By default, this is unbound.  @@ -9129,104 +9136,104 @@ File: bashref.info, Node: Commands For History, Next: Commands For Text, Prev 8.4.2 Commands For Manipulating The History ------------------------------------------- -'accept-line (Newline or Return)' +‘accept-line (Newline or Return)’ Accept the line regardless of where the cursor is. If this line is non-empty, add it to the history list according to the setting of - the 'HISTCONTROL' and 'HISTIGNORE' variables. If this line is a + the ‘HISTCONTROL’ and ‘HISTIGNORE’ variables. If this line is a modified history line, then restore the history line to its original state. -'previous-history (C-p)' +‘previous-history (C-p)’ Move 'back' through the history list, fetching the previous command. -'next-history (C-n)' +‘next-history (C-n)’ Move 'forward' through the history list, fetching the next command. -'beginning-of-history (M-<)' +‘beginning-of-history (M-<)’ Move to the first line in the history. -'end-of-history (M->)' +‘end-of-history (M->)’ Move to the end of the input history, i.e., the line currently being entered. -'reverse-search-history (C-r)' +‘reverse-search-history (C-r)’ Search backward starting at the current line and moving 'up' through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the mark. -'forward-search-history (C-s)' +‘forward-search-history (C-s)’ Search forward starting at the current line and moving 'down' through the history as necessary. This is an incremental search. This command sets the region to the matched text and activates the mark. -'non-incremental-reverse-search-history (M-p)' +‘non-incremental-reverse-search-history (M-p)’ Search backward starting at the current line and moving 'up' through the history as necessary using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. -'non-incremental-forward-search-history (M-n)' +‘non-incremental-forward-search-history (M-n)’ Search forward starting at the current line and moving 'down' through the history as necessary using a non-incremental search for a string supplied by the user. The search string may match anywhere in a history line. -'history-search-forward ()' +‘history-search-forward ()’ 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. By default, this command is unbound. -'history-search-backward ()' +‘history-search-backward ()’ Search backward 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. By default, this command is unbound. -'history-substring-search-forward ()' +‘history-substring-search-forward ()’ 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-incremental search. By default, this command is unbound. -'history-substring-search-backward ()' +‘history-substring-search-backward ()’ 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-incremental search. By default, this command is unbound. -'yank-nth-arg (M-C-y)' +‘yank-nth-arg (M-C-y)’ 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 inserts the Nth word from the end of the previous command. Once the - argument N is computed, the argument is extracted as if the '!N' + argument N is computed, the argument is extracted as if the ‘!N’ history expansion had been specified. -'yank-last-arg (M-. or M-_)' +‘yank-last-arg (M-. or M-_)’ Insert last argument to the previous command (the last word of the previous history entry). With a numeric argument, behave exactly - like 'yank-nth-arg'. Successive calls to 'yank-last-arg' move back + like ‘yank-nth-arg’. Successive calls to ‘yank-last-arg’ 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). The history expansion facilities are used to extract the last argument, - as if the '!$' history expansion had been specified. + as if the ‘!$’ history expansion had been specified. -'operate-and-get-next (C-o)' +‘operate-and-get-next (C-o)’ Accept the current line for return to the calling application 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. -'fetch-history ()' +‘fetch-history ()’ 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. @@ -9237,40 +9244,40 @@ File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev 8.4.3 Commands For Changing Text -------------------------------- -'end-of-file (usually C-d)' +‘end-of-file (usually C-d)’ The character indicating end-of-file as set, for example, by - 'stty'. If this character is read when there are no characters on + ‘stty’. If this character is read when there are no characters on the line, and point is at the beginning of the line, Readline interprets it as the end of input and returns EOF. -'delete-char (C-d)' +‘delete-char (C-d)’ Delete the character at point. If this function is bound to the - same character as the tty EOF character, as 'C-d' commonly is, see + same character as the tty EOF character, as ‘C-d’ commonly is, see above for the effects. -'backward-delete-char (Rubout)' +‘backward-delete-char (Rubout)’ Delete the character behind the cursor. A numeric argument means to kill the characters instead of deleting them. -'forward-backward-delete-char ()' +‘forward-backward-delete-char ()’ Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is deleted. By default, this is not bound to a key. -'quoted-insert (C-q or C-v)' +‘quoted-insert (C-q or C-v)’ Add the next character typed to the line verbatim. This is how to - insert key sequences like 'C-q', for example. + insert key sequences like ‘C-q’, for example. -'self-insert (a, b, A, 1, !, ...)' +‘self-insert (a, b, A, 1, !, ...)’ Insert yourself. -'bracketed-paste-begin ()' +‘bracketed-paste-begin ()’ 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 Readline to insert the pasted text as a single unit without treating each character as if it had been read from the keyboard. The characters are inserted as if each one - was bound to 'self-insert' instead of executing any editing + was bound to ‘self-insert’ instead of executing any editing commands. Bracketed paste sets the region (the characters between point and @@ -9278,46 +9285,46 @@ File: bashref.info, Node: Commands For Text, Next: Commands For Killing, Prev mark_: when the mark is active, Readline redisplay uses the terminal's standout mode to denote the region. -'transpose-chars (C-t)' +‘transpose-chars (C-t)’ Drag the character before the cursor forward over the character at the cursor, moving the cursor forward as well. If the insertion point is at the end of the line, then this transposes the last two characters of the line. Negative arguments have no effect. -'transpose-words (M-t)' +‘transpose-words (M-t)’ 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. -'shell-transpose-words (M-C-t)' +‘shell-transpose-words (M-C-t)’ 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 'shell-forward-word' and - 'shell-backward-word'. + boundaries are the same as ‘shell-forward-word’ and + ‘shell-backward-word’. -'upcase-word (M-u)' +‘upcase-word (M-u)’ Uppercase the current (or following) word. With a negative argument, uppercase the previous word, but do not move the cursor. -'downcase-word (M-l)' +‘downcase-word (M-l)’ Lowercase the current (or following) word. With a negative argument, lowercase the previous word, but do not move the cursor. -'capitalize-word (M-c)' +‘capitalize-word (M-c)’ Capitalize the current (or following) word. With a negative argument, capitalize the previous word, but do not move the cursor. -'overwrite-mode ()' +‘overwrite-mode ()’ Toggle overwrite mode. With an explicit positive numeric argument, switches to overwrite mode. With an explicit non-positive numeric argument, switches to insert mode. This command affects only - 'emacs' mode; 'vi' mode does overwrite differently. Each call to - 'readline()' starts in insert mode. + ‘emacs’ mode; ‘vi’ mode does overwrite differently. Each call to + ‘readline()’ starts in insert mode. - In overwrite mode, characters bound to 'self-insert' replace the + In overwrite mode, characters bound to ‘self-insert’ replace the text at point rather than pushing the text to the right. - Characters bound to 'backward-delete-char' replace the character + Characters bound to ‘backward-delete-char’ replace the character before point with a space. By default, this command is unbound. @@ -9328,78 +9335,78 @@ File: bashref.info, Node: Commands For Killing, Next: Numeric Arguments, Prev 8.4.4 Killing And Yanking ------------------------- -'kill-line (C-k)' +‘kill-line (C-k)’ Kill the text from point to the end of the line. With a negative numeric argument, kill backward from the cursor to the beginning of the current line. -'backward-kill-line (C-x Rubout)' +‘backward-kill-line (C-x Rubout)’ Kill backward from the cursor to the beginning of the current line. With a negative numeric argument, kill forward from the cursor to the end of the current line. -'unix-line-discard (C-u)' +‘unix-line-discard (C-u)’ Kill backward from the cursor to the beginning of the current line. -'kill-whole-line ()' +‘kill-whole-line ()’ Kill all characters on the current line, no matter where point is. By default, this is unbound. -'kill-word (M-d)' +‘kill-word (M-d)’ 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 'forward-word'. + as ‘forward-word’. -'backward-kill-word (M-)' +‘backward-kill-word (M-)’ Kill the word behind point. Word boundaries are the same as - 'backward-word'. + ‘backward-word’. -'shell-kill-word (M-C-d)' +‘shell-kill-word (M-C-d)’ 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 'shell-forward-word'. + as ‘shell-forward-word’. -'shell-backward-kill-word ()' +‘shell-backward-kill-word ()’ Kill the word behind point. Word boundaries are the same as - 'shell-backward-word'. + ‘shell-backward-word’. -'unix-word-rubout (C-w)' +‘unix-word-rubout (C-w)’ Kill the word behind point, using white space as a word boundary. The killed text is saved on the kill-ring. -'unix-filename-rubout ()' +‘unix-filename-rubout ()’ Kill the word behind point, using white space and the slash character as the word boundaries. The killed text is saved on the kill-ring. -'delete-horizontal-space ()' +‘delete-horizontal-space ()’ Delete all spaces and tabs around point. By default, this is unbound. -'kill-region ()' +‘kill-region ()’ Kill the text in the current region. By default, this command is unbound. -'copy-region-as-kill ()' +‘copy-region-as-kill ()’ Copy the text in the region to the kill buffer, so it can be yanked right away. By default, this command is unbound. -'copy-backward-word ()' +‘copy-backward-word ()’ Copy the word before point to the kill buffer. The word boundaries - are the same as 'backward-word'. By default, this command is + are the same as ‘backward-word’. By default, this command is unbound. -'copy-forward-word ()' +‘copy-forward-word ()’ Copy the word following point to the kill buffer. The word - boundaries are the same as 'forward-word'. By default, this + boundaries are the same as ‘forward-word’. By default, this command is unbound. -'yank (C-y)' +‘yank (C-y)’ Yank the top of the kill ring into the buffer at point. -'yank-pop (M-y)' +‘yank-pop (M-y)’ Rotate the kill-ring, and yank the new top. You can only do this - if the prior command is 'yank' or 'yank-pop'. + if the prior command is ‘yank’ or ‘yank-pop’.  File: bashref.info, Node: Numeric Arguments, Next: Commands For Completion, Prev: Commands For Killing, Up: Bindable Readline Commands @@ -9407,15 +9414,15 @@ File: bashref.info, Node: Numeric Arguments, Next: Commands For Completion, P 8.4.5 Specifying Numeric Arguments ---------------------------------- -'digit-argument (M-0, M-1, ... M--)' +‘digit-argument (M-0, M-1, ... M--)’ Add this digit to the argument already accumulating, or start a new - argument. 'M--' starts a negative argument. + argument. ‘M--’ starts a negative argument. -'universal-argument ()' +‘universal-argument ()’ 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 followed - by digits, executing 'universal-argument' again ends the numeric + by digits, executing ‘universal-argument’ again ends the numeric argument, but is otherwise ignored. As a special case, if this command is immediately followed by a character that is neither a digit nor minus sign, the argument count for the next command is @@ -9430,101 +9437,101 @@ File: bashref.info, Node: Commands For Completion, Next: Keyboard Macros, Pre 8.4.6 Letting Readline Type For You ----------------------------------- -'complete ()' +‘complete ()’ Attempt to perform completion on the text before point. The actual completion performed is application-specific. Bash attempts completion treating the text as a variable (if the text begins with - '$'), username (if the text begins with '~'), hostname (if the text - begins with '@'), or command (including aliases and functions) in + ‘$’), username (if the text begins with ‘~’), hostname (if the text + begins with ‘@’), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted. -'possible-completions (M-?)' +‘possible-completions (M-?)’ List the possible completions of the text before point. When displaying completions, Readline sets the number of columns used - for display to the value of 'completion-display-width', the value - of the environment variable 'COLUMNS', or the screen width, in that + for display to the value of ‘completion-display-width’, the value + of the environment variable ‘COLUMNS’, or the screen width, in that order. -'insert-completions (M-*)' +‘insert-completions (M-*)’ Insert all completions of the text before point that would have - been generated by 'possible-completions'. + been generated by ‘possible-completions’. -'menu-complete ()' - Similar to 'complete', but replaces the word to be completed with a +‘menu-complete ()’ + Similar to ‘complete’, but replaces the word to be completed with a single match from the list of possible completions. Repeated - execution of 'menu-complete' steps through the list of possible + execution of ‘menu-complete’ steps through the list of possible completions, inserting each match in turn. At the end of the list of completions, the bell is rung (subject to the setting of - 'bell-style') and the original text is restored. An argument of N + ‘bell-style’) and the original text is restored. An argument of N moves N positions forward in the list of matches; a negative argument may be used to move backward through the list. This command is intended to be bound to , but is unbound by default. -'menu-complete-backward ()' - Identical to 'menu-complete', but moves backward through the list - of possible completions, as if 'menu-complete' had been given a +‘menu-complete-backward ()’ + Identical to ‘menu-complete’, but moves backward through the list + of possible completions, as if ‘menu-complete’ had been given a negative argument. -'delete-char-or-list ()' +‘delete-char-or-list ()’ Deletes the character under the cursor if not at the beginning or - end of the line (like 'delete-char'). If at the end of the line, - behaves identically to 'possible-completions'. This command is + end of the line (like ‘delete-char’). If at the end of the line, + behaves identically to ‘possible-completions’. This command is unbound by default. -'complete-filename (M-/)' +‘complete-filename (M-/)’ Attempt filename completion on the text before point. -'possible-filename-completions (C-x /)' +‘possible-filename-completions (C-x /)’ List the possible completions of the text before point, treating it as a filename. -'complete-username (M-~)' +‘complete-username (M-~)’ Attempt completion on the text before point, treating it as a username. -'possible-username-completions (C-x ~)' +‘possible-username-completions (C-x ~)’ List the possible completions of the text before point, treating it as a username. -'complete-variable (M-$)' +‘complete-variable (M-$)’ Attempt completion on the text before point, treating it as a shell variable. -'possible-variable-completions (C-x $)' +‘possible-variable-completions (C-x $)’ List the possible completions of the text before point, treating it as a shell variable. -'complete-hostname (M-@)' +‘complete-hostname (M-@)’ Attempt completion on the text before point, treating it as a hostname. -'possible-hostname-completions (C-x @)' +‘possible-hostname-completions (C-x @)’ List the possible completions of the text before point, treating it as a hostname. -'complete-command (M-!)' +‘complete-command (M-!)’ 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. -'possible-command-completions (C-x !)' +‘possible-command-completions (C-x !)’ List the possible completions of the text before point, treating it as a command name. -'dynamic-complete-history (M-)' +‘dynamic-complete-history (M-)’ Attempt completion on the text before point, comparing the text against lines from the history list for possible completion matches. -'dabbrev-expand ()' +‘dabbrev-expand ()’ Attempt menu completion on the text before point, comparing the text against lines from the history list for possible completion matches. -'complete-into-braces (M-{)' +‘complete-into-braces (M-{)’ Perform filename completion and insert the list of possible completions enclosed within braces so the list is available to the shell (*note Brace Expansion::). @@ -9535,18 +9542,18 @@ File: bashref.info, Node: Keyboard Macros, Next: Miscellaneous Commands, Prev 8.4.7 Keyboard Macros --------------------- -'start-kbd-macro (C-x ()' +‘start-kbd-macro (C-x ()’ Begin saving the characters typed into the current keyboard macro. -'end-kbd-macro (C-x ))' +‘end-kbd-macro (C-x ))’ Stop saving the characters typed into the current keyboard macro and save the definition. -'call-last-kbd-macro (C-x e)' +‘call-last-kbd-macro (C-x e)’ Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard. -'print-last-kbd-macro ()' +‘print-last-kbd-macro ()’ Print the last keyboard macro defined in a format suitable for the INPUTRC file. @@ -9556,53 +9563,53 @@ File: bashref.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: 8.4.8 Some Miscellaneous Commands --------------------------------- -'re-read-init-file (C-x C-r)' +‘re-read-init-file (C-x C-r)’ Read in the contents of the INPUTRC file, and incorporate any bindings or variable assignments found there. -'abort (C-g)' +‘abort (C-g)’ Abort the current editing command and ring the terminal's bell - (subject to the setting of 'bell-style'). + (subject to the setting of ‘bell-style’). -'do-lowercase-version (M-A, M-B, M-X, ...)' +‘do-lowercase-version (M-A, M-B, M-X, ...)’ If the metafied character X is upper case, run the command that is bound to the corresponding metafied lower case character. The behavior is undefined if X is already lower case. -'prefix-meta ()' +‘prefix-meta ()’ Metafy the next character typed. This is for keyboards without a - meta key. Typing ' f' is equivalent to typing 'M-f'. + meta key. Typing ‘ f’ is equivalent to typing ‘M-f’. -'undo (C-_ or C-x C-u)' +‘undo (C-_ or C-x C-u)’ Incremental undo, separately remembered for each line. -'revert-line (M-r)' +‘revert-line (M-r)’ Undo all changes made to this line. This is like executing the - 'undo' command enough times to get back to the beginning. + ‘undo’ command enough times to get back to the beginning. -'tilde-expand (M-&)' +‘tilde-expand (M-&)’ Perform tilde expansion on the current word. -'set-mark (C-@)' +‘set-mark (C-@)’ Set the mark to the point. If a numeric argument is supplied, the mark is set to that position. -'exchange-point-and-mark (C-x C-x)' +‘exchange-point-and-mark (C-x C-x)’ Swap the point with the mark. The current cursor position is set to the saved position, and the old cursor position is saved as the mark. -'character-search (C-])' +‘character-search (C-])’ A character is read and point is moved to the next occurrence of that character. A negative argument searches for previous occurrences. -'character-search-backward (M-C-])' +‘character-search-backward (M-C-])’ A character is read and point is moved to the previous occurrence of that character. A negative argument searches for subsequent occurrences. -'skip-csi-sequence ()' +‘skip-csi-sequence ()’ Read enough characters to consume a multi-key sequence such as those defined for keys like Home and End. Such sequences begin with a Control Sequence Indicator (CSI), usually ESC-[. If this @@ -9611,92 +9618,93 @@ File: bashref.info, Node: Miscellaneous Commands, Prev: Keyboard Macros, Up: inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC-[. -'insert-comment (M-#)' - Without a numeric argument, the value of the 'comment-begin' +‘insert-comment (M-#)’ + Without a numeric argument, the value of the ‘comment-begin’ variable is inserted 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 - 'comment-begin', the value is inserted, otherwise the characters in - 'comment-begin' are deleted from the beginning of the line. In + ‘comment-begin’, the value is inserted, otherwise the characters in + ‘comment-begin’ are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed. - The default value of 'comment-begin' causes this command to make + The default value of ‘comment-begin’ 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 executed by the shell. -'dump-functions ()' +‘dump-functions ()’ Print all of the functions and their key bindings to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. -'dump-variables ()' +‘dump-variables ()’ Print all of the settable variables and their values to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. -'dump-macros ()' +‘dump-macros ()’ Print all of the Readline key sequences bound to macros and the strings they output. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an INPUTRC file. This command is unbound by default. -'spell-correct-word (C-x s)' +‘spell-correct-word (C-x s)’ Perform spelling correction on the current word, treating it as a - directory or filename, in the same way as the 'cdspell' shell + directory or filename, in the same way as the ‘cdspell’ shell option. Word boundaries are the same as those used by - 'shell-forward-word'. + ‘shell-forward-word’. -'glob-complete-word (M-g)' +‘glob-complete-word (M-g)’ The word before point is treated as a pattern for pathname expansion, with an asterisk implicitly appended. This pattern is used to generate a list of matching file names for possible completions. -'glob-expand-word (C-x *)' +‘glob-expand-word (C-x *)’ The word before point is treated as a pattern for pathname expansion, and the list of matching file names is inserted, - replacing the word. If a numeric argument is supplied, a '*' is + replacing the word. If a numeric argument is supplied, a ‘*’ is appended before pathname expansion. -'glob-list-expansions (C-x g)' +‘glob-list-expansions (C-x g)’ The list of expansions that would have been generated by - 'glob-expand-word' is displayed, and the line is redrawn. If a - numeric argument is supplied, a '*' is appended before pathname + ‘glob-expand-word’ is displayed, and the line is redrawn. If a + numeric argument is supplied, a ‘*’ is appended before pathname expansion. -'display-shell-version (C-x C-v)' +‘display-shell-version (C-x C-v)’ Display version information about the current instance of Bash. -'shell-expand-line (M-C-e)' +‘shell-expand-line (M-C-e)’ 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, - word splitting, and quote removal. + command and proces substitution, word splitting, and quote removal. + An explicit argument suppresses command and process substitution. -'history-expand-line (M-^)' +‘history-expand-line (M-^)’ Perform history expansion on the current line. -'magic-space ()' +‘magic-space ()’ Perform history expansion on the current line and insert a space (*note History Interaction::). -'alias-expand-line ()' +‘alias-expand-line ()’ Perform alias expansion on the current line (*note Aliases::). -'history-and-alias-expand-line ()' +‘history-and-alias-expand-line ()’ Perform history and alias expansion on the current line. -'insert-last-argument (M-. or M-_)' - A synonym for 'yank-last-arg'. +‘insert-last-argument (M-. or M-_)’ + A synonym for ‘yank-last-arg’. -'edit-and-execute-command (C-x C-e)' +‘edit-and-execute-command (C-x C-e)’ Invoke an editor on the current command line, and execute the - result as shell commands. Bash attempts to invoke '$VISUAL', - '$EDITOR', and 'emacs' as the editor, in that order. + result as shell commands. Bash attempts to invoke ‘$VISUAL’, + ‘$EDITOR’, and ‘emacs’ as the editor, in that order. -'execute-named-command (M-x)' +‘execute-named-command (M-x)’ Read a bindable readline 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 supplied @@ -9709,19 +9717,19 @@ File: bashref.info, Node: Readline vi Mode, Next: Programmable Completion, Pr 8.5 Readline vi Mode ==================== -While the Readline library does not have a full set of 'vi' editing +While the Readline library does not have a full set of ‘vi’ editing functions, it does contain enough to allow simple editing of the line. -The Readline 'vi' mode behaves as specified in the POSIX standard. +The Readline ‘vi’ mode behaves as specified in the POSIX standard. - In order to switch interactively between 'emacs' and 'vi' editing -modes, use the 'set -o emacs' and 'set -o vi' commands (*note The Set -Builtin::). The Readline default is 'emacs' mode. + In order to switch interactively between ‘emacs’ and ‘vi’ editing +modes, use the ‘set -o emacs’ and ‘set -o vi’ commands (*note The Set +Builtin::). The Readline default is ‘emacs’ mode. - When you enter a line in 'vi' mode, you are already placed in -'insertion' mode, as if you had typed an 'i'. Pressing switches + When you enter a line in ‘vi’ mode, you are already placed in +'insertion' mode, as if you had typed an ‘i’. Pressing switches you into 'command' mode, where you can edit the text of the line with -the standard 'vi' movement keys, move to previous history lines with 'k' -and subsequent lines with 'j', and so forth. +the standard ‘vi’ movement keys, move to previous history lines with ‘k’ +and subsequent lines with ‘j’, and so forth.  File: bashref.info, Node: Programmable Completion, Next: Programmable Completion Builtins, Prev: Readline vi Mode, Up: Command Line Editing @@ -9731,19 +9739,19 @@ File: bashref.info, Node: Programmable Completion, Next: Programmable Completi When word completion is attempted for an argument to a command for which a completion specification (a COMPSPEC) has been defined using the -'complete' builtin (*note Programmable Completion Builtins::), the +‘complete’ builtin (*note Programmable Completion Builtins::), the programmable completion facilities are invoked. First, the command name is identified. If a compspec has been defined 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), any -compspec defined with the '-E' option to 'complete' is used. If the +compspec defined with the ‘-E’ option to ‘complete’ is used. If the command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. If those searches do not result in a compspec, any compspec -defined with the '-D' option to 'complete' is used as the default. If +defined with the ‘-D’ option to ‘complete’ is used as the default. If there is no default compspec, Bash attempts alias expansion on the command word as a final resort, and attempts to find a compspec for the command word from any successful expansion @@ -9754,20 +9762,20 @@ described above (*note Commands For Completion::) is performed. First, the actions specified by the compspec are used. Only matches which are prefixed by the word being completed are returned. When the -'-f' or '-d' option is used for filename or directory name completion, -the shell variable 'FIGNORE' is used to filter the matches. *Note Bash -Variables::, for a description of 'FIGNORE'. +‘-f’ or ‘-d’ option is used for filename or directory name completion, +the shell variable ‘FIGNORE’ is used to filter the matches. *Note Bash +Variables::, for a description of ‘FIGNORE’. - Any completions specified by a filename expansion pattern to the '-G' + Any completions specified by a filename expansion pattern to the ‘-G’ option are generated next. The words generated by the pattern need not -match the word being completed. The 'GLOBIGNORE' shell variable is not -used to filter the matches, but the 'FIGNORE' shell variable is used. +match the word being completed. The ‘GLOBIGNORE’ shell variable is not +used to filter the matches, but the ‘FIGNORE’ shell variable is used. - Next, the string specified as the argument to the '-W' option is -considered. The string is first split using the characters in the 'IFS' + Next, the string specified as the argument to the ‘-W’ option is +considered. The string is first split using the characters in the ‘IFS’ special variable as delimiters. Shell quoting is honored within the string, in order to provide a mechanism for the words to contain shell -metacharacters or characters in the value of 'IFS'. Each word is then +metacharacters or characters in the value of ‘IFS’. Each word is then expanded using brace expansion, tilde expansion, parameter and variable expansion, command substitution, and arithmetic expansion, as described above (*note Shell Expansions::). The results are split using the rules @@ -9776,11 +9784,11 @@ are prefix-matched against the word being completed, and the matching words become the possible completions. After these matches have been generated, any shell function or -command specified with the '-F' and '-C' options is invoked. When the -command or function is invoked, the 'COMP_LINE', 'COMP_POINT', -'COMP_KEY', and 'COMP_TYPE' variables are assigned values as described +command specified with the ‘-F’ and ‘-C’ options is invoked. When the +command or function is invoked, the ‘COMP_LINE’, ‘COMP_POINT’, +‘COMP_KEY’, and ‘COMP_TYPE’ variables are assigned values as described above (*note Bash Variables::). If a shell function is being invoked, -the 'COMP_WORDS' and 'COMP_CWORD' variables are also set. When the +the ‘COMP_WORDS’ and ‘COMP_CWORD’ variables are also set. When the function or command is invoked, the first argument ($1) is the name of the command whose arguments are being completed, the second argument ($2) is the word being completed, and the third argument ($3) is the @@ -9789,49 +9797,49 @@ filtering of the generated completions against the word being completed is performed; the function or command has complete freedom in generating the matches. - Any function specified with '-F' is invoked first. The function may -use any of the shell facilities, including the 'compgen' and 'compopt' + Any function specified with ‘-F’ is invoked first. The function may +use any of the shell facilities, including the ‘compgen’ and ‘compopt’ builtins described below (*note Programmable Completion Builtins::), to generate the matches. It must put the possible completions in the -'COMPREPLY' array variable, one per array element. +‘COMPREPLY’ array variable, one per array element. - Next, any command specified with the '-C' option is invoked in an + Next, any command specified with the ‘-C’ option is invoked in an environment equivalent to command substitution. It should print a list of completions, one per line, to the standard output. Backslash may be used to escape a newline, if necessary. After all of the possible completions are generated, any filter -specified with the '-X' option is applied to 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 +specified with the ‘-X’ option is applied to 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 will be removed from the list. -A leading '!' negates the pattern; in this case any completion not -matching the pattern will be removed. If the 'nocasematch' shell option -(see the description of 'shopt' in *note The Shopt Builtin::) is +A leading ‘!’ negates the pattern; in this case any completion not +matching the pattern will be removed. If the ‘nocasematch’ shell option +(see the description of ‘shopt’ in *note The Shopt Builtin::) is enabled, the match is performed without regard to the case of alphabetic characters. - Finally, any prefix and suffix specified with the '-P' and '-S' + Finally, any prefix and suffix specified with the ‘-P’ and ‘-S’ options are added to each member of the completion list, and the result is returned to the Readline completion code as the list of possible completions. If the previously-applied actions do not generate any matches, and -the '-o dirnames' option was supplied to 'complete' when the compspec +the ‘-o dirnames’ option was supplied to ‘complete’ when the compspec was defined, directory name completion is attempted. - If the '-o plusdirs' option was supplied to 'complete' when the + If the ‘-o plusdirs’ option was supplied to ‘complete’ when the compspec was defined, directory name completion is attempted and any matches are added to the results of the other actions. 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 Bash completions are not attempted, and the Readline default of -filename completion is disabled. If the '-o bashdefault' option was -supplied to 'complete' when the compspec was defined, the default Bash +filename completion is disabled. If the ‘-o bashdefault’ option was +supplied to ‘complete’ when the compspec was defined, the default Bash completions are attempted if the compspec generates no matches. If the -'-o default' option was supplied to 'complete' when the compspec was +‘-o default’ option was supplied to ‘complete’ when the compspec was defined, Readline's default completion will be performed if the compspec (and, if attempted, the default Bash completions) generate no matches. @@ -9843,7 +9851,7 @@ setting of the MARK-SYMLINKED-DIRECTORIES Readline variable. There is some support for dynamically modifying completions. This is most useful when used in combination with a default completion specified -with '-D'. It's possible for shell functions executed as completion +with ‘-D’. It's possible for shell functions executed as completion handlers 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 @@ -9874,19 +9882,19 @@ completion facilities: one to specify how the arguments to a particular command are to be completed, and two to modify the completion as it is happening. -'compgen' +‘compgen’ compgen [-V VARNAME] [OPTION] [WORD] Generate possible completion matches for WORD according to the - OPTIONs, which may be any option accepted by the 'complete' builtin - with the exceptions of '-p', '-r', '-D', '-E', and '-I', and write + OPTIONs, which may be any option accepted by the ‘complete’ builtin + with the exceptions of ‘-p’, ‘-r’, ‘-D’, ‘-E’, and ‘-I’, and write the matches to the standard output. - If the '-V' option is supplied, 'compgen' stores the generated + If the ‘-V’ option is supplied, ‘compgen’ stores the generated completions into the indexed array variable VARNAME instead of writing them to the standard output. - When using the '-F' or '-C' options, the various shell variables + When using the ‘-F’ or ‘-C’ options, the various shell variables set by the programmable completion facilities, while available, will not have useful values. @@ -9898,29 +9906,29 @@ happening. The return value is true unless an invalid option is supplied, or no matches were generated. -'complete' +‘complete’ complete [-abcdefgjksuv] [-o COMP-OPTION] [-DEI] [-A ACTION] [-G GLOBPAT] [-W WORDLIST] [-F FUNCTION] [-C COMMAND] [-X FILTERPAT] [-P PREFIX] [-S SUFFIX] NAME [NAME ...] complete -pr [-DEI] [NAME ...] Specify how arguments to each NAME should be completed. If the - '-p' option is supplied, or if no options are supplied, existing - completion specifications are printed in a way that allows them to - be reused as input. The '-r' option removes a completion + ‘-p’ option is supplied, or if no options or NAMEs are supplied, + existing completion specifications are printed in a way that allows + them to be reused as input. The ‘-r’ option removes a completion specification for each NAME, or, if no NAMEs are supplied, all - completion specifications. The '-D' option indicates that other + completion specifications. The ‘-D’ option indicates that other supplied options and actions should apply to the "default" command completion; that is, completion attempted on a command for which no - completion has previously been defined. The '-E' option indicates + completion has previously been defined. The ‘-E’ option indicates that other supplied options and actions should apply to "empty" command completion; that is, completion attempted on a blank line. - The '-I' option indicates that other supplied options and actions + The ‘-I’ 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 + the line, or after a command delimiter such as ‘;’ or ‘|’, which is usually command name completion. If multiple options are supplied, - the '-D' option takes precedence over '-E', and both take - precedence over '-I'. If any of '-D', '-E', or '-I' are supplied, + the ‘-D’ option takes precedence over ‘-E’, and both take + precedence over ‘-I’. If any of ‘-D’, ‘-E’, or ‘-I’ are supplied, any other NAME arguments are ignored; these completions only apply to the case specified by the option. @@ -9929,206 +9937,206 @@ happening. Completion::). Other options, if specified, have the following meanings. The - arguments to the '-G', '-W', and '-X' options (and, if necessary, - the '-P' and '-S' options) should be quoted to protect them from - expansion before the 'complete' builtin is invoked. + arguments to the ‘-G’, ‘-W’, and ‘-X’ options (and, if necessary, + the ‘-P’ and ‘-S’ options) should be quoted to protect them from + expansion before the ‘complete’ builtin is invoked. - '-o COMP-OPTION' + ‘-o COMP-OPTION’ The COMP-OPTION controls several aspects of the compspec's behavior beyond the simple generation of completions. COMP-OPTION may be one of: - 'bashdefault' + ‘bashdefault’ Perform the rest of the default Bash completions if the compspec generates no matches. - 'default' + ‘default’ Use Readline's default filename completion if the compspec generates no matches. - 'dirnames' + ‘dirnames’ Perform directory name completion if the compspec generates no matches. - 'filenames' + ‘filenames’ Tell Readline that the compspec generates filenames, so it can perform any filename-specific processing (like adding a slash to directory names, quoting special characters, or suppressing trailing spaces). This option is intended to be used with shell functions specified - with '-F'. + with ‘-F’. - 'fullquote' + ‘fullquote’ Tell Readline to quote all the completed words even if they are not filenames. - 'noquote' + ‘noquote’ Tell Readline not to quote the completed words if they are filenames (quoting filenames is the default). - 'nosort' + ‘nosort’ Tell Readline not to sort the list of possible completions alphabetically. - 'nospace' + ‘nospace’ Tell Readline not to append a space (the default) to words completed at the end of the line. - 'plusdirs' + ‘plusdirs’ After any matches defined by the compspec are generated, directory name completion is attempted and any matches are added to the results of the other actions. - '-A ACTION' + ‘-A ACTION’ The ACTION may be one of the following to generate a list of possible completions: - 'alias' - Alias names. May also be specified as '-a'. + ‘alias’ + Alias names. May also be specified as ‘-a’. - 'arrayvar' + ‘arrayvar’ Array variable names. - 'binding' + ‘binding’ Readline key binding names (*note Bindable Readline Commands::). - 'builtin' + ‘builtin’ Names of shell builtin commands. May also be specified - as '-b'. + as ‘-b’. - 'command' - Command names. May also be specified as '-c'. + ‘command’ + Command names. May also be specified as ‘-c’. - 'directory' - Directory names. May also be specified as '-d'. + ‘directory’ + Directory names. May also be specified as ‘-d’. - 'disabled' + ‘disabled’ Names of disabled shell builtins. - 'enabled' + ‘enabled’ Names of enabled shell builtins. - 'export' + ‘export’ Names of exported shell variables. May also be specified - as '-e'. + as ‘-e’. - 'file' - File names. May also be specified as '-f'. + ‘file’ + File names. May also be specified as ‘-f’. - 'function' + ‘function’ Names of shell functions. - 'group' - Group names. May also be specified as '-g'. + ‘group’ + Group names. May also be specified as ‘-g’. - 'helptopic' - Help topics as accepted by the 'help' builtin (*note Bash + ‘helptopic’ + Help topics as accepted by the ‘help’ builtin (*note Bash Builtins::). - 'hostname' + ‘hostname’ Hostnames, as taken from the file specified by the - 'HOSTFILE' shell variable (*note Bash Variables::). + ‘HOSTFILE’ shell variable (*note Bash Variables::). - 'job' + ‘job’ Job names, if job control is active. May also be - specified as '-j'. + specified as ‘-j’. - 'keyword' - Shell reserved words. May also be specified as '-k'. + ‘keyword’ + Shell reserved words. May also be specified as ‘-k’. - 'running' + ‘running’ Names of running jobs, if job control is active. - 'service' - Service names. May also be specified as '-s'. + ‘service’ + Service names. May also be specified as ‘-s’. - 'setopt' - Valid arguments for the '-o' option to the 'set' builtin + ‘setopt’ + Valid arguments for the ‘-o’ option to the ‘set’ builtin (*note The Set Builtin::). - 'shopt' - Shell option names as accepted by the 'shopt' builtin + ‘shopt’ + Shell option names as accepted by the ‘shopt’ builtin (*note Bash Builtins::). - 'signal' + ‘signal’ Signal names. - 'stopped' + ‘stopped’ Names of stopped jobs, if job control is active. - 'user' - User names. May also be specified as '-u'. + ‘user’ + User names. May also be specified as ‘-u’. - 'variable' + ‘variable’ Names of all shell variables. May also be specified as - '-v'. + ‘-v’. - '-C COMMAND' + ‘-C COMMAND’ COMMAND is executed in a subshell environment, and its output is used as the possible completions. Arguments are passed as - with the '-F' option. + with the ‘-F’ option. - '-F FUNCTION' + ‘-F FUNCTION’ The shell function FUNCTION is executed in the current shell environment. When it is executed, $1 is the name of the command whose arguments are being completed, $2 is the word being completed, and $3 is the word preceding the word being completed, as described above (*note Programmable Completion::). When it finishes, the possible completions are - retrieved from the value of the 'COMPREPLY' array variable. + retrieved from the value of the ‘COMPREPLY’ array variable. - '-G GLOBPAT' + ‘-G GLOBPAT’ The filename expansion pattern GLOBPAT is expanded to generate the possible completions. - '-P PREFIX' + ‘-P PREFIX’ PREFIX is added at the beginning of each possible completion after all other options have been applied. - '-S SUFFIX' + ‘-S SUFFIX’ SUFFIX is appended to each possible completion after all other options have been applied. - '-W WORDLIST' - The WORDLIST is split using the characters in the 'IFS' + ‘-W WORDLIST’ + The WORDLIST is split using the characters in the ‘IFS’ special variable as delimiters, and each resultant word is expanded. The possible completions are the members of the resultant list which match the word being completed. - '-X FILTERPAT' + ‘-X FILTERPAT’ FILTERPAT is a pattern as used for filename expansion. It is applied to the list of possible completions generated by the preceding options and arguments, and each completion matching - FILTERPAT is removed from the list. A leading '!' in + FILTERPAT is removed from the list. A leading ‘!’ in FILTERPAT negates the pattern; in this case, any completion not matching FILTERPAT is removed. The return value is true unless an invalid option is supplied, an - option other than '-p', '-r', '-D', '-E', or '-I' is supplied + option other than ‘-p’, ‘-r’, ‘-D’, ‘-E’, or ‘-I’ is supplied without a NAME argument, an attempt is made to remove a completion specification for a NAME for which no specification exists, or an error occurs adding a completion specification. -'compopt' +‘compopt’ compopt [-o OPTION] [-DEI] [+o OPTION] [NAME] Modify completion options for each NAME according to the OPTIONs, or for the currently-executing completion if no NAMEs are supplied. If no OPTIONs are given, display the completion options for each NAME or the current completion. The possible values of OPTION are - those valid for the 'complete' builtin described above. The '-D' + those valid for the ‘complete’ builtin described above. The ‘-D’ option indicates that other supplied options should apply to the "default" command completion; that is, completion attempted on a command for which no completion has previously been defined. The - '-E' option indicates that other supplied options should apply to + ‘-E’ option indicates that other supplied options should apply to "empty" command completion; that is, completion attempted on a - blank line. The '-I' option indicates that other supplied options + blank line. The ‘-I’ option indicates that other supplied options should apply to completion on the initial non-assignment word on - the line, or after a command delimiter such as ';' or '|', which is + the line, or after a command delimiter such as ‘;’ or ‘|’, which is usually command name completion. - If multiple options are supplied, the '-D' option takes precedence - over '-E', and both take precedence over '-I' + If multiple options are supplied, the ‘-D’ option takes precedence + over ‘-E’, and both take precedence over ‘-I’ The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a NAME for which no @@ -10141,23 +10149,23 @@ File: bashref.info, Node: A Programmable Completion Example, Prev: Programmabl ===================================== The most common way to obtain additional completion functionality beyond -the default actions 'complete' and 'compgen' provide is to use a shell -function and bind it to a particular command using 'complete -F'. +the default actions ‘complete’ and ‘compgen’ provide is to use a shell +function and bind it to a particular command using ‘complete -F’. - The following function provides completions for the 'cd' builtin. It + The following function provides completions for the ‘cd’ builtin. It is a reasonably good example of what shell functions must do when used -for completion. This function uses the word passed as '$2' to determine -the directory name to complete. You can also use the 'COMP_WORDS' array -variable; the current word is indexed by the 'COMP_CWORD' variable. +for completion. This function uses the word passed as ‘$2’ to determine +the directory name to complete. You can also use the ‘COMP_WORDS’ array +variable; the current word is indexed by the ‘COMP_CWORD’ variable. - The function relies on the 'complete' and 'compgen' builtins to do -much of the work, adding only the things that the Bash 'cd' does beyond + The function relies on the ‘complete’ and ‘compgen’ builtins to do +much of the work, adding only the things that the Bash ‘cd’ does beyond accepting basic directory names: tilde expansion (*note Tilde Expansion::), searching directories in $CDPATH, which is described above -(*note Bourne Shell Builtins::), and basic support for the 'cdable_vars' -shell option (*note The Shopt Builtin::). '_comp_cd' modifies the value +(*note Bourne Shell Builtins::), and basic support for the ‘cdable_vars’ +shell option (*note The Shopt Builtin::). ‘_comp_cd’ modifies the value of IFS so that it contains only a newline to accommodate file names -containing spaces and tabs - 'compgen' prints the possible completions +containing spaces and tabs - ‘compgen’ prints the possible completions it generates one per line. Possible completions go into the COMPREPLY array variable, one @@ -10211,8 +10219,8 @@ retrieves the completions from there when the function returns. return 0 } - We install the completion function using the '-F' option to -'complete': + We install the completion function using the ‘-F’ option to +‘complete’: # Tell readline to quote appropriate and append slashes to directories; # use the bash default completion for other arguments @@ -10220,22 +10228,22 @@ retrieves the completions from there when the function returns. Since we'd like Bash and Readline to take care of some of the other details for us, we use several other options to tell Bash and Readline -what to do. The '-o filenames' option tells Readline that the possible +what to do. The ‘-o filenames’ option tells Readline that the possible completions should be treated as filenames, and quoted appropriately. That option will also cause Readline to append a slash to filenames it can determine are directories (which is why we might want to extend -'_comp_cd' to append a slash if we're using directories found via -CDPATH: Readline can't tell those completions are directories). The '-o -nospace' option tells Readline to not append a space character to the -directory name, in case we want to append to it. The '-o bashdefault' +‘_comp_cd’ to append a slash if we're using directories found via +CDPATH: Readline can't tell those completions are directories). The ‘-o +nospace’ option tells Readline to not append a space character to the +directory name, in case we want to append to it. The ‘-o bashdefault’ option brings in the rest of the "Bash default" completions - possible completions that Bash adds to the default Readline set. These include things like command name completion, variable completion for words -beginning with '$' or '${', completions containing pathname expansion +beginning with ‘$’ or ‘${’, completions containing pathname expansion patterns (*note Filename Expansion::), and so on. - Once installed using 'complete', '_comp_cd' will be called every time -we attempt word completion for a 'cd' command. + Once installed using ‘complete’, ‘_comp_cd’ will be called every time +we attempt word completion for a ‘cd’ command. Many more examples - an extensive collection of completions for most of the common GNU, Unix, and Linux commands - are available as part of @@ -10245,7 +10253,7 @@ project now lives at . There are ports for other systems such as Solaris and Mac OS X. An older version of the bash_completion package is distributed with -bash in the 'examples/complete' subdirectory. +bash in the ‘examples/complete’ subdirectory.  File: bashref.info, Node: Using History Interactively, Next: Installing Bash, Prev: Command Line Editing, Up: Top @@ -10272,52 +10280,52 @@ File: bashref.info, Node: Bash History Facilities, Next: Bash History Builtins 9.1 Bash History Facilities =========================== -When the '-o history' option to the 'set' builtin is enabled (*note The -Set Builtin::), the shell provides access to the "command history", the -list of commands previously typed. The value of the 'HISTSIZE' shell +When the ‘-o history’ option to the ‘set’ builtin is enabled (*note The +Set Builtin::), the shell provides access to the “command history”, the +list of commands previously typed. The value of the ‘HISTSIZE’ shell variable is used as the number of commands to save in a history list. -The text of the last '$HISTSIZE' commands (default 500) is saved. The +The text of the last ‘$HISTSIZE’ commands (default 500) is saved. The shell stores each command in the history list prior to parameter and variable expansion but after history expansion is performed, subject to -the values of the shell variables 'HISTIGNORE' and 'HISTCONTROL'. +the values of the shell variables ‘HISTIGNORE’ and ‘HISTCONTROL’. When the shell starts up, the history is initialized from the file -named by the 'HISTFILE' variable (default '~/.bash_history'). The file -named by the value of 'HISTFILE' is truncated, if necessary, to contain +named by the ‘HISTFILE’ variable (default ‘~/.bash_history’). The file +named by the value of ‘HISTFILE’ is truncated, if necessary, to contain no more than the number of lines specified by the value of the -'HISTFILESIZE' variable. When a shell with history enabled exits, the -last '$HISTSIZE' lines are copied from the history list to the file -named by '$HISTFILE'. If the 'histappend' shell option is set (*note +‘HISTFILESIZE’ variable. When a shell with history enabled exits, the +last ‘$HISTSIZE’ lines are copied from the history list to the file +named by ‘$HISTFILE’. If the ‘histappend’ shell option is set (*note Bash Builtins::), the lines are appended to the history file, otherwise -the history file is overwritten. If 'HISTFILE' is unset or null, or if +the history file is overwritten. If ‘HISTFILE’ is unset or null, or if the history file is unwritable, the history is not saved. After saving the history, the history file is truncated to contain no more than -'$HISTFILESIZE' lines. If 'HISTFILESIZE' is unset, or set to null, a +‘$HISTFILESIZE’ lines. If ‘HISTFILESIZE’ is unset, or set to null, a non-numeric value, or a numeric value less than zero, the history file is not truncated. - If the 'HISTTIMEFORMAT' is set, the time stamp information associated + If the ‘HISTTIMEFORMAT’ is set, the time stamp information associated with each history entry is written to the history file, marked with the history comment character. When the history file is read, lines beginning with the history comment character followed immediately by a digit are interpreted as timestamps for the following history entry. - The 'fc' builtin command may be used to list or edit and re-execute a -portion of the history list. The 'history' builtin may be used to + The ‘fc’ builtin command may be used to list or edit and re-execute a +portion of the history list. The ‘history’ builtin may be used to display or modify the history list and manipulate the history file. When using command-line editing, search commands are available in each editing mode that provide access to the history list (*note Commands For History::). The shell allows control over which commands are saved on the history -list. The 'HISTCONTROL' and 'HISTIGNORE' variables are used to cause -the shell to save only a subset of the commands entered. The 'cmdhist' +list. The ‘HISTCONTROL’ and ‘HISTIGNORE’ variables are used to cause +the shell to save only a subset of the commands entered. The ‘cmdhist’ shell option, if enabled, causes the shell to attempt to save each line of a multi-line command in the same history entry, adding semicolons -where necessary to preserve syntactic correctness. The 'lithist' shell +where necessary to preserve syntactic correctness. The ‘lithist’ shell option causes the shell to save the command with embedded newlines -instead of semicolons. The 'shopt' builtin is used to set these -options. *Note The Shopt Builtin::, for a description of 'shopt'. +instead of semicolons. The ‘shopt’ builtin is used to set these +options. *Note The Shopt Builtin::, for a description of ‘shopt’.  File: bashref.info, Node: Bash History Builtins, Next: History Interaction, Prev: Bash History Facilities, Up: Using History Interactively @@ -10328,7 +10336,7 @@ File: bashref.info, Node: Bash History Builtins, Next: History Interaction, P Bash provides two builtin commands which manipulate the history list and history file. -'fc' +‘fc’ fc [-e ENAME] [-lnr] [FIRST] [LAST] fc -s [PAT=REP] [COMMAND] @@ -10340,19 +10348,19 @@ history file. from the current command number). When listing, a FIRST or LAST of 0 is equivalent to -1 and -0 is - equivalent to the current command (usually the 'fc' command); + equivalent to the current command (usually the ‘fc’ command); otherwise 0 is equivalent to -1 and -0 is invalid. If LAST is not specified, it is set to FIRST. If FIRST is not - specified, it is set to the previous command for editing and -16 - for listing. If the '-l' flag is given, the commands are listed on - standard output. The '-n' flag suppresses the command numbers when - listing. The '-r' flag reverses the order of the listing. + specified, it is set to the previous command for editing and −16 + for listing. If the ‘-l’ flag is given, the commands are listed on + standard output. The ‘-n’ flag suppresses the command numbers when + listing. The ‘-r’ flag reverses the order of the listing. Otherwise, the editor given by ENAME is invoked on a file containing those commands. If ENAME is not given, the value of the - following variable expansion is used: '${FCEDIT:-${EDITOR:-vi}}'. - This says to use the value of the 'FCEDIT' variable if set, or the - value of the 'EDITOR' variable if that is set, or 'vi' if neither + following variable expansion is used: ‘${FCEDIT:-${EDITOR:-vi}}’. + This says to use the value of the ‘FCEDIT’ variable if set, or the + value of the ‘EDITOR’ variable if that is set, or ‘vi’ if neither is set. When editing is complete, the edited commands are echoed and executed. @@ -10360,11 +10368,11 @@ history file. PAT in the selected command is replaced by REP. COMMAND is interpreted the same as FIRST above. - A useful alias to use with the 'fc' command is 'r='fc -s'', so that - typing 'r cc' runs the last command beginning with 'cc' and typing - 'r' re-executes the last command (*note Aliases::). + A useful alias to use with the ‘fc’ command is ‘r='fc -s'’, so that + typing ‘r cc’ runs the last command beginning with ‘cc’ and typing + ‘r’ re-executes the last command (*note Aliases::). -'history' +‘history’ history [N] history -c history -d OFFSET @@ -10373,69 +10381,69 @@ history file. history -ps ARG With no options, display the history list with line numbers. Lines - prefixed with a '*' have been modified. An argument of N lists - only the last N lines. If the shell variable 'HISTTIMEFORMAT' is - set and not null, it is used as a format string for STRFTIME to - display the time stamp associated with each displayed history + prefixed with a ‘*’ have been modified. An argument of N lists + only the last N lines. If the shell variable ‘HISTTIMEFORMAT’ is + set and not null, it is used as a format string for ‘strftime’(3) + to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp and the history line. Options, if supplied, have the following meanings: - '-c' + ‘-c’ Clear the history list. This may be combined with the other options to replace the history list completely. - '-d OFFSET' + ‘-d OFFSET’ Delete the history entry at position OFFSET. If OFFSET is positive, it should be specified as it appears when the history is displayed. If OFFSET is negative, it is interpreted as relative to one greater than the last history position, so negative indices count back from the end of the - history, and an index of '-1' refers to the current 'history - -d' command. + history, and an index of ‘-1’ refers to the current ‘history + -d’ command. - '-d START-END' + ‘-d START-END’ Delete the range of history entries between positions START and END, inclusive. Positive and negative values for START and END are interpreted as described above. - '-a' + ‘-a’ Append the new history lines to the history file. These are history lines entered since the beginning of the current Bash session, but not already appended to the history file. - '-n' + ‘-n’ Append the history lines not already read from the history file to the current history list. These are lines appended to the history file since the beginning of the current Bash session. - '-r' + ‘-r’ Read the history file and append its contents to the history list. - '-w' + ‘-w’ Write out the current history list to the history file. - '-p' + ‘-p’ Perform history substitution on the ARGs and display the result on the standard output, without storing the results in the history list. - '-s' + ‘-s’ The ARGs are added to the end of the history list as a single entry. - If a FILENAME argument is supplied when any of the '-w', '-r', - '-a', or '-n' options is used, Bash uses FILENAME as the history - file. If not, then the value of the 'HISTFILE' variable is used. - If 'HISTFILE' is unset or null, these options have no effect. + If a FILENAME argument is supplied when any of the ‘-w’, ‘-r’, + ‘-a’, or ‘-n’ options is used, Bash uses FILENAME as the history + file. If not, then the value of the ‘HISTFILE’ variable is used. + If ‘HISTFILE’ is unset or null, these options have no effect. The return value is 0 unless an invalid option is encountered, an error occurs while reading or writing the history file, an invalid - OFFSET or range is supplied as an argument to '-d', or the history - expansion supplied as an argument to '-p' fails. + OFFSET or range is supplied as an argument to ‘-d’, or the history + expansion supplied as an argument to ‘-p’ fails.  File: bashref.info, Node: History Interaction, Prev: Bash History Builtins, Up: Using History Interactively @@ -10444,7 +10452,7 @@ File: bashref.info, Node: History Interaction, Prev: Bash History Builtins, U ===================== The History library provides a history expansion feature that is similar -to the history expansion provided by 'csh'. This section describes the +to the history expansion provided by ‘csh’. This section describes the syntax used to manipulate the history information. History expansions introduce words from the history list into the @@ -10462,16 +10470,16 @@ determine which line from the history list should be used during substitution. The second is to select portions of that line for inclusion into the current one. - The line selected from the history is called the "event", and the -portions of that line that are acted upon are called "words". The line + The line selected from the history is called the “event”, and the +portions of that line that are acted upon are called “words”. The line is broken into words in the same fashion that Bash does, so that several -words surrounded by quotes are considered one word. The "event -designator" selects the event, the optional "word designator" selects -words from the event, and various optional "modifiers" are available to +words surrounded by quotes are considered one word. The “event +designator” selects the event, the optional “word designator” selects +words from the event, and various optional “modifiers” are available to manipulate the selected words. History expansions are introduced by the appearance of the history -expansion character, which is '!' by default. History expansions may +expansion character, which is ‘!’ by default. History expansions may appear anywhere in the input, but do not nest. History expansion implements shell-like quoting conventions: a @@ -10482,35 +10490,35 @@ double quotes may be subject to history expansion, since backslash can escape the history expansion character, but single quotes may not, since they are not treated specially within double quotes. - When using the shell, only '\' and ''' may be used to escape the + When using the shell, only ‘\’ and ‘'’ may be used to escape 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. There is a special abbreviation for substitution, active when the -QUICK SUBSTITUTION character (default '^') is the first character on the +QUICK SUBSTITUTION character (default ‘^’) is the first character on the line. It selects the previous history list entry, using an event -designator equivalent to '!!', and substitutes one string for another in +designator equivalent to ‘!!’, and substitutes one string for another in that line. It is described below (*note Event Designators::). This is the only history expansion that does not begin with the history expansion character. - Several shell options settable with the 'shopt' builtin (*note The + Several shell options settable with the ‘shopt’ builtin (*note The Shopt Builtin::) may be used to tailor the behavior of history -expansion. If the 'histverify' shell option is enabled, and Readline is +expansion. If the ‘histverify’ shell option is enabled, and Readline is being used, history substitutions are not immediately passed to the shell parser. Instead, the expanded line is reloaded into the Readline editing buffer for further modification. If Readline is being used, and -the 'histreedit' shell option is enabled, a failed history expansion +the ‘histreedit’ shell option is enabled, a failed history expansion will be reloaded into the Readline editing buffer for correction. The -'-p' option to the 'history' builtin command may be used to see what a -history expansion will do before using it. The '-s' option to the -'history' builtin may be used to add commands to the end of the history +‘-p’ option to the ‘history’ builtin command may be used to see what a +history expansion will do before using it. The ‘-s’ option to the +‘history’ builtin may be used to add commands to the end of the history list without actually executing them, so that they are available for subsequent recall. This is most useful in conjunction with Readline. The shell allows control of the various characters used by the -history expansion mechanism with the 'histchars' variable, as explained +history expansion mechanism with the ‘histchars’ variable, as explained above (*note Bash Variables::). The shell uses the history comment character to mark history timestamps when writing the history file. @@ -10533,36 +10541,36 @@ of the portion of the word beginning with the history expansion character, and ending with the word designator if one is present, or the end of the word. -'!' +‘!’ Start a history substitution, except when followed by a space, tab, - the end of the line, '=', or the rest of the shell metacharacters + the end of the line, ‘=’, or the rest of the shell metacharacters defined above (*note Definitions::). -'!N' +‘!N’ Refer to command line N. -'!-N' +‘!-N’ Refer to the command N lines back. -'!!' - Refer to the previous command. This is a synonym for '!-1'. +‘!!’ + Refer to the previous command. This is a synonym for ‘!-1’. -'!STRING' +‘!STRING’ Refer to the most recent command preceding the current position in the history list starting with STRING. -'!?STRING[?]' +‘!?STRING[?]’ Refer to the most recent command preceding the current position in - the history list containing STRING. The trailing '?' may be + the history list containing STRING. The trailing ‘?’ may be omitted if the STRING is followed immediately by a newline. If STRING is missing, the string from the most recent search is used; it is an error if there is no previous search string. -'^STRING1^STRING2^' +‘^STRING1^STRING2^’ Quick Substitution. Repeat the last command, replacing STRING1 - with STRING2. Equivalent to '!!:s^STRING1^STRING2^'. + with STRING2. Equivalent to ‘!!:s^STRING1^STRING2^’. -'!#' +‘!#’ The entire command line typed so far.  @@ -10573,58 +10581,58 @@ File: bashref.info, Node: Word Designators, Next: Modifiers, Prev: Event Desi Word designators are used to select desired words from the event. They are optional; if the word designator isn't supplied, the history -expansion uses the entire event. A ':' separates the event +expansion 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 +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 inserted into the current line separated by single spaces. For example, -'!!' +‘!!’ designates the preceding command. When you type this, the preceding command is repeated in toto. -'!!:$' +‘!!:$’ designates the last argument of the preceding command. This may be - shortened to '!$'. + shortened to ‘!$’. -'!fi:2' +‘!fi:2’ designates the second argument of the most recent command starting - with the letters 'fi'. + with the letters ‘fi’. Here are the word designators: -'0 (zero)' - The '0'th word. For many applications, this is the command word. +‘0 (zero)’ + The ‘0’th word. For many applications, this is the command word. -'N' +‘N’ The Nth word. -'^' +‘^’ The first argument; that is, word 1. -'$' +‘$’ The last argument. -'%' - The first word matched by the most recent '?STRING?' search, if the +‘%’ + The first word matched by the most recent ‘?STRING?’ search, if the search string begins with a character that is part of a word. -'X-Y' - A range of words; '-Y' abbreviates '0-Y'. +‘X-Y’ + A range of words; ‘-Y’ abbreviates ‘0-Y’. -'*' - All of the words, except the '0'th. 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, except the ‘0’th. This is a synonym for ‘1-$’. + It is not an error to use ‘*’ if there is just one word in the event; the empty string is returned in that case. -'X*' - Abbreviates 'X-$' +‘X*’ + Abbreviates ‘X-$’ -'X-' - Abbreviates 'X-$' like 'X*', but omits the last word. If 'x' is +‘X-’ + Abbreviates ‘X-$’ like ‘X*’, but omits the last word. If ‘x’ is missing, it defaults to 0. If a word designator is supplied without an event specification, the @@ -10637,54 +10645,54 @@ File: bashref.info, Node: Modifiers, Prev: Word Designators, Up: History Inte --------------- After the optional word designator, you can add a sequence of one or -more of the following modifiers, each preceded by a ':'. These modify, +more of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event. -'h' +‘h’ Remove a trailing pathname component, leaving only the head. -'t' +‘t’ Remove all leading pathname components, leaving the tail. -'r' - Remove a trailing suffix of the form '.SUFFIX', leaving the +‘r’ + Remove a trailing suffix of the form ‘.SUFFIX’, leaving the basename. -'e' +‘e’ Remove all but the trailing suffix. -'p' +‘p’ Print the new command but do not execute it. -'q' +‘q’ Quote the substituted words, escaping further substitutions. -'x' - Quote the substituted words as with 'q', but break into words at - spaces, tabs, and newlines. The 'q' and 'x' modifiers are mutually +‘x’ + Quote the substituted words as with ‘q’, but break into words at + spaces, tabs, and newlines. The ‘q’ and ‘x’ modifiers are mutually exclusive; the last one supplied is used. -'s/OLD/NEW/' +‘s/OLD/NEW/’ Substitute NEW for the first occurrence of OLD in the event line. - Any character may be used as the delimiter in place of '/'. The + Any character may be used as the delimiter in place of ‘/’. The delimiter may be quoted in OLD and NEW with a single backslash. If - '&' appears in NEW, it is replaced by OLD. A single backslash will - quote the '&'. If OLD is null, it is set to the last OLD + ‘&’ appears in NEW, it is replaced by OLD. A single backslash will + quote the ‘&’. If OLD is null, it is set to the last OLD substituted, or, if no previous history substitutions took place, - the last STRING in a !?STRING'[?]' search. If NEW is null, each + the last STRING in a !?STRING‘[?]’ search. If NEW is null, each matching OLD is deleted. The final delimiter is optional if it is the last character on the input line. -'&' +‘&’ Repeat the previous substitution. -'g' -'a' +‘g’ +‘a’ Cause changes to be applied over the entire event line. Used in - conjunction with 's', as in 'gs/OLD/NEW/', or with '&'. + conjunction with ‘s’, as in ‘gs/OLD/NEW/’, or with ‘&’. -'G' - Apply the following 's' or '&' modifier once to each word in the +‘G’ + Apply the following ‘s’ or ‘&’ modifier once to each word in the event.  @@ -10725,45 +10733,45 @@ These are installation instructions for Bash. The simplest way to compile Bash is: - 1. 'cd' to the directory containing the source code and type - './configure' to configure Bash for your system. If you're using - 'csh' on an old version of System V, you might need to type 'sh - ./configure' instead to prevent 'csh' from trying to execute - 'configure' itself. + 1. ‘cd’ to the directory containing the source code and type + ‘./configure’ to configure Bash for your system. If you're using + ‘csh’ on an old version of System V, you might need to type ‘sh + ./configure’ instead to prevent ‘csh’ from trying to execute + ‘configure’ itself. - Running 'configure' takes some time. While running, it prints + Running ‘configure’ takes some time. While running, it prints messages telling which features it is checking for. - 2. Type 'make' to compile Bash and build the 'bashbug' bug reporting + 2. Type ‘make’ to compile Bash and build the ‘bashbug’ bug reporting script. - 3. Optionally, type 'make tests' to run the Bash test suite. + 3. Optionally, type ‘make tests’ to run the Bash test suite. - 4. Type 'make install' to install 'bash' and 'bashbug'. This will + 4. Type ‘make install’ to install ‘bash’ and ‘bashbug’. This will also install the manual pages and Info file, message translation files, some supplemental documentation, a number of example loadable builtin commands, and a set of header files for developing loadable builtins. You may need additional privileges to install - 'bash' to your desired destination, so 'sudo make install' might be + ‘bash’ to your desired destination, so ‘sudo make install’ might be required. More information about controlling the locations where - 'bash' and other files are installed is below (*note Installation + ‘bash’ and other files are installed is below (*note Installation Names::). - The 'configure' shell script attempts to guess correct values for + The ‘configure’ shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses -those values to create a 'Makefile' in each directory of the package -(the top directory, the 'builtins', 'doc', 'po', and 'support' -directories, each directory under 'lib', and several others). It also -creates a 'config.h' file containing system-dependent definitions. -Finally, it creates a shell script named 'config.status' that you can +those values to create a ‘Makefile’ in each directory of the package +(the top directory, the ‘builtins’, ‘doc’, ‘po’, and ‘support’ +directories, each directory under ‘lib’, and several others). It also +creates a ‘config.h’ file containing system-dependent definitions. +Finally, it creates a shell script named ‘config.status’ that you can run in the future to recreate the current configuration, a file -'config.cache' that saves the results of its tests to speed up -reconfiguring, and a file 'config.log' containing compiler output -(useful mainly for debugging 'configure'). If at some point -'config.cache' contains results you don't want to keep, you may remove +‘config.cache’ that saves the results of its tests to speed up +reconfiguring, and a file ‘config.log’ containing compiler output +(useful mainly for debugging ‘configure’). If at some point +‘config.cache’ contains results you don't want to keep, you may remove or edit it. - To find out more about the options and arguments that the 'configure' + To find out more about the options and arguments that the ‘configure’ script understands, type bash-4.2$ ./configure --help @@ -10773,8 +10781,8 @@ at the Bash prompt in your Bash source directory. If you want to build Bash in a directory separate from the source directory - to build for multiple architectures, for example - just use the full path to the configure script. The following commands will -build Bash in a directory under '/usr/local/build' from the source code -in '/usr/local/src/bash-4.4': +build Bash in a directory under ‘/usr/local/build’ from the source code +in ‘/usr/local/src/bash-4.4’: mkdir /usr/local/build/bash-4.4 cd /usr/local/build/bash-4.4 @@ -10785,19 +10793,19 @@ in '/usr/local/src/bash-4.4': about building in a directory separate from the source. If you need to do unusual things to compile Bash, please try to -figure out how 'configure' could check whether or not to do them, and +figure out how ‘configure’ could check whether or not to do them, and mail diffs or instructions to so they can be considered for the next release. - The file 'configure.ac' is used to create 'configure' by a program -called Autoconf. You only need 'configure.ac' if you want to change it -or regenerate 'configure' using a newer version of Autoconf. If you do + The file ‘configure.ac’ is used to create ‘configure’ by a program +called Autoconf. You only need ‘configure.ac’ if you want to change it +or regenerate ‘configure’ using a newer version of Autoconf. If you do this, make sure you are using Autoconf version 2.69 or newer. You can remove the program binaries and object files from the source -code directory by typing 'make clean'. To also remove the files that -'configure' created (so you can compile Bash for a different kind of -computer), type 'make distclean'. +code directory by typing ‘make clean’. To also remove the files that +‘configure’ created (so you can compile Bash for a different kind of +computer), type ‘make distclean’.  File: bashref.info, Node: Compilers and Options, Next: Compiling For Multiple Architectures, Prev: Basic Installation, Up: Installing Bash @@ -10806,14 +10814,14 @@ File: bashref.info, Node: Compilers and Options, Next: Compiling For Multiple ========================== Some systems require unusual options for compilation or linking that the -'configure' script does not know about. You can give 'configure' +‘configure’ script does not know about. You can give ‘configure’ initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure - On systems that have the 'env' program, you can do it like this: + On systems that have the ‘env’ program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure @@ -10827,29 +10835,29 @@ File: bashref.info, Node: Compiling For Multiple Architectures, Next: Installa You can compile Bash for more than one kind of computer at the same time, by placing the object files for each architecture in their own -directory. To do this, you must use a version of 'make' that supports -the 'VPATH' variable, such as GNU 'make'. 'cd' to the directory where -you want the object files and executables to go and run the 'configure' +directory. To do this, you must use a version of ‘make’ that supports +the ‘VPATH’ variable, such as GNU ‘make’. ‘cd’ to the directory where +you want the object files and executables to go and run the ‘configure’ script from the source directory (*note Basic Installation::). You may -need to supply the '--srcdir=PATH' argument to tell 'configure' where -the source files are. 'configure' automatically checks for the source -code in the directory that 'configure' is in and in '..'. +need to supply the ‘--srcdir=PATH’ argument to tell ‘configure’ where +the source files are. ‘configure’ automatically checks for the source +code in the directory that ‘configure’ is in and in '..'. - If you have to use a 'make' that does not support the 'VPATH' + If you have to use a ‘make’ that does not support the ‘VPATH’ variable, you can compile Bash for one architecture at a time in the source code directory. After you have installed Bash for one -architecture, use 'make distclean' before reconfiguring for another +architecture, use ‘make distclean’ before reconfiguring for another architecture. Alternatively, if your system supports symbolic links, you can use -the 'support/mkclone' script to create a build tree which has symbolic +the ‘support/mkclone’ script to create a build tree which has symbolic links back to each file in the source directory. Here's an example that creates a build directory in the current directory from a source -directory '/usr/gnu/src/bash-2.0': +directory ‘/usr/gnu/src/bash-2.0’: bash /usr/gnu/src/bash-2.0/support/mkclone -s /usr/gnu/src/bash-2.0 . -The 'mkclone' script requires Bash, so you must have already built Bash +The ‘mkclone’ script requires Bash, so you must have already built Bash for at least one architecture before you can create build directories for other architectures. @@ -10859,41 +10867,41 @@ File: bashref.info, Node: Installation Names, Next: Specifying the System Type 10.4 Installation Names ======================= -By default, 'make install' will install into '/usr/local/bin', -'/usr/local/man', etc.; that is, the "installation prefix" defaults to -'/usr/local'. You can specify an installation prefix other than -'/usr/local' by giving 'configure' the option '--prefix=PATH', or by -specifying a value for the 'prefix' 'make' variable when running 'make -install' (e.g., 'make install prefix=PATH'). The 'prefix' variable -provides a default for 'exec_prefix' and other variables used when +By default, ‘make install’ will install into ‘/usr/local/bin’, +‘/usr/local/man’, etc.; that is, the “installation prefix” defaults to +‘/usr/local’. You can specify an installation prefix other than +‘/usr/local’ by giving ‘configure’ the option ‘--prefix=PATH’, or by +specifying a value for the ‘prefix’ ‘make’ variable when running ‘make +install’ (e.g., ‘make install prefix=PATH’). The ‘prefix’ variable +provides a default for ‘exec_prefix’ and other variables used when installing Bash. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you -give 'configure' the option '--exec-prefix=PATH', 'make install' will +give ‘configure’ the option ‘--exec-prefix=PATH’, ‘make install’ will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. If you would like to change the installation locations for a single -run, you can specify these variables as arguments to 'make': 'make -install exec_prefix=/' will install 'bash' and 'bashbug' into '/bin' -instead of the default '/usr/local/bin'. +run, you can specify these variables as arguments to ‘make’: ‘make +install exec_prefix=/’ will install ‘bash’ and ‘bashbug’ into ‘/bin’ +instead of the default ‘/usr/local/bin’. If you want to see the files Bash will install and where it will install them without changing anything on your system, specify the -variable 'DESTDIR' as an argument to 'make'. Its value should be the +variable ‘DESTDIR’ as an argument to ‘make’. Its value should be the absolute directory path you'd like to use as the root of your sample installation tree. For example, mkdir /fs1/bash-install make install DESTDIR=/fs1/bash-install -will install 'bash' into '/fs1/bash-install/usr/local/bin/bash', the +will install ‘bash’ into ‘/fs1/bash-install/usr/local/bin/bash’, the documentation into directories within -'/fs1/bash-install/usr/local/share', the example loadable builtins into -'/fs1/bash-install/usr/local/lib/bash', and so on. You can use the -usual 'exec_prefix' and 'prefix' variables to alter the directory paths -beneath the value of 'DESTDIR'. +‘/fs1/bash-install/usr/local/share’, the example loadable builtins into +‘/fs1/bash-install/usr/local/lib/bash’, and so on. You can use the +usual ‘exec_prefix’ and ‘prefix’ variables to alter the directory paths +beneath the value of ‘DESTDIR’. The GNU Makefile standards provide a more complete description of these variables and their effects. @@ -10904,15 +10912,15 @@ File: bashref.info, Node: Specifying the System Type, Next: Sharing Defaults, 10.5 Specifying the System Type =============================== -There may be some features 'configure' can not figure out automatically, +There may be some features ‘configure’ can not figure out automatically, but needs to determine by the type of host Bash will run on. Usually -'configure' can figure that out, but if it prints a message saying it -can not guess the host type, give it the '--host=TYPE' option. 'TYPE' -can either be a short name for the system type, such as 'sun4', or a -canonical name with three fields: 'CPU-COMPANY-SYSTEM' (e.g., -'i386-unknown-freebsd4.2'). +‘configure’ can figure that out, but if it prints a message saying it +can not guess the host type, give it the ‘--host=TYPE’ option. ‘TYPE’ +can either be a short name for the system type, such as ‘sun4’, or a +canonical name with three fields: ‘CPU-COMPANY-SYSTEM’ (e.g., +‘i386-unknown-freebsd4.2’). - See the file 'support/config.sub' for the possible values of each + See the file ‘support/config.sub’ for the possible values of each field.  @@ -10921,14 +10929,14 @@ File: bashref.info, Node: Sharing Defaults, Next: Operation Controls, Prev: S 10.6 Sharing Defaults ===================== -If you want to set default values for 'configure' scripts to share, you -can create a site shell script called 'config.site' that gives default -values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' -looks for 'PREFIX/share/config.site' if it exists, then -'PREFIX/etc/config.site' if it exists. Or, you can set the -'CONFIG_SITE' environment variable to the location of the site script. -A warning: the Bash 'configure' looks for a site script, but not all -'configure' scripts do. +If you want to set default values for ‘configure’ scripts to share, you +can create a site shell script called ‘config.site’ that gives default +values for variables like ‘CC’, ‘cache_file’, and ‘prefix’. ‘configure’ +looks for ‘PREFIX/share/config.site’ if it exists, then +‘PREFIX/etc/config.site’ if it exists. Or, you can set the +‘CONFIG_SITE’ environment variable to the location of the site script. +A warning: the Bash ‘configure’ looks for a site script, but not all +‘configure’ scripts do.  File: bashref.info, Node: Operation Controls, Next: Optional Features, Prev: Sharing Defaults, Up: Installing Bash @@ -10936,31 +10944,31 @@ File: bashref.info, Node: Operation Controls, Next: Optional Features, Prev: 10.7 Operation Controls ======================= -'configure' recognizes the following options to control how it operates. +‘configure’ recognizes the following options to control how it operates. -'--cache-file=FILE' +‘--cache-file=FILE’ Use and save the results of the tests in FILE instead of - './config.cache'. Set FILE to '/dev/null' to disable caching, for - debugging 'configure'. + ‘./config.cache’. Set FILE to ‘/dev/null’ to disable caching, for + debugging ‘configure’. -'--help' - Print a summary of the options to 'configure', and exit. +‘--help’ + Print a summary of the options to ‘configure’, and exit. -'--quiet' -'--silent' -'-q' +‘--quiet’ +‘--silent’ +‘-q’ Do not print messages saying which checks are being made. -'--srcdir=DIR' +‘--srcdir=DIR’ Look for the Bash source code in directory DIR. Usually - 'configure' can determine that directory automatically. + ‘configure’ can determine that directory automatically. -'--version' - Print the version of Autoconf used to generate the 'configure' +‘--version’ + Print the version of Autoconf used to generate the ‘configure’ script, and exit. - 'configure' also accepts some other, not widely used, boilerplate -options. 'configure --help' prints the complete list. + ‘configure’ also accepts some other, not widely used, boilerplate +options. ‘configure --help’ prints the complete list.  File: bashref.info, Node: Optional Features, Prev: Operation Controls, Up: Installing Bash @@ -10968,271 +10976,271 @@ File: bashref.info, Node: Optional Features, Prev: Operation Controls, Up: In 10.8 Optional Features ====================== -The Bash 'configure' has a number of '--enable-FEATURE' options, where +The Bash ‘configure’ has a number of ‘--enable-FEATURE’ options, where FEATURE indicates an optional part of Bash. There are also several -'--with-PACKAGE' options, where PACKAGE is something like 'bash-malloc' -or 'purify'. To turn off the default use of a package, use -'--without-PACKAGE'. To configure Bash without a feature that is -enabled by default, use '--disable-FEATURE'. +‘--with-PACKAGE’ options, where PACKAGE is something like ‘bash-malloc’ +or ‘purify’. To turn off the default use of a package, use +‘--without-PACKAGE’. To configure Bash without a feature that is +enabled by default, use ‘--disable-FEATURE’. - Here is a complete list of the '--enable-' and '--with-' options that -the Bash 'configure' recognizes. + Here is a complete list of the ‘--enable-’ and ‘--with-’ options that +the Bash ‘configure’ recognizes. -'--with-afs' +‘--with-afs’ Define if you are using the Andrew File System from Transarc. -'--with-bash-malloc' - Use the Bash version of 'malloc' in the directory 'lib/malloc'. - This is not the same 'malloc' that appears in GNU libc, but an - older version originally derived from the 4.2 BSD 'malloc'. This - 'malloc' is very fast, but wastes some space on each allocation. - This option is enabled by default. The 'NOTES' file contains a +‘--with-bash-malloc’ + Use the Bash version of ‘malloc’ in the directory ‘lib/malloc’. + This is not the same ‘malloc’ that appears in GNU libc, but an + older version originally derived from the 4.2 BSD ‘malloc’. This + ‘malloc’ is very fast, but wastes some space on each allocation. + This option is enabled by default. The ‘NOTES’ file contains a list of systems for which this should be turned off, and - 'configure' disables this option automatically for a number of + ‘configure’ disables this option automatically for a number of systems. -'--with-curses' +‘--with-curses’ Use the curses library instead of the termcap library. This should be supplied if your system has an inadequate or incomplete termcap database. -'--with-gnu-malloc' - A synonym for '--with-bash-malloc'. +‘--with-gnu-malloc’ + A synonym for ‘--with-bash-malloc’. -'--with-installed-readline[=PREFIX]' +‘--with-installed-readline[=PREFIX]’ Define this to make Bash link with a locally-installed version of - Readline rather than the version in 'lib/readline'. This works - only with Readline 5.0 and later versions. If PREFIX is 'yes' or - not supplied, 'configure' uses the values of the make variables - 'includedir' and 'libdir', which are subdirectories of 'prefix' by + Readline rather than the version in ‘lib/readline’. This works + only with Readline 5.0 and later versions. If PREFIX is ‘yes’ or + not supplied, ‘configure’ uses the values of the make variables + ‘includedir’ and ‘libdir’, which are subdirectories of ‘prefix’ by default, to find the installed version of Readline if it is not in the standard system include and library directories. If PREFIX is - 'no', Bash links with the version in 'lib/readline'. If PREFIX is - set to any other value, 'configure' treats it as a directory + ‘no’, Bash links with the version in ‘lib/readline’. If PREFIX is + set to any other value, ‘configure’ treats it as a directory pathname and looks for the installed version of Readline in - subdirectories of that directory (include files in PREFIX/'include' - and the library in PREFIX/'lib'). + subdirectories of that directory (include files in PREFIX/‘include’ + and the library in PREFIX/‘lib’). -'--with-libintl-prefix[=PREFIX]' +‘--with-libintl-prefix[=PREFIX]’ Define this to make Bash link with a locally-installed version of - the libintl library instead of the version in 'lib/intl'. + the libintl library instead of the version in ‘lib/intl’. -'--with-libiconv-prefix[=PREFIX]' +‘--with-libiconv-prefix[=PREFIX]’ Define this to make Bash look for libiconv in PREFIX instead of the standard system locations. There is no version included with Bash. -'--enable-minimal-config' +‘--enable-minimal-config’ This produces a shell with minimal features, close to the historical Bourne shell. - There are several '--enable-' options that alter how Bash is + There are several ‘--enable-’ options that alter how Bash is compiled, linked, and installed, rather than changing run-time features. -'--enable-largefile' +‘--enable-largefile’ Enable support for large files (http://www.unix.org/version2/whatsnew/lfs20mar.html) if the operating system requires special compiler options to build programs which can access large files. This is enabled by default, if the operating system provides large file support. -'--enable-profiling' +‘--enable-profiling’ This builds a Bash binary that produces profiling information to be - processed by 'gprof' each time it is executed. + processed by ‘gprof’ each time it is executed. -'--enable-separate-helpfiles' - Use external files for the documentation displayed by the 'help' +‘--enable-separate-helpfiles’ + Use external files for the documentation displayed by the ‘help’ builtin instead of storing the text internally. -'--enable-static-link' - This causes Bash to be linked statically, if 'gcc' is being used. +‘--enable-static-link’ + This causes Bash to be linked statically, if ‘gcc’ is being used. This could be used to build a version to use as root's shell. - The 'minimal-config' option can be used to disable all of the + The ‘minimal-config’ option can be used to disable all of the following options, but it is processed first, so individual options may -be enabled using 'enable-FEATURE'. +be enabled using ‘enable-FEATURE’. - All of the following options except for 'alt-array-implementation', -'disabled-builtins', 'direxpand-default', 'strict-posix-default', and -'xpg-echo-default' are enabled by default, unless the operating system + All of the following options except for ‘alt-array-implementation’, +‘disabled-builtins’, ‘direxpand-default’, ‘strict-posix-default’, and +‘xpg-echo-default’ are enabled by default, unless the operating system does not provide the necessary support. -'--enable-alias' - Allow alias expansion and include the 'alias' and 'unalias' +‘--enable-alias’ + Allow alias expansion and include the ‘alias’ and ‘unalias’ builtins (*note Aliases::). -'--enable-alt-array-implementation' +‘--enable-alt-array-implementation’ This builds Bash using an alternate implementation of arrays (*note Arrays::) that provides faster access at the expense of using more memory (sometimes many times more, depending on how sparse an array is). -'--enable-arith-for-command' - Include support for the alternate form of the 'for' command that - behaves like the C language 'for' statement (*note Looping +‘--enable-arith-for-command’ + Include support for the alternate form of the ‘for’ command that + behaves like the C language ‘for’ statement (*note Looping Constructs::). -'--enable-array-variables' +‘--enable-array-variables’ Include support for one-dimensional array shell variables (*note Arrays::). -'--enable-bang-history' - Include support for 'csh'-like history substitution (*note History +‘--enable-bang-history’ + Include support for ‘csh’-like history substitution (*note History Interaction::). -'--enable-brace-expansion' - Include 'csh'-like brace expansion ( 'b{a,b}c' ==> 'bac bbc' ). - See *note Brace Expansion::, for a complete description. +‘--enable-brace-expansion’ + Include ‘csh’-like brace expansion ( ‘b{a,b}c’ ↦ ‘bac bbc’ ). See + *note Brace Expansion::, for a complete description. -'--enable-casemod-attributes' - Include support for case-modifying attributes in the 'declare' - builtin and assignment statements. Variables with the 'uppercase' +‘--enable-casemod-attributes’ + Include support for case-modifying attributes in the ‘declare’ + builtin and assignment statements. Variables with the ‘uppercase’ attribute, for example, will have their values converted to uppercase upon assignment. -'--enable-casemod-expansion' +‘--enable-casemod-expansion’ Include support for case-modifying word expansions. -'--enable-command-timing' - Include support for recognizing 'time' as a reserved word and for - displaying timing statistics for the pipeline following 'time' +‘--enable-command-timing’ + Include support for recognizing ‘time’ as a reserved word and for + displaying timing statistics for the pipeline following ‘time’ (*note Pipelines::). This allows pipelines as well as shell builtins and functions to be timed. -'--enable-cond-command' - Include support for the '[[' conditional command. (*note +‘--enable-cond-command’ + Include support for the ‘[[’ conditional command. (*note Conditional Constructs::). -'--enable-cond-regexp' +‘--enable-cond-regexp’ Include support for matching POSIX regular expressions using the - '=~' binary operator in the '[[' conditional command. (*note + ‘=~’ binary operator in the ‘[[’ conditional command. (*note Conditional Constructs::). -'--enable-coprocesses' - Include support for coprocesses and the 'coproc' reserved word +‘--enable-coprocesses’ + Include support for coprocesses and the ‘coproc’ reserved word (*note Pipelines::). -'--enable-debugger' +‘--enable-debugger’ Include support for the Bash debugger (distributed separately). -'--enable-dev-fd-stat-broken' - If calling 'stat' on /dev/fd/N returns different results than - calling 'fstat' on file descriptor N, supply this option to enable +‘--enable-dev-fd-stat-broken’ + If calling ‘stat’ on /dev/fd/N returns different results than + calling ‘fstat’ on file descriptor N, supply this option to enable a workaround. This has implications for conditional commands that test file attributes. -'--enable-direxpand-default' - Cause the 'direxpand' shell option (*note The Shopt Builtin::) to +‘--enable-direxpand-default’ + Cause the ‘direxpand’ shell option (*note The Shopt Builtin::) to be enabled by default when the shell starts. It is normally disabled by default. -'--enable-directory-stack' - Include support for a 'csh'-like directory stack and the 'pushd', - 'popd', and 'dirs' builtins (*note The Directory Stack::). +‘--enable-directory-stack’ + Include support for a ‘csh’-like directory stack and the ‘pushd’, + ‘popd’, and ‘dirs’ builtins (*note The Directory Stack::). -'--enable-disabled-builtins' - Allow builtin commands to be invoked via 'builtin xxx' even after - 'xxx' has been disabled using 'enable -n xxx'. See *note Bash - Builtins::, for details of the 'builtin' and 'enable' builtin +‘--enable-disabled-builtins’ + Allow builtin commands to be invoked via ‘builtin xxx’ even after + ‘xxx’ has been disabled using ‘enable -n xxx’. See *note Bash + Builtins::, for details of the ‘builtin’ and ‘enable’ builtin commands. -'--enable-dparen-arithmetic' - Include support for the '((...))' command (*note Conditional +‘--enable-dparen-arithmetic’ + Include support for the ‘((...))’ command (*note Conditional Constructs::). -'--enable-extended-glob' +‘--enable-extended-glob’ Include support for the extended pattern matching features described above under *note Pattern Matching::. -'--enable-extended-glob-default' - Set the default value of the 'extglob' shell option described above +‘--enable-extended-glob-default’ + Set the default value of the ‘extglob’ shell option described above under *note The Shopt Builtin:: to be enabled. -'--enable-function-import' +‘--enable-function-import’ Include support for importing function definitions exported by another instance of the shell from the environment. This option is enabled by default. -'--enable-glob-asciiranges-default' - Set the default value of the 'globasciiranges' shell option +‘--enable-glob-asciiranges-default’ + Set the default value of the ‘globasciiranges’ shell option described above under *note The Shopt Builtin:: to be enabled. This controls the behavior of character ranges when used in pattern matching bracket expressions. -'--enable-help-builtin' - Include the 'help' builtin, which displays help on shell builtins +‘--enable-help-builtin’ + Include the ‘help’ builtin, which displays help on shell builtins and variables (*note Bash Builtins::). -'--enable-history' - Include command history and the 'fc' and 'history' builtin commands +‘--enable-history’ + Include command history and the ‘fc’ and ‘history’ builtin commands (*note Bash History Facilities::). -'--enable-job-control' +‘--enable-job-control’ This enables the job control features (*note Job Control::), if the operating system supports them. -'--enable-multibyte' +‘--enable-multibyte’ This enables support for multibyte characters if the operating system provides the necessary support. -'--enable-net-redirections' +‘--enable-net-redirections’ This enables the special handling of filenames of the form - '/dev/tcp/HOST/PORT' and '/dev/udp/HOST/PORT' when used in + ‘/dev/tcp/HOST/PORT’ and ‘/dev/udp/HOST/PORT’ when used in redirections (*note Redirections::). -'--enable-process-substitution' +‘--enable-process-substitution’ This enables process substitution (*note Process Substitution::) if the operating system provides the necessary support. -'--enable-progcomp' +‘--enable-progcomp’ Enable the programmable completion facilities (*note Programmable Completion::). If Readline is not enabled, this option has no effect. -'--enable-prompt-string-decoding' +‘--enable-prompt-string-decoding’ Turn on the interpretation of a number of backslash-escaped - characters in the '$PS0', '$PS1', '$PS2', and '$PS4' prompt + characters in the ‘$PS0’, ‘$PS1’, ‘$PS2’, and ‘$PS4’ prompt strings. See *note Controlling the Prompt::, for a complete list of prompt string escape sequences. -'--enable-readline' +‘--enable-readline’ Include support for command-line editing and history with the Bash version of the Readline library (*note Command Line Editing::). -'--enable-restricted' - Include support for a "restricted shell". If this is enabled, - Bash, when called as 'rbash', enters a restricted mode. See *note +‘--enable-restricted’ + Include support for a “restricted shell”. If this is enabled, + Bash, when called as ‘rbash’, enters a restricted mode. See *note The Restricted Shell::, for a description of restricted mode. -'--enable-select' - Include the 'select' compound command, which allows the generation +‘--enable-select’ + Include the ‘select’ compound command, which allows the generation of simple menus (*note Conditional Constructs::). -'--enable-single-help-strings' - Store the text displayed by the 'help' builtin as a single string +‘--enable-single-help-strings’ + Store the text displayed by the ‘help’ builtin as a single string for each help topic. This aids in translating the text to different languages. You may need to disable this if your compiler cannot handle very long string literals. -'--enable-strict-posix-default' +‘--enable-strict-posix-default’ Make Bash POSIX-conformant by default (*note Bash POSIX Mode::). -'--enable-translatable-strings' - Enable support for '$"STRING"' translatable strings (*note Locale +‘--enable-translatable-strings’ + Enable support for ‘$"STRING"’ translatable strings (*note Locale Translation::). -'--enable-usg-echo-default' - A synonym for '--enable-xpg-echo-default'. +‘--enable-usg-echo-default’ + A synonym for ‘--enable-xpg-echo-default’. -'--enable-xpg-echo-default' - Make the 'echo' builtin expand backslash-escaped characters by - default, without requiring the '-e' option. This sets the default - value of the 'xpg_echo' shell option to 'on', which makes the Bash - 'echo' behave more like the version specified in the Single Unix +‘--enable-xpg-echo-default’ + Make the ‘echo’ builtin expand backslash-escaped characters by + default, without requiring the ‘-e’ option. This sets the default + value of the ‘xpg_echo’ shell option to ‘on’, which makes the Bash + ‘echo’ behave more like the version specified in the Single Unix Specification, version 3. *Note Bash Builtins::, for a description - of the escape sequences that 'echo' recognizes. + of the escape sequences that ‘echo’ recognizes. - The file 'config-top.h' contains C Preprocessor '#define' statements -for options which are not settable from 'configure'. Some of these are + The file ‘config-top.h’ contains C Preprocessor ‘#define’ statements +for options which are not settable from ‘configure’. Some of these are not meant to be changed; beware of the consequences if you do. Read the comments associated with each definition for more information about its effect. @@ -11250,21 +11258,21 @@ of Bash. The latest version of Bash is always available for FTP from . Once you have determined that a bug actually exists, use the -'bashbug' command to submit a bug report or use the form at the Bash +‘bashbug’ command to submit a bug report or use the form at the Bash project page (https://savannah.gnu.org/projects/bash/). If you have a fix, you are encouraged to submit that as well! Suggestions and 'philosophical' bug reports may be mailed to or . All bug reports should include: - * The version number of Bash. - * The hardware and operating system. - * The compiler used to compile Bash. - * A description of the bug behaviour. - * A short script or 'recipe' which exercises the bug and may be used + • The version number of Bash. + • The hardware and operating system. + • The compiler used to compile Bash. + • A description of the bug behaviour. + • A short script or 'recipe' which exercises the bug and may be used to reproduce it. -'bashbug' inserts the first three items automatically into the template +‘bashbug’ inserts the first three items automatically into the template it provides for filing a bug report. Please send all reports concerning this manual to . @@ -11281,314 +11289,314 @@ POSIX standard as the specification of how these features are to be implemented. There are some differences between the traditional Bourne shell and Bash; this section quickly details the differences of significance. A number of these differences are explained in greater -depth in previous sections. This section uses the version of 'sh' +depth in previous sections. This section uses the version of ‘sh’ included in SVR4.2 (the last version of the historical Bourne shell) as the baseline reference. - * Bash is POSIX-conformant, even where the POSIX specification - differs from traditional 'sh' behavior (*note Bash POSIX Mode::). + • Bash is POSIX-conformant, even where the POSIX specification + differs from traditional ‘sh’ behavior (*note Bash POSIX Mode::). - * Bash has multi-character invocation options (*note Invoking + • Bash has multi-character invocation options (*note Invoking Bash::). - * Bash has command-line editing (*note Command Line Editing::) and - the 'bind' builtin. + • Bash has command-line editing (*note Command Line Editing::) and + the ‘bind’ builtin. - * Bash provides a programmable word completion mechanism (*note - Programmable Completion::), and builtin commands 'complete', - 'compgen', and 'compopt', to manipulate it. + • Bash provides a programmable word completion mechanism (*note + Programmable Completion::), and builtin commands ‘complete’, + ‘compgen’, and ‘compopt’, to manipulate it. - * Bash has command history (*note Bash History Facilities::) and the - 'history' and 'fc' builtins to manipulate it. The Bash history + • Bash has command history (*note Bash History Facilities::) and the + ‘history’ and ‘fc’ builtins to manipulate it. The Bash history list maintains timestamp information and uses the value of the - 'HISTTIMEFORMAT' variable to display it. + ‘HISTTIMEFORMAT’ variable to display it. - * Bash implements 'csh'-like history expansion (*note History + • Bash implements ‘csh’-like history expansion (*note History Interaction::). - * Bash has one-dimensional array variables (*note Arrays::), and the + • Bash has one-dimensional array variables (*note Arrays::), and the appropriate variable expansions and assignment syntax to use them. Several of the Bash builtins take options to act on arrays. Bash provides a number of built-in array variables. - * The '$'...'' quoting syntax, which expands ANSI-C backslash-escaped + • The ‘$'...'’ quoting syntax, which expands ANSI-C backslash-escaped characters in the text between the single quotes, is supported (*note ANSI-C Quoting::). - * Bash supports the '$"..."' quoting syntax to do locale-specific - translation of the characters between the double quotes. The '-D', - '--dump-strings', and '--dump-po-strings' invocation options list + • Bash supports the ‘$"..."’ quoting syntax to do locale-specific + translation of the characters between the double quotes. The ‘-D’, + ‘--dump-strings’, and ‘--dump-po-strings’ invocation options list the translatable strings found in a script (*note Locale Translation::). - * Bash implements the '!' keyword to negate the return value of a - pipeline (*note Pipelines::). Very useful when an 'if' statement - needs to act only if a test fails. The Bash '-o pipefail' option - to 'set' will cause a pipeline to return a failure status if any + • Bash implements the ‘!’ keyword to negate the return value of a + pipeline (*note Pipelines::). Very useful when an ‘if’ statement + needs to act only if a test fails. The Bash ‘-o pipefail’ option + to ‘set’ will cause a pipeline to return a failure status if any command fails. - * Bash has the 'time' reserved word and command timing (*note + • Bash has the ‘time’ reserved word and command timing (*note Pipelines::). The display of the timing statistics may be - controlled with the 'TIMEFORMAT' variable. + controlled with the ‘TIMEFORMAT’ variable. - * Bash implements the 'for (( EXPR1 ; EXPR2 ; EXPR3 ))' arithmetic + • Bash implements the ‘for (( EXPR1 ; EXPR2 ; EXPR3 ))’ arithmetic for command, similar to the C language (*note Looping Constructs::). - * Bash includes the 'select' compound command, which allows the + • Bash includes the ‘select’ compound command, which allows the generation of simple menus (*note Conditional Constructs::). - * Bash includes the '[[' compound command, which makes conditional + • Bash includes the ‘[[’ compound command, which makes conditional testing part of the shell grammar (*note Conditional Constructs::), including optional regular expression matching. - * Bash provides optional case-insensitive matching for the 'case' and - '[[' constructs. + • Bash provides optional case-insensitive matching for the ‘case’ and + ‘[[’ constructs. - * Bash includes brace expansion (*note Brace Expansion::) and tilde + • Bash includes brace expansion (*note Brace Expansion::) and tilde expansion (*note Tilde Expansion::). - * Bash implements command aliases and the 'alias' and 'unalias' + • Bash implements command aliases and the ‘alias’ and ‘unalias’ builtins (*note Aliases::). - * Bash provides shell arithmetic, the '((' compound command (*note + • Bash provides shell arithmetic, the ‘((’ compound command (*note Conditional Constructs::), and arithmetic expansion (*note Shell Arithmetic::). - * Variables present in the shell's initial environment are + • Variables present in the shell's initial environment are automatically exported to child processes. The Bourne shell does not normally do this unless the variables are explicitly marked - using the 'export' command. + using the ‘export’ command. - * Bash supports the '+=' assignment operator, which appends to the + • Bash supports the ‘+=’ assignment operator, which appends to the value of the variable named on the left hand side. - * Bash includes the POSIX pattern removal '%', '#', '%%' and '##' + • Bash includes the POSIX pattern removal ‘%’, ‘#’, ‘%%’ and ‘##’ expansions to remove leading or trailing substrings from variable values (*note Shell Parameter Expansion::). - * The expansion '${#xx}', which returns the length of '${xx}', is + • The expansion ‘${#xx}’, which returns the length of ‘${xx}’, is supported (*note Shell Parameter Expansion::). - * The expansion '${var:'OFFSET'[:'LENGTH']}', which expands to the - substring of 'var''s value of length LENGTH, beginning at OFFSET, + • The expansion ‘${var:’OFFSET‘[:’LENGTH‘]}’, which expands to the + substring of ‘var’'s value of length LENGTH, beginning at OFFSET, is present (*note Shell Parameter Expansion::). - * The expansion '${VAR/[/]'PATTERN'[/'REPLACEMENT']}', which matches + • The expansion ‘${VAR/[/]’PATTERN‘[/’REPLACEMENT‘]}’, which matches PATTERN and replaces it with REPLACEMENT in the value of VAR, is available (*note Shell Parameter Expansion::). - * The expansion '${!PREFIX*}' expansion, which expands to the names + • The expansion ‘${!PREFIX*}’ expansion, which expands to the names of all shell variables whose names begin with PREFIX, is available (*note Shell Parameter Expansion::). - * Bash has indirect variable expansion using '${!word}' (*note Shell + • Bash has indirect variable expansion using ‘${!word}’ (*note Shell Parameter Expansion::). - * Bash can expand positional parameters beyond '$9' using '${NUM}'. + • Bash can expand positional parameters beyond ‘$9’ using ‘${NUM}’. - * The POSIX '$()' form of command substitution is implemented (*note - Command Substitution::), and preferred to the Bourne shell's '``' + • The POSIX ‘$()’ form of command substitution is implemented (*note + Command Substitution::), and preferred to the Bourne shell's ‘``’ (which is also implemented for backwards compatibility). - * Bash has process substitution (*note Process Substitution::). + • Bash has process substitution (*note Process Substitution::). - * Bash automatically assigns variables that provide information about - the current user ('UID', 'EUID', and 'GROUPS'), the current host - ('HOSTTYPE', 'OSTYPE', 'MACHTYPE', and 'HOSTNAME'), and the - instance of Bash that is running ('BASH', 'BASH_VERSION', and - 'BASH_VERSINFO'). *Note Bash Variables::, for details. + • Bash automatically assigns variables that provide information about + the current user (‘UID’, ‘EUID’, and ‘GROUPS’), the current host + (‘HOSTTYPE’, ‘OSTYPE’, ‘MACHTYPE’, and ‘HOSTNAME’), and the + instance of Bash that is running (‘BASH’, ‘BASH_VERSION’, and + ‘BASH_VERSINFO’). *Note Bash Variables::, for details. - * The 'IFS' variable is used to split only the results of expansion, + • The ‘IFS’ variable is used to split only the results of expansion, not all words (*note Word Splitting::). This closes a longstanding shell security hole. - * The filename expansion bracket expression code uses '!' and '^' to + • The filename expansion bracket expression code uses ‘!’ and ‘^’ to negate the set of characters between the brackets. The Bourne - shell uses only '!'. + shell uses only ‘!’. - * Bash implements the full set of POSIX filename expansion operators, + • Bash implements the full set of POSIX filename expansion operators, including character classes, equivalence classes, and collating symbols (*note Filename Expansion::). - * Bash implements extended pattern matching features when the - 'extglob' shell option is enabled (*note Pattern Matching::). + • Bash implements extended pattern matching features when the + ‘extglob’ shell option is enabled (*note Pattern Matching::). - * It is possible to have a variable and a function with the same - name; 'sh' does not separate the two name spaces. + • It is possible to have a variable and a function with the same + name; ‘sh’ does not separate the two name spaces. - * Bash functions are permitted to have local variables using the - 'local' builtin, and thus useful recursive functions may be written + • Bash functions are permitted to have local variables using the + ‘local’ builtin, and thus useful recursive functions may be written (*note Bash Builtins::). - * Variable assignments preceding commands affect only that command, - even builtins and functions (*note Environment::). In 'sh', all + • Variable assignments preceding commands affect only that command, + even builtins and functions (*note Environment::). In ‘sh’, all variable assignments preceding commands are global unless the command is executed from the file system. - * Bash performs filename expansion on filenames specified as operands + • Bash performs filename expansion on filenames specified as operands to input and output redirection operators (*note Redirections::). - * Bash contains the '<>' redirection operator, allowing a file to be - opened for both reading and writing, and the '&>' redirection + • Bash contains the ‘<>’ redirection operator, allowing a file to be + opened for both reading and writing, and the ‘&>’ redirection operator, for directing standard output and standard error to the same file (*note Redirections::). - * Bash includes the '<<<' redirection operator, allowing a string to + • Bash includes the ‘<<<’ redirection operator, allowing a string to be used as the standard input to a command. - * Bash implements the '[n]<&WORD' and '[n]>&WORD' redirection + • Bash implements the ‘[n]<&WORD’ and ‘[n]>&WORD’ redirection operators, which move one file descriptor to another. - * Bash treats a number of filenames specially when they are used in + • Bash treats a number of filenames specially when they are used in redirection operators (*note Redirections::). - * Bash can open network connections to arbitrary machines and + • Bash can open network connections to arbitrary machines and services with the redirection operators (*note Redirections::). - * The 'noclobber' option is available to avoid overwriting existing - files with output redirection (*note The Set Builtin::). The '>|' - redirection operator may be used to override 'noclobber'. + • The ‘noclobber’ option is available to avoid overwriting existing + files with output redirection (*note The Set Builtin::). The ‘>|’ + redirection operator may be used to override ‘noclobber’. - * The Bash 'cd' and 'pwd' builtins (*note Bourne Shell Builtins::) - each take '-L' and '-P' options to switch between logical and + • The Bash ‘cd’ and ‘pwd’ builtins (*note Bourne Shell Builtins::) + each take ‘-L’ and ‘-P’ options to switch between logical and physical modes. - * Bash allows a function to override a builtin with the same name, + • Bash allows a function to override a builtin with the same name, and provides access to that builtin's functionality within the - function via the 'builtin' and 'command' builtins (*note Bash + function via the ‘builtin’ and ‘command’ builtins (*note Bash Builtins::). - * The 'command' builtin allows selective disabling of functions when + • The ‘command’ builtin allows selective disabling of functions when command lookup is performed (*note Bash Builtins::). - * Individual builtins may be enabled or disabled using the 'enable' + • Individual builtins may be enabled or disabled using the ‘enable’ builtin (*note Bash Builtins::). - * The Bash 'exec' builtin takes additional options that allow users + • The Bash ‘exec’ builtin takes additional options that allow users to control the contents of the environment passed to the executed command, and what the zeroth argument to the command is to be (*note Bourne Shell Builtins::). - * Shell functions may be exported to children via the environment - using 'export -f' (*note Shell Functions::). + • Shell functions may be exported to children via the environment + using ‘export -f’ (*note Shell Functions::). - * The Bash 'export', 'readonly', and 'declare' builtins can take a - '-f' option to act on shell functions, a '-p' option to display + • The Bash ‘export’, ‘readonly’, and ‘declare’ builtins can take a + ‘-f’ option to act on shell functions, a ‘-p’ option to display variables with various attributes set in a format that can be used - as shell input, a '-n' option to remove various variable - attributes, and 'name=value' arguments to set variable attributes + as shell input, a ‘-n’ option to remove various variable + attributes, and ‘name=value’ arguments to set variable attributes and values simultaneously. - * The Bash 'hash' builtin allows a name to be associated with an + • The Bash ‘hash’ builtin allows a name to be associated with an arbitrary filename, even when that filename cannot be found by - searching the '$PATH', using 'hash -p' (*note Bourne Shell + searching the ‘$PATH’, using ‘hash -p’ (*note Bourne Shell Builtins::). - * Bash includes a 'help' builtin for quick reference to shell + • Bash includes a ‘help’ builtin for quick reference to shell facilities (*note Bash Builtins::). - * The 'printf' builtin is available to display formatted output + • The ‘printf’ builtin is available to display formatted output (*note Bash Builtins::). - * The Bash 'read' builtin (*note Bash Builtins::) will read a line - ending in '\' with the '-r' option, and will use the 'REPLY' + • The Bash ‘read’ builtin (*note Bash Builtins::) will read a line + ending in ‘\’ with the ‘-r’ option, and will use the ‘REPLY’ variable as a default if no non-option arguments are supplied. The - Bash 'read' builtin also accepts a prompt string with the '-p' - option and will use Readline to obtain the line when given the '-e' - or '-E' options. The 'read' builtin also has additional options to - control input: the '-s' option will turn off echoing of input - characters as they are read, the '-t' option will allow 'read' to + Bash ‘read’ builtin also accepts a prompt string with the ‘-p’ + option and will use Readline to obtain the line when given the ‘-e’ + or ‘-E’ options. The ‘read’ builtin also has additional options to + control input: the ‘-s’ option will turn off echoing of input + characters as they are read, the ‘-t’ option will allow ‘read’ to time out if input does not arrive within a specified number of - seconds, the '-n' option will allow reading only a specified number - of characters rather than a full line, and the '-d' option will + seconds, the ‘-n’ option will allow reading only a specified number + of characters rather than a full line, and the ‘-d’ option will read until a particular character rather than newline. - * The 'return' builtin may be used to abort execution of scripts - executed with the '.' or 'source' builtins (*note Bourne Shell + • The ‘return’ builtin may be used to abort execution of scripts + executed with the ‘.’ or ‘source’ builtins (*note Bourne Shell Builtins::). - * Bash includes the 'shopt' builtin, for finer control of shell + • Bash includes the ‘shopt’ builtin, for finer control of shell optional capabilities (*note The Shopt Builtin::), and allows these options to be set and unset at shell invocation (*note Invoking Bash::). - * Bash has much more optional behavior controllable with the 'set' + • Bash has much more optional behavior controllable with the ‘set’ builtin (*note The Set Builtin::). - * The '-x' ('xtrace') option displays commands other than simple + • The ‘-x’ (‘xtrace’) option displays commands other than simple commands when performing an execution trace (*note The Set Builtin::). - * The 'test' builtin (*note Bourne Shell Builtins::) is slightly + • The ‘test’ builtin (*note Bourne Shell Builtins::) is slightly different, as it implements the POSIX algorithm, which specifies the behavior based on the number of arguments. - * Bash includes the 'caller' builtin, which displays the context of + • Bash includes the ‘caller’ builtin, which displays the context of any active subroutine call (a shell function or a script executed - with the '.' or 'source' builtins). This supports the Bash + with the ‘.’ or ‘source’ builtins). This supports the Bash debugger. - * The 'trap' builtin (*note Bourne Shell Builtins::) allows a 'DEBUG' - pseudo-signal specification, similar to 'EXIT'. Commands specified - with a 'DEBUG' trap are executed before every simple command, 'for' - command, 'case' command, 'select' command, every arithmetic 'for' + • The ‘trap’ builtin (*note Bourne Shell Builtins::) allows a ‘DEBUG’ + pseudo-signal specification, similar to ‘EXIT’. Commands specified + with a ‘DEBUG’ trap are executed before every simple command, ‘for’ + command, ‘case’ command, ‘select’ command, every arithmetic ‘for’ command, and before the first command executes in a shell function. - The 'DEBUG' trap is not inherited by shell functions unless the - function has been given the 'trace' attribute or the 'functrace' - option has been enabled using the 'shopt' builtin. The 'extdebug' - shell option has additional effects on the 'DEBUG' trap. - - The 'trap' builtin (*note Bourne Shell Builtins::) allows an 'ERR' - pseudo-signal specification, similar to 'EXIT' and 'DEBUG'. - Commands specified with an 'ERR' trap are executed after a simple - command fails, with a few exceptions. The 'ERR' trap is not - inherited by shell functions unless the '-o errtrace' option to the - 'set' builtin is enabled. - - The 'trap' builtin (*note Bourne Shell Builtins::) allows a - 'RETURN' pseudo-signal specification, similar to 'EXIT' and - 'DEBUG'. Commands specified with a 'RETURN' trap are executed + The ‘DEBUG’ trap is not inherited by shell functions unless the + function has been given the ‘trace’ attribute or the ‘functrace’ + option has been enabled using the ‘shopt’ builtin. The ‘extdebug’ + shell option has additional effects on the ‘DEBUG’ trap. + + The ‘trap’ builtin (*note Bourne Shell Builtins::) allows an ‘ERR’ + pseudo-signal specification, similar to ‘EXIT’ and ‘DEBUG’. + Commands specified with an ‘ERR’ trap are executed after a simple + command fails, with a few exceptions. The ‘ERR’ trap is not + inherited by shell functions unless the ‘-o errtrace’ option to the + ‘set’ builtin is enabled. + + The ‘trap’ builtin (*note Bourne Shell Builtins::) allows a + ‘RETURN’ pseudo-signal specification, similar to ‘EXIT’ and + ‘DEBUG’. Commands specified with a ‘RETURN’ trap are executed before execution resumes after a shell function or a shell script - executed with '.' or 'source' returns. The 'RETURN' trap is not + executed with ‘.’ or ‘source’ returns. The ‘RETURN’ trap is not inherited by shell functions unless the function has been given the - 'trace' attribute or the 'functrace' option has been enabled using - the 'shopt' builtin. + ‘trace’ attribute or the ‘functrace’ option has been enabled using + the ‘shopt’ builtin. - * The Bash 'type' builtin is more extensive and gives more + • The Bash ‘type’ builtin is more extensive and gives more information about the names it finds (*note Bash Builtins::). - * The Bash 'umask' builtin permits a '-p' option to cause the output - to be displayed in the form of a 'umask' command that may be reused + • The Bash ‘umask’ builtin permits a ‘-p’ option to cause the output + to be displayed in the form of a ‘umask’ command that may be reused as input (*note Bourne Shell Builtins::). - * Bash implements a 'csh'-like directory stack, and provides the - 'pushd', 'popd', and 'dirs' builtins to manipulate it (*note The + • Bash implements a ‘csh’-like directory stack, and provides the + ‘pushd’, ‘popd’, and ‘dirs’ builtins to manipulate it (*note The Directory Stack::). Bash also makes the directory stack visible as - the value of the 'DIRSTACK' shell variable. + the value of the ‘DIRSTACK’ shell variable. - * Bash interprets special backslash-escaped characters in the prompt + • Bash interprets special backslash-escaped characters in the prompt strings when interactive (*note Controlling the Prompt::). - * The Bash restricted mode is more useful (*note The Restricted + • The Bash restricted mode is more useful (*note The Restricted Shell::); the SVR4.2 shell restricted mode is too limited. - * The 'disown' builtin can remove a job from the internal shell job + • The ‘disown’ builtin can remove a job from the internal shell job table (*note Job Control Builtins::) or suppress the sending of - 'SIGHUP' to a job when the shell exits as the result of a 'SIGHUP'. + ‘SIGHUP’ to a job when the shell exits as the result of a ‘SIGHUP’. - * Bash includes a number of features to support a separate debugger + • Bash includes a number of features to support a separate debugger for shell scripts. - * The SVR4.2 shell has two privilege-related builtins ('mldmode' and - 'priv') not present in Bash. + • The SVR4.2 shell has two privilege-related builtins (‘mldmode’ and + ‘priv’) not present in Bash. - * Bash does not have the 'stop' or 'newgrp' builtins. + • Bash does not have the ‘stop’ or ‘newgrp’ builtins. - * Bash does not use the 'SHACCT' variable or perform shell + • Bash does not use the ‘SHACCT’ variable or perform shell accounting. - * The SVR4.2 'sh' uses a 'TIMEOUT' variable like Bash uses 'TMOUT'. + • The SVR4.2 ‘sh’ uses a ‘TIMEOUT’ variable like Bash uses ‘TMOUT’. More features unique to Bash may be found in *note Bash Features::. @@ -11598,41 +11606,41 @@ B.1 Implementation Differences From The SVR4.2 Shell Since Bash is a completely new implementation, it does not suffer from many of the limitations of the SVR4.2 shell. For instance: - * Bash does not fork a subshell when redirecting into or out of a - shell control structure such as an 'if' or 'while' statement. + • Bash does not fork a subshell when redirecting into or out of a + shell control structure such as an ‘if’ or ‘while’ statement. - * Bash does not allow unbalanced quotes. The SVR4.2 shell will - silently insert a needed closing quote at 'EOF' under certain + • Bash does not allow unbalanced quotes. The SVR4.2 shell will + silently insert a needed closing quote at ‘EOF’ under certain circumstances. This can be the cause of some hard-to-find errors. - * The SVR4.2 shell uses a baroque memory management scheme based on - trapping 'SIGSEGV'. If the shell is started from a process with - 'SIGSEGV' blocked (e.g., by using the 'system()' C library function + • The SVR4.2 shell uses a baroque memory management scheme based on + trapping ‘SIGSEGV’. If the shell is started from a process with + ‘SIGSEGV’ blocked (e.g., by using the ‘system()’ C library function call), it misbehaves badly. - * In a questionable attempt at security, the SVR4.2 shell, when - invoked without the '-p' option, will alter its real and effective + • In a questionable attempt at security, the SVR4.2 shell, when + invoked without the ‘-p’ option, will alter its real and effective UID and GID if they are less than some magic threshold value, commonly 100. This can lead to unexpected results. - * The SVR4.2 shell does not allow users to trap 'SIGSEGV', 'SIGALRM', - or 'SIGCHLD'. + • The SVR4.2 shell does not allow users to trap ‘SIGSEGV’, ‘SIGALRM’, + or ‘SIGCHLD’. - * The SVR4.2 shell does not allow the 'IFS', 'MAILCHECK', 'PATH', - 'PS1', or 'PS2' variables to be unset. + • The SVR4.2 shell does not allow the ‘IFS’, ‘MAILCHECK’, ‘PATH’, + ‘PS1’, or ‘PS2’ variables to be unset. - * The SVR4.2 shell treats '^' as the undocumented equivalent of '|'. + • The SVR4.2 shell treats ‘^’ as the undocumented equivalent of ‘|’. - * Bash allows multiple option arguments when it is invoked ('-x -v'); - the SVR4.2 shell allows only one option argument ('-xv'). In fact, + • Bash allows multiple option arguments when it is invoked (‘-x -v’); + the SVR4.2 shell allows only one option argument (‘-xv’). In fact, some versions of the shell dump core if the second argument begins - with a '-'. + with a ‘-’. - * The SVR4.2 shell exits a script if any builtin fails; Bash exits a + • The SVR4.2 shell exits a script if any builtin fails; Bash exits a script only if one of the POSIX special builtins fails, and only for certain failures, as enumerated in the POSIX standard. - * The SVR4.2 shell behaves differently when invoked as 'jsh' (it + • The SVR4.2 shell behaves differently when invoked as ‘jsh’ (it turns on job control).  @@ -11643,7 +11651,7 @@ Appendix C GNU Free Documentation License Version 1.3, 3 November 2008 - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -11652,7 +11660,7 @@ Appendix C GNU Free Documentation License 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other - functional and useful document "free" in the sense of freedom: to + functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the @@ -12142,10 +12150,10 @@ D.1 Index of Shell Builtin Commands [index] * Menu: -* .: Bourne Shell Builtins. - (line 17) * :: Bourne Shell Builtins. (line 11) +* .: Bourne Shell Builtins. + (line 17) * [: Bourne Shell Builtins. (line 285) * alias: Bash Builtins. (line 11) @@ -12211,7 +12219,7 @@ D.1 Index of Shell Builtin Commands * pwd: Bourne Shell Builtins. (line 222) * read: Bash Builtins. (line 518) -* readarray: Bash Builtins. (line 621) +* readarray: Bash Builtins. (line 624) * readonly: Bourne Shell Builtins. (line 232) * return: Bourne Shell Builtins. @@ -12220,7 +12228,7 @@ D.1 Index of Shell Builtin Commands * shift: Bourne Shell Builtins. (line 272) * shopt: The Shopt Builtin. (line 9) -* source: Bash Builtins. (line 630) +* source: Bash Builtins. (line 633) * suspend: Job Control Builtins. (line 116) * test: Bourne Shell Builtins. @@ -12231,12 +12239,12 @@ D.1 Index of Shell Builtin Commands (line 393) * true: Bourne Shell Builtins. (line 455) -* type: Bash Builtins. (line 635) -* typeset: Bash Builtins. (line 673) -* ulimit: Bash Builtins. (line 679) +* type: Bash Builtins. (line 638) +* typeset: Bash Builtins. (line 676) +* ulimit: Bash Builtins. (line 682) * umask: Bourne Shell Builtins. (line 460) -* unalias: Bash Builtins. (line 785) +* unalias: Bash Builtins. (line 788) * unset: Bourne Shell Builtins. (line 478) * wait: Job Control Builtins. @@ -12253,9 +12261,9 @@ D.2 Index of Shell Reserved Words * !: Pipelines. (line 9) * [[: Conditional Constructs. - (line 126) + (line 125) * ]]: Conditional Constructs. - (line 126) + (line 125) * {: Command Grouping. (line 21) * }: Command Grouping. (line 21) * case: Conditional Constructs. @@ -12277,7 +12285,7 @@ D.2 Index of Shell Reserved Words * in: Conditional Constructs. (line 28) * select: Conditional Constructs. - (line 84) + (line 83) * then: Conditional Constructs. (line 7) * time: Pipelines. (line 9) @@ -12293,24 +12301,24 @@ D.3 Parameter and Variable Index [index] * Menu: +* _: Bash Variables. (line 13) +* -: Special Parameters. (line 46) * !: Special Parameters. (line 55) +* ?: Special Parameters. (line 42) +* @: Special Parameters. (line 22) +* *: Special Parameters. (line 9) * #: Special Parameters. (line 39) * $: Special Parameters. (line 51) +* $_: Bash Variables. (line 14) +* $-: Special Parameters. (line 47) * $!: Special Parameters. (line 56) +* $?: Special Parameters. (line 43) +* $@: Special Parameters. (line 23) +* $*: Special Parameters. (line 10) * $#: Special Parameters. (line 40) * $$: Special Parameters. (line 52) -* $*: Special Parameters. (line 10) -* $-: Special Parameters. (line 47) * $0: Special Parameters. (line 61) -* $?: Special Parameters. (line 43) -* $@: Special Parameters. (line 23) -* $_: Bash Variables. (line 14) -* *: Special Parameters. (line 9) -* -: Special Parameters. (line 46) * 0: Special Parameters. (line 60) -* ?: Special Parameters. (line 42) -* @: Special Parameters. (line 22) -* _: Bash Variables. (line 13) * active-region-end-color: Readline Init File Syntax. (line 51) * active-region-start-color: Readline Init File Syntax. @@ -12318,8 +12326,6 @@ D.3 Parameter and Variable Index * auto_resume: Job Control Variables. (line 6) * BASH: Bash Variables. (line 23) -* BASHOPTS: Bash Variables. (line 26) -* BASHPID: Bash Variables. (line 35) * BASH_ALIASES: Bash Variables. (line 42) * BASH_ARGC: Bash Variables. (line 51) * BASH_ARGV: Bash Variables. (line 65) @@ -12339,6 +12345,8 @@ D.3 Parameter and Variable Index * BASH_VERSINFO: Bash Variables. (line 176) * BASH_VERSION: Bash Variables. (line 199) * BASH_XTRACEFD: Bash Variables. (line 202) +* BASHOPTS: Bash Variables. (line 26) +* BASHPID: Bash Variables. (line 35) * bell-style: Readline Init File Syntax. (line 64) * bind-tty-special-chars: Readline Init File Syntax. @@ -12355,6 +12363,13 @@ D.3 Parameter and Variable Index * COLUMNS: Bash Variables. (line 220) * comment-begin: Readline Init File Syntax. (line 100) +* COMP_CWORD: Bash Variables. (line 226) +* COMP_KEY: Bash Variables. (line 255) +* COMP_LINE: Bash Variables. (line 232) +* COMP_POINT: Bash Variables. (line 237) +* COMP_TYPE: Bash Variables. (line 245) +* COMP_WORDBREAKS: Bash Variables. (line 259) +* COMP_WORDS: Bash Variables. (line 265) * completion-display-width: Readline Init File Syntax. (line 105) * completion-ignore-case: Readline Init File Syntax. @@ -12366,13 +12381,6 @@ D.3 Parameter and Variable Index * completion-query-items: Readline Init File Syntax. (line 130) * COMPREPLY: Bash Variables. (line 272) -* COMP_CWORD: Bash Variables. (line 226) -* COMP_KEY: Bash Variables. (line 255) -* COMP_LINE: Bash Variables. (line 232) -* COMP_POINT: Bash Variables. (line 237) -* COMP_TYPE: Bash Variables. (line 245) -* COMP_WORDBREAKS: Bash Variables. (line 259) -* COMP_WORDS: Bash Variables. (line 265) * convert-meta: Readline Init File Syntax. (line 141) * COPROC: Bash Variables. (line 278) @@ -12422,40 +12430,40 @@ D.3 Parameter and Variable Index (line 13) * horizontal-scroll-mode: Readline Init File Syntax. (line 229) -* HOSTFILE: Bash Variables. (line 493) -* HOSTNAME: Bash Variables. (line 504) -* HOSTTYPE: Bash Variables. (line 507) +* HOSTFILE: Bash Variables. (line 494) +* HOSTNAME: Bash Variables. (line 505) +* HOSTTYPE: Bash Variables. (line 508) * IFS: Bourne Shell Variables. (line 18) -* IGNOREEOF: Bash Variables. (line 510) +* IGNOREEOF: Bash Variables. (line 511) * input-meta: Readline Init File Syntax. (line 238) -* INPUTRC: Bash Variables. (line 520) -* INSIDE_EMACS: Bash Variables. (line 524) +* INPUTRC: Bash Variables. (line 521) +* INSIDE_EMACS: Bash Variables. (line 525) * isearch-terminators: Readline Init File Syntax. (line 248) * keymap: Readline Init File Syntax. (line 255) * LANG: Creating Internationalized Scripts. (line 51) -* LANG <1>: Bash Variables. (line 530) -* LC_ALL: Bash Variables. (line 534) -* LC_COLLATE: Bash Variables. (line 538) -* LC_CTYPE: Bash Variables. (line 545) +* LANG <1>: Bash Variables. (line 531) +* LC_ALL: Bash Variables. (line 535) +* LC_COLLATE: Bash Variables. (line 539) +* LC_CTYPE: Bash Variables. (line 546) * LC_MESSAGES: Creating Internationalized Scripts. (line 51) -* LC_MESSAGES <1>: Bash Variables. (line 550) -* LC_NUMERIC: Bash Variables. (line 554) -* LC_TIME: Bash Variables. (line 558) -* LINENO: Bash Variables. (line 562) -* LINES: Bash Variables. (line 567) -* MACHTYPE: Bash Variables. (line 573) +* LC_MESSAGES <1>: Bash Variables. (line 551) +* LC_NUMERIC: Bash Variables. (line 555) +* LC_TIME: Bash Variables. (line 559) +* LINENO: Bash Variables. (line 563) +* LINES: Bash Variables. (line 568) +* MACHTYPE: Bash Variables. (line 574) * MAIL: Bourne Shell Variables. (line 22) -* MAILCHECK: Bash Variables. (line 577) +* MAILCHECK: Bash Variables. (line 578) * MAILPATH: Bourne Shell Variables. (line 27) -* MAPFILE: Bash Variables. (line 585) +* MAPFILE: Bash Variables. (line 586) * mark-modified-lines: Readline Init File Syntax. (line 285) * mark-symlinked-directories: Readline Init File Syntax. @@ -12466,46 +12474,46 @@ D.3 Parameter and Variable Index (line 302) * meta-flag: Readline Init File Syntax. (line 238) -* OLDPWD: Bash Variables. (line 589) +* OLDPWD: Bash Variables. (line 590) * OPTARG: Bourne Shell Variables. (line 34) -* OPTERR: Bash Variables. (line 592) +* OPTERR: Bash Variables. (line 593) * OPTIND: Bourne Shell Variables. (line 38) -* OSTYPE: Bash Variables. (line 596) +* OSTYPE: Bash Variables. (line 597) * output-meta: Readline Init File Syntax. (line 307) * page-completions: Readline Init File Syntax. (line 315) * PATH: Bourne Shell Variables. (line 42) -* PIPESTATUS: Bash Variables. (line 599) -* POSIXLY_CORRECT: Bash Variables. (line 604) -* PPID: Bash Variables. (line 614) -* PROMPT_COMMAND: Bash Variables. (line 618) -* PROMPT_DIRTRIM: Bash Variables. (line 624) -* PS0: Bash Variables. (line 630) +* PIPESTATUS: Bash Variables. (line 600) +* POSIXLY_CORRECT: Bash Variables. (line 605) +* PPID: Bash Variables. (line 615) +* PROMPT_COMMAND: Bash Variables. (line 619) +* PROMPT_DIRTRIM: Bash Variables. (line 625) +* PS0: Bash Variables. (line 631) * PS1: Bourne Shell Variables. (line 48) * PS2: Bourne Shell Variables. (line 53) -* PS3: Bash Variables. (line 635) -* PS4: Bash Variables. (line 640) -* PWD: Bash Variables. (line 648) -* RANDOM: Bash Variables. (line 651) -* READLINE_ARGUMENT: Bash Variables. (line 657) -* READLINE_LINE: Bash Variables. (line 661) -* READLINE_MARK: Bash Variables. (line 665) -* READLINE_POINT: Bash Variables. (line 671) -* REPLY: Bash Variables. (line 675) +* PS3: Bash Variables. (line 636) +* PS4: Bash Variables. (line 641) +* PWD: Bash Variables. (line 649) +* RANDOM: Bash Variables. (line 652) +* READLINE_ARGUMENT: Bash Variables. (line 658) +* READLINE_LINE: Bash Variables. (line 662) +* READLINE_MARK: Bash Variables. (line 666) +* READLINE_POINT: Bash Variables. (line 672) +* REPLY: Bash Variables. (line 676) * revert-all-at-newline: Readline Init File Syntax. (line 325) * search-ignore-case: Readline Init File Syntax. (line 332) -* SECONDS: Bash Variables. (line 678) -* SHELL: Bash Variables. (line 687) -* SHELLOPTS: Bash Variables. (line 692) -* SHLVL: Bash Variables. (line 701) +* SECONDS: Bash Variables. (line 679) +* SHELL: Bash Variables. (line 688) +* SHELLOPTS: Bash Variables. (line 693) +* SHLVL: Bash Variables. (line 702) * show-all-if-ambiguous: Readline Init File Syntax. (line 337) * show-all-if-unmodified: Readline Init File Syntax. @@ -12514,15 +12522,15 @@ D.3 Parameter and Variable Index (line 352) * skip-completed-text: Readline Init File Syntax. (line 358) -* SRANDOM: Bash Variables. (line 706) +* SRANDOM: Bash Variables. (line 707) * TEXTDOMAIN: Creating Internationalized Scripts. (line 51) * TEXTDOMAINDIR: Creating Internationalized Scripts. (line 51) -* TIMEFORMAT: Bash Variables. (line 715) -* TMOUT: Bash Variables. (line 753) -* TMPDIR: Bash Variables. (line 765) -* UID: Bash Variables. (line 769) +* TIMEFORMAT: Bash Variables. (line 716) +* TMOUT: Bash Variables. (line 754) +* TMPDIR: Bash Variables. (line 766) +* UID: Bash Variables. (line 770) * vi-cmd-mode-string: Readline Init File Syntax. (line 371) * vi-ins-mode-string: Readline Init File Syntax. @@ -12544,7 +12552,7 @@ D.4 Function Index * accept-line (Newline or Return): Commands For History. (line 6) * alias-expand-line (): Miscellaneous Commands. - (line 132) + (line 133) * backward-char (C-b): Commands For Moving. (line 15) * backward-delete-char (Rubout): Commands For Text. (line 17) * backward-kill-line (C-x Rubout): Commands For Killing. @@ -12606,7 +12614,7 @@ D.4 Function Index * dynamic-complete-history (M-): Commands For Completion. (line 90) * edit-and-execute-command (C-x C-e): Miscellaneous Commands. - (line 141) + (line 142) * 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. @@ -12615,7 +12623,7 @@ D.4 Function Index * exchange-point-and-mark (C-x C-x): Miscellaneous Commands. (line 37) * execute-named-command (M-x): Miscellaneous Commands. - (line 146) + (line 147) * fetch-history (): Commands For History. (line 103) * forward-backward-delete-char (): Commands For Text. (line 21) @@ -12630,9 +12638,9 @@ D.4 Function Index * glob-list-expansions (C-x g): Miscellaneous Commands. (line 110) * history-and-alias-expand-line (): Miscellaneous Commands. - (line 135) + (line 136) * history-expand-line (M-^): Miscellaneous Commands. - (line 125) + (line 126) * history-search-backward (): Commands For History. (line 57) * history-search-forward (): Commands For History. @@ -12646,7 +12654,7 @@ D.4 Function Index * insert-completions (M-*): Commands For Completion. (line 22) * insert-last-argument (M-. or M-_): Miscellaneous Commands. - (line 138) + (line 139) * kill-line (C-k): Commands For Killing. (line 6) * kill-region (): Commands For Killing. @@ -12656,7 +12664,7 @@ D.4 Function Index * kill-word (M-d): Commands For Killing. (line 23) * magic-space (): Miscellaneous Commands. - (line 128) + (line 129) * menu-complete (): Commands For Completion. (line 26) * menu-complete-backward (): Commands For Completion. @@ -12914,138 +12922,138 @@ D.5 Concept Index  Tag Table: -Node: Top897 -Node: Introduction2817 -Node: What is Bash?3033 -Node: What is a shell?4147 -Node: Definitions6685 -Node: Basic Shell Features9636 -Node: Shell Syntax10855 -Node: Shell Operation11881 -Node: Quoting13174 -Node: Escape Character14478 -Node: Single Quotes14963 -Node: Double Quotes15311 -Node: ANSI-C Quoting16589 -Node: Locale Translation17901 -Node: Creating Internationalized Scripts19212 -Node: Comments23329 -Node: Shell Commands23947 -Node: Reserved Words24885 -Node: Simple Commands25641 -Node: Pipelines26295 -Node: Lists29281 -Node: Compound Commands31076 -Node: Looping Constructs32088 -Node: Conditional Constructs34583 -Node: Command Grouping49071 -Node: Coprocesses50549 -Node: GNU Parallel53212 -Node: Shell Functions54129 -Node: Shell Parameters62014 -Node: Positional Parameters66402 -Node: Special Parameters67304 -Node: Shell Expansions70518 -Node: Brace Expansion72606 -Node: Tilde Expansion75340 -Node: Shell Parameter Expansion77961 -Node: Command Substitution96554 -Node: Arithmetic Expansion100018 -Node: Process Substitution100986 -Node: Word Splitting102106 -Node: Filename Expansion104154 -Node: Pattern Matching107087 -Node: Quote Removal112089 -Node: Redirections112384 -Node: Executing Commands122078 -Node: Simple Command Expansion122748 -Node: Command Search and Execution124858 -Node: Command Execution Environment127245 -Node: Environment130280 -Node: Exit Status131943 -Node: Signals133727 -Node: Shell Scripts137176 -Node: Shell Builtin Commands140203 -Node: Bourne Shell Builtins142241 -Node: Bash Builtins165633 -Node: Modifying Shell Behavior198853 -Node: The Set Builtin199198 -Node: The Shopt Builtin210172 -Node: Special Builtins226367 -Node: Shell Variables227359 -Node: Bourne Shell Variables227796 -Node: Bash Variables229900 -Node: Bash Features264969 -Node: Invoking Bash265982 -Node: Bash Startup Files272116 -Node: Interactive Shells277247 -Node: What is an Interactive Shell?277658 -Node: Is this Shell Interactive?278307 -Node: Interactive Shell Behavior279122 -Node: Bash Conditional Expressions282751 -Node: Shell Arithmetic287664 -Node: Aliases290625 -Node: Arrays293519 -Node: The Directory Stack300153 -Node: Directory Stack Builtins300937 -Node: Controlling the Prompt305197 -Node: The Restricted Shell308162 -Node: Bash POSIX Mode310772 -Node: Shell Compatibility Mode327689 -Node: Job Control335940 -Node: Job Control Basics336400 -Node: Job Control Builtins341402 -Node: Job Control Variables347197 -Node: Command Line Editing348353 -Node: Introduction and Notation350024 -Node: Readline Interaction351647 -Node: Readline Bare Essentials352838 -Node: Readline Movement Commands354627 -Node: Readline Killing Commands355587 -Node: Readline Arguments357508 -Node: Searching358552 -Node: Readline Init File360738 -Node: Readline Init File Syntax361999 -Node: Conditional Init Constructs386024 -Node: Sample Init File390220 -Node: Bindable Readline Commands393344 -Node: Commands For Moving394548 -Node: Commands For History396599 -Node: Commands For Text401593 -Node: Commands For Killing405571 -Node: Numeric Arguments408275 -Node: Commands For Completion409414 -Node: Keyboard Macros413605 -Node: Miscellaneous Commands414293 -Node: Readline vi Mode420662 -Node: Programmable Completion421569 -Node: Programmable Completion Builtins429349 -Node: A Programmable Completion Example440469 -Node: Using History Interactively445717 -Node: Bash History Facilities446401 -Node: Bash History Builtins449412 -Node: History Interaction454503 -Node: Event Designators458755 -Node: Word Designators460293 -Node: Modifiers462158 -Node: Installing Bash463966 -Node: Basic Installation465103 -Node: Compilers and Options468825 -Node: Compiling For Multiple Architectures469566 -Node: Installation Names471258 -Node: Specifying the System Type473367 -Node: Sharing Defaults474084 -Node: Operation Controls474757 -Node: Optional Features475715 -Node: Reporting Bugs486935 -Node: Major Differences From The Bourne Shell488269 -Node: GNU Free Documentation License505127 -Node: Indexes530304 -Node: Builtin Index530758 -Node: Reserved Word Index537859 -Node: Variable Index540307 -Node: Function Index557441 -Node: Concept Index571300 +Node: Top902 +Node: Introduction2844 +Node: What is Bash?3060 +Node: What is a shell?4204 +Node: Definitions6786 +Node: Basic Shell Features9965 +Node: Shell Syntax11188 +Node: Shell Operation12218 +Node: Quoting13519 +Node: Escape Character14835 +Node: Single Quotes15336 +Node: Double Quotes15688 +Node: ANSI-C Quoting17034 +Node: Locale Translation18422 +Node: Creating Internationalized Scripts19769 +Node: Comments23970 +Node: Shell Commands24608 +Node: Reserved Words25550 +Node: Simple Commands26418 +Node: Pipelines27080 +Node: Lists30146 +Node: Compound Commands32021 +Node: Looping Constructs33033 +Node: Conditional Constructs35580 +Node: Command Grouping50487 +Node: Coprocesses51977 +Node: GNU Parallel54676 +Node: Shell Functions55597 +Node: Shell Parameters63706 +Node: Positional Parameters68242 +Node: Special Parameters69180 +Node: Shell Expansions72490 +Node: Brace Expansion74682 +Node: Tilde Expansion77348 +Node: Shell Parameter Expansion80117 +Node: Command Substitution99144 +Node: Arithmetic Expansion102680 +Node: Process Substitution103648 +Node: Word Splitting104788 +Node: Filename Expansion106932 +Node: Pattern Matching110031 +Node: Quote Removal115267 +Node: Redirections115574 +Node: Executing Commands125386 +Node: Simple Command Expansion126056 +Node: Command Search and Execution128170 +Node: Command Execution Environment130581 +Node: Environment133893 +Node: Exit Status135600 +Node: Signals137388 +Node: Shell Scripts141005 +Node: Shell Builtin Commands144100 +Node: Bourne Shell Builtins146214 +Node: Bash Builtins170621 +Node: Modifying Shell Behavior205229 +Node: The Set Builtin205574 +Node: The Shopt Builtin217092 +Node: Special Builtins233831 +Node: Shell Variables234823 +Node: Bourne Shell Variables235260 +Node: Bash Variables237456 +Node: Bash Features273881 +Node: Invoking Bash274898 +Node: Bash Startup Files281300 +Node: Interactive Shells286615 +Node: What is an Interactive Shell?287026 +Node: Is this Shell Interactive?287695 +Node: Interactive Shell Behavior288522 +Node: Bash Conditional Expressions292279 +Node: Shell Arithmetic297456 +Node: Aliases300541 +Node: Arrays303499 +Node: The Directory Stack310301 +Node: Directory Stack Builtins311101 +Node: Controlling the Prompt315553 +Node: The Restricted Shell318694 +Node: Bash POSIX Mode321484 +Node: Shell Compatibility Mode338968 +Node: Job Control347457 +Node: Job Control Basics347917 +Node: Job Control Builtins353094 +Node: Job Control Variables359057 +Node: Command Line Editing360237 +Node: Introduction and Notation361944 +Node: Readline Interaction363591 +Node: Readline Bare Essentials364782 +Node: Readline Movement Commands366603 +Node: Readline Killing Commands367603 +Node: Readline Arguments369584 +Node: Searching370644 +Node: Readline Init File372876 +Node: Readline Init File Syntax374161 +Node: Conditional Init Constructs399102 +Node: Sample Init File403470 +Node: Bindable Readline Commands406594 +Node: Commands For Moving407822 +Node: Commands For History409925 +Node: Commands For Text415011 +Node: Commands For Killing419089 +Node: Numeric Arguments421893 +Node: Commands For Completion423048 +Node: Keyboard Macros427367 +Node: Miscellaneous Commands428071 +Node: Readline vi Mode434728 +Node: Programmable Completion435683 +Node: Programmable Completion Builtins443643 +Node: A Programmable Completion Example455212 +Node: Using History Interactively460560 +Node: Bash History Facilities461244 +Node: Bash History Builtins464359 +Node: History Interaction469605 +Node: Event Designators473933 +Node: Word Designators475519 +Node: Modifiers477508 +Node: Installing Bash479420 +Node: Basic Installation480557 +Node: Compilers and Options484439 +Node: Compiling For Multiple Architectures485192 +Node: Installation Names486944 +Node: Specifying the System Type489181 +Node: Sharing Defaults489930 +Node: Operation Controls490647 +Node: Optional Features491669 +Node: Reporting Bugs503474 +Node: Major Differences From The Bourne Shell504826 +Node: GNU Free Documentation License522638 +Node: Indexes547818 +Node: Builtin Index548272 +Node: Reserved Word Index555373 +Node: Variable Index557821 +Node: Function Index574955 +Node: Concept Index588814  End Tag Table diff --git a/doc/bashref.log b/doc/bashref.log index 48f67f55..abecdd4b 100644 --- a/doc/bashref.log +++ b/doc/bashref.log @@ -1,12 +1,12 @@ -This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/MacPorts 2021.58693_0) (preloaded format=pdfetex 2021.8.30) 14 DEC 2023 16:39 +This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023/MacPorts 2023.66589_3) (preloaded format=pdfetex 2024.1.2) 7 FEB 2024 09:25 entering extended mode restricted \write18 enabled. file:line:error style messages enabled. %&-line parsing enabled. -**\input /usr/local/src/bash/bash-20231212/doc/bashref.texi \input /usr/local/s -rc/bash/bash-20231212/doc/bashref.texi -(/usr/local/src/bash/bash-20231212/doc/bashref.texi -(/usr/local/src/bash/bash-20231212/doc/texinfo.tex +**\input /usr/local/src/bash/bash-20240205/doc/bashref.texi \input /usr/local/s +rc/bash/bash-20240205/doc/bashref.texi +(/usr/local/src/bash/bash-20240205/doc/bashref.texi +(/usr/local/src/bash/bash-20240205/doc/texinfo.tex Loading texinfo [version 2015-11-22.14]: \outerhsize=\dimen16 \outervsize=\dimen17 @@ -162,15 +162,15 @@ This is `epsf.tex' v2.7.4 <14 February 2011> texinfo.tex: doing @include of version.texi -(/usr/local/src/bash/bash-20231212/doc/version.texi) [1{/opt/local/var/db/texmf +(/usr/local/src/bash/bash-20240205/doc/version.texi) [1{/opt/local/var/db/texmf /fonts/map/pdftex/updmap/pdftex.map}] [2] -(/usr/local/build/bash/bash-20231212/doc/bashref.toc [-1] [-2] [-3]) [-4] -(/usr/local/build/bash/bash-20231212/doc/bashref.toc) -(/usr/local/build/bash/bash-20231212/doc/bashref.toc) Chapter 1 +(/usr/local/build/bash/bash-20240205/doc/bashref.toc [-1] [-2] [-3]) [-4] +(/usr/local/build/bash/bash-20240205/doc/bashref.toc) +(/usr/local/build/bash/bash-20240205/doc/bashref.toc) Chapter 1 \openout0 = `bashref.toc'. -(/usr/local/build/bash/bash-20231212/doc/bashref.aux) +(/usr/local/build/bash/bash-20240205/doc/bashref.aux) \openout1 = `bashref.aux'. Chapter 2 [1] [2] @@ -221,16 +221,17 @@ Overfull \hbox (5.95723pt too wide) in paragraph at lines 724--725 @rwindfile=@write4 \openout4 = `bashref.rw'. -[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] -[24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] -[39] [40] [41] [42] [43] [44] [45] [46] [47] Chapter 4 [48] +[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19{/opt/local/share/texmf-tex +live/fonts/enc/dvips/cm-super/cm-super-t1.enc}] [20] [21] [22] [23] [24] +[25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] +[40] [41] [42] [43] [44] [45] [46] [47] Chapter 4 [48] @btindfile=@write5 \openout5 = `bashref.bt'. - [49] [50] [51] -[52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] -[67] [68] -Overfull \hbox (38.26585pt too wide) in paragraph at lines 5420--5420 + [49] [50] [51] [52] +[53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] +[68] +Overfull \hbox (38.26585pt too wide) in paragraph at lines 5435--5435 []@texttt set [-abefhkmnptuvxBCEHPT] [-o @textttsl option-name@texttt ] [--] [ -] [@textttsl ar-gu-ment []@texttt ][] @@ -243,7 +244,7 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5420--5420 .etc. -Overfull \hbox (38.26585pt too wide) in paragraph at lines 5421--5421 +Overfull \hbox (38.26585pt too wide) in paragraph at lines 5436--5436 []@texttt set [+abefhkmnptuvxBCEHPT] [+o @textttsl option-name@texttt ] [--] [ -] [@textttsl ar-gu-ment []@texttt ][] @@ -262,10 +263,10 @@ Overfull \hbox (38.26585pt too wide) in paragraph at lines 5421--5421 [119] [120] texinfo.tex: doing @include of rluser.texi - (/usr/local/src/bash/bash-20231212/lib/readline/doc/rluser.texi + (/usr/local/src/bash/bash-20240205/lib/readline/doc/rluser.texi Chapter 8 [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] -Underfull \hbox (badness 7540) in paragraph at lines 878--884 +Underfull \hbox (badness 7540) in paragraph at lines 882--888 []@textrm In the ex-am-ple above, @textttsl C-u[] @textrm is bound to the func -tion @@ -278,7 +279,7 @@ Underfull \hbox (badness 7540) in paragraph at lines 878--884 .etc. -Underfull \hbox (badness 10000) in paragraph at lines 878--884 +Underfull \hbox (badness 10000) in paragraph at lines 882--888 @texttt universal-argument[]@textrm , @textttsl M-DEL[] @textrm is bound to th e func-tion @@ -291,7 +292,7 @@ e func-tion .etc. [133] [134] [135] [136] -Overfull \hbox (26.43913pt too wide) in paragraph at lines 1112--1112 +Overfull \hbox (26.43913pt too wide) in paragraph at lines 1116--1116 []@texttt Meta-Control-h: backward-kill-word Text after the function name is i gnored[] @@ -312,10 +313,10 @@ gnored[] texinfo.tex: doing @include of hsuser.texi -(/usr/local/src/bash/bash-20231212/lib/readline/doc/hsuser.texi Chapter 9 +(/usr/local/src/bash/bash-20240205/lib/readline/doc/hsuser.texi Chapter 9 [158] [159] [160] [161] [162] [163]) Chapter 10 [164] [165] [166] [167] [168] -Underfull \hbox (badness 10000) in paragraph at lines 9776--9785 +Underfull \hbox (badness 10000) in paragraph at lines 9801--9810 []@textrm All of the fol-low-ing op-tions ex-cept for `@texttt alt-array-implem entation[]@textrm '[], @@ -328,7 +329,7 @@ entation[]@textrm '[], .etc. -Underfull \hbox (badness 10000) in paragraph at lines 9776--9785 +Underfull \hbox (badness 10000) in paragraph at lines 9801--9810 @textrm `@texttt disabled-builtins[]@textrm '[], `@texttt direxpand-default[]@t extrm '[], `@texttt strict-posix-default[]@textrm '[], and @@ -344,35 +345,34 @@ extrm '[], `@texttt strict-posix-default[]@textrm '[], and [178] [179] Appendix C [180] texinfo.tex: doing @include of fdl.texi - (/usr/local/src/bash/bash-20231212/doc/fdl.texi + (/usr/local/src/bash/bash-20240205/doc/fdl.texi [181] [182] [183] [184] [185] [186] [187]) Appendix D [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] ) Here is how much of TeX's memory you used: - 4104 strings out of 497086 - 47614 string characters out of 6206517 - 141909 words of memory out of 5000000 - 4869 multiletter control sequences out of 15000+600000 + 4105 strings out of 495840 + 47629 string characters out of 6171739 + 143202 words of memory out of 5000000 + 5048 multiletter control sequences out of 15000+600000 34315 words of font info for 116 fonts, out of 8000000 for 9000 - 51 hyphenation exceptions out of 8191 - 16i,6n,16p,389b,983s stack positions out of 5000i,500n,10000p,200000b,80000s -{/opt/local/share/texmf-texlive/font -s/enc/dvips/cm-super/cm-super-t1.enc}< -/opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsl10.pfb> -Output written on bashref.pdf (203 pages, 816032 bytes). + 701 hyphenation exceptions out of 8191 + 16i,6n,16p,389b,983s stack positions out of 10000i,1000n,20000p,200000b,200000s + + +Output written on bashref.pdf (203 pages, 816864 bytes). PDF statistics: 2830 PDF objects out of 2984 (max. 8388607) 2580 compressed objects within 26 object streams diff --git a/doc/bashref.pdf b/doc/bashref.pdf index 62d31940..f05cad16 100644 Binary files a/doc/bashref.pdf and b/doc/bashref.pdf differ diff --git a/doc/bashref.texi b/doc/bashref.texi index e50494eb..344fd94a 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -1999,8 +1999,6 @@ where @var{x} and @var{y} are either integers or letters, and @var{incr}, an optional increment, is an integer. When integers are supplied, the expression expands to each number between @var{x} and @var{y}, inclusive. -Supplied integers may be prefixed with @samp{0} to force each term to have the -same width. When either @var{x} or @var{y} begins with a zero, the shell attempts to force all generated terms to contain the same number of digits, zero-padding where necessary. @@ -4313,10 +4311,12 @@ The expression is parsed and evaluated according to precedence using the rules listed above. @end table +If the shell is in @sc{posix} mode, or if the expression is part +of the @code{[[} command, +the @samp{<} and @samp{>} operators sort using the current locale. If the shell is not in @sc{posix} mode, -when used with @code{test} or @samp{[}, the @samp{<} and @samp{>} -operators sort lexicographically using ASCII ordering. -If the shell is in @sc{posix} mode, these operators use the current locale. +the @code{test} and @samp{[} 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. @@ -6771,9 +6771,11 @@ after reading any startup files. @item HISTIGNORE A colon-separated list of patterns used to decide which command -lines should be saved on the history list. Each pattern is +lines should be saved on the history list. +Each pattern is anchored at the beginning of the line and must match the complete -line (no implicit @samp{*} is appended). Each pattern is tested +line (Bash will not implicitly append a @samp{*}). +Each pattern is tested against the line after the checks specified by @env{HISTCONTROL} are applied. In addition to the normal shell pattern matching characters, @samp{&} matches the previous history line. @samp{&} diff --git a/doc/builtins.0 b/doc/builtins.0 index bea922bd..84d52c36 100644 --- a/doc/builtins.0 +++ b/doc/builtins.0 @@ -1,6 +1,4 @@ -BASH_BUILTINS(1) General Commands Manual BASH_BUILTINS(1) - - +_B_A_S_H___B_U_I_L_T_I_N_S(1) General Commands Manual _B_A_S_H___B_U_I_L_T_I_N_S(1) NNAAMMEE :, ., [, alias, bg, bind, break, builtin, caller, cd, command, compgen, @@ -21,38 +19,39 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 and performing any specified redirections. The return status is zero. - .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] + .. _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] ssoouurrccee _f_i_l_e_n_a_m_e [_a_r_g_u_m_e_n_t_s] Read and execute commands from _f_i_l_e_n_a_m_e in the current shell en- vironment and return the exit status of the last command exe- cuted from _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e does not contain a slash, filenames in PPAATTHH are used to find the directory containing _f_i_l_e_n_a_m_e, but _f_i_l_e_n_a_m_e does not need to be executable. The file - searched for in PPAATTHH need not be executable. When bbaasshh is not - in _p_o_s_i_x _m_o_d_e, it searches the current directory if no file is - found in PPAATTHH. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin - command is turned off, the PPAATTHH is not searched. If any _a_r_g_u_- - _m_e_n_t_s are supplied, they become the positional parameters when - _f_i_l_e_n_a_m_e is executed. Otherwise the positional parameters are - unchanged. If the --TT option is enabled, .. inherits any trap on + searched for in PPAATTHH need not be executable. When bbaasshh is not + in _p_o_s_i_x _m_o_d_e, it searches the current directory if no file is + found in PPAATTHH. If the ssoouurrcceeppaatthh option to the sshhoopptt builtin + command is turned off, the PPAATTHH is not searched. If any _a_r_g_u_- + _m_e_n_t_s are supplied, they become the positional parameters when + _f_i_l_e_n_a_m_e is executed. Otherwise the positional parameters 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 call to .., and .. unsets the DDEEBBUUGG trap while it exe- cutes. If --TT is not set, and the sourced file changes the DDEEBBUUGG - trap, the new value is retained when .. completes. The return - status is the status of the last command exited within the + trap, the new value is retained when .. completes. The return + status is the status of the last command exited within the script (0 if no commands are executed), and false 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] ...] AAlliiaass with no arguments or with the --pp option 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, an alias is defined 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 + aliases in the form aalliiaass _n_a_m_e=_v_a_l_u_e on standard output. When + arguments are supplied, an alias is defined 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. For each _n_a_m_e in the argument list for which no _v_a_l_u_e is sup- plied, the name and value of the alias is printed. AAlliiaass re- @@ -62,9 +61,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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's - notion of the _c_u_r_r_e_n_t _j_o_b is used. 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 + notion of the _c_u_r_r_e_n_t _j_o_b is used. 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 without job control. bbiinndd [--mm _k_e_y_m_a_p] [--llppssvvPPSSVVXX] @@ -74,8 +73,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS bbiinndd [--mm _k_e_y_m_a_p] _k_e_y_s_e_q:_f_u_n_c_t_i_o_n_-_n_a_m_e 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 set a rreeaaddlliinnee + Display current rreeaaddlliinnee key and function bindings, bind a key + sequence to a rreeaaddlliinnee function or macro, or set a rreeaaddlliinnee variable. Each non-option argument is a command as it would ap- pear in a rreeaaddlliinnee initialization file such as _._i_n_p_u_t_r_c, but each binding or command must be passed as a separate argument; @@ -126,10 +125,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS _m_a_n_d is executed, the shell sets the RREEAADDLLIINNEE__LLIINNEE vari- able 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__AARRGGUU-- - MMEENNTT variable. If there was no argument, that variable + 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__AARRGGUU-- + MMEENNTT variable. If there was no argument, that variable is not set. If the executed command changes the value of any of RREEAADDLLIINNEE__LLIINNEE, RREEAADDLLIINNEE__PPOOIINNTT, or RREEAADDLLIINNEE__MMAARRKK, those new values will be reflected in the editing state. @@ -137,22 +136,22 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS associated commands in a format that can be reused as in- put. - The return value is 0 unless an unrecognized option is given or + The return value is 0 unless an unrecognized option is given or an error occurred. bbrreeaakk [_n] - Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is - specified, break _n levels. _n must be >= 1. If _n is greater - than the number of enclosing loops, all enclosing loops are ex- - ited. The return value is 0 unless _n is not greater than or + Exit from within a ffoorr, wwhhiillee, uunnttiill, or sseelleecctt loop. If _n is + specified, break _n levels. _n must be >= 1. If _n is greater + than the number of enclosing loops, all enclosing loops are ex- + ited. 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, passing it _a_r_g_u_m_e_n_t_s, and + Execute the specified shell builtin, 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 func- tionality of the builtin within the function. The ccdd builtin is - commonly redefined this way. The return status is false if + commonly redefined this way. The return status 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] @@ -161,114 +160,113 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS out _e_x_p_r, ccaalllleerr displays the line number and source filename of the current subroutine call. If a non-negative integer is sup- plied as _e_x_p_r, ccaalllleerr displays the line number, subroutine name, - and source file corresponding to that position in the current - 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 + and source file corresponding to that position in the current + 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 call stack. ccdd [--LL|[--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 the default. The vari- + Change the current directory to _d_i_r. if _d_i_r is not supplied, + the value of the HHOOMMEE shell variable is the default. The vari- able CCDDPPAATTHH defines the search path for the directory containing - _d_i_r: each directory name in CCDDPPAATTHH is searched for _d_i_r. Alter- - native directory names in CCDDPPAATTHH are separated by a colon (:). - A null directory name in CCDDPPAATTHH is the same as the current di- - rectory, i.e., ``..''. If _d_i_r begins with a slash (/), then CCDD-- - PPAATTHH is not used. The --PP option causes ccdd to use the physical - directory structure by resolving symbolic links while traversing - _d_i_r and before processing instances of _._. in _d_i_r (see also the - --PP option to the sseett builtin command); the --LL option forces sym- - bolic links to be followed by resolving the link after process- - ing instances of _._. in _d_i_r. If _._. appears in _d_i_r, it is pro- - cessed by removing the immediately previous pathname component - from _d_i_r, back to a slash or the beginning of _d_i_r. If the --ee - option is supplied with --PP, and the current working directory - cannot be successfully determined after a successful directory - change, ccdd will return an unsuccessful status. On systems that - support it, the --@@ option presents the extended attributes asso- - ciated with a file as a directory. An argument of -- is con- - verted to $$OOLLDDPPWWDD before the directory change is attempted. If - a non-empty directory name from CCDDPPAATTHH is used, or if -- is the - first argument, and the directory change is successful, the ab- - solute pathname of the new working directory is written to the - standard output. 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 directory before the change. The return - value is true if the directory was successfully changed; false - otherwise. + _d_i_r: 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 the same as the current + directory, i.e., If _d_i_r begins with a slash (/), then CCDDPPAATTHH is + not used. The --PP option causes ccdd to use the physical directory + structure by resolving symbolic links while traversing _d_i_r and + before processing instances of _._. in _d_i_r (see also the --PP option + to the sseett builtin command); the --LL option forces symbolic links + to be followed by resolving the link after processing instances + of _._. in _d_i_r. If _._. appears in _d_i_r, it is processed by removing + the immediately previous pathname component from _d_i_r, back to a + slash or the beginning of _d_i_r. If the --ee option is supplied + with --PP, and the current working directory cannot be success- + fully determined after a successful directory change, ccdd will + return an unsuccessful status. 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 the directory change is attempted. If a non-empty direc- + tory name from CCDDPPAATTHH is used, or if -- is the first argument, + and the directory change is successful, the absolute pathname of + the new working directory is written to the standard output. 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 + directory before the change. 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 ...] Run _c_o_m_m_a_n_d with _a_r_g_s suppressing the normal shell function lookup. Only builtin commands or commands found in the PPAATTHH are - executed. If the --pp option is given, 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 standard utilities. If either the --VV or --vv op- - tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv - option causes a single word indicating the command or filename + executed. If the --pp option is given, 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 standard utilities. If either the --VV or --vv op- + tion is supplied, a description of _c_o_m_m_a_n_d is printed. The --vv + option causes a single word indicating the command or filename used to invoke _c_o_m_m_a_n_d to be displayed; the --VV option produces a more verbose description. If the --VV or --vv option is supplied, the exit status is 0 if _c_o_m_m_a_n_d was found, and 1 if not. If neither option is supplied and an error occurred or _c_o_m_m_a_n_d can- - not be found, the exit status is 127. Otherwise, the exit sta- + not be found, the exit status is 127. Otherwise, the exit sta- tus 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 sup- plied, ccoommppggeenn stores the generated completions 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 by the programmable completion facilities, while + 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 by the programmable completion facilities, while available, will not have useful values. 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, + tion specification with the same flags. If _w_o_r_d is specified, only those completions matching _w_o_r_d will be displayed. - 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] [--GG _g_l_o_b_p_a_t] [--WW _w_o_r_d_l_i_s_t] [--FF _f_u_n_c_t_i_o_n] [--CC _c_o_m_m_a_n_d] - [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e _._._.] + [--XX _f_i_l_t_e_r_p_a_t] [--PP _p_r_e_f_i_x] [--SS _s_u_f_f_i_x] _n_a_m_e [_n_a_m_e ...] ccoommpplleettee --pprr [--DDEEII] [_n_a_m_e ...] - Specify how arguments to each _n_a_m_e should be completed. If the - --pp option is supplied, or if no options are supplied, existing - completion specifications are printed in a way that allows them - to be reused as input. The --rr option removes a completion spec- - ification for each _n_a_m_e, or, if no _n_a_m_es are supplied, all com- - pletion specifications. The --DD option indicates that other sup- - plied options and actions should apply to the ``default'' com- - mand completion; that is, completion attempted on a command for - which no completion has previously been defined. The --EE option - indicates that other supplied options and actions should apply - to ``empty'' command completion; 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 usually 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 specified by the option. - - The process of applying these completion specifications when - word completion is attempted is described in _b_a_s_h_(_1_). - - 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- + 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 supplied, + existing completion specifications are printed in a way that al- + lows 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- + plied, all completion specifications. The --DD option indicates + that other supplied options and actions should apply to the com- + mand completion; that is, completion attempted on a command for + which no completion has previously been defined. The --EE option + indicates that other supplied options and actions should apply + to command completion; 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 usually 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 ap- + ply to the case specified by the option. + + The process of applying these completion specifications when + word completion is attempted is described in _b_a_s_h(1). + + 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 @@ -302,13 +300,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS tempted and any matches are added to the results of the other actions. --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 @@ -316,7 +314,7 @@ BBAASSHH 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 names. May also be specified as --ff. ffuunnccttiioonn @@ -325,17 +323,17 @@ BBAASSHH 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. @@ -353,15 +351,15 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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- - rent command line. When it finishes, the possible com- - pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY + the word preceding the word being completed on the cur- + rent command line. When it finishes, the possible com- + pletions are retrieved from the value of the CCOOMMPPRREEPPLLYY array variable. --GG _g_l_o_b_p_a_t - The pathname expansion pattern _g_l_o_b_p_a_t is expanded to + The pathname expansion pattern _g_l_o_b_p_a_t is expanded to generate the possible completions. --PP _p_r_e_f_i_x - _p_r_e_f_i_x is added at the beginning of each possible com- + _p_r_e_f_i_x is added at the beginning of each possible com- pletion after all other options have been applied. --SS _s_u_f_f_i_x _s_u_f_f_i_x is appended to each possible completion after all @@ -371,11 +369,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS special variable as delimiters, and each resultant word is expanded. Shell quoting is honored within _w_o_r_d_l_i_s_t, in order 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- + shell metacharacters or characters in the value of IIFFSS. + The possible completions are the members of the resul- tant list which match the word being completed. --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. @@ -384,52 +382,51 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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_- _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 given, display the completion op- - tions 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 op- - tions should apply to the ``default'' command completion; that - is, completion attempted on a command for which no completion - has previously been defined. The --EE option indicates that other - supplied options should apply to ``empty'' command completion; - that is, completion attempted on a blank line. The --II option - indicates that other supplied options should apply to completion - on the initial non-assignment word on the line, or after a com- - mand delimiter such as ;; or ||, which is usually command name - completion. + supplied. If no _o_p_t_i_o_ns are given, display the completion op- + tions 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 op- + tions should apply to the command completion; that is, comple- + tion attempted on a command for which no completion has previ- + ously been defined. The --EE option indicates that other supplied + options should apply to command completion; that is, completion + attempted on a blank line. The --II option indicates that other + supplied options should apply to completion on the initial non- + assignment word on the line, or after a command delimiter such + as ;; or ||, which is usually command name completion. - 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] Resume the next iteration of the enclosing ffoorr, wwhhiillee, uunnttiill, or - sseelleecctt loop. If _n is specified, resume at the _nth enclosing - loop. _n must be >= 1. If _n is greater than the number of en- - closing loops, the last enclosing loop (the ``top-level'' loop) - is resumed. The return value is 0 unless _n is not greater than - or equal to 1. + sseelleecctt loop. If _n is specified, resume at the _nth enclosing + loop. _n must be >= 1. If _n is greater than the number of en- + closing loops, the shell resumes the last enclosing loop (the + 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 - given then display the values of variables. The --pp option will + Declare variables and/or give them attributes. If no _n_a_m_es are + given then display the values of variables. 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 than --ff and --FF, are ignored. When --pp is supplied without _n_a_m_e arguments, it will display the attributes and values of all variables having the attributes specified by the additional options. If no other - options are supplied with --pp, ddeeccllaarree will display the at- - tributes and values of all shell variables. The --ff option will - restrict the display to shell functions. The --FF option inhibits - the display of function definitions; only the function name and + options are supplied with --pp, ddeeccllaarree will display the attrib- + utes and values of all shell variables. The --ff option will re- + strict 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 --FF option implies @@ -438,17 +435,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS tion. It is ignored in all other cases. 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 variable with the same _n_a_m_e - at a surrounding scope. If there is no existing variable, the + 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 variables with the specified attri- - bute or to give variables attributes: + used to restrict output to variables with the specified at- + tribute or to give variables attributes: --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss in - _b_a_s_h_(_1_)). + _b_a_s_h(1)). --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss in - _b_a_s_h_(_1_)). + _b_a_s_h(1)). --ff Use function names only. --ii The variable is treated as an integer; arithmetic evalua- - tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h_(_1_)) is performed + tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)) 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 @@ -471,24 +468,24 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --xx Mark _n_a_m_es for export to subsequent commands via the en- vironment. - Using `+' instead of `-' turns off the attribute instead, with - the exceptions that ++aa and ++AA may not be used to destroy array - variables and ++rr will not remove the readonly attribute. When - used in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as - with the llooccaall command, unless the --gg option is supplied. 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 compound assign- - ment 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 attempt is made to - assign a value to a readonly variable, an attempt is made to as- - sign a value to an array variable without using the compound as- - signment syntax (see AArrrraayyss in _b_a_s_h_(_1_)), 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 attempt is - made to display a non-existent function with --ff. + Using instead of turns off the attribute instead, with the ex- + ceptions that ++aa and ++AA may not be used to destroy array vari- + ables and ++rr will not remove the readonly attribute. When used + in a function, ddeeccllaarree and ttyyppeesseett make each _n_a_m_e local, as with + the llooccaall command, unless the --gg option is supplied. If a vari- + able 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 compound 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 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 + AArrrraayyss in _b_a_s_h(1)), one of the _n_a_m_e_s is not a valid shell vari- + able 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 attempt is made to display a non- + existent function with --ff. ddiirrss [[--ccllppvv]] [[++_n]] [[--_n]] Without options, displays the list of currently remembered di- @@ -497,17 +494,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS list with the ppuusshhdd command; the ppooppdd command removes entries from the list. The current directory is always the first direc- tory in the stack. - --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. @@ -521,7 +518,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS is given, each _j_o_b_s_p_e_c is not removed from the table, but is marked so that SSIIGGHHUUPP is not sent to the job if the shell re- ceives a SSIIGGHHUUPP. If no _j_o_b_s_p_e_c is supplied, the --aa option means - to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- + to remove or mark all jobs; the --rr option without a _j_o_b_s_p_e_c ar- gument restricts operation to running jobs. The return value is 0 unless a _j_o_b_s_p_e_c does not specify a valid job. @@ -529,11 +526,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 suppressed. If the --ee option - is given, interpretation of the following backslash-escaped - characters is enabled. The --EE option disables the interpreta- - tion of these escape characters, even on systems where they are - interpreted by default. The xxppgg__eecchhoo shell option may be used - to dynamically determine whether or not eecchhoo interprets any op- + is given, interpretation of the following backslash-escaped + characters is enabled. The --EE option disables the interpreta- + tion of these escape characters, even on systems where they are + interpreted by default. The xxppgg__eecchhoo shell option may be used + to dynamically determine whether or not eecchhoo interprets any op- tions and expands these escape characters by default. eecchhoo does not interpret ---- to mean the end of options. eecchhoo interprets the following escape sequences: @@ -561,30 +558,30 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 a disk command 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 disk commands. - If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- - abled. For example, to use the tteesstt binary found via the PPAATTHH - instead of the shell builtin version, run ``enable -n test''. - 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. - 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, if _f_i_l_e_n_a_m_e does not contain a slash. The default is sys- - tem-dependent, and may include "." to force a search of the cur- - rent directory. The --dd option will delete a builtin previously - loaded with --ff. If no _n_a_m_e arguments are given, or if the --pp - option is supplied, a list of shell builtins is printed. With - no other option arguments, the list consists of all enabled - shell builtins. If --nn is supplied, only disabled builtins are - printed. If --aa is supplied, the list printed includes all - builtins, with an indication of whether or not each is enabled. - If --ss is supplied, the output is restricted to the POSIX _s_p_e_c_i_a_l - builtins. 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 there - is an error loading a new builtin from a shared object. + to be executed without specifying a full pathname, even though + the shell normally searches for builtins before disk commands. + If --nn is used, each _n_a_m_e is disabled; otherwise, _n_a_m_e_s are en- + abled. For example, to use the tteesstt binary found via the PPAATTHH + instead of the shell builtin version, run 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. 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, if _f_i_l_e_n_a_m_e + does not contain a slash. The default 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 no + _n_a_m_e arguments are given, or if the --pp option is supplied, a + list of shell builtins is printed. With no other option argu- + ments, the list consists of all enabled shell builtins. If --nn + is supplied, only disabled builtins are printed. If --aa is sup- + plied, the list printed includes all builtins, with an indica- + tion of whether or not each is enabled. If --ss is supplied, the + output is restricted to the POSIX _s_p_e_c_i_a_l builtins. If no op- + tions 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 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 ...] The _a_r_gs are read and concatenated together into a single com- @@ -600,16 +597,16 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS _g_i_n(1) does. The --cc option causes _c_o_m_m_a_n_d to be executed with an empty environment. 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 can- - not be executed for some reason, a non-interactive shell exits, - unless the eexxeeccffaaiill shell option is enabled. In that case, it - returns failure. An interactive shell returns failure 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 + not be executed for some reason, a non-interactive shell exits, + unless the eexxeeccffaaiill shell option is enabled. In that case, it + returns failure. An interactive shell returns failure 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 redirection error, the return status is 1. eexxiitt [_n] - Cause the shell to exit with a status of _n. If _n is omitted, + Cause the shell to exit with a status of _n. If _n is omitted, the exit status is that of the last command executed. A trap on EEXXIITT is executed before the shell terminates. @@ -623,26 +620,26 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS to be removed from each _n_a_m_e. If a variable name is followed by =_w_o_r_d, the value of the variable is set to _w_o_r_d. 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 sup- + of the _n_a_m_e_s is not a valid shell variable name, or --ff is sup- plied with a _n_a_m_e that is not a function. ffaallssee Does nothing, returns a non-zero status. 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 - 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); otherwise 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. + 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); otherwise 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 prints the + last 10 commands) and to _f_i_r_s_t otherwise. If _f_i_r_s_t is not spec- + ified, it is set to the previous command for editing and -16 for + listing. The --nn option suppresses the command numbers when listing. The --rr option reverses the order of the commands. If the --ll option @@ -655,9 +652,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS In the second form, _c_o_m_m_a_n_d is re-executed after each instance of _p_a_t is replaced by _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 this is ``r="fc -s"'', - so that typing ``r cc'' runs the last command beginning with - ``cc'' and typing ``r'' re-executes the last command. + _f_i_r_s_t above. A useful alias to use with this is so that typing + runs the last command beginning with and typing re-executes the + last command. If the first form is used, the return value is 0 unless an in- valid option is encountered or _f_i_r_s_t or _l_a_s_t specify history @@ -671,20 +668,20 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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, the shell's notion of the _c_u_r_r_e_n_t _j_o_b - is used. The return value is that of the command placed into - the foreground, or failure if run when job control is disabled + is used. The return value is that of the command placed into + the foreground, or failure if run when job control is disabled or, when run with job control enabled, if _j_o_b_s_p_e_c does not spec- ify 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 _o_p_t_s_t_r_i_n_g _n_a_m_e [_a_r_g ...] ggeettooppttss is used by shell procedures to parse positional parame- ters. _o_p_t_s_t_r_i_n_g contains the option characters to be recog- nized; if a character is followed by a colon, the option is ex- pected to have 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 shell variable _n_a_m_e, initializing + 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 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 op- @@ -709,15 +706,15 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS variable OOPPTTEERRRR is set to 0, no error messages will be dis- played, even if the first character of _o_p_t_s_t_r_i_n_g is not a colon. - If an invalid option is seen, ggeettooppttss places ? into _n_a_m_e and, if - not silent, prints an error message and unsets OOPPTTAARRGG. If - ggeettooppttss is silent, the option character found is placed in OOPP-- - TTAARRGG and no diagnostic message is printed. + 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-- + TTAARRGG and does not print a diagnostic message. - If a required argument is not found, and ggeettooppttss is not silent, - a question mark (??) is placed in _n_a_m_e, OOPPTTAARRGG is unset, and a - diagnostic message is printed. If ggeettooppttss is silent, then a - colon (::) is placed in _n_a_m_e and OOPPTTAARRGG is set to the option + 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 character found. ggeettooppttss returns true if an option, specified or unspecified, is @@ -728,11 +725,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e is determined by searching the directories in $$PPAATTHH and remem- bered. Any previously-remembered pathname is discarded. If the - --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename - of the command. The --rr option causes the shell to forget all - remembered locations. Assigning to the PPAATTHH variable also - clears all hashed filenames. The --dd option causes the shell to - forget the remembered location of each _n_a_m_e. If the --tt option + --pp option is supplied, hhaasshh uses _f_i_l_e_n_a_m_e as the full filename + of the command. The --rr option causes the shell to forget all + remembered locations. Assigning to the PPAATTHH variable also + clears all hashed filenames. The --dd option causes the shell to + forget the remembered location of each _n_a_m_e. If the --tt option is supplied, the full pathname to which each _n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are supplied with --tt, the _n_a_m_e is printed before the hashed full pathname. The --ll option @@ -742,13 +739,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS and --pp options (the options that act on the _n_a_m_e arguments) are mutually exclusive. Only one will be active. If more than one is supplied, --tt has higher priority than --pp, and both are higher - priority than --dd. The return status is true unless a _n_a_m_e is + priority than --dd. The return status is true unless a _n_a_m_e is not found or an invalid 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 help for all the builtins and shell control + 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 help for all the builtins and shell control structures is printed. --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 @@ -762,8 +759,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hhiissttoorryy --dd _o_f_f_s_e_t hhiissttoorryy --dd _s_t_a_r_t-_e_n_d hhiissttoorryy --aannrrww [_f_i_l_e_n_a_m_e] - hhiissttoorryy --pp _a_r_g [_a_r_g _._._.] - hhiissttoorryy --ss _a_r_g [_a_r_g _._._.] + hhiissttoorryy --pp _a_r_g [_a_r_g ...] + hhiissttoorryy --ss _a_r_g [_a_r_g ...] With no options, display the command history list with line num- bers. Lines listed with a ** have been modified. An argument of _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- @@ -786,10 +783,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Delete the range of history entries between positions _s_t_a_r_t and _e_n_d, inclusive. Positive and negative values for _s_t_a_r_t and _e_n_d are interpreted as described above. - --aa Append the ``new'' history lines to the history file. - These are history lines entered since the beginning of - the current bbaasshh session, but not already appended to the - history file. + --aa Append the history lines to the history file. These are + history lines entered since the beginning of the current + bbaasshh session, but not already appended to the history + file. --nn Read the history lines not already read from the history file into the current history list. These are lines ap- pended to the history file since the beginning of the @@ -798,23 +795,23 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS the current history list. --ww Write the current history list to the history file, over- writing the history file's contents. - --pp Perform history substitution on the following _a_r_g_s and - display the result on the standard output. Does not - store the results in the history list. Each _a_r_g must be + --pp Perform history substitution on the following _a_r_g_s and + display the result on the standard output. Does not + store the results in the history list. Each _a_r_g must be quoted to disable normal history expansion. - --ss Store the _a_r_g_s in the history list as a single entry. - The last command in the history list is removed before + --ss Store the _a_r_g_s in the history list as a single entry. + The last command in the history list is removed before the _a_r_g_s are added. - If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- - tion associated with each history entry is written to the his- - tory file, marked with the history comment character. When the - history file is read, lines beginning with the history comment - character followed immediately by a digit are interpreted as + If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa- + tion associated with each history entry is written to the his- + tory file, marked with the history comment character. When the + history file is read, lines beginning with the history comment + character followed immediately by a digit are interpreted as timestamps for the following history entry. The return value is 0 unless an invalid option is encountered, an error occurs while - reading or writing the history file, an invalid _o_f_f_s_e_t or range - is supplied as an argument to --dd, or the history expansion sup- + reading or writing the history file, an invalid _o_f_f_s_e_t or range + is supplied as an argument to --dd, or the history expansion sup- plied as an argument to --pp fails. jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ] @@ -847,20 +844,20 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS signal names. If any arguments are supplied when --ll is given, the names of the signals corresponding to the arguments are listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to - --ll is a number specifying either a signal number or the exit - status of a process terminated by a signal. The --LL option is - equivalent to --ll. kkiillll returns true if at least one signal was + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. The --LL option is + equivalent to --ll. kkiillll returns true if at least one signal was successfully sent, or false if an error occurs or an invalid op- tion is encountered. lleett _a_r_g [_a_r_g ...] Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- - MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h_(_1_)). If the last _a_r_g evaluates to 0, + MMEETTIICC EEVVAALLUUAATTIIOONN in _b_a_s_h(1)). If the last _a_r_g evaluates to 0, lleett returns 1; 0 is returned otherwise. llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ... | - ] - For each argument, a local variable named _n_a_m_e is created, and - assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted + For each argument, a local variable named _n_a_m_e is created, and + assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted by ddeeccllaarree. When llooccaall is used within a function, it causes the variable _n_a_m_e to have a visible scope restricted to that func- tion and its children. If _n_a_m_e is -, the set of shell options @@ -872,21 +869,21 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS before the function. With no operands, llooccaall writes a list of local variables to the standard output. It is an error to use llooccaall when not within a function. The return status is 0 unless - llooccaall is used outside a function, an invalid _n_a_m_e is supplied, + llooccaall is used outside a function, an invalid _n_a_m_e is supplied, or _n_a_m_e is a readonly variable. llooggoouutt Exit a login shell. - mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC + mmaappffiillee [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] rreeaaddaarrrraayy [--dd _d_e_l_i_m] [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] - Read lines from the standard input into the indexed array vari- - able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- - plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if + Read lines from the standard input into the indexed array vari- + able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup- + plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if supplied, have the following meanings: - --dd The first character of _d_e_l_i_m is used to terminate each - input line, rather than newline. If _d_e_l_i_m is the empty + --dd The first character of _d_e_l_i_m is used to terminate each + input line, rather than newline. If _d_e_l_i_m is the empty string, mmaappffiillee will terminate a line when it reads a NUL character. --nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are @@ -918,28 +915,26 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ppooppdd [-nn] [+_n] [-_n] Removes entries from the directory stack. The elements are num- - bered from 0 starting at the first directory listed by ddiirrss. - With no arguments, ppooppdd removes the top directory from the + bered from 0 starting at the first directory listed by ddiirrss. + With no arguments, ppooppdd removes the top directory from the stack, and changes to the new top directory. Arguments, if sup- plied, have the following meanings: --nn Suppresses the normal change of directory when removing directories from the stack, so that only the stack is ma- nipulated. - ++_n Removes the _nth entry counting from the left of the list - shown by ddiirrss, starting with zero, from the stack. For - example: ``popd +0'' removes the first directory, ``popd - +1'' the second. + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero, from the stack. For + example: removes the first directory, the second. --_n Removes the _nth entry counting from the right of the list - shown by ddiirrss, starting with zero. For example: ``popd - -0'' removes the last directory, ``popd -1'' the next to - last. + shown by ddiirrss, starting with zero. For example: removes + the last directory, the next to last. If the top element of the directory stack is modified, and the _-_n option was not supplied, ppooppdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppooppdd returns a non-zero value. - Otherwise, ppooppdd returns false if an invalid option is encoun- + Otherwise, ppooppdd returns false if an invalid option is encoun- tered, the directory stack is empty, or a non-existent directory stack entry is specified. @@ -963,30 +958,30 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ifiers: %%bb causes pprriinnttff to expand backslash escape sequences in the corresponding _a_r_g_u_m_e_n_t in the same way as eecchhoo --ee. - %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a - format that can be reused as shell input. %%qq and %%QQ use - the $$'''' quoting style if any characters in the argument - string require it, and backslash quoting otherwise. If - the format string uses the _p_r_i_n_t_f alternate form, these + %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a + format that can be reused as shell input. %%qq and %%QQ use + the $$'''' quoting style if any characters in the argument + string require it, and backslash quoting otherwise. If + the format string uses the _p_r_i_n_t_f alternate form, these two formats quote the argument string using single quotes. - %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- + %%QQ like %%qq, but applies any supplied precision to the _a_r_g_u_- _m_e_n_t before quoting it. %%((_d_a_t_e_f_m_t))TT - causes pprriinnttff to output the date-time string resulting - from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). + causes pprriinnttff to output the date-time string resulting + from using _d_a_t_e_f_m_t as a format string for _s_t_r_f_t_i_m_e(3). The corresponding _a_r_g_u_m_e_n_t is an integer representing the number of seconds since the epoch. Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. If no ar- gument is specified, conversion behaves as if -1 had been - given. This is an exception to the usual pprriinnttff behav- + given. This is an exception to the usual pprriinnttff behav- ior. The %b, %q, and %T format specifiers all use the field width and precision arguments from the format specification and write that - many bytes from (or use that wide a field for) the expanded ar- - gument, which usually contains more characters than the origi- + many bytes from (or use that wide a field for) the expanded ar- + gument, which usually contains more characters than the origi- nal. The %n format specifier accepts a corresponding argument that is @@ -999,10 +994,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Arguments to non-string format specifiers are treated as C con- stants, except that a leading plus or minus sign is allowed, and - if the leading character is a single or double quote, the value + if the leading character is a single or double quote, the value is the ASCII value of the following character. - The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, the extra format specifications behave as if a zero value or null string, as appropriate, had been supplied. The return @@ -1028,7 +1023,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS _d_i_r Adds _d_i_r to the directory stack at the top After the stack has been modified, if the --nn option was not sup- - plied, ppuusshhdd uses the ccdd builtin to change to the directory at + plied, ppuusshhdd uses the ccdd builtin to change to the directory at the top of the stack. If the ccdd fails, ppuusshhdd returns a non-zero value. @@ -1049,11 +1044,11 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS occurs while reading the name of the current directory or an in- valid option is supplied. - rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] + rreeaadd [--EEeerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [--ii _t_e_x_t] [--nn _n_c_h_a_r_s] [--NN _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] One line is read from the standard input, or from the file de- scriptor _f_d supplied as an argument to the --uu option, split into - words as described in _b_a_s_h_(_1_) under WWoorrdd SSpplliittttiinngg, and the + words as described in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg, and the first word is assigned to the first _n_a_m_e, the second word to the second _n_a_m_e, and so on. If there are more words than names, the remaining words and their intervening delimiters are assigned to @@ -1061,8 +1056,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS stream than names, the remaining names are assigned empty val- ues. The characters in IIFFSS are used to split the line into words using the same rules the shell uses for expansion (de- - scribed in _b_a_s_h_(_1_) under WWoorrdd SSpplliittttiinngg). The backslash charac- - ter (\\) may be used to remove any special meaning for the next + scribed in _b_a_s_h (1) under WWoorrdd SSpplliittttiinngg). The backslash char- + acter (\\) may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: --aa _a_n_a_m_e @@ -1072,25 +1067,25 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS nored. --dd _d_e_l_i_m The first character of _d_e_l_i_m is used to terminate the in- - put line, rather than newline. If _d_e_l_i_m is the empty - string, rreeaadd will terminate a line when it reads a NUL + put line, rather than newline. If _d_e_l_i_m is the empty + string, rreeaadd will terminate a line when it reads a NUL character. - --ee If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h_(_1_)) to obtain the - line. Readline uses the current (or default, if line - editing was not previously active) editing settings, but + --ee If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the + line. Readline uses the current (or default, if line + editing was not previously active) editing settings, but uses readline's default filename completion. - --EE If the standard input is coming from a terminal, rreeaadd - uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h_(_1_)) to obtain the - line. Readline uses the current (or default, if line - editing was not previously active) editing settings, but - uses bash's default completion, including programmable + --EE If the standard input is coming from a terminal, rreeaadd + uses rreeaaddlliinnee (see RREEAADDLLIINNEE in _b_a_s_h(1)) to obtain the + line. Readline uses the current (or default, if line + editing was not previously active) editing settings, but + uses bash's default completion, including programmable completion. --ii _t_e_x_t - If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is placed into the editing buffer before editing begins. --nn _n_c_h_a_r_s - rreeaadd returns after reading _n_c_h_a_r_s characters rather than + rreeaadd returns after reading _n_c_h_a_r_s characters rather than waiting for a complete line of input, but honors a delim- iter if fewer than _n_c_h_a_r_s characters are read before the delimiter. @@ -1115,13 +1110,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --ss Silent mode. If input is coming from a terminal, charac- ters are not echoed. --tt _t_i_m_e_o_u_t - Cause rreeaadd to time out and return failure if a complete - line of input (or a specified number of characters) is - not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- - mal number with a fractional portion following the deci- - mal point. This option is only effective if rreeaadd is - reading input from a terminal, pipe, or other special - file; it has no effect when reading from regular files. + Cause rreeaadd to time out and return failure if a complete + line of input (or a specified number of characters) is + not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_o_u_t may be a deci- + mal number with a fractional portion following the deci- + mal point. This option is only effective if rreeaadd is + reading input from a terminal, pipe, or other special + file; it has no effect when reading from regular files. If rreeaadd times out, rreeaadd saves any partial input read into the specified variable _n_a_m_e. If _t_i_m_e_o_u_t is 0, rreeaadd re- turns immediately, without trying to read any data. The @@ -1131,11 +1126,14 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS timeout is exceeded. --uu _f_d Read input from file descriptor _f_d. - If no _n_a_m_e_s are supplied, the line read, without the ending de- - limiter but otherwise unmodified, is assigned to the variable - RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- - tered, rreeaadd times out (in which case the status is greater than - 128), a variable assignment error (such as assigning to a read- + Other than the case where _d_e_l_i_m is the empty string, rreeaadd ig- + nores any NUL characters in the input. + + If no _n_a_m_e_s are supplied, the line read, without the ending de- + limiter but otherwise unmodified, is assigned to the variable + RREEPPLLYY. The exit status is zero, unless end-of-file is encoun- + tered, rreeaadd times out (in which case the status is greater than + 128), a variable assignment error (such as assigning to a read- only variable) occurs, or an invalid file descriptor is supplied as the argument to --uu. @@ -1146,7 +1144,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS marked. The --aa option restricts the variables to indexed ar- rays; the --AA option restricts the variables to associative ar- rays. If both options are supplied, --AA takes precedence. If no - _n_a_m_e arguments are given, or if the --pp option is supplied, a + _n_a_m_e arguments are given, or if the --pp option is supplied, a list of all readonly names is printed. The other options may be used to restrict the output to a subset of the set of readonly names. The --pp option causes output to be displayed in a format @@ -1157,9 +1155,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS a _n_a_m_e that is not a function. rreettuurrnn [_n] - Causes a function to stop executing and return the value speci- - fied by _n to its caller. If _n is omitted, the return status is - that of the last command executed in the function body. If rree-- + Causes a function to stop executing and return the value speci- + fied by _n to its caller. If _n is omitted, the return status is + that of the last command executed in the function body. If rree-- ttuurrnn is executed by a trap handler, the last command used to de- termine the status is the last command executed before the trap handler. If rreettuurrnn is executed during a DDEEBBUUGG trap, the last @@ -1170,9 +1168,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS that script and return either _n or the exit status of the last command executed within the script as the exit status of the script. If _n is supplied, the return value is its least signif- - icant 8 bits. The return status is non-zero if rreettuurrnn is sup- - plied a non-numeric argument, or is used outside a function and - not during execution of a script by .. or ssoouurrccee. Any command + icant 8 bits. The return status is non-zero if rreettuurrnn is sup- + plied a non-numeric argument, or is used outside a function and + not during execution of a script by .. or ssoouurrccee. Any command associated with the RREETTUURRNN trap is executed before execution re- sumes after the function or script. @@ -1182,27 +1180,27 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS sseett ++oo Without options, display the name and value of each shell vari- able in a format that can be reused as input for setting or re- setting the currently-set variables. Read-only variables cannot - be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The - output is sorted according to the current locale. When options - are specified, they set or unset shell attributes. Any argu- - ments remaining after option processing are treated as values + be reset. In _p_o_s_i_x _m_o_d_e, only shell variables are listed. The + output is sorted according to the current locale. When options + are specified, they set or unset shell attributes. Any argu- + ments remaining after option processing are treated as values for the positional parameters and are assigned, in order, to $$11, - $$22, ...... $$_n. Options, if specified, have the following mean- + $$22, ..., $$_n. Options, if specified, have the following mean- ings: --aa Each variable or function that is created or modified is - given the export attribute and marked for export to the + given the export attribute and marked for export to the environment of subsequent commands. - --bb Report the status of terminated background jobs immedi- + --bb Report the status of terminated background jobs immedi- ately, rather than before the next primary prompt. This is effective only when job control is enabled. --ee Exit immediately if a _p_i_p_e_l_i_n_e (which may consist of a single _s_i_m_p_l_e _c_o_m_m_a_n_d), a _l_i_s_t, or a _c_o_m_p_o_u_n_d _c_o_m_m_a_n_d - (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)), exits with a non-zero + (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)), exits with a non-zero status. The shell does not exit if the command that fails is part of the command list immediately following a wwhhiillee or uunnttiill keyword, part of the test following the - iiff or eelliiff reserved words, part of any command executed - in a &&&& or |||| list except the command following the fi- + iiff or eelliiff reserved words, part of any command executed + in a &&&& or |||| list except the command following the fi- nal &&&& or ||||, any command in a pipeline but the last, or if the command's return value is being inverted with !!. If a compound command other than a subshell returns a @@ -1211,7 +1209,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS if set, is executed before the shell exits. This option applies to the shell environment and each subshell envi- ronment separately (see CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT in - _b_a_s_h_(_1_)), and may cause subshells to exit before execut- + _b_a_s_h(1)), and may cause subshells to exit before execut- ing all the commands in the subshell. If a compound command or shell function executes in a @@ -1231,12 +1229,12 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS that precede the command name. --mm Monitor mode. Job control is enabled. This option is on by default for interactive shells on systems that - support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h_(_1_)). All processes + support it (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). All processes run in a separate process group. When a background job completes, the shell prints a line containing its exit status. --nn Read commands but do not execute them. This may be used - to check a shell script for syntax errors. This is ig- + to check a shell script for syntax errors. This is ig- nored by interactive shells. --oo _o_p_t_i_o_n_-_n_a_m_e The _o_p_t_i_o_n_-_n_a_m_e can be one of the following: @@ -1244,10 +1242,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS Same as --aa. bbrraacceeeexxppaanndd Same as --BB. - eemmaaccss Use an emacs-style command line editing inter- + eemmaaccss Use an emacs-style command line editing inter- face. This is enabled by default when the shell is interactive, unless the shell is started with - the ----nnooeeddiittiinngg option. This also affects the + the ----nnooeeddiittiinngg option. This also affects the editing interface used for rreeaadd --ee. eerrrreexxiitt Same as --ee. eerrrrttrraaccee @@ -1257,13 +1255,12 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS hhaasshhaallll Same as --hh. hhiisstteexxppaanndd Same as --HH. - hhiissttoorryy Enable command history, as described in _b_a_s_h_(_1_) - under HHIISSTTOORRYY. This option is on by default in + hhiissttoorryy Enable command history, as described in _b_a_s_h(1) + under HHIISSTTOORRYY. This option is on by default in interactive shells. iiggnnoorreeeeooff - The effect is as if the shell command ``IG- - NOREEOF=10'' had been executed (see SShheellll VVaarrii-- - aabblleess in _b_a_s_h_(_1_)). + The effect is as if the shell command had been + executed (see SShheellll VVaarriiaabblleess in _b_a_s_h(1)). kkeeyywwoorrdd Same as --kk. mmoonniittoorr Same as --mm. nnoocclloobbbbeerr @@ -1285,7 +1282,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 - in _b_a_s_h_(_1_) for a reference to a document that + in _b_a_s_h(1) for a reference to a document that details how posix mode affects bash's behavior. pprriivviilleeggeedd Same as --pp. @@ -1294,18 +1291,18 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 $$EENNVV and - $$BBAASSHH__EENNVV files are not processed, shell functions are - not inherited from the environment, and the SSHHEELLLLOOPPTTSS, - BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- - pear 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 sup- + --pp Turn on _p_r_i_v_i_l_e_g_e_d mode. In this mode, the $$EENNVV and + $$BBAASSHH__EENNVV files are not processed, shell functions are + not inherited from the environment, and the SSHHEELLLLOOPPTTSS, + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they ap- + pear 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 sup- plied, these actions are taken and the effective user id is set to the real user id. If the --pp option is sup- plied at startup, the effective user id is not reset. @@ -1315,20 +1312,19 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 - status. + cial parameters and or array variables subscripted with + or as an error when performing parameter expansion. If + expansion is attempted on an unset variable or parame- + ter, the shell prints an error message, and, if not in- + teractive, 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 standard error. --BB The shell performs brace expansion (see BBrraaccee EExxppaannssiioonn - in _b_a_s_h_(_1_)). This is on by default. + in _b_a_s_h(1)). This is on by default. --CC If set, bbaasshh does not overwrite an existing file with the >>, >>&&, and <<>> redirection operators. This may be overridden when creating output files by using the redi- @@ -1339,17 +1335,17 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 change the current directory. --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, then the positional + ---- If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parame- ters are set to the _a_r_gs, even if some of them begin with a --. @@ -1361,25 +1357,25 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 true unless an invalid option is encoun- + shell. The current set of options may be found in $$--. The re- + turn status is always true unless an invalid option is encoun- tered. sshhiifftt [_n] - The positional parameters from _n+1 ... are renamed to $$11 ........ - Parameters represented by the numbers $$## down to $$##-_n+1 are un- - set. _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 param- - eters are not changed. The return status is greater than zero + The positional parameters from _n+1 ... are renamed to $$11 ........ + Parameters represented by the numbers $$## down to $$##-_n+1 are un- + set. _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 para- + meters 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, a list - of all settable options is displayed, with an indication of + of all settable options is displayed, with an indication of whether or not each is set; if _o_p_t_n_a_m_e_s are supplied, the output is restricted to those options. The --pp option causes output to be displayed in a form that may be reused as input. Other op- @@ -1388,45 +1384,45 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS --uu Disable (unset) each _o_p_t_n_a_m_e. --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 given with --qq, the return sta- - tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- + ple _o_p_t_n_a_m_e arguments are given with --qq, the return sta- + tus is zero if all _o_p_t_n_a_m_e_s are enabled; non-zero other- wise. - --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. 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, minor errors in the spelling of a directory com- ponent in a ccdd command will be corrected. The errors checked for are transposed characters, a missing charac- - ter, and one character too many. If a correction is - found, the corrected filename is printed, and the com- - mand proceeds. This option is only used by interactive + ter, and one character too many. If a correction is + found, the corrected filename is printed, and the com- + mand proceeds. This option is only used by interactive shells. cchheecckkhhaasshh If set, bbaasshh checks that a command found in the hash ta- @@ -1435,10 +1431,10 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS formed. 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, this causes the exit to be deferred until a second exit is attempted without an intervening command - (see JJOOBB CCOONNTTRROOLL in _b_a_s_h_(_1_)). The shell always post- + (see JJOOBB CCOONNTTRROOLL in _b_a_s_h(1)). The shell always post- pones exiting if any jobs are stopped. cchheecckkwwiinnssiizzee If set, bbaasshh checks the window size after each external @@ -1449,7 +1445,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 in _b_a_s_h_(_1_) under HHIISS-- + history is enabled, as described in _b_a_s_h(1) under HHIISS-- TTOORRYY. ccoommppaatt3311 ccoommppaatt3322 @@ -1460,76 +1456,75 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ccoommppaatt4444 ccoommppaatt5500 These control aspects of the shell's compatibility mode - (see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE in _b_a_s_h_(_1_)). + (see SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE in _b_a_s_h(1)). ccoommpplleettee__ffuullllqquuoottee 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. - This changes the contents of the readline editing buf- - fer. If not set, bbaasshh attempts to preserve what the + If set, bbaasshh replaces directory names with the results + of word expansion when performing filename completion. + This changes the contents of the readline editing + 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 ````....'''' must always be matched explicitly, even if - ddoottgglloobb is set. + 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 command. An interactive shell does not + not execute the file specified as an argument to the + eexxeecc builtin command. An interactive shell does not exit if eexxeecc fails. eexxppaanndd__aalliiaasseess - If set, aliases are expanded as described in _b_a_s_h_(_1_) un- + If set, aliases are expanded as described in _b_a_s_h(1) un- der AALLIIAASSEESS. This option is enabled by default for in- teractive shells. eexxttddeebbuugg 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 - in their descriptions in _b_a_s_h_(_1_)). + 44.. BBAASSHH__AARRGGCC and BBAASSHH__AARRGGVV are updated as described + in their descriptions in _b_a_s_h(1)). - 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. @@ -1538,38 +1533,38 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS _c_o_m_m_a_n_d )) inherit the EERRRR trap. eexxttgglloobb If set, the extended pattern matching features described - in _b_a_s_h_(_1_) under PPaatthhnnaammee EExxppaannssiioonn are enabled. + in _b_a_s_h(1) under PPaatthhnnaammee EExxppaannssiioonn are enabled. 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 in _b_a_s_h_(_1_) for a + ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS in _b_a_s_h(1) for a description of FFIIGGNNOORREE. This option is enabled by de- fault. gglloobbaasscciiiirraannggeess If set, range expressions used in pattern matching - bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h_(_1_)) + bracket expressions (see PPaatttteerrnn MMaattcchhiinngg in _b_a_s_h(1)) behave as if in the traditional C locale when performing - comparisons. That is, the current locale's collating - sequence is not taken into account, so bb will not col- - late between AA and BB, and upper-case and lower-case + comparisons. That is, the current locale's collating + sequence is not taken into account, so bb will not col- + late 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 ````..''''. This option is enabled by default. + 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- @@ -1582,7 +1577,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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. @@ -1601,26 +1596,26 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 in - _b_a_s_h_(_1_)). This is enabled by default. + _b_a_s_h(1)). 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 _p_o_s_i_x _m_o_d_e 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 _p_o_s_i_x _m_o_d_e is enabled. iinntteerraaccttiivvee__ccoommmmeennttss If set, allow a word beginning with ## to cause that word and all remaining characters on that line to be ignored - in an interactive shell (see CCOOMMMMEENNTTSS in _b_a_s_h_(_1_)). This + in an interactive shell (see CCOOMMMMEENNTTSS in _b_a_s_h(1)). 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. @@ -1643,14 +1638,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS llooggiinn__sshheellll The shell sets this option if it is started as a login - shell (see IINNVVOOCCAATTIIOONN in _b_a_s_h_(_1_)). The value may not be + shell (see IINNVVOOCCAATTIIOONN in _b_a_s_h(1)). 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, the - message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- - played. + 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 nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn If set, and rreeaaddlliinnee is being used, bbaasshh will not at- @@ -1660,34 +1654,34 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS nnooccaasseegglloobb If set, bbaasshh matches filenames in a case-insensitive fashion when performing pathname expansion (see PPaatthhnnaammee - EExxppaannssiioonn in _b_a_s_h_(_1_)). + EExxppaannssiioonn in _b_a_s_h(1)). 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 - (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h_(_1_)) expand to nothing + (see PPaatthhnnaammee EExxppaannssiioonn in _b_a_s_h(1)) expand to nothing and are 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 in - _b_a_s_h_(_1_). This option is enabled by default. + string of pattern substitution to the text matched by + the pattern, as described under PPaarraammeetteerr EExxppaannssiioonn in + _b_a_s_h(1). This option is enabled by default. pprrooggccoommpp If set, the programmable completion facilities (see PPrroo-- - ggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h_(_1_)) are enabled. This op- + ggrraammmmaabbllee CCoommpplleettiioonn in _b_a_s_h(1)) are enabled. This op- tion is enabled by default. pprrooggccoommpp__aalliiaass @@ -1699,62 +1693,62 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS pprroommppttvvaarrss If set, prompt strings undergo parameter expansion, com- - mand substitution, arithmetic expansion, and quote re- - moval after being expanded as described in PPRROOMMPPTTIINNGG in - _b_a_s_h_(_1_). This option is enabled by default. + mand substitution, arithmetic expansion, and quote re- + moval after being expanded as described in PPRROOMMPPTTIINNGG in + _b_a_s_h(1). This option is enabled by default. rreessttrriicctteedd__sshheellll - The shell sets this option if it is started in re- - stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h_(_1_)). The - value may not be changed. This is not reset when the - startup files are executed, allowing the startup files + The shell sets this option if it is started in re- + stricted mode (see RREESSTTRRIICCTTEEDD SSHHEELLLL in _b_a_s_h(1)). The + value may not be changed. This is not reset when the + startup files are executed, allowing the startup files to discover 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 + find the directory containing the file supplied as an argument. This option 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 RREE-- - DDIIRREECCTTIIOONN in _b_a_s_h_(_1_)) instead of leaving them open when - the command completes. + If set, the shell automatically closes file descriptors + assigned using the _{_v_a_r_n_a_m_e_} redirection syntax (see + RREEDDIIRREECCTTIIOONN in _b_a_s_h(1)) 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 can be used to 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 + 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 can be used to 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 supplied. 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 op- - erand must be a separate argument. Expressions are composed of - the primaries described in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- + 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 in _b_a_s_h(1) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- SSIIOONNSS. 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- - pends on the number of arguments; see below. Operator prece- + 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. Operator prece- dence is used 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 the normal precedence of operators. _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. @@ -1773,41 +1767,41 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 in - _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + _b_a_s_h(1) 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 - operators listed in _b_a_s_h_(_1_) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- - SSIIOONNSS, the result of the expression is the result of the - binary test using the first and third arguments as oper- - ands. The --aa and --oo operators are considered binary op- - erators when there are three arguments. If the first ar- - gument is !!, the value is the negation of the two-argu- + If the second argument is one of the binary conditional + operators listed in _b_a_s_h(1) under CCOONNDDIITTIIOONNAALL EEXXPPRREESS-- + SSIIOONNSS, 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-argu- ment test using the second and third arguments. If the first argument is exactly (( and the third argument is ex- - actly )), the result is the one-argument test of the sec- + actly )), the result is the one-argument test of the sec- ond argument. Otherwise, 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. the two-argument test using the second and - third arguments. If the first argument is exactly (( and - the fourth argument is exactly )), the result is the two- - argument test of the second and third arguments. Other- + the three-argument expression composed of the remaining + arguments. the two-argument test using the second and + third arguments. If the first argument is exactly (( and + the fourth argument is exactly )), the result is the two- + argument test of the second and third arguments. Other- wise, 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 precedence using the rules listed above. - If the shell is not in _p_o_s_i_x _m_o_d_e, when used with tteesstt or [[, the - << and >> operators sort lexicographically using ASCII ordering. - When the shell is in _p_o_s_i_x _m_o_d_e, these operators sort using the - current locale. + When the shell is in _p_o_s_i_x _m_o_d_e, or if the expression is part of + the [[[[ command, the << and >> operators sort using the current lo- + cale. If the shell is not in _p_o_s_i_x _m_o_d_e, the tteesstt and [[ com- + mands sort lexicographically using ASCII ordering. ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. @@ -1823,9 +1817,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 @@ -1844,9 +1838,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS If a _s_i_g_s_p_e_c is EEXXIITT (0) the command _a_c_t_i_o_n is executed on exit from the shell. If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _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, + _s_e_l_e_c_t command, (( arithmetic command, [[ conditional command, arithmetic _f_o_r command, and before the first command executes in - a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h_(_1_)). Refer to the + a shell function (see SSHHEELLLL GGRRAAMMMMAARR in _b_a_s_h(1)). Refer to the description of the eexxttddeebbuugg option to the sshhoopptt builtin for de- tails of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_c_t_i_o_n is executed each time a shell function or a @@ -1858,7 +1852,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS 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, or if the command's return value is being inverted using @@ -1877,55 +1871,55 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] With no options, 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 disk file, respectively. If the _n_a_m_e is - not found, then nothing is printed, and ttyyppee returns a non-zero - exit status. If the --pp option is used, ttyyppee either returns the - name of the executable file that would be found by searching - $$PPAATTHH if _n_a_m_e were specified as a command name, 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 name'' would not - return _f_i_l_e. If a command is hashed, --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, re- - served words, functions, and builtins, but the path search op- - tions (--pp and --PP) can be supplied to restrict the output to exe- - cutable files. ttyyppee does not consult the table of hashed com- - mands 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 ccoommmmaanndd builtin. ttyyppee returns true if all of the arguments - are found, false if any are not found. + 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 disk file, respectively. If the _n_a_m_e is + not found, then nothing is printed, and ttyyppee returns a non-zero + exit status. If the --pp option is used, ttyyppee either returns the + name of the executable file that would be found by searching + $$PPAATTHH if _n_a_m_e were specified as a command name, or nothing if + would not return _f_i_l_e. The --PP option forces a PPAATTHH search for + each _n_a_m_e, even if would not return _f_i_l_e. If a command is + hashed, --pp and --PP print the hashed value, which is not necessar- + ily 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 sup- + plied 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 ccoommmmaanndd builtin. ttyyppee re- + turns 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 to processes started by it, on systems that allow such control. The --HH and --SS options specify that 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- + 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- fied, both the soft and hard limits are set. 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, re- spectively. If _l_i_m_i_t is omitted, the current value of the soft limit of the resource is printed, 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 op- + When more than one resource is specified, the limit name and + unit, if appropriate, are printed before the value. Other op- tions are interpreted as follows: --aa All current limits are reported; 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 + --ee The maximum scheduling priority ( + --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) @@ -1956,23 +1950,23 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS uummaasskk [--pp] [--SS] [_m_o_d_e] The user file-creation mask is set to _m_o_d_e. If _m_o_d_e begins with - a digit, it is interpreted as an octal number; otherwise it is - interpreted as a symbolic mode mask similar to that accepted by - _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is - printed. The --SS option causes the mask to be printed in sym- - bolic form; the default output is an octal number. If the --pp + a digit, it is interpreted as an octal number; otherwise it is + interpreted as a symbolic mode mask similar to that accepted by + _c_h_m_o_d(1). If _m_o_d_e is omitted, the current value of the mask is + printed. The --SS option causes the mask to be printed in sym- + bolic form; 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 0 if the mode - was successfully changed or if no _m_o_d_e argument was supplied, + was successfully changed or if no _m_o_d_e argument was supplied, and false otherwise. uunnaalliiaass [-aa] [_n_a_m_e ...] - Remove each _n_a_m_e from the list of defined aliases. If --aa is - supplied, all alias definitions are removed. The return value + Remove each _n_a_m_e from the list of defined aliases. If --aa is + supplied, all alias definitions are removed. 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. Read-only variables may not be unset. If --ff is specified, each _n_a_m_e refers to a shell func- @@ -1991,16 +1985,16 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS sequently reset. The exit status is true unless a _n_a_m_e is read- only or may not be unset. - wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d _._._.] + wwaaiitt [--ffnn] [--pp _v_a_r_n_a_m_e] [_i_d ...] Wait for each specified child process and return its termination - status. Each _i_d may be a process ID or a job specification; if - a job spec is given, all processes in that job's pipeline are - waited for. If _i_d is not given, wwaaiitt waits for all running - background jobs and the last-executed process substitution, if + status. Each _i_d may be a process ID or a job specification; if + a job spec is given, all processes in that job's pipeline are + waited for. If _i_d is not given, 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 a single job from the list of _i_ds or, if no _i_ds are supplied, any job, to complete - and returns its exit status. If none of the supplied arguments + and returns its exit status. If none of the supplied arguments is a child of the shell, or if no arguments are supplied and the shell has no unwaited-for children, the exit status is 127. If the --pp option is supplied, the process or job identifier of the @@ -2010,33 +2004,33 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS only when the --nn option is supplied. Supplying the --ff option, when job control is enabled, forces wwaaiitt to wait for _i_d to ter- minate before returning its status, instead of returning when it - changes status. If _i_d specifies a non-existent process or job, - the return status is 127. If wwaaiitt is interrupted by a signal, - the return status will be greater than 128, as described under - SSIIGGNNAALLSS in _b_a_s_h_(_1_). Otherwise, the return status is the exit + changes status. If _i_d specifies a non-existent process or job, + the return status is 127. If wwaaiitt is interrupted by a signal, + the return status will be greater than 128, as described under + SSIIGGNNAALLSS in _b_a_s_h(1). Otherwise, the return status is the exit status of the last process or job waited for. 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- - fied as a set of options to the shopt builtin ( ccoommppaatt3311, ccoommppaatt3322, - ccoommppaatt4400, ccoommppaatt4411, and so on). There is only one current compatibil- - ity level -- each option is mutually exclusive. The compatibility - level is intended to allow users to select behavior from previous ver- - sions that is incompatible with newer versions while they migrate - scripts to use current features and behavior. It's intended to be a - temporary solution. - - This section does not mention behavior that is standard for a particu- - lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the - regexp matching operator quotes special regexp characters in the word, + 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 + 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- + tion. + + This section does not mention behavior that is standard for a particu- + lar version (e.g., setting ccoommppaatt3322 means that quoting the rhs of the + regexp matching operator quotes special regexp characters in the word, which is default behavior in bash-3.2 and subsequent versions). - 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 @@ -2045,14 +2039,14 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE 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 has begun deprecating older compatibility - levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- + Starting with bash-4.4, bbaasshh has begun deprecating older compatibility + levels. Eventually, the options will be removed in favor of BBAASSHH__CCOOMM-- PPAATT. - Bash-5.0 was the final version for which there will be an individual + Bash-5.0 was the final version for which there will be an individual shopt option for the previous version. Users should control the compat- ibility level with BBAASSHH__CCOOMMPPAATT. @@ -2069,7 +2063,7 @@ 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. @@ -2092,45 +2086,45 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE 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 the shell does not print a warning message if an attempt - is made to use a quoted compound assignment as an argu- - ment to declare (e.g., declare -a foo='(1 2)'). Later + +o the shell does not print a warning message if an attempt + is made to use a quoted compound assignment as an argu- + ment to declare (e.g., declare -a foo='(1 2)'). Later versions warn that this usage is deprecated - +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- + 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 + +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 enabled - +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- + +o Bash-5.1 changed the way $$RRAANNDDOOMM is generated to intro- duce slightly more randomness. If the shell compatibility level is set to 50 or lower, it reverts to the method from bash-5.0 and previous versions, so seeding the ran- @@ -2147,27 +2141,27 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE 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 + +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 + +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 - 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 can be expanded more than once - +o tteesstt --vv, when given an argument of AA[[@@]], where AAPP iiss aann - eexxiissttiinngg aassssoocciiaattiivvee aarrrraayy,, wwiillll rreettuurrnn ttrruuee iiff tthhee aarrrraayy - hhaass aannyy sseett eelleemmeennttss.. BBaasshh--55..22 wwiillll llooookk ffoorr aanndd rreeppoorrtt - oonn aa kkeeyy nnaammeedd @@.. - ++oo 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 + +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 + 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 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 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- @@ -2178,6 +2172,4 @@ SSHHEELLLL CCOOMMPPAATTIIBBIILLIITTYY MMOODDEE SSEEEE AALLSSOO bash(1), sh(1) - - -GNU Bash 5.2 2023 January 27 BASH_BUILTINS(1) +GNU Bash 5.2 2023 January 27 _B_A_S_H___B_U_I_L_T_I_N_S(1) diff --git a/lib/readline/doc/history.3 b/lib/readline/doc/history.3 index 0ecbe1b4..0a7024a2 100644 --- a/lib/readline/doc/history.3 +++ b/lib/readline/doc/history.3 @@ -6,9 +6,9 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Fri Jan 19 11:53:57 EST 2024 +.\" Last Change: Mon Feb 5 14:37:12 EST 2024 .\" -.TH HISTORY 3 "2024 January 19" "GNU History 8.3" +.TH HISTORY 3 "2024 February 5" "GNU History 8.3" .\" .\" File Name macro. This used to be `.PN', for Path Name, .\" but Sun doesn't seem to like that very much. @@ -18,7 +18,7 @@ .. .de Q .ie \n(.g \(lq\\$1\(rq\\$2 -.el \{ +.el \{\ . if t ``\\$1''\\$2 . if n "\\$1"\\$2 .\} @@ -53,7 +53,7 @@ history \- GNU History Library Many programs read input from the user a line at a time. The GNU History library is able to keep track of those lines, associate arbitrary data with each line, and utilize information from previous lines in -composing new ones. +composing new ones. .PP .SH "HISTORY EXPANSION" The history library supports a history expansion feature that @@ -78,7 +78,7 @@ and the portions of that line that are acted upon are \fIwords\fP. Various \fImodifiers\fP are available to manipulate the selected words. The line is broken into words in the same fashion as \fBbash\fP does when reading input, -so that several words that would otherwise be separated +so that several words that would otherwise be separated are considered one word when surrounded by quotes (see the description of \fBhistory_tokenize()\fP below). .PP @@ -118,7 +118,8 @@ Refer to the current command minus .IR n . .TP .B !! -Refer to the previous command. This is a synonym for `!\-1'. +Refer to the previous command. This is a synonym for +.Q !\-1 . .TP .B !\fIstring\fR Refer to the most recent command @@ -182,15 +183,22 @@ The last word. This is usually the last argument, but will expand to the zeroth word if there is only one word in the line. .TP .B % -The first word matched by the most recent `?\fIstring\fR?' search, +The first word matched by the most recent +.Q ?\fIstring\fR? +search, if the search string begins with a character that is part of a word. .TP .I x\fB\-\fPy -A range of words; `\-\fIy\fR' abbreviates `0\-\fIy\fR'. +A range of words; +.Q \-\fIy\fR +abbreviates +.Q 0\-\fIy\fR . .TP .B * -All of the words but the zeroth. This is a synonym -for `\fI1\-$\fP'. It is not an error to use +All of the words but the zeroth. +This is a synonym for +.Q \fI1\-$\fP . +It is not an error to use .B * if there is just one word in the event; the empty string is returned in that case. @@ -207,7 +215,8 @@ If a word designator is supplied without an event specification, the previous command is used as the event. .SS Modifiers After the optional word designator, there may appear a sequence of -one or more of the following modifiers, each preceded by a `:'. +one or more of the following modifiers, each preceded by a +.Q : . These modify, or edit, the word or words selected from the history event. .PP .PD 0 @@ -279,17 +288,26 @@ is deleted. Repeat the previous substitution. .TP .B g -Cause changes to be applied over the entire event line. This is -used in conjunction with `\fB:s\fP' (e.g., `\fB:gs/\fIold\fP/\fInew\fP/\fR') -or `\fB:&\fP'. If used with -`\fB:s\fP', any delimiter can be used -in place of /, and the final delimiter is optional +Cause changes to be applied over the entire event line. +This is used in conjunction with +.Q \fB:s\fP +(e.g., +.Q \fB:gs/\fIold\fP/\fInew\fP/\fR ) +or +.Q \fB:&\fP . +If used with +.Q \fB:s\fP , +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 \fBa\fP may be used as a synonym for \fBg\fP. .TP .B G -Apply the following `\fBs\fP' or `\fB&\fP' modifier once to each word -in the event line. +Apply the following +.Q \fBs\fP + or +.Q \fB&\fP +modifier once to each word in the event line. .PD .SH "PROGRAMMING WITH HISTORY FUNCTIONS" This section describes how to use the History library in other programs. @@ -500,8 +518,8 @@ offset. The search is anchored: matching lines must begin with \fIstring\fP. If \fIdirection\fP is less than 0, then the search is through previous entries, otherwise through subsequent entries. If \fIstring\fP is found, then the -current history index is set to that entry, and the return value is 0. -Otherwise, nothing is changed, and a -1 is returned. +current history index is set to that entry, and the return value is 0. +Otherwise, nothing is changed, and a -1 is returned. .Fn3 int history_search_pos "const char *string" "int direction" "int pos" Search for \fIstring\fP in the history list, starting at \fIpos\fP, an @@ -632,7 +650,7 @@ This is disabled by default. .Vb "char *" history_word_delimiters The characters that separate tokens for \fBhistory_tokenize()\fP. -The default value is \fB"\ \et\en()<>;&|"\fP. +The default value is \fB\(dq\ \et\en()<>;&|\(dq\fP. .Vb "char *" history_no_expand_chars The list of characters which inhibit history expansion if found immediately @@ -674,7 +692,7 @@ It is intended for use by applications like \fBbash\fP that use the history expansion character for additional purposes. By default, this variable is set to \fBNULL\fP. .SH FILES -.PD 0 +.PD 0 .TP .FN \(ti/.history Default filename for reading and writing saved history diff --git a/lib/readline/doc/readline.3 b/lib/readline/doc/readline.3 index a6b06596..e6f46942 100644 --- a/lib/readline/doc/readline.3 +++ b/lib/readline/doc/readline.3 @@ -6,9 +6,9 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Thu Jan 18 11:05:44 EST 2024 +.\" Last Change: Mon Feb 5 10:50:56 EST 2024 .\" -.TH READLINE 3 "2024 January 18" "GNU Readline 8.3" +.TH READLINE 3 "2024 February 5" "GNU Readline 8.3" .\" .\" File Name macro. This used to be `.PN', for Path Name, .\" but Sun doesn't seem to like that very much. @@ -18,7 +18,7 @@ .. .de Q .ie \n(.g \(lq\\$1\(rq\\$2 -.el \{ +.el \{\ . if t ``\\$1''\\$2 . if n "\\$1"\\$2 .\} @@ -49,7 +49,7 @@ readline \- get a line from a user with editing will read a line from the terminal and return it, using .B prompt -as a prompt. If +as a prompt. If .B prompt is \fBNULL\fP or the empty string, no prompt is issued. The line returned is allocated with @@ -188,11 +188,13 @@ When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP, is the name of a key spelled out in English. For example: .PP .RS -Control\-u: universal\-argument -.br -Meta\-Rubout: backward\-kill\-word -.br -Control\-o: "> output" +.EX +.nf +Control-u: universal\-argument +Meta-Rubout: backward\-kill\-word +Control-o: \(dq> output\(dq +.fi +.EE .RE .LP In the above example, @@ -209,7 +211,8 @@ expressed on the right hand side (that is, to insert the text .Q "> output" into the line). .PP -In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP, +In the second form, +\fB\(dqkeyseq\(dq\fP:\^\fIfunction\-name\fP or \fImacro\fP, .B keyseq differs from .B keyname @@ -220,11 +223,13 @@ used, as in the following example, but the symbolic character names are not recognized. .PP .RS -"\eC\-u": universal\-argument -.br -"\eC\-x\eC\-r": re\-read\-init\-file -.br -"\ee[11\(ti": "Function Key 1" +.EX +.nf +\(dq\eC\-u\(dq: universal\-argument +\(dq\eC\-x\eC\-r\(dq: re\-read\-init\-file +\(dq\ee[11\(ti\(dq: \(dqFunction Key 1\(dq +.fi +.EE .RE .PP In this example, @@ -256,11 +261,11 @@ an escape character .B \e\e backslash .TP -.B \e" -literal ", a double quote +.B \e\(dq +literal \(dq, a double quote .TP -.B \e' -literal ', a single quote +.B \e\(aq +literal \(aq, a single quote .RE .PD .PP @@ -308,7 +313,7 @@ be used to indicate a macro definition. Unquoted text is assumed to be a function name. In the macro body, the backslash escapes described above are expanded. Backslash will quote any other character in the macro text, -including " and '. +including \(dq and \(aq. .PP .B Bash allows the current readline key bindings to be displayed or modified @@ -340,8 +345,12 @@ or .B Off (without regard to case). Unrecognized variable names are ignored. -When a variable value is read, empty or null values, "on" (case-insensitive), -and "1" are equivalent to \fBOn\fP. All other values are equivalent to +When readline reads a variable value, empty or null values, +.Q "on" +(case-insensitive), and +.Q 1 +are equivalent to \fBOn\fP. +All other values are equivalent to \fBOff\fP. The variables and their default values are: .PP @@ -358,7 +367,7 @@ This variable is reset to the default value whenever the terminal type changes. The default value is the string that puts the terminal in standout mode, as obtained from the terminal's terminfo description. A sample value might be -.Q "\ee[01;33m" . +.Q \ee[01;33m . .TP .B active\-region\-end\-color A string variable that @@ -374,7 +383,7 @@ This variable is reset to the default value whenever the terminal type changes. The default value is the string that restores the terminal from standout mode, as obtained from the terminal's terminfo description. A sample value might be -.Q "\ee[0m" . +.Q \ee[0m . .TP .B bell\-style (audible) Controls what happens when readline wants to ring the terminal bell. @@ -383,10 +392,9 @@ If set to \fBnone\fP, readline never rings the bell. If set to If set to \fBaudible\fP, readline attempts to ring the terminal's bell. .TP .B bind\-tty\-special\-chars (On) -If set to \fBOn\fP (the default), readline attempts to bind the control -characters that are -treated specially by the kernel's terminal driver to their -readline equivalents. +If set to \fBOn\fP (the default), readline attempts to bind +the control characters that are treated specially by the kernel's +terminal driver to their readline equivalents. These override the default readline bindings described here. Type .Q "stty -a" @@ -412,9 +420,13 @@ If set to \fBOn\fP, readline displays possible completions using different colors to indicate their file type. The color definitions are taken from the value of the \fBLS_COLORS\fP environment variable. +.\" Tucking multiple macro calls into a paragraph tag requires some +.\" finesse. We require `\c`, and while the single-font macros don't +.\" honor input trap continuation, the font alternation macros do. .TP -.B comment\-begin (``#'') -The string that is inserted in \fBvi\fP mode when the +.BR comment\-begin\ (\c +.Q \fB#\fP \fB)\fP +The string that is inserted when the .B insert\-comment command is executed. This command is bound to @@ -430,7 +442,7 @@ The value is ignored if it is less than 0 or greater than the terminal screen width. A value of 0 will cause matches to be displayed one per line. The default value is \-1. -.TP +.TP .B completion\-ignore\-case (Off) If set to \fBOn\fP, readline performs filename matching and completion in a case\-insensitive fashion. @@ -465,11 +477,11 @@ by stripping the eighth bit and prefixing it with an escape character (in effect, using escape as the \fImeta prefix\fP). The default is \fIOn\fP, but readline will set it to \fIOff\fP if the locale contains eight-bit characters. -This variable is dependent on the \fBLC_CTYPE\fP locale category, and +This variable is dependent on the \fBLC_CTYPE\fP locale category, and may change if the locale is changed. .TP .B disable\-completion (Off) -If set to \fBOn\fP, readline will inhibit word completion. Completion +If set to \fBOn\fP, readline will inhibit word completion. Completion characters will be inserted into the line as if they had been mapped to \fBself-insert\fP. .TP @@ -488,13 +500,13 @@ or .BR vi . .TP .B emacs\-mode\-string (@) -If the \fIshow\-mode\-in\-prompt\fP variable is enabled, +If the \fIshow\-mode\-in\-prompt\fP variable is enabled, this string is displayed immediately before the last line of the primary prompt when emacs editing mode is active. The value is expanded like a key binding, so the standard set of meta- and control prefixes and backslash escape sequences is available. Use the \e1 and \e2 escapes to begin and end sequences of -non-printing characters, which can be used to embed a terminal control +non-printing characters, which can be used to embed a terminal control sequence into the mode string. .TP .B enable\-active\-region (On) @@ -532,8 +544,8 @@ If set to \fBOn\fP, tilde expansion is performed when readline attempts word completion. .TP .B history\-preserve\-point (Off) -If set to \fBOn\fP, the history code attempts to place point at the -same location on each history line retrieved with \fBprevious-history\fP +If set to \fBOn\fP, the history code attempts to place point at the +same location on each history line retrieved with \fBprevious-history\fP or \fBnext-history\fP. .TP .B history\-size (unset) @@ -558,12 +570,13 @@ it will not clear the eighth bit in the characters it reads), regardless of what the terminal claims it can support. The name .B meta\-flag is a synonym for this variable. -The default is \fIOff\fP, but readline will set it to \fIOn\fP if the +The default is \fIOff\fP, but readline will set it to \fIOn\fP if the locale contains eight-bit characters. -This variable is dependent on the \fBLC_CTYPE\fP locale category, and +This variable is dependent on the \fBLC_CTYPE\fP locale category, and may change if the locale is changed. .TP -.B isearch\-terminators (``C\-[ C\-J'') +.BR isearch\-terminators\ (\c +.Q \fBC\-[C\-J\fP \fB)\fP The string of characters that should terminate an incremental search without subsequently executing the character as a command. If this variable has not been given a value, the characters @@ -584,7 +597,7 @@ also affects the default keymap. .B keyseq\-timeout (500) Specifies the duration \fIreadline\fP 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 +the input read so far, or can take additional input to complete a longer key sequence). If no input is received within the timeout, \fIreadline\fP will use the shorter but complete key sequence. @@ -608,11 +621,13 @@ have a slash appended (subject to the value of \fBmark\-directories\fP). .TP .B match\-hidden\-files (On) -This variable, when set to \fBOn\fP, causes readline to match files whose -names begin with a `.' (hidden files) when performing filename -completion. -If set to \fBOff\fP, the leading `.' must be -supplied by the user in the filename to be completed. +This variable, when set to \fBOn\fP, forces readline to match files whose +names begin with a +.Q . +(hidden files) when performing filename completion. +If set to \fBOff\fP, the user must include the leading +.Q . +in the filename to be completed. .TP .B menu\-complete\-display\-prefix (Off) If set to \fBOn\fP, menu completion displays the common prefix of the @@ -657,9 +672,9 @@ matches to be listed immediately instead of ringing the bell. This alters the default behavior of the completion functions in a fashion similar to \fBshow\-all\-if\-ambiguous\fP. If set to -.BR On , +.BR On , words which have more than one possible completion without any -possible partial completion (the possible completions don't share +possible partial completion (the possible completions don't share a common prefix) cause the matches to be listed immediately instead of ringing the bell. .TP @@ -677,7 +692,7 @@ after point in the word being completed, so portions of the word following the cursor are not duplicated. .TP .B vi\-cmd\-mode\-string ((cmd)) -If the \fIshow\-mode\-in\-prompt\fP variable is enabled, +If the \fIshow\-mode\-in\-prompt\fP 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 is expanded like a @@ -688,18 +703,18 @@ non-printing characters, which can be used to embed a terminal control sequence into the mode string. .TP .B vi\-ins\-mode\-string ((ins)) -If the \fIshow\-mode\-in\-prompt\fP variable is enabled, +If the \fIshow\-mode\-in\-prompt\fP 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. +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 +key binding, so the standard set of meta- and control prefixes and backslash escape sequences is available. Use the \e1 and \e2 escapes to begin and end sequences of -non-printing characters, which can be used to embed a terminal control +non-printing characters, which can be used to embed a terminal control sequence into the mode string. .TP .B visible\-stats (Off) -If set to \fBOn\fP, a character denoting a file's type as reported +If set to \fBOn\fP, a character denoting a file's type as reported by \fIstat\fP(2) is appended to the filename when listing possible completions. .PD @@ -708,7 +723,8 @@ Readline 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 used. -.IP \fB$if\fP +.TP +.B $if The .B $if construct allows bindings to be made based on the @@ -717,14 +733,16 @@ readline. The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it. .RS -.IP \fBmode\fP +.TP +.B mode The \fBmode=\fP form of the \fB$if\fP directive is used to test whether readline is in emacs or vi mode. This may be used in conjunction with the \fBset keymap\fP command, for instance, to set bindings in the \fIemacs-standard\fP and \fIemacs-ctlx\fP keymaps only if readline is starting out in emacs mode. -.IP \fBterm\fP +.TP +.B term The \fBterm=\fP 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 @@ -737,7 +755,8 @@ to match both and .IR sun\-cmd , for instance. -.IP \fBversion\fP +.TP +.B version The \fBversion\fP test may be used to perform comparisons against specific readline versions. The \fBversion\fP expands to the current readline version. @@ -757,9 +776,11 @@ minor version (e.g., \fB7.1\fP). If the minor version is omitted, it is assumed to be \fB0\fP. The operator may be separated from the string \fBversion\fP and from the version number argument by whitespace. -.IP \fBapplication\fP -The \fBapplication\fP construct is used to include -application-specific settings. Each program using the readline +.TP +.I application +The \fIapplication\fP construct is used to include +application-specific settings. +Each program using the readline library sets the \fIapplication name\fP, and an initialization file can test for a particular value. This could be used to bind key sequences to functions useful for @@ -767,14 +788,17 @@ a specific program. For instance, the following command adds a key sequence that quotes the current or previous word in \fBbash\fP: .PP .RS +.EX .nf \fB$if\fP Bash # Quote the current or previous word -"\eC-xq": "\eeb\e"\eef\e"" +\(dq\eC-xq\(dq: \(dq\eeb\e\(dq\eef\e\(dq\(dq \fB$endif\fP .fi +.EE .RE -.IP \fIvariable\fP +.TP +.I variable The \fIvariable\fP construct provides simple equality tests for readline variables and values. The permitted comparison operators are \fI=\fP, \fI==\fP, and \fI!=\fP. @@ -784,13 +808,16 @@ side by whitespace. Both string and boolean variables may be tested. Boolean variables must be tested against the values \fIon\fP and \fIoff\fP. .RE -.IP \fB$endif\fP +.TP +.B $endif This command, as seen in the previous example, terminates an \fB$if\fP command. -.IP \fB$else\fP +.TP +.B $else Commands in this branch of the \fB$if\fP directive are executed if the test fails. -.IP \fB$include\fP +.TP +.B $include This directive takes a single filename as an argument and reads commands and bindings from that file. For example, the following directive would read \fI/etc/inputrc\fP: @@ -798,7 +825,7 @@ would read \fI/etc/inputrc\fP: .PP .nf \fB$include\fP \^ \fI/etc/inputrc\fP -.fi +.fi .RE .SH SEARCHING Readline provides commands for searching through the command history @@ -940,12 +967,16 @@ and make it the current line. Without an argument, move back to the first entry in the history list. .TP .B reverse\-search\-history (C\-r) -Search backward starting at the current line and moving `up' through -the history as necessary. This is an incremental search. +Search backward starting at the current line and moving +.Q up +through the history as necessary. +This is an incremental search. .TP .B forward\-search\-history (C\-s) -Search forward starting at the current line and moving `down' through -the history as necessary. This is an incremental search. +Search forward starting at the current line and moving +.Q down +through the history as necessary. +This is an incremental search. .TP .B non\-incremental\-reverse\-search\-history (M\-p) Search backward through the history starting at the current line @@ -1032,7 +1063,7 @@ commonly is, see above for the effects. Delete the character behind the cursor. When given a numeric argument, save the deleted text on the kill ring. .TP -.B forward\-backward\-delete\-char +.B forward\-backward\-delete\-char Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is deleted. @@ -1044,7 +1075,7 @@ how to insert characters like \fBC\-q\fP, for example. .B tab\-insert (M-TAB) Insert a tab character. .TP -.B self\-insert (a,\ b,\ A,\ 1,\ !,\ ...) +.B "self\-insert (a, b, A, 1, !, \fR.\|.\|.\fP)" Insert the character typed. .TP .B transpose\-chars (C\-t) @@ -1148,7 +1179,7 @@ or .SS Numeric Arguments .PD 0 .TP -.B digit\-argument (M\-0, M\-1, ..., M\-\-) +.B digit\-argument (M\-0, M\-1, \fR.\|.\|.\fP, M\-\-) Add this digit to the argument already accumulating, or start a new argument. M\-\- starts a negative argument. .TP @@ -1206,7 +1237,7 @@ At the end of the list of completions, the bell is rung (subject to the setting of \fBbell\-style\fP) and the original text is restored. An argument of \fIn\fP moves \fIn\fP positions forward in the list -of matches; a negative argument may be used to move backward +of matches; a negative argument may be used to move backward through the list. This command is intended to be bound to \fBTAB\fP, but is unbound by default. @@ -1252,7 +1283,7 @@ Abort the current editing command and ring the terminal's bell (subject to the setting of .BR bell\-style ). .TP -.B do\-lowercase\-version (M\-A, M\-B, M\-\fIx\fP, ...) +.B do\-lowercase\-version (M\-A, M\-B, M\-\fIx\fP, \fR.\|.\|.\fP) If the metafied character \fIx\fP is uppercase, run the command that is bound to the corresponding metafied lowercase character. The behavior is undefined if \fIx\fP is already lowercase. @@ -1308,8 +1339,8 @@ Without a numeric argument, the value of the readline .B comment\-begin variable is inserted 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 \fBcomment\-begin\fP, the value is inserted, otherwise +the characters at the beginning of the line do not match the value +of \fBcomment\-begin\fP, the value is inserted, otherwise the characters in \fBcomment-begin\fP are deleted from the beginning of the line. In either case, the line is accepted as if a newline had been typed. diff --git a/lib/readline/doc/rluser.texi b/lib/readline/doc/rluser.texi index 1e3823cf..45e8a85d 100644 --- a/lib/readline/doc/rluser.texi +++ b/lib/readline/doc/rluser.texi @@ -405,11 +405,12 @@ set editing-mode vi @end example Variable names and values, where appropriate, are recognized without regard -to case. Unrecognized variable names are ignored. +to case. +Unrecognized variable names are ignored. Boolean variables (those that can be set to on or off) are set to on if -the value is null or empty, @var{on} (case-insensitive), or 1. Any other -value results in the variable being set to off. +the value is null or empty, @var{on} (case-insensitive), or 1. +Any other value results in the variable being set to off. @ifset BashFeatures The @w{@code{bind -V}} command lists the current Readline variable names @@ -723,11 +724,11 @@ The default is @samp{off}. @item match-hidden-files @vindex match-hidden-files -This variable, when set to @samp{on}, causes Readline to match files whose +This variable, when set to @samp{on}, forces Readline to match files whose names begin with a @samp{.} (hidden files) when performing filename completion. -If set to @samp{off}, the leading @samp{.} must be -supplied by the user in the filename to be completed. +If set to @samp{off}, the user must include the leading @samp{.} +in the filename to be completed. This variable is @samp{on} by default. @item menu-complete-display-prefix