diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-12-08 20:14:30 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-12-08 20:14:30 -0500 |
commit | 8f714a7c33bc0b909d0e684645a851ef4346195d (patch) | |
tree | b919e3450120c6505dce7b8d586a420d54139efc /doc/bash.0 | |
parent | 691aebcba30d177684f6cbb95e9377dfc598bda0 (diff) | |
download | bash-8f714a7c33bc0b909d0e684645a851ef4346195d.tar.gz |
commit bash-20090818 snapshot
Diffstat (limited to 'doc/bash.0')
-rw-r--r-- | doc/bash.0 | 716 |
1 files changed, 371 insertions, 345 deletions
@@ -196,22 +196,23 @@ 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 variable, if it appears in the environment, is 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. + the SSHHEELLLLOOPPTTSS, BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear 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 ccoonnttrrooll ooppeerraattoorr @@ -222,81 +223,81 @@ DDEEFFIINNIITTIIOONNSS RREESSEERRVVEEDD WWOORRDDSS _R_e_s_e_r_v_e_d _w_o_r_d_s are words that have a special meaning to the shell. The following words are recognized as reserved when unquoted and either the - first word of a simple command (see SSHHEELLLL GGRRAAMMMMAARR below) or the third + first word of a simple command (see SSHHEELLLL GGRRAAMMMMAARR below) or the third word of a ccaassee or ffoorr command: - !! ccaassee ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt tthheenn uunnttiill + !! ccaassee ddoo ddoonnee eelliiff eellssee eessaacc ffii ffoorr ffuunnccttiioonn iiff iinn sseelleecctt tthheenn uunnttiill wwhhiillee {{ }} ttiimmee [[[[ ]]]] SSHHEELLLL GGRRAAMMMMAARR SSiimmppllee CCoommmmaannddss - A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- - lowed by bbllaannkk-separated words and redirections, and terminated by a + A _s_i_m_p_l_e _c_o_m_m_a_n_d is a sequence of optional variable assignments fol- + lowed by bbllaannkk-separated words and redirections, and terminated by a _c_o_n_t_r_o_l _o_p_e_r_a_t_o_r. The first word specifies the command to be executed, - and is passed as argument zero. The remaining words are passed as + and is passed as argument zero. The remaining words are passed as arguments 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 [ [|||||&&] _c_o_m_m_a_n_d_2 ... ] - The standard output of _c_o_m_m_a_n_d 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- + The standard output of _c_o_m_m_a_n_d 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 command (see RREEDDIIRREECCTTIIOONN below). If ||&& is used, the standard error of _c_o_m_m_a_n_d is connected to _c_o_m_m_a_n_d_2's standard input - through the pipe; it is shorthand for 22>>&&11 ||. This implicit redirect- + through the pipe; it is shorthand for 22>>&&11 ||. This implicit redirect- ion of the standard error is performed after any redirections specified by the command. The return status of a pipeline is the exit status of the last command, - unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the - pipeline's return status is the value of the last (rightmost) command - to exit with a non-zero status, or zero if all commands exit success- + unless the ppiippeeffaaiill option is enabled. If ppiippeeffaaiill is enabled, the + pipeline's return status is the value of the last (rightmost) command + to exit with a non-zero status, or zero if all commands exit success- fully. If the reserved word !! precedes a pipeline, the exit status of - that pipeline is the logical negation of the exit status as described - above. 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. The TTIIMMEEFFOORRMMAATT variable may be set to a format - string that specifies how the timing information should be displayed; + 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. 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. - Each command in a pipeline is executed as a separate process (i.e., in + Each command in a pipeline is executed as a separate process (i.e., in a subshell). LLiissttss - A _l_i_s_t is a sequence of one or more pipelines separated by one of the + A _l_i_s_t is a sequence of one or more pipelines separated by one of the operators ;;, &&, &&&&, or ||||, and optionally terminated by one of ;;, &&, or <<nneewwlliinnee>>. Of these list operators, &&&& and |||| have equal precedence, followed by ;; and &&, which have equal precedence. - A sequence of one or more newlines may appear in a _l_i_s_t instead of a + A sequence of one or more newlines may appear in a _l_i_s_t instead of a semicolon to delimit commands. - If a command is terminated by the control operator &&, the shell exe- - cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not - wait for the command to finish, and the return status is 0. 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 + If a command is terminated by the control operator &&, the shell exe- + cutes the command in the _b_a_c_k_g_r_o_u_n_d in a subshell. The shell does not + wait for the command to finish, and the return status is 0. Commands + separated by a ;; are executed sequentially; the shell waits for each + command to terminate in turn. The return status is the exit status of the last command executed. - AND and OR lists are sequences of one of more pipelines separated by - the &&&& and |||| control operators, respectively. AND and OR lists are + AND and OR lists are sequences of one of 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. An OR list has the form @@ -304,77 +305,77 @@ SSHHEELLLL GGRRAAMMMMAARR _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: - (_l_i_s_t) _l_i_s_t is executed in a subshell environment (see CCOOMMMMAANNDD EEXXEECCUU-- - TTIIOONN EENNVVIIRROONNMMEENNTT below). Variable assignments and builtin com- - mands that affect the shell's environment do not remain in - effect after the command completes. The return status is the + (_l_i_s_t) _l_i_s_t is executed in a subshell environment (see CCOOMMMMAANNDD EEXXEECCUU-- + TTIIOONN EENNVVIIRROONNMMEENNTT below). Variable assignments and builtin com- + mands that affect the shell's environment do not remain in + effect after the command completes. The return status is the exit status of _l_i_s_t. { _l_i_s_t; } - _l_i_s_t is simply executed in the current shell environment. _l_i_s_t - must be terminated with a newline or semicolon. This is known - as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of - _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are + _l_i_s_t is simply executed in the current shell environment. _l_i_s_t + must be terminated with a newline or semicolon. This is known + as a _g_r_o_u_p _c_o_m_m_a_n_d. The return status is the exit status of + _l_i_s_t. Note that unlike the metacharacters (( and )), {{ and }} are _r_e_s_e_r_v_e_d _w_o_r_d_s and must occur where a reserved word is permitted - to be recognized. Since they do not cause a word break, they - must be separated from _l_i_s_t by whitespace or another shell + to be recognized. Since they do not cause a word break, they + must be separated from _l_i_s_t by whitespace or another shell metacharacter. ((_e_x_p_r_e_s_s_i_o_n)) - The _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules described - below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of the expres- - sion is non-zero, the return status is 0; otherwise the return + The _e_x_p_r_e_s_s_i_o_n is evaluated according to the rules described + below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If the value of the expres- + sion is non-zero, the return status is 0; otherwise the return status is 1. This is exactly equivalent to lleett ""_e_x_p_r_e_s_s_i_o_n"". [[[[ _e_x_p_r_e_s_s_i_o_n ]]]] - Return a status of 0 or 1 depending on the evaluation of the - conditional expression _e_x_p_r_e_s_s_i_o_n. Expressions are composed of - the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. - Word splitting and pathname expansion are not performed on the - words between the [[[[ and ]]]]; tilde expansion, parameter and - variable expansion, arithmetic expansion, command substitution, - process substitution, and quote removal are performed. Condi- + Return a status of 0 or 1 depending on the evaluation of the + conditional expression _e_x_p_r_e_s_s_i_o_n. Expressions are composed of + the primaries described below under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS. + Word splitting and pathname expansion are not performed on the + words between the [[[[ and ]]]]; tilde expansion, parameter and + variable expansion, arithmetic expansion, command substitution, + process substitution, and quote removal are performed. Condi- tional operators such as --ff must be unquoted to be recognized as primaries. - When the ==== and !!== operators are used, the string to the right + When the ==== and !!== operators are used, the string to the right of the operator is considered a pattern and matched according to - the rules described below under PPaatttteerrnn MMaattcchhiinngg. If the shell - option nnooccaasseemmaattcchh 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 pat- + the rules described below under PPaatttteerrnn MMaattcchhiinngg. If the shell + option nnooccaasseemmaattcchh 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 pat- tern, and 1 otherwise. Any part of the pattern may be quoted to force it to be matched as a string. - An additional binary operator, ==~~, is available, with the same - precedence as ==== and !!==. When it is used, the string to the - right of the operator is considered an extended regular expres- + 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 an extended regular expres- sion and matched accordingly (as in _r_e_g_e_x(3)). The return value is 0 if the string matches the pattern, and 1 otherwise. If the - regular expression is syntactically incorrect, the conditional + regular expression is syntactically incorrect, the conditional expression's return value is 2. If the shell option nnooccaasseemmaattcchh is enabled, the match is performed without regard to the case of alphabetic characters. Any part of the pattern may be quoted to - force it to be matched as a string. Substrings matched by - parenthesized subexpressions within the regular expression are - saved in the array variable BBAASSHH__RREEMMAATTCCHH. The element of - BBAASSHH__RREEMMAATTCCHH with index 0 is the portion of the string matching + force it to be matched as a string. Substrings matched by + parenthesized subexpressions within the regular expression are + saved in the array variable BBAASSHH__RREEMMAATTCCHH. The element of + BBAASSHH__RREEMMAATTCCHH with index 0 is the portion of the string matching the entire regular expression. The element of BBAASSHH__RREEMMAATTCCHH with - index _n is the portion of the string matching the _nth parenthe- + index _n is the portion of the string matching the _nth parenthe- sized subexpression. - Expressions may be combined using the following operators, + Expressions may be combined using the following operators, listed in decreasing order of precedence: (( _e_x_p_r_e_s_s_i_o_n )) - Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to + Returns the value of _e_x_p_r_e_s_s_i_o_n. This may be used to override the normal precedence of operators. !! _e_x_p_r_e_s_s_i_o_n True if _e_x_p_r_e_s_s_i_o_n is false. @@ -384,187 +385,187 @@ SSHHEELLLL GGRRAAMMMMAARR True if either _e_x_p_r_e_s_s_i_o_n_1 or _e_x_p_r_e_s_s_i_o_n_2 is true. The &&&& and |||| operators do not evaluate _e_x_p_r_e_s_s_i_o_n_2 if the value - of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of + of _e_x_p_r_e_s_s_i_o_n_1 is sufficient to determine the return value of the entire conditional expression. ffoorr _n_a_m_e [ [ iinn [ _w_o_r_d _._._. ] ] ; ] ddoo _l_i_s_t ; ddoonnee The list of words following iinn is expanded, generating a list of items. The variable _n_a_m_e is set to each element of this list in - turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omit- - ted, the ffoorr command executes _l_i_s_t once for each positional + turn, and _l_i_s_t is executed each time. If the iinn _w_o_r_d is omit- + ted, the ffoorr command executes _l_i_s_t once for each positional parameter that is set (see PPAARRAAMMEETTEERRSS below). The return status - is the exit status of the last command that executes. If the + is the exit status of the last command that executes. If the expansion of the items following iinn results in an empty list, no commands are executed, and the return status is 0. ffoorr (( _e_x_p_r_1 ; _e_x_p_r_2 ; _e_x_p_r_3 )) ; ddoo _l_i_s_t ; ddoonnee First, the arithmetic expression _e_x_p_r_1 is evaluated according to - the rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. The - arithmetic expression _e_x_p_r_2 is then evaluated repeatedly until - it evaluates to zero. Each time _e_x_p_r_2 evaluates to a non-zero - value, _l_i_s_t is executed and the arithmetic expression _e_x_p_r_3 is - evaluated. If any expression is omitted, it behaves as if it + the rules described below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. The + arithmetic expression _e_x_p_r_2 is then evaluated repeatedly until + it evaluates to zero. Each time _e_x_p_r_2 evaluates to a non-zero + value, _l_i_s_t is executed and the arithmetic expression _e_x_p_r_3 is + evaluated. If any expression is omitted, it behaves as if it evaluates to 1. The return value is the exit status of the last command in _l_i_s_t that is executed, or false if any of the expres- sions is invalid. sseelleecctt _n_a_m_e [ iinn _w_o_r_d ] ; ddoo _l_i_s_t ; ddoonnee The list of words following iinn is expanded, generating a list of - items. The set of expanded words is printed on the standard - error, each preceded by a number. If the iinn _w_o_r_d is omitted, - the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). - The PPSS33 prompt is then displayed and a line read from the stan- - dard input. If the line consists of a number corresponding to - one of the displayed words, then the value of _n_a_m_e is set to - that word. If the line is empty, the words and prompt are dis- + items. The set of expanded words is printed on the standard + error, each preceded by a number. If the iinn _w_o_r_d is omitted, + the positional parameters are printed (see PPAARRAAMMEETTEERRSS below). + The PPSS33 prompt is then displayed and a line read from the stan- + dard input. If the line consists of a number corresponding to + one of the displayed words, then the value of _n_a_m_e is set to + that word. If the line is empty, the words and prompt are dis- played again. If EOF is read, the command completes. Any other - value read causes _n_a_m_e to be set to null. The line read is - saved in the variable RREEPPLLYY. The _l_i_s_t is executed after each + value read causes _n_a_m_e to be set to null. The line read is + saved in the variable RREEPPLLYY. The _l_i_s_t is executed after each selection until a bbrreeaakk command is executed. The exit status of - sseelleecctt is the exit status of the last command executed in _l_i_s_t, + sseelleecctt is the exit status of the last command executed in _l_i_s_t, or zero if no commands were executed. ccaassee _w_o_r_d iinn [ [(] _p_a_t_t_e_r_n [ || _p_a_t_t_e_r_n ] ... ) _l_i_s_t ;; ] ... eessaacc A ccaassee command first expands _w_o_r_d, and tries to match it against each _p_a_t_t_e_r_n in turn, using the same matching rules as for path- - name expansion (see PPaatthhnnaammee EExxppaannssiioonn below). The _w_o_r_d is - expanded using tilde expansion, parameter and variable expan- - sion, arithmetic substitution, command substitution, process - substitution and quote removal. Each _p_a_t_t_e_r_n examined is + name expansion (see PPaatthhnnaammee EExxppaannssiioonn below). The _w_o_r_d is expanded using tilde expansion, parameter and variable expan- + sion, arithmetic substitution, command substitution, process + substitution and quote removal. Each _p_a_t_t_e_r_n examined is + expanded using tilde expansion, parameter and variable expan- sion, arithmetic substitution, command substitution, and process - substitution. If the shell option nnooccaasseemmaattcchh is enabled, the - match is performed without regard to the case of alphabetic - characters. When a match is found, the corresponding _l_i_s_t is + substitution. If the shell option nnooccaasseemmaattcchh is enabled, the + match is performed without regard to the case of alphabetic + characters. When a match is found, the corresponding _l_i_s_t is executed. If the ;;;; operator is used, no subsequent matches are - attempted after the first pattern match. Using ;;&& in place of - ;;;; causes execution to continue with the _l_i_s_t associated with - the next set of patterns. Using ;;;;&& in place of ;;;; causes the - shell to test the next pattern list in the statement, if any, + attempted after the first pattern match. Using ;;&& in place of + ;;;; causes execution to continue with the _l_i_s_t associated with + the next set of patterns. Using ;;;;&& in place of ;;;; causes the + shell to test the next pattern list in the statement, if any, and execute any associated _l_i_s_t on a successful match. The exit status is zero if no pattern matches. Otherwise, it is the exit status of the last command executed in _l_i_s_t. iiff _l_i_s_t; tthheenn _l_i_s_t_; [ eelliiff _l_i_s_t; tthheenn _l_i_s_t; ] ... [ eellssee _l_i_s_t; ] ffii - The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn - _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in - turn, and if its exit status is zero, the corresponding tthheenn + The iiff _l_i_s_t is executed. If its exit status is zero, the tthheenn + _l_i_s_t is executed. Otherwise, each eelliiff _l_i_s_t is executed in + turn, and if its exit status is zero, the corresponding tthheenn _l_i_s_t is executed and the command completes. Otherwise, the eellssee - _l_i_s_t is executed, if present. The exit status is the exit sta- + _l_i_s_t is executed, if present. The exit status is the exit sta- tus of the last command executed, or zero if no condition tested true. wwhhiillee _l_i_s_t; ddoo _l_i_s_t; ddoonnee uunnttiill _l_i_s_t; ddoo _l_i_s_t; ddoonnee - The wwhhiillee command continuously executes the ddoo _l_i_s_t as long as - the last command in _l_i_s_t returns an exit status of zero. The + The wwhhiillee command continuously executes the ddoo _l_i_s_t as long as + the last command in _l_i_s_t returns an exit status of zero. The uunnttiill command is identical to the wwhhiillee command, except that the - test is negated; the ddoo _l_i_s_t is executed as long as the last + test is negated; the ddoo _l_i_s_t is executed as long as the last command in _l_i_s_t returns a non-zero exit status. The exit status - of the wwhhiillee and uunnttiill commands is the exit status of the last + of the wwhhiillee and uunnttiill commands is the exit status of the last ddoo _l_i_s_t command executed, or zero if none was executed. CCoopprroocceesssseess A _c_o_p_r_o_c_e_s_s is a shell command preceded by the ccoopprroocc reserved word. A - coprocess is executed asynchronously in a subshell, as if the command - had been terminated with the && control operator, with a two-way pipe + coprocess is executed asynchronously in a subshell, as if the command + had been terminated with the && control operator, with a two-way pipe established between the executing shell and the coprocess. The format for a coprocess is: ccoopprroocc [_N_A_M_E] _c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n_s] - This creates a coprocess named _N_A_M_E. If _N_A_M_E is not supplied, the + This creates a coprocess named _N_A_M_E. If _N_A_M_E is not supplied, the default name is _C_O_P_R_O_C. _N_A_M_E must not be supplied if _c_o_m_m_a_n_d is a _s_i_m_- _p_l_e _c_o_m_m_a_n_d (see above); otherwise, it is interpreted as the first word - of the simple command. When the coproc 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 descriptor in the executing shell, and that file - descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is - connected via a pipe to a file descriptor in the executing shell, and - that file descriptor is assigned to _N_A_M_E[1]. This pipe is established - before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN - below). The file descriptors can be utilized as arguments to shell - commands and redirections using standard word expansions. The process - id of the shell spawned to execute the coprocess is available as the - value of the variable _N_A_M_E_PID. The wwaaiitt builtin command may be used + of the simple command. When the coproc 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 descriptor in the executing shell, and that file + descriptor is assigned to _N_A_M_E[0]. The standard input of _c_o_m_m_a_n_d is + connected via a pipe to a file descriptor in the executing shell, and + that file descriptor is assigned to _N_A_M_E[1]. This pipe is established + before any redirections specified by the command (see RREEDDIIRREECCTTIIOONN + below). The file descriptors can be utilized as arguments to shell + commands and redirections using standard word expansions. The process + id of the shell spawned to execute the coprocess is available as the + value of the variable _N_A_M_E_PID. The wwaaiitt builtin command may be used to wait for the coprocess to terminate. The return status of a coprocess is the exit status of _c_o_m_m_a_n_d. SShheellll FFuunnccttiioonn DDeeffiinniittiioonnss - A shell function is an object that is called like a simple command and - executes a compound command with a new set of positional parameters. + A shell function is an object that is called like a simple command and + executes a compound command with a new set of positional parameters. Shell functions are declared as follows: [ ffuunnccttiioonn ] _n_a_m_e () _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d [_r_e_d_i_r_e_c_t_i_o_n] - This defines a function named _n_a_m_e. The reserved word ffuunnccttiioonn - is optional. If the ffuunnccttiioonn reserved word is supplied, the - parentheses are optional. The _b_o_d_y of the function is the com- - pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). - That command is usually a _l_i_s_t of commands between { and }, but - may be any command listed under CCoommppoouunndd CCoommmmaannddss above. _c_o_m_- + This defines a function named _n_a_m_e. The reserved word ffuunnccttiioonn + is optional. If the ffuunnccttiioonn reserved word is supplied, the + parentheses are optional. The _b_o_d_y of the function is the com- + pound command _c_o_m_p_o_u_n_d_-_c_o_m_m_a_n_d (see CCoommppoouunndd CCoommmmaannddss above). + That command is usually a _l_i_s_t of commands between { and }, but + may be any command listed under CCoommppoouunndd CCoommmmaannddss above. _c_o_m_- _p_o_u_n_d_-_c_o_m_m_a_n_d is executed whenever _n_a_m_e is specified as the name - of a simple command. Any redirections (see RREEDDIIRREECCTTIIOONN below) - specified when a function is defined are performed when the - function is executed. The exit status of a function definition + of a simple command. Any redirections (see RREEDDIIRREECCTTIIOONN below) + specified when a function is defined are performed when the + function is executed. The exit status of a function definition is zero unless a syntax error occurs or a readonly function with the same name already exists. When executed, the exit status of - a function is the exit status of the last command executed in + a function is the exit status of the last command executed in the body. (See FFUUNNCCTTIIOONNSS below.) CCOOMMMMEENNTTSS In a non-interactive shell, or an interactive shell in which the iinntteerr-- - aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## causes that word and - all remaining characters on that line to be ignored. An interactive - shell without the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow + aaccttiivvee__ccoommmmeennttss option to the sshhoopptt builtin is enabled (see SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS below), a word beginning with ## causes that word and + all remaining characters on that line to be ignored. An interactive + shell without the iinntteerraaccttiivvee__ccoommmmeennttss option enabled does not allow comments. The iinntteerraaccttiivvee__ccoommmmeennttss option is on by default in interac- tive shells. QQUUOOTTIINNGG - _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or - words to the shell. Quoting can be used to disable special treatment + _Q_u_o_t_i_n_g is used to remove the special meaning of certain characters or + words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. - Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special + Each of the _m_e_t_a_c_h_a_r_a_c_t_e_r_s listed above under DDEEFFIINNIITTIIOONNSS has special meaning to the shell and must be quoted if it is to represent itself. - When the command history expansion facilities are being used (see HHIISS-- + When the command history expansion facilities are being used (see HHIISS-- TTOORRYY EEXXPPAANNSSIIOONN below), the _h_i_s_t_o_r_y _e_x_p_a_n_s_i_o_n character, usually !!, must be quoted to prevent history expansion. - There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single + There are three quoting mechanisms: the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r, single quotes, and double quotes. - A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the + A non-quoted backslash (\\) is the _e_s_c_a_p_e _c_h_a_r_a_c_t_e_r. It preserves the literal value of the next character that follows, with the exception of - <newline>. If a \\<newline> pair appears, and the backslash is not - itself quoted, the \\<newline> is treated as a line continuation (that + <newline>. If a \\<newline> pair appears, and the backslash is not + itself quoted, the \\<newline> is treated as a line continuation (that is, it is removed from the input stream and effectively ignored). - Enclosing characters in single quotes preserves the literal value of + Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. - Enclosing characters in double quotes preserves the literal value of - all characters within the quotes, with the exception of $$, ``, \\, and, - when history expansion is enabled, !!. The characters $$ and `` retain - their special meaning within double quotes. The backslash retains its - special meaning only when followed by one of the following characters: - $$, ``, "", \\, or <<nneewwlliinnee>>. A double quote may be quoted within double + 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, !!. The characters $$ and `` retain + their special meaning within double quotes. The backslash retains its + special meaning only when followed by one of the following characters: + $$, ``, "", \\, or <<nneewwlliinnee>>. A double quote may be quoted within double quotes by preceding it with a backslash. If enabled, history expansion - will be performed unless an !! appearing in double quotes is escaped + will be performed unless an !! appearing in double quotes is escaped using a backslash. The backslash preceding the !! is not removed. - The special parameters ** and @@ have special meaning when in double + The special parameters ** and @@ have special meaning when in double quotes (see PPAARRAAMMEETTEERRSS below). Words of the form $$'_s_t_r_i_n_g' are treated specially. The word expands to - _s_t_r_i_n_g, with backslash-escaped characters replaced as specified by the - ANSI C standard. Backslash escape sequences, if present, are decoded + _s_t_r_i_n_g, with backslash-escaped characters replaced as specified by the + ANSI C standard. Backslash escape sequences, if present, are decoded as follows: \\aa alert (bell) \\bb backspace @@ -576,202 +577,210 @@ QQUUOOTTIINNGG \\vv vertical tab \\\\ backslash \\'' single quote - \\_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) \\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 ($$) will cause the - string to be translated according to the current locale. If the cur- - rent locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the string + A double-quoted string preceded by a dollar sign ($$) will cause the + string to be translated according to the current locale. If the cur- + rent locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted. PPAARRAAMMEETTEERRSS - A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- + A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- ber, or one of the special characters listed below under SSppeecciiaall PPaarraamm-- - eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a - _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the - ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). + eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a + _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the + ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). A parameter is set if it has been assigned a value. The null string is - a valid value. Once a variable is set, it may be unset only by using + a valid value. Once a variable is set, it may be unset only by using the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form _n_a_m_e=[_v_a_l_u_e] - If _v_a_l_u_e is not given, the variable is assigned the null string. All - _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- - mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- + If _v_a_l_u_e is not given, the variable is assigned the null string. All + _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- + mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e is evaluated as an arithmetic expression even if the $((...)) expansion - is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not - performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall - PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- - ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, + is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not + performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall + PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- + ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, eexxppoorrtt, rreeaaddoonnllyy, and llooccaall builtin commands. - 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. When += is applied to a vari- - able for which the integer attribute has been set, _v_a_l_u_e is evaluated - as an arithmetic expression and added to the variable's current value, + able for which the integer attribute has been set, _v_a_l_u_e is evaluated + as an arithmetic expression and added to the variable's current value, which is also evaluated. When += is applied to an array variable using - compound assignment (see AArrrraayyss below), the variable's value is not + compound assignment (see AArrrraayyss below), the variable's value is not unset (as it is when using =), and new values are appended to the array - beginning at one greater than the array's maximum index (for indexed + beginning at one greater than the array's maximum index (for indexed arrays) or added as additional key-value pairs in an associative array. - When applied to a string-valued variable, _v_a_l_u_e is expanded and + When applied to a string-valued variable, _v_a_l_u_e is expanded and appended to the variable's value. PPoossiittiioonnaall PPaarraammeetteerrss - A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, other than the single digit 0. Positional parameters are assigned from - the shell's arguments when it is invoked, and may be reassigned using - the sseett builtin command. Positional parameters may not be assigned to - with assignment statements. The positional parameters are temporarily + the shell's arguments when it is invoked, and may be reassigned using + the sseett builtin command. Positional parameters may not be assigned to + with assignment statements. The positional parameters are temporarily replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). - When a positional parameter consisting of more than a single digit is + When a positional parameter consisting of more than a single digit is expanded, it must be enclosed in braces (see EEXXPPAANNSSIIOONN below). SSppeecciiaall PPaarraammeetteerrss - The shell treats several parameters specially. These parameters may + The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. - ** Expands to the positional parameters, starting from one. When - the expansion occurs within double quotes, it expands to a sin- + ** Expands to the positional parameters, starting from one. When + the expansion occurs within double quotes, it expands to a sin- gle word with the value of each parameter separated by the first character of the IIFFSS special variable. That is, "$$**" is equiva- lent 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 sepa- - rated by spaces. If IIFFSS is null, the parameters are joined + of the IIFFSS variable. If IIFFSS is unset, the parameters are sepa- + rated by spaces. If IIFFSS is null, the parameters are joined without intervening separators. - @@ Expands to the positional parameters, starting from one. When + @@ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$$@@" is equivalent to "$$11" - "$$22" ... If the double-quoted expansion occurs within a word, - the expansion of the first parameter is joined with the begin- - ning part of the original word, and the expansion of the last - parameter is joined with the last part of the original word. - When there are no positional parameters, "$$@@" and $$@@ expand to + "$$22" ... If the double-quoted expansion occurs within a word, + the expansion of the first parameter is joined with the begin- + ning part of the original word, and the expansion of the last + parameter is joined with the last part of the original word. + When there are no positional parameters, "$$@@" and $$@@ expand to nothing (i.e., they are removed). ## Expands to the number of positional parameters in decimal. - ?? Expands to the exit status of the most recently executed fore- + ?? Expands to the exit status of the most recently executed fore- ground pipeline. - -- Expands to the current option flags as specified upon invoca- - tion, by the sseett builtin command, or those set by the shell + -- Expands to the current option flags as specified upon invoca- + tion, by the sseett builtin command, or those set by the shell itself (such as the --ii option). - $$ Expands to the process ID of the shell. In a () subshell, it - expands to the process ID of the current shell, not the sub- + $$ Expands to the process ID of the shell. In a () subshell, it + expands to the process ID of the current shell, not the sub- shell. - !! Expands to the process ID of the most recently executed back- + !! Expands to the process ID of the most recently executed back- ground (asynchronous) command. - 00 Expands to the name of the shell or shell script. This is set + 00 Expands to the name of the shell or shell script. This is set at shell initialization. If bbaasshh is invoked with a file of com- - mands, $$00 is set to the name of that file. If bbaasshh is started - with the --cc option, then $$00 is set to the first argument after - the string to be executed, if one is present. Otherwise, it is - set to the file name used to invoke bbaasshh, as given by argument + mands, $$00 is set to the name of that file. If bbaasshh is started + with the --cc option, then $$00 is set to the first argument after + the string to be executed, if one is present. Otherwise, it is + set to the file name used to invoke bbaasshh, as given by argument zero. - __ At shell startup, set to the absolute pathname used to invoke - the shell or shell script being executed as passed in the envi- - ronment or argument list. Subsequently, expands to the last - argument to the previous command, after expansion. Also set to - the full pathname used to invoke each command executed and + __ At shell startup, set to the absolute pathname used to invoke + the shell or shell script being executed as passed in the envi- + ronment or argument list. Subsequently, expands to the last + argument to the previous command, after expansion. Also set to + the full pathname used to invoke each command executed and placed in the environment exported to that command. When check- - ing mail, this parameter holds the name of the mail file cur- + ing mail, this parameter holds the name of the mail file cur- rently being checked. SShheellll VVaarriiaabblleess The following variables are set by the shell: - BBAASSHH Expands to the full file name used to invoke this instance of + BBAASSHH Expands to the full file name used to invoke this instance of bbaasshh. + BBAASSHHOOPPTTSS + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --ss option to the sshhoopptt + 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 + 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 + 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. BBAASSHH__AALLIIAASSEESS - An associative array variable whose members correspond to the + An associative array variable whose members correspond to the internal list of aliases as maintained by the aalliiaass builtin Ele- - ments added to this array appear in the alias list; unsetting - array elements cause aliases to be removed from the alias list. + ments added to this array appear in the alias list; unsetting + array elements cause aliases to be removed from the alias list. BBAASSHH__AARRGGCC - An array variable whose values are the number of parameters in + An array variable whose values are the number of parameters in each frame of the current bbaasshh execution call stack. The number - of parameters to the current subroutine (shell function or - script executed with .. or ssoouurrccee) is at the top of the stack. - When a subroutine is executed, the number of parameters passed + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in - extended debugging mode (see the description of the eexxttddeebbuugg + extended debugging mode (see the description of the eexxttddeebbuugg option to the sshhoopptt builtin below) BBAASSHH__AARRGGVV - An array variable containing all of the parameters in the cur- + An array variable containing all of the parameters in the cur- rent bbaasshh execution call stack. The final parameter of the last - subroutine call is at the top of the stack; the first parameter + subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is exe- - cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The - shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see - the description of the eexxttddeebbuugg option to the sshhoopptt builtin + cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The + shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see + the description of the eexxttddeebbuugg option to the sshhoopptt builtin below) 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; - unsetting array elements cause commands to be removed from the + unsetting array elements cause commands to be removed from the hash table. BBAASSHH__CCOOMMMMAANNDD - The command currently being executed or about to be executed, + The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, - in which case it is the command executing at the time of the + in which case it is the command executing at the time of the trap. BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG The command argument to the --cc invocation option. BBAASSHH__LLIINNEENNOO - An array variable whose members are the line numbers in source - files corresponding to each member of FFUUNNCCNNAAMMEE. - $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file where - $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if refer- - enced within another shell function). The corresponding source - file name is $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}}. Use LLIINNEENNOO to obtain the cur- + An array variable whose members are the line numbers in source + files corresponding to each member of FFUUNNCCNNAAMMEE. + $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file where + $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if refer- + enced within another shell function). The corresponding source + file name is $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}}. Use LLIINNEENNOO to obtain the cur- rent line number. BBAASSHH__RREEMMAATTCCHH - An array variable whose members are assigned by the ==~~ binary - operator to the [[[[ conditional command. The element with index - 0 is the portion of the string matching the entire regular - expression. The element with index _n is the portion of the + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular + expression. The element with index _n is the portion of the string matching the _nth parenthesized subexpression. This vari- able is read-only. BBAASSHH__SSOOUURRCCEE - An array variable whose members are the source filenames corre- + An array variable whose members are the source filenames corre- sponding to the elements in the FFUUNNCCNNAAMMEE array variable. BBAASSHH__SSUUBBSSHHEELLLL - Incremented by one each time a subshell or subshell environment + Incremented by one each time a subshell or subshell environment is spawned. The initial value is 0. BBAASSHH__VVEERRSSIINNFFOO A readonly array variable whose members hold version information - for this instance of bbaasshh. The values assigned to the array + for this instance of bbaasshh. The values assigned to the array members are as follows: - BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). - BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). + BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). + BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). 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[[5]] The value of MMAACCHHTTYYPPEE. BBAASSHH__VVEERRSSIIOONN - Expands to a string describing the version of this instance of + Expands to a string describing the version of this instance of bbaasshh. CCOOMMPP__CCWWOORRDD - An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current + An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current cursor position. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__KKEEYY @@ -779,116 +788,116 @@ PPAARRAAMMEETTEERRSS rent completion function. CCOOMMPP__LLIINNEE - The current command line. This variable is available only in - shell functions and external commands invoked by the pro- - grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + The current command line. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__PPOOIINNTT - The index of the current cursor position relative to the begin- - ning of the current command. If the current cursor position is + The index of the current cursor position relative to the begin- + ning of the current command. If the current cursor position is at the end of the current command, the value of this variable is - equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in - shell functions and external commands invoked by the pro- - grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the pro- + grammable 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 pro- - grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + 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 pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__WWOORRDDBBRREEAAKKSS - The set of characters that the rreeaaddlliinnee library treats as word - separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS - is unset, it loses its special properties, even if it is subse- + The set of characters that the rreeaaddlliinnee library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- quently reset. CCOOMMPP__WWOORRDDSS - An array variable (see AArrrraayyss below) consisting of the individ- - ual words in the current command line. The line is split into - words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The line is split into + words as rreeaaddlliinnee would split it, using CCOOMMPP__WWOORRDDBBRREEAAKKSS as described above. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). DDIIRRSSTTAACCKK An array variable (see AArrrraayyss below) containing the current con- - tents of the directory stack. Directories appear in the stack - in the order they are displayed by the ddiirrss builtin. Assigning + tents of the directory stack. Directories appear in the stack + in the order they are displayed by the ddiirrss builtin. Assigning to members of this array variable may be used to modify directo- - ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must be used to add and remove directories. Assignment to this vari- - able will not change the current directory. If DDIIRRSSTTAACCKK is - unset, it loses its special properties, even if it is subse- + able will not change the current directory. If DDIIRRSSTTAACCKK is + unset, it loses its special properties, even if it is subse- quently reset. - 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 is "main". This variable exists only when a - shell function is executing. Assignments to FFUUNNCCNNAAMMEE have no - effect and return an error status. If FFUUNNCCNNAAMMEE is unset, it - loses its special properties, even if it is subsequently reset. - - GGRROOUUPPSS An array variable containing the list of groups of which the - current user is a member. Assignments to GGRROOUUPPSS have no effect - and return an error status. If GGRROOUUPPSS is unset, it loses its + tom-most element is "main". This variable exists only when a + shell function is executing. Assignments to FFUUNNCCNNAAMMEE have no + effect and return an error status. If FFUUNNCCNNAAMMEE is unset, it + loses its special properties, even if it is subsequently reset. + + GGRROOUUPPSS An array variable containing the list of groups of which the + current user is a member. Assignments to GGRROOUUPPSS have no effect + and return an error status. If GGRROOUUPPSS is unset, it loses its special properties, even if it is subsequently reset. HHIISSTTCCMMDD The history number, or index in the history list, of the current - command. If HHIISSTTCCMMDD is unset, it loses its special properties, + command. If HHIISSTTCCMMDD is unset, it loses its special properties, even if it is subsequently reset. HHOOSSTTNNAAMMEE Automatically set to the name of the current host. HHOOSSTTTTYYPPEE - Automatically set to a string that uniquely describes the type - of machine on which bbaasshh is executing. The default is system- + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- dependent. - LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a - decimal number representing the current sequential line number - (starting with 1) within a script or function. When not in a - script or function, the value substituted is not guaranteed to + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to be meaningful. If LLIINNEENNOO is unset, it loses its special proper- ties, even if it is subsequently reset. MMAACCHHTTYYPPEE - Automatically set to a string that fully describes the system - type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- + Automatically set to a string that fully describes the system + type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- _p_a_n_y_-_s_y_s_t_e_m format. The default is system-dependent. OOLLDDPPWWDD The previous working directory as set by the ccdd command. - OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss + OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss + OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOSSTTYYPPEE Automatically set to a string that describes the operating sys- - tem on which bbaasshh is executing. The default is system-depen- + OOSSTTYYPPEE Automatically set to a string that describes the operating sys- + tem on which bbaasshh is executing. The default is system-depen- dent. PPIIPPEESSTTAATTUUSS - An array variable (see AArrrraayyss below) containing a list of exit - status values from the processes in the most-recently-executed + An array variable (see AArrrraayyss below) containing a list of exit + status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command). - PPPPIIDD The process ID of the shell's parent. This variable is read- + PPPPIIDD The process ID of the shell's parent. This variable is read- only. PPWWDD The current working directory as set by the ccdd command. @@ -896,27 +905,27 @@ PPAARRAAMMEETTEERRSS RRAANNDDOOMM Each time this parameter is referenced, a random integer between 0 and 32767 is generated. The sequence of random numbers may be initialized by assigning a value to RRAANNDDOOMM. If RRAANNDDOOMM is unset, - it loses its special properties, even if it is subsequently + it loses its special properties, even if it is subsequently reset. - RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when no arguments are supplied. SSEECCOONNDDSS - Each time this parameter is referenced, the number of seconds - since shell invocation is returned. If a value is assigned to - SSEECCOONNDDSS, the value returned upon subsequent references is the - number of seconds since the assignment plus the value assigned. + Each time this parameter is referenced, the number of seconds + since shell invocation is returned. If a value is assigned to + SSEECCOONNDDSS, the value returned upon subsequent references is the + number of seconds since the assignment plus the value assigned. If SSEECCOONNDDSS is unset, it loses its special properties, even if it is subsequently reset. SSHHEELLLLOOPPTTSS - A colon-separated list of enabled shell options. Each word in - the list is a valid argument for the --oo option to the sseett + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --oo option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If - this variable is in the environment when bbaasshh starts up, each - shell option in the list will be enabled before reading any + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any startup files. This variable is read-only. SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. @@ -924,20 +933,29 @@ PPAARRAAMMEETTEERRSS UUIIDD Expands to the user ID of the current user, initialized at shell startup. This variable is readonly. - The following variables are used by the shell. In some cases, bbaasshh + The following variables are used by the shell. In some cases, bbaasshh assigns a default value to a variable; these cases are noted below. BBAASSHH__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 file name. + subjected to parameter expansion, command substitution, and + arithmetic expansion before being interpreted as a file name. PPAATTHH is not used to search for the resultant file name. - CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated - list of directories in which the shell looks for destination - directories specified by the ccdd command. A sample value is + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + list of directories in which the shell looks for destination + directories specified by the ccdd command. A sample value is ".:~:/usr". + BBAASSHH__XXTTRRAACCEEFFDD + If set to an integer corresponding to a valid file descriptor, + bbaasshh will write the trace output generated when _s_e_t _-_x is + enabled to that file descriptor. The file descriptor is closed + when BBAASSHH__XXTTRRAACCEEFFDD is unset or assigned a new value. Unsetting + BBAASSHH__XXTTRRAACCEEFFDD or assigning it the empty string causes the trace + output to be sent to the standard error. Note that setting + BBAASSHH__XXTTRRAACCEEFFDD to 2 (the standard error file descriptor) and then + unsetting it will result in the standard error being closed. CCOOLLUUMMNNSS Used by the sseelleecctt builtin command to determine the terminal width when printing selection lists. Automatically set upon @@ -3264,6 +3282,14 @@ RREEAADDLLIINNEE A character is read and point is moved to the previous occur- rence of that character. A negative count searches for subse- quent 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 + 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, + instead of inserting stray characters into the editing buffer. + This is unbound by default, but usually bound to ESC-[. iinnsseerrtt--ccoommmmeenntt ((MM--##)) Without a numeric argument, the value of the readline ccoomm-- mmeenntt--bbeeggiinn variable is inserted at the beginning of the current @@ -4656,15 +4682,15 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --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, - CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they appear in the - environment, are ignored. If the shell is started with - the effective user (group) id not equal to the real user - (group) id, and the --pp option is not supplied, these - actions are taken and the effective user id is set to - the real user id. If the --pp option is supplied at - startup, the effective user id is not reset. Turning - this option off causes the effective user and group ids - to be set to the real user and group ids. + BBAASSHHOOPPTTSS, CCDDPPAATTHH, and GGLLOOBBIIGGNNOORREE variables, if they + appear in the environment, are ignored. If the shell is + started with the effective user (group) id not equal to + the real user (group) id, and the --pp option is not 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. + Turning this option off causes the effective user and + group ids to be set to the real user and group ids. --tt Exit after reading and executing one command. --uu Treat unset variables and parameters other than the spe- cial parameters "@" and "*" as an error when performing @@ -5278,4 +5304,4 @@ BBUUGGSS -GNU Bash-4.0 2009 July 30 BASH(1) +GNU Bash-4.0 2009 August 17 BASH(1) |