From ed35cb4a6394a5121724fc8a2c0ace6eb5be9de1 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Wed, 7 Dec 2011 09:24:27 -0500 Subject: commit bash-20080529 snapshot --- doc/bash.0 | 1402 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 751 insertions(+), 651 deletions(-) (limited to 'doc/bash.0') diff --git a/doc/bash.0 b/doc/bash.0 index a82dfd99..7dc069cb 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -217,7 +217,7 @@ DDEEFFIINNIITTIIOONNSS ccoonnttrrooll ooppeerraattoorr A _t_o_k_e_n that performs a control function. It is one of the fol- lowing symbols: - |||| && &&&& ;; ;;;; (( )) || <> + |||| && &&&& ;; ;;;; (( )) || ||&& <> 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 @@ -240,14 +240,18 @@ SSHHEELLLL GGRRAAMMMMAARR 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 the char- - acter ||. The format for a pipeline is: + 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 ... ] + [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- - tions specified by the command (see RREEDDIIRREECCTTIIOONN below). + 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- + 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 @@ -432,10 +436,14 @@ SSHHEELLLL GGRRAAMMMMAARR 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. After the first match, no subsequent matches are - attempted. The exit status is zero if no pattern matches. Oth- - erwise, it is the exit status of the last command executed in - _l_i_s_t. + executed. If the ;;;; operator is used, no subsequent matches are + attempted after the first pattern match. Using ;;&& in place of + ;;;; causes execution to continue with the _l_i_s_t associated with + the next set of patterns. Using ;;;;&& in place of ;;;; causes the + shell to test the next pattern list in the statement, if any, + and execute any associated _l_i_s_t on a 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 @@ -1226,12 +1234,18 @@ EEXXPPAANNSSIIOONN are not sorted; left to right order is preserved. For example, a{{d,c,b}}e expands into `ade ace abe'. - A sequence expression takes the form {{_x...._y}}, where _x and _y are either - integers or single characters. When integers are supplied, the expres- - sion expands to each number between _x and _y, inclusive. When charac- - ters are supplied, the expression expands to each character lexico- - graphically between _x and _y, inclusive. Note that both _x and _y must be - of the same type. + A sequence expression takes the form {{_x...._y[[...._i_n_c_r]]}}_, _w_h_e_r_e _x _a_n_d _y _a_r_e + _e_i_t_h_e_r _i_n_t_e_g_e_r_s _o_r _s_i_n_g_l_e _c_h_a_r_a_c_t_e_r_s_, _a_n_d _i_n_c_r_, _a_n _o_p_t_i_o_n_a_l _i_n_c_r_e_m_e_n_t_, + _i_s _a_n _i_n_t_e_g_e_r_. _W_h_e_n _i_n_t_e_g_e_r_s _a_r_e _s_u_p_p_l_i_e_d_, _t_h_e _e_x_p_r_e_s_s_i_o_n _e_x_p_a_n_d_s _t_o + _e_a_c_h _n_u_m_b_e_r _b_e_t_w_e_e_n _x _a_n_d _y_, _i_n_c_l_u_s_i_v_e_. _S_u_p_p_l_i_e_d _i_n_t_e_g_e_r_s _m_a_y _b_e _p_r_e_- + _f_i_x_e_d _w_i_t_h _0 _t_o _f_o_r_c_e _e_a_c_h _t_e_r_m _t_o _h_a_v_e _t_h_e _s_a_m_e _w_i_d_t_h_. _W_h_e_n _e_i_t_h_e_r _x + _o_r _y _b_e_g_i_n_s _w_i_t_h _a _z_e_r_o_, _t_h_e _s_h_e_l_l _a_t_t_e_m_p_t_s _t_o _f_o_r_c_e _a_l_l _g_e_n_e_r_a_t_e_d + _t_e_r_m_s _t_o _c_o_n_t_a_i_n _t_h_e _s_a_m_e _n_u_m_b_e_r _o_f _d_i_g_i_t_s_, _z_e_r_o_-_p_a_d_d_i_n_g _w_h_e_r_e _n_e_c_e_s_- + _s_a_r_y_. _W_h_e_n _c_h_a_r_a_c_t_e_r_s _a_r_e _s_u_p_p_l_i_e_d_, _t_h_e _e_x_p_r_e_s_s_i_o_n _e_x_p_a_n_d_s _t_o _e_a_c_h + _c_h_a_r_a_c_t_e_r _l_e_x_i_c_o_g_r_a_p_h_i_c_a_l_l_y _b_e_t_w_e_e_n _x _a_n_d _y_, _i_n_c_l_u_s_i_v_e_. _N_o_t_e _t_h_a_t _b_o_t_h + _x _a_n_d _y _m_u_s_t _b_e _o_f _t_h_e _s_a_m_e _t_y_p_e_. _W_h_e_n _t_h_e _i_n_c_r_e_m_e_n_t _i_s _s_u_p_p_l_i_e_d_, _i_t + _i_s _u_s_e_d _a_s _t_h_e _d_i_f_f_e_r_e_n_c_e _b_e_t_w_e_e_n _e_a_c_h _t_e_r_m_. _T_h_e _d_e_f_a_u_l_t _i_n_c_r_e_m_e_n_t _i_s + _1 _o_r _-_1 _a_s _a_p_p_r_o_p_r_i_a_t_e_. Brace expansion is performed before any other expansions, and any char- acters special to other expansions are preserved in the result. It is @@ -1560,39 +1574,44 @@ EEXXPPAANNSSIIOONN The special pattern characters have the following meanings: - ** Matches any string, including the null string. + ** Matches any string, including the null string. When the gglloobb-- + ssttaarr shell option is enabled, and ** is used in a filename expan- + sion 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 subdirectories. ?? Matches any single character. - [[......]] Matches any one of the enclosed characters. A pair of charac- + [[......]] Matches any one of the enclosed characters. A pair of charac- ters separated by a hyphen denotes a _r_a_n_g_e _e_x_p_r_e_s_s_i_o_n; any char- - acter that sorts 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. The sorting order - of characters in range expressions is determined by the current - locale and the value of the LLCC__CCOOLLLLAATTEE shell variable, if set. - A -- may be matched by including it as the first or last charac- + acter that sorts 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. The sorting order + of characters in range expressions is determined by the current + locale and the value of the LLCC__CCOOLLLLAATTEE shell variable, if set. + A -- may be matched by including it as the first or last charac- ter 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 the - syntax [[::_c_l_a_s_s::]], where _c_l_a_s_s is one of the following classes + 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 + 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 char- + The wwoorrdd character class matches letters, digits, and the char- acter _. - Within [[ and ]], an _e_q_u_i_v_a_l_e_n_c_e _c_l_a_s_s can be specified using the - syntax [[==_c==]], which matches all characters with the same colla- - tion weight (as defined by the current locale) as the character + Within [[ and ]], an _e_q_u_i_v_a_l_e_n_c_e _c_l_a_s_s can be specified using the + syntax [[==_c==]], which matches all characters with the same colla- + tion weight (as defined by the current locale) as the character _c. Within [[ and ]], the syntax [[.._s_y_m_b_o_l..]] matches the collating sym- bol _s_y_m_b_o_l. If the eexxttgglloobb shell option is enabled using the sshhoopptt builtin, several - extended pattern matching operators are recognized. In the following + extended pattern matching operators are recognized. 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 of the fol- lowing sub-patterns: @@ -1610,48 +1629,48 @@ 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. Redirection may - also be used to open and close files for the current shell execution + 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. Redirection may + also be used to open and close files for the current shell execution environment. The following redirection operators may precede or appear anywhere within a _s_i_m_p_l_e _c_o_m_m_a_n_d or may follow a _c_o_m_m_a_n_d. Redirections are processed in the order they appear, from left to right. - 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 re- + direction 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 + The word following the redirection operator in the following descrip- + tions, unless otherwise noted, is subjected to brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expan- - sion, quote removal, pathname expansion, and word splitting. If it + sion, 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 as standard output before the standard output was + directs only the standard output to file _d_i_r_l_i_s_t, because the standard + error was duplicated as standard output before the standard output was redirected to _d_i_r_l_i_s_t. BBaasshh handles several filenames specially when they are used in redirec- tions, as described in the following table: //ddeevv//ffdd//_f_d - If _f_d is a valid integer, file descriptor _f_d is dupli- + If _f_d is a valid integer, file descriptor _f_d is dupli- cated. //ddeevv//ssttddiinn File descriptor 0 is duplicated. @@ -1661,22 +1680,22 @@ 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 a TCP connection to the corresponding 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 - is an integer port number or service name, bbaasshh attempts + is an integer port number or service name, bbaasshh attempts to open a UDP connection to the corresponding socket. A failure to open or create a file causes the redirection to fail. - Redirections using file descriptors greater than 9 should be used with - care, as they may conflict with file descriptors the shell uses inter- + Redirections using file descriptors greater than 9 should be used with + care, as they may conflict with file descriptors the shell uses inter- nally. 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: @@ -1684,27 +1703,27 @@ RREEDDIIRREECCTTIIOONN [_n]<<_w_o_r_d RReeddiirreeccttiinngg OOuuttppuutt - Redirection of output causes the file whose name results from the + Redirection of output causes the file whose name results from the expansion 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 + does not exist it is created; if it does exist it is truncated to zero size. The general format for redirecting output is: [_n]>>_w_o_r_d - If the redirection operator is >>, and the nnoocclloobbbbeerr option to the sseett - 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 >>, and the nnoocclloobbbbeerr option to the sseett + 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. AAppppeennddiinngg RReeddiirreecctteedd OOuuttppuutt - Redirection of output in this fashion causes the file whose name - results from the expansion of _w_o_r_d to be opened for appending on file - descriptor _n, or the standard output (file descriptor 1) if _n is not + Redirection of output in this fashion causes the file whose name + results from the expansion of _w_o_r_d 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: @@ -1713,11 +1732,11 @@ RREEDDIIRREECCTTIIOONN RReeddiirreeccttiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr - BBaasshh allows both the standard output (file descriptor 1) and the stan- - dard error output (file descriptor 2) to be redirected to the file - whose name is the expansion of _w_o_r_d with this construct. + 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 _w_o_r_d. - There are two formats for redirecting standard output and standard + There are two formats for redirecting standard output and standard error: &&>>_w_o_r_d @@ -1729,10 +1748,24 @@ RREEDDIIRREECCTTIIOONN >>_w_o_r_d 2>>&&1 + + 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 + file whose name is the expansion of _w_o_r_d. + + The format for appending standard output and standard error is: + + &&>>>>_w_o_r_d + + This is semantically equivalent to + + >>>>_w_o_r_d 2>>&&1 + HHeerree DDooccuummeennttss - This type of redirection instructs the shell to read input from the - current source until a line containing only _w_o_r_d (with no trailing - blanks) is seen. All of the lines read up to that point are then used + This type of redirection instructs the shell to read input from the + current source until a line containing only _w_o_r_d (with no trailing + blanks) is seen. All of the lines read up to that point are then used as the standard input for a command. The format of here-documents is: @@ -1741,18 +1774,18 @@ RREEDDIIRREECCTTIIOONN _h_e_r_e_-_d_o_c_u_m_e_n_t _d_e_l_i_m_i_t_e_r - No parameter expansion, command substitution, arithmetic expansion, or + No parameter expansion, command substitution, arithmetic expansion, or pathname expansion is performed on _w_o_r_d. If any characters in _w_o_r_d are - quoted, the _d_e_l_i_m_i_t_e_r is the result of quote removal on _w_o_r_d, and the - lines in the here-document are not expanded. If _w_o_r_d is unquoted, all - lines of the here-document are subjected to parameter expansion, com- - mand substitution, and arithmetic expansion. In the latter case, the - character sequence \\<> is ignored, and \\ must be used to quote + quoted, the _d_e_l_i_m_i_t_e_r is the result of quote removal on _w_o_r_d, and the + lines in the here-document are not expanded. If _w_o_r_d is unquoted, all + lines of the here-document are subjected to parameter expansion, com- + mand substitution, and arithmetic expansion. In the latter case, 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 - allows 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 + allows here-documents within shell scripts to be indented in a natural fashion. HHeerree SSttrriinnggss @@ -1768,20 +1801,20 @@ 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 - descriptor open for input, a redirection error occurs. If _w_o_r_d evalu- - ates to --, file descriptor _n is closed. If _n is not specified, the + 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 + descriptor open for input, a redirection error occurs. If _w_o_r_d evalu- + ates to --, file descriptor _n is closed. If _n is not specified, the standard input (file descriptor 0) is used. The operator [_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. As a special case, if _n is omitted, and _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. As a special case, if _n is omitted, and _w_o_r_d does not expand to one or more digits, the standard output and standard error are redirected as described previously. @@ -1790,7 +1823,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 input (file descriptor 0) if _n is not specified. _d_i_g_i_t is closed after being duplicated to _n. @@ -1798,7 +1831,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 @@ -1806,108 +1839,108 @@ 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 when it is used as - the first word of a simple command. The shell maintains a list of - aliases that may be set and unset with the aalliiaass and uunnaalliiaass builtin - commands (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The first word of each - simple command, if unquoted, is checked to see if it has an alias. If - so, that word is replaced by the text of the alias. The characters //, - $$, ``, and == and any of the shell _m_e_t_a_c_h_a_r_a_c_t_e_r_s or quoting characters + _A_l_i_a_s_e_s allow a string to be substituted for a word when it is used as + the first word of a simple command. The shell maintains a list of + aliases that may be set and unset with the aalliiaass and uunnaalliiaass builtin + commands (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The first word of each + simple command, if unquoted, is checked to see if it has an alias. If + so, that word is replaced by the text of the alias. The characters //, + $$, ``, and == and any of the shell _m_e_t_a_c_h_a_r_a_c_t_e_r_s 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 llss to llss --FF, for instance, and - bbaasshh does not try to recursively expand the replacement text. If the - last character of the alias value is a _b_l_a_n_k, then the next command + 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 llss to llss --FF, for instance, and + bbaasshh does not try to recursively expand the replacement text. If the + last character of the alias value is a _b_l_a_n_k, then the next command word following the alias is also checked for alias expansion. Aliases are created and listed with the aalliiaass command, and removed with the uunnaalliiaass command. - There is no mechanism for using arguments in the replacement text. If - arguments are needed, a shell function should be used (see FFUUNNCCTTIIOONNSS + There is no mechanism for using arguments in the replacement text. If + arguments are needed, a shell function should be used (see FFUUNNCCTTIIOONNSS below). - Aliases are not expanded when the shell is not interactive, unless the - eexxppaanndd__aalliiaasseess shell option is set using sshhoopptt (see the description of + Aliases are not expanded when the shell is not interactive, unless the + eexxppaanndd__aalliiaasseess shell option is set using sshhoopptt (see the description of sshhoopptt under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - The rules concerning the definition and use of aliases are somewhat - confusing. BBaasshh always reads at least one complete line of input - before executing any of the commands on that line. Aliases are - expanded when a command is read, not when it is executed. Therefore, - an alias definition appearing on the same line as another command does - not take effect until the next line of input is read. The commands + The rules concerning the definition and use of aliases are somewhat + confusing. BBaasshh always reads at least one complete line of input + before executing any of the commands on that line. Aliases are + expanded when a command is read, not when it is executed. Therefore, + an alias definition appearing on the same line as another command does + not take effect until the next line of input is read. The commands following the alias definition on that line are not affected by the new - alias. This behavior is also an issue when functions are executed. - Aliases are expanded when a function definition is read, not when the - function is executed, because a function definition is itself a com- + alias. This behavior is also an issue when functions are executed. + Aliases are expanded when a function definition is read, not when the + function is executed, because a function definition is itself a com- pound 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 aalliiaass in com- + available until after that function is executed. To be safe, always + put alias definitions on a separate line, and do not use aalliiaass in com- pound commands. For almost every purpose, aliases are superseded by shell functions. FFUUNNCCTTIIOONNSS - A shell function, defined as described above under SSHHEELLLL GGRRAAMMMMAARR, - 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 + A shell function, defined as described above under SSHHEELLLL GGRRAAMMMMAARR, + 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 - interpret 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 + interpret 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 0 is unchanged. The - first element of the FFUUNNCCNNAAMMEE variable is set to the name of the func- - tion while the function is executing. All other aspects of the shell - execution environment are identical between a function and its caller + updated to reflect the change. Special parameter 0 is unchanged. The + first element of the FFUUNNCCNNAAMMEE variable is set to the name of the func- + tion while the function is executing. All other aspects of the shell + execution environment are identical between a function and its caller with the exception that the DDEEBBUUGG and RREETTUURRNN traps (see the description - of the ttrraapp builtin under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) are not inher- - ited unless the function has been given the ttrraaccee attribute (see the - description of the ddeeccllaarree builtin below) or the --oo ffuunnccttrraaccee shell - option has been enabled with the sseett builtin (in which case all func- + of the ttrraapp builtin under SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below) are not inher- + ited unless the function has been given the ttrraaccee attribute (see the + description of the ddeeccllaarree builtin below) or the --oo ffuunnccttrraaccee shell + option has been enabled with the sseett builtin (in which case all func- tions inherit the DDEEBBUUGG and RREETTUURRNN traps). - Variables local to the function may be declared with the llooccaall builtin + Variables local to the function may be declared with the llooccaall builtin command. Ordinarily, variables and their values are shared between the function and its caller. - 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 + 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 before execution resumes. When a function completes, the values of the - positional parameters and the special parameter ## are restored to the + positional parameters and the special parameter ## are restored to the values they had prior to the function's execution. - Function names and definitions may be listed with the --ff option to the + 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 subshells 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. Note that shell + 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 subshells 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. Note that shell functions and variables with the same name may result in multiple iden- - tically-named entries in the environment passed to the shell's chil- + tically-named entries in the environment passed to the shell's chil- dren. Care should be taken in cases where this may cause a problem. - Functions may be recursive. No limit is imposed on the number of + Functions may be recursive. No limit is imposed on the number of recursive calls. AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN - The shell allows arithmetic expressions to be evaluated, under certain - circumstances (see the lleett and ddeeccllaarree builtin commands 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 following list of operators is grouped - into levels of equal-precedence operators. The levels are listed in + The shell allows arithmetic expressions to be evaluated, under certain + circumstances (see the lleett and ddeeccllaarree builtin commands 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 following list of operators is grouped + into levels of equal-precedence operators. The levels are listed in order of decreasing precedence. _i_d++++ _i_d---- @@ -1935,39 +1968,39 @@ AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN _e_x_p_r_1 ,, _e_x_p_r_2 comma - Shell variables are allowed as operands; parameter expansion is per- + 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 + 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 integer attribute turned on + to 0. A shell variable need not have its integer attribute turned on to be used in an expression. Constants with a leading 0 are interpreted as octal numbers. A leading - 0x or 0X denotes hexadecimal. Otherwise, numbers take the form - [_b_a_s_e_#]n, where _b_a_s_e is a decimal number between 2 and 64 representing + 0x or 0X denotes hexadecimal. Otherwise, numbers take the form + [_b_a_s_e_#]n, where _b_a_s_e is a decimal number between 2 and 64 representing the arithmetic base, and _n is a number in that base. If _b_a_s_e_# is omit- - ted, then base 10 is used. 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 uppercase + ted, then base 10 is used. 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 uppercase letters may be used interchangeably to represent numbers between 10 and 35. - Operators are evaluated in order of precedence. Sub-expressions in - parentheses are evaluated first and may override the precedence rules + Operators are evaluated in order of precedence. Sub-expressions in + parentheses are evaluated first and may override the precedence rules above. CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS - Conditional expressions are used by the [[[[ compound command and the - tteesstt and [[ builtin commands to test file attributes and perform string - and arithmetic comparisons. Expressions are formed from the following - unary or binary primaries. If any _f_i_l_e argument to one of the pri- + Conditional expressions are used by the [[[[ compound command and the + tteesstt and [[ builtin commands to test file attributes and perform string + and arithmetic comparisons. Expressions are formed from the following + unary or binary primaries. 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, + 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, is checked. Unless otherwise specified, primaries that operate on files follow sym- @@ -2014,20 +2047,20 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS --SS _f_i_l_e True if _f_i_l_e exists and is a socket. --NN _f_i_l_e - True if _f_i_l_e exists and has been modified since it was last + True if _f_i_l_e exists and has been modified since it was last read. _f_i_l_e_1 -nntt _f_i_l_e_2 - True if _f_i_l_e_1 is newer (according to modification date) than + True if _f_i_l_e_1 is newer (according to modification date) than _f_i_l_e_2, or if _f_i_l_e_1 exists and _f_i_l_e_2 does not. _f_i_l_e_1 -oott _f_i_l_e_2 - True if _f_i_l_e_1 is older than _f_i_l_e_2, or if _f_i_l_e_2 exists and _f_i_l_e_1 + True if _f_i_l_e_1 is older than _f_i_l_e_2, or if _f_i_l_e_2 exists and _f_i_l_e_1 does not. _f_i_l_e_1 --eeff _f_i_l_e_2 - True if _f_i_l_e_1 and _f_i_l_e_2 refer to the same device and inode num- + True if _f_i_l_e_1 and _f_i_l_e_2 refer to the same device and inode num- bers. --oo _o_p_t_n_a_m_e - True if shell option _o_p_t_n_a_m_e is enabled. See the list of - options under the description of the --oo option to the sseett + True if shell option _o_p_t_n_a_m_e is enabled. See the list of + options under the description of the --oo option to the sseett builtin below. --zz _s_t_r_i_n_g True if the length of _s_t_r_i_n_g is zero. @@ -2043,111 +2076,115 @@ CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS True if the strings are not equal. _s_t_r_i_n_g_1 << _s_t_r_i_n_g_2 - True if _s_t_r_i_n_g_1 sorts before _s_t_r_i_n_g_2 lexicographically in the + True if _s_t_r_i_n_g_1 sorts before _s_t_r_i_n_g_2 lexicographically in the current locale. _s_t_r_i_n_g_1 >> _s_t_r_i_n_g_2 - True if _s_t_r_i_n_g_1 sorts after _s_t_r_i_n_g_2 lexicographically in the + True if _s_t_r_i_n_g_1 sorts after _s_t_r_i_n_g_2 lexicographically in the current locale. _a_r_g_1 OOPP _a_r_g_2 - OOPP is one of --eeqq, --nnee, --lltt, --llee, --ggtt, or --ggee. These arithmetic - binary operators return true if _a_r_g_1 is equal to, not equal to, - less than, less than or equal to, greater than, or greater than - or equal to _a_r_g_2, respectively. _A_r_g_1 and _a_r_g_2 may be positive + OOPP is one of --eeqq, --nnee, --lltt, --llee, --ggtt, or --ggee. These arithmetic + binary operators return true if _a_r_g_1 is equal to, not equal to, + less than, less than or equal to, greater than, or greater than + or equal to _a_r_g_2, respectively. _A_r_g_1 and _a_r_g_2 may be positive or negative integers. SSIIMMPPLLEE CCOOMMMMAANNDD EEXXPPAANNSSIIOONN - When a simple command is executed, the shell performs the following + When a simple command is executed, the shell performs the following expansions, assignments, and redirections, from left to right. - 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 - shell environment. Otherwise, the variables are added to the environ- - ment of the executed command and do not affect the current shell envi- - ronment. If any of the assignments attempts to assign a value to a - readonly variable, an error occurs, and the command exits with a non- + shell environment. Otherwise, the variables are added to the environ- + ment of the executed command and do not affect the current shell envi- + ronment. If any of the assignments attempts to assign a 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 - affect the current shell environment. A redirection error causes the + If no command name results, redirections are performed, but do not + affect 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. CCOOMMMMAANNDD EEXXEECCUUTTIIOONN - After a command has been split into words, if it results in a simple - command and an optional list of arguments, the following actions are + After a command has been split into words, if it results in a simple + command and an optional list of arguments, the following actions are taken. - 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 above in FFUUNNCCTTIIOONNSS. If the name does not match a - function, the shell searches for it in the list of shell builtins. If + 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 above in FFUUNNCCTTIIOONNSS. 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 builtin is invoked. - 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 - remember 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 prints an error message and returns - an exit status of 127. - - If the search is successful, or if the command name contains one or + 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 + remember 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 + with the original command and the original command's arguments as its + arguments, and the function's exit status becomes the exit status of + the shell. If that function is not defined, the shell prints an error + message and returns an exit status of 127. + + If the search is successful, or if the command name contains one or more slashes, the shell executes the named program in a separate execu- tion environment. Argument 0 is set to the name given, and the remain- ing arguments to the command are set to the arguments given, if any. - 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. A subshell is spawned 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 + 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. A subshell is spawned 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 child. - If the program is a file beginning with ##!!, the remainder of the first - line specifies an interpreter for the program. The shell executes the + If the program is a file beginning with ##!!, the remainder of the first + line specifies an interpreter for the program. The shell executes the specified interpreter on operating systems that do not handle this exe- cutable format themselves. The arguments to the interpreter consist of - a single optional argument following the interpreter name on the first - line of the program, followed by the name of the program, followed by + a single optional argument following the interpreter name on the first + line of the program, followed by the name of the program, followed by the command arguments, if any. CCOOMMMMAANNDD EEXXEECCUUTTIIOONN EENNVVIIRROONNMMEENNTT - The shell has an _e_x_e_c_u_t_i_o_n _e_n_v_i_r_o_n_m_e_n_t, which consists of the follow- + The shell has an _e_x_e_c_u_t_i_o_n _e_n_v_i_r_o_n_m_e_n_t, which consists of the follow- ing: - +o open files inherited by the shell at invocation, as modified by + +o open files inherited by the shell at invocation, as modified by redirections supplied to the eexxeecc builtin - +o the current working directory as set by ccdd, ppuusshhdd, or ppooppdd, or + +o the current working directory as set by ccdd, ppuusshhdd, or ppooppdd, or inherited by the shell at invocation - +o the file creation mode mask as set by uummaasskk or inherited from + +o the file creation mode mask as set by uummaasskk or inherited from the shell's parent +o current traps set by ttrraapp @@ -2155,234 +2192,234 @@ 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 the shell's parent, and traps ignored by the shell are ignored - A command invoked in this separate environment cannot affect the + A command invoked in this separate environment cannot affect the shell's execution environment. - Command substitution, commands grouped with parentheses, and asynchro- + Command substitution, commands grouped with parentheses, and asynchro- nous commands are invoked in a subshell environment that is a duplicate - of the shell environment, except that traps caught by the shell are + of the shell environment, except that traps caught by the shell are reset to the values that the shell inherited from its parent at invoca- tion. Builtin commands that are invoked as part of a pipeline are also executed in a subshell environment. Changes made to the subshell envi- ronment cannot affect the shell's execution environment. - If a command is followed by a && and job control is not active, the - default standard input for the command is the empty file _/_d_e_v_/_n_u_l_l. - Otherwise, the invoked command inherits the file descriptors of the + If a command is followed by a && and job control is not active, the + default standard input for the command is the empty file _/_d_e_v_/_n_u_l_l. + Otherwise, the invoked command inherits the file descriptors of the calling 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 + The shell 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 _e_x_p_o_r_t to child pro- - cesses. Executed commands inherit the environment. The eexxppoorrtt and - ddeeccllaarree --xx commands allow parameters and functions to be added to and + 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 + 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, - replacing 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 + ronment 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 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. - If the --kk option is set (see the sseett builtin command below), then _a_l_l - parameter assignments are placed in the environment for a command, not + If the --kk option is set (see the sseett builtin command below), then _a_l_l + parameter assignments are placed in the environment for a command, not just those that precede the command name. - When bbaasshh invokes an external command, the variable __ is set to the - full file name of the command and passed to that command in its envi- + When bbaasshh invokes an external command, the variable __ is set to the + full file name of the command and passed to that command in its envi- ronment. 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 + 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, the shell + are also limited to this range. Under certain circumstances, the shell 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 - returns 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 + returns 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, the exit status is greater than zero. - Shell builtin commands return a status of 0 (_t_r_u_e) if successful, and - non-zero (_f_a_l_s_e) if an error occurs while they execute. All builtins + Shell builtin commands return a status of 0 (_t_r_u_e) if successful, and + non-zero (_f_a_l_s_e) if an error occurs while they execute. All builtins return an exit status of 2 to indicate incorrect usage. - BBaasshh itself returns the exit status of the last command executed, - unless a syntax error occurs, in which case it exits with a non-zero + BBaasshh itself returns the exit status of the last command executed, + unless 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 + is caught and handled (so that the wwaaiitt builtin is interruptible). In + all cases, bbaasshh ignores SSIIGGQQUUIITT. If job control is in effect, bbaasshh ignores SSIIGGTTTTIINN, SSIIGGTTTTOOUU, and SSIIGGTTSSTTPP. 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 - effect, asynchronous commands ignore SSIIGGIINNTT and SSIIGGQQUUIITT in addition to - these inherited handlers. Commands run as a result of command substi- + inherited by the shell from its parent. When job control is not in + effect, 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 + 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 + 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 using 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 + 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. 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 + _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 execution 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 + point. A user typically employs this facility via an interactive interface supplied jointly by the system's terminal driver 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- - generated signals such as SSIIGGIINNTT. These processes are said to be in - 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 + generated signals such as SSIIGGIINNTT. These processes are said to be in + 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 + erated signals. Only foreground processes are allowed to read from or write to the terminal. Background processes which attempt to read from (write to) the terminal are sent a SSIIGGTTTTIINN ((SSIIGGTTTTOOUU)) signal by the ter- minal driver, which, unless caught, suspends the process. - If the operating system on which bbaasshh is running supports job control, + 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- ically ^^ZZ, Control-Z) while a process is running causes that process to - 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 - returned 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 + 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 + returned 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. There are a number of ways to refer to a job in the shell. The charac- ter %% introduces a job name. Job number _n may be referred to as %%nn. 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 exam- + 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 exam- ple, %%ccee refers to a stopped ccee job. If a prefix matches more than one - job, bbaasshh reports an error. Using %%??ccee, on the other hand, refers to + 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 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 back- - ground. The _p_r_e_v_i_o_u_s _j_o_b may be referenced using %%--. In output per- + 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 back- + ground. The _p_r_e_v_i_o_u_s _j_o_b may be referenced using %%--. In output per- taining to jobs (e.g., the output of the jjoobbss command), the current job - is always flagged with a ++, and the previous job with a --. A single % - (with no accompanying job specification) also refers to the current + is always flagged with a ++, and the previous job with a --. A single % + (with no accompanying 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, + 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''''. - 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 + 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 + immediately. Any trap on SSIIGGCCHHLLDD is executed for each child that exits. - 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 - made without an intervening command, the shell does not print another + 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 + made without an intervening command, the shell does not print another warning, and any stopped jobs are terminated. 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 allows these prompt - strings to be customized by inserting a number of backslash-escaped + it is ready to read a command, and the secondary prompt PPSS22 when it + needs more input to complete a command. 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 - inserted into the prompt string; an empty _f_o_r_m_a_t results + the _f_o_r_m_a_t is passed to _s_t_r_f_t_i_m_e(3) and the result is + inserted into the prompt string; an empty _f_o_r_m_a_t results in a locale-specific time representation. The braces are required \\ee an ASCII escape character (033) @@ -2392,7 +2429,7 @@ PPRROOMMPPTTIINNGG \\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 @@ -2401,7 +2438,7 @@ 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 current working directory, with $$HHOOMMEE abbreviated + \\ww the current working directory, with $$HHOOMMEE abbreviated with a tilde \\WW the basename of the current working directory, with $$HHOOMMEE abbreviated with a tilde @@ -2410,63 +2447,63 @@ 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 - below), 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 substitu- - tion, arithmetic expansion, and quote removal, subject to the value of - the pprroommppttvvaarrss shell option (see the description of the sshhoopptt command + 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 + below), 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 substitu- + tion, 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). RREEAADDLLIINNEE - This is the library that handles reading input when using an interac- + This is the library that handles reading input when using an interac- tive shell, unless the ----nnooeeddiittiinngg option is given at shell invocation. By default, the line editing commands are similar to those of emacs. A - vi-style line editing interface is also available. To turn off line - editing after the shell is running, use the ++oo eemmaaccss or ++oo vvii options + vi-style line editing interface is also available. To turn off line + editing after the shell is running, use the ++oo eemmaaccss or ++oo vvii options to the sseett builtin (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). 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 + 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 separate the chunks of text on the kill ring. RReeaaddlliinnee IInniittiiaalliizzaattiioonn - 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. When a program which uses the readline library starts up, + 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. When a program which uses the readline library 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 con- + 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 con- structs. 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 @@ -2474,19 +2511,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 - and a key sequence to which it should be bound. The name may be speci- + 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. @@ -2497,15 +2534,15 @@ RREEAADDLLIINNEE Meta-Rubout: backward-kill-word Control-o: "> output" - 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 + 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). - 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 - be specified by placing the sequence within double quotes. Some GNU - Emacs style key escapes can be used, as in the following example, but + 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 + be specified by placing the sequence 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 @@ -2513,7 +2550,7 @@ 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 + _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 @@ -2524,7 +2561,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 @@ -2534,20 +2571,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 @@ -2557,44 +2594,50 @@ RREEAADDLLIINNEE sseett _v_a_r_i_a_b_l_e_-_n_a_m_e _v_a_l_u_e - 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- + 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: bbeellll--ssttyyllee ((aauuddiibbllee)) - Controls what happens when readline wants to ring the terminal + 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, readline attempts to bind the control characters + If set to OOnn, readline attempts to bind the control characters treated specially by the kernel's terminal driver to their read- line equivalents. ccoommmmeenntt--bbeeggiinn ((````##'''')) - The string that is inserted when the readline iinnsseerrtt--ccoommmmeenntt + 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--iiggnnoorree--ccaassee ((OOffff)) If set to OOnn, readline performs filename matching and completion in a case-insensitive fashion. + ccoommpplleettiioonn--pprreeffiixx--ddiissppllaayy--lleennggtthh ((00)) + The length in characters of the common prefix of a list of pos- + sible 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 possi- + ble completions. ccoommpplleettiioonn--qquueerryy--iitteemmss ((110000)) - This determines when the user is queried about viewing the num- - ber of possible completions generated by the ppoossssiibbllee--ccoommppllee-- - ttiioonnss command. It may be set to any integer value greater than - or equal to zero. If the number of possible completions is + This determines when the user is queried about viewing the num- + ber of possible completions generated by the ppoossssiibbllee--ccoommppllee-- + ttiioonnss command. It may be set to any integer value greater than + or equal to zero. If the number of possible completions is greater than or equal to the value of this variable, the user is - asked whether or not he wishes to view them; otherwise they are + asked whether or not he wishes to view them; otherwise they are simply listed on the terminal. ccoonnvveerrtt--mmeettaa ((OOnn)) - If set to OOnn, readline will convert characters with the eighth + 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 + prefixing an escape character (in effect, using escape as the _m_e_t_a _p_r_e_f_i_x). ddiissaabbllee--ccoommpplleettiioonn ((OOffff)) If set to OOnn, readline will inhibit word completion. Completion - characters will be inserted into the line as if they had been + characters will be inserted into the line as if they had been mapped to sseellff--iinnsseerrtt. eeddiittiinngg--mmooddee ((eemmaaccss)) Controls whether readline begins with a set of key bindings sim- @@ -2602,64 +2645,69 @@ RREEAADDLLIINNEE vvii. eennaabbllee--kkeeyyppaadd ((OOffff)) When set to OOnn, readline will try to enable the application key- - pad when it is called. Some systems need this to enable the + pad when it is called. Some systems need this to enable the arrow keys. eexxppaanndd--ttiillddee ((OOffff)) - If set to oonn, tilde expansion is performed when readline + If set to oonn, tilde expansion is performed when readline attempts word completion. hhiissttoorryy--pprreesseerrvvee--ppooiinntt ((OOffff)) - If set to oonn, the history code attempts to place point at the - same location on each history line retrieved with pprreevviioouuss--hhiiss-- + If set to oonn, the history code attempts to place point at the + same location on each history line retrieved with pprreevviioouuss--hhiiss-- ttoorryy or nneexxtt--hhiissttoorryy. hhiissttoorryy--ssiizzee ((00)) - Set the maximum number of history entries saved in the history + Set the maximum number of history entries saved in the history list. If set to zero, the number of entries in the history list is not limited. hhoorriizzoonnttaall--ssccrroollll--mmooddee ((OOffff)) - When set to OOnn, makes readline use a single line for display, + 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 + becomes longer than the screen width rather than wrapping to a new line. iinnppuutt--mmeettaa ((OOffff)) - If set to OOnn, readline will enable eight-bit input (that is, it - will not strip the high bit from the characters it reads), + If set to OOnn, readline will enable eight-bit input (that is, it + will not strip the high bit from the characters it reads), regardless of what the terminal claims it can support. The name mmeettaa--ffllaagg is a synonym for this variable. iisseeaarrcchh--tteerrmmiinnaattoorrss ((````CC--[[CC--JJ'''')) - The string of characters that should terminate an incremental - search without subsequently executing the character as a com- - mand. If this variable has not been given a value, the charac- + The string of characters that should terminate an incremental + search without subsequently executing the character as a com- + mand. If this variable has not been given a value, the charac- ters _E_S_C and _C_-_J will terminate an incremental search. kkeeyymmaapp ((eemmaaccss)) - Set the current readline keymap. The set of valid keymap names - is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- - _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is - equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the + Set the current readline keymap. The set of valid keymap names + is _e_m_a_c_s_, _e_m_a_c_s_-_s_t_a_n_d_a_r_d_, _e_m_a_c_s_-_m_e_t_a_, _e_m_a_c_s_-_c_t_l_x_, _v_i_, _v_i_-_c_o_m_- + _m_a_n_d, and _v_i_-_i_n_s_e_r_t. _v_i is equivalent to _v_i_-_c_o_m_m_a_n_d; _e_m_a_c_s is + equivalent to _e_m_a_c_s_-_s_t_a_n_d_a_r_d. The default value is _e_m_a_c_s; the value of eeddiittiinngg--mmooddee also affects the default keymap. 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 + tories have a slash appended (subject to the value of mmaarrkk--ddiirreeccttoorriieess). 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, unless the leading `.' is supplied by the + This variable, when set to OOnn, causes readline to match files + whose names begin with a `.' (hidden files) when performing + filename completion, unless the leading `.' is supplied by the user in the filename to be completed. 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. 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 + before returning when aacccceepptt--lliinnee is executed. By default, his- + tory lines may be modified and retain individual undo lists + across calls to 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 @@ -3049,6 +3097,10 @@ RREEAADDLLIINNEE Attempt completion on the text before point, comparing the text against lines from the history list for possible completion matches. + ddaabbbbrreevv--eexxppaanndd + Attempt menu completion on the text before point, comparing the + text against lines from the history list for possible completion + matches. ccoommpplleettee--iinnttoo--bbrraacceess ((MM--{{)) Perform filename completion and insert the list of possible com- pletions enclosed within braces so the list is available to the @@ -3504,7 +3556,13 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS Remove any current binding for _k_e_y_s_e_q. --xx _k_e_y_s_e_q::_s_h_e_l_l_-_c_o_m_m_a_n_d Cause _s_h_e_l_l_-_c_o_m_m_a_n_d to be executed whenever _k_e_y_s_e_q is - entered. + entered. When _s_h_e_l_l_-_c_o_m_m_a_n_d is executed, the shell sets + the RREEAADDLLIINNEE__LLIINNEE variable to the contents of the rreeaadd-- + lliinnee line buffer and the RREEAADDLLIINNEE__PPOOIINNTT variable to the + current location of the insertion point. If the executed + command changes the value of RREEAADDLLIINNEE__LLIINNEE or RREEAADD-- + LLIINNEE__PPOOIINNTT, those new values will be reflected in the + editing state. The return value is 0 unless an unrecognized option is given or an error occurred. @@ -3513,8 +3571,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 - exited. The return value is 0 unless the shell is not executing - a loop when bbrreeaakk is executed. + exited. The return value is 0 unless _n is not greater than or + equal to 1. bbuuiillttiinn _s_h_e_l_l_-_b_u_i_l_t_i_n [_a_r_g_u_m_e_n_t_s] Execute the specified shell builtin, passing it _a_r_g_u_m_e_n_t_s, and @@ -3524,6 +3582,19 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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] + Returns the context of any active subroutine call (a shell func- + tion or a script executed with the .. or ssoouurrccee builtins. With- + 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 + the call stack. + ccdd [--LL||--PP] [_d_i_r] Change the current directory to _d_i_r. The variable HHOOMMEE is the default _d_i_r. The variable CCDDPPAATTHH defines the search path for @@ -3541,19 +3612,6 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS output. The return value is true if the directory was success- fully changed; false otherwise. - ccaalllleerr [_e_x_p_r] - Returns the context of any active subroutine call (a shell func- - tion or a script executed with the .. or ssoouurrccee builtins. With- - 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 - the call stack. - 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 @@ -3585,16 +3643,18 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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] [--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] + ccoommpplleettee [--aabbccddeeffggjjkkssuuvv] [--oo _c_o_m_p_-_o_p_t_i_o_n] [--EE] [--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 _._._.] - ccoommpplleettee --pprr [_n_a_m_e ...] + ccoommpplleettee --pprr [--EE] [_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. + pletion specifications. The --EE option indicates that the + remaining options and actions should apply to ``empty'' command + completion; that is, completion attempted on a blank line. The process of applying these completion specifications when word completion is attempted is described above under PPrroo-- @@ -3726,8 +3786,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS sseelleecctt loop. If _n is specified, resume at the _nth enclosing loop. _n must be >= 1. If _n is greater than the number of enclosing loops, the last enclosing loop (the ``top-level'' - loop) is resumed. The return value is 0 unless the shell is not - executing a loop when ccoonnttiinnuuee is executed. + loop) is resumed. The return value is 0 unless _n is not greater + than or equal to 1. ddeeccllaarree [--aaffFFiirrttxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] ttyyppeesseett [--aaffFFiirrttxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] @@ -4008,13 +4068,16 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS printed. The return status is true unless a _n_a_m_e is not found or an invalid option is supplied. - hheellpp [--ss] [_p_a_t_t_e_r_n] + 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 - structures is printed. The --ss option restricts the information - displayed to a short usage synopsis. The return status is 0 - unless no command matches _p_a_t_t_e_r_n. + 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 + format + --ss Display only a short usage synopsis for each _p_a_t_t_e_r_n + The return status is 0 unless no command matches _p_a_t_t_e_r_n. hhiissttoorryy [[_n]] hhiissttoorryy --cc @@ -4024,44 +4087,44 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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-- - FFOORRMMAATT is set and not null, it is used as a format string for - _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- - played history entry. No intervening blank is printed between - the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is - supplied, it is used as the name of the history file; if not, - the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the + _n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE-- + FFOORRMMAATT is set and not null, it is used as a format string for + _s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis- + played history entry. No intervening blank is printed between + the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is + supplied, it is used as the name of the history file; if not, + the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the following meanings: --cc Clear the history list by deleting all the entries. --dd _o_f_f_s_e_t Delete the history entry at position _o_f_f_s_e_t. - --aa Append the ``new'' history lines (history lines entered - since the beginning of the current bbaasshh session) to the + --aa Append the ``new'' history lines (history lines entered + since the beginning of the current bbaasshh session) to the history file. - --nn Read the history lines not already read from the history - file into the current history list. These are lines - appended 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 + appended to the history file since the beginning of the current bbaasshh session. --rr Read the contents of the history file and use them as the current history. - --ww Write the current history to the history file, overwrit- + --ww Write the current history to the history file, overwrit- ing 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 is set, the time stamp information associ- - ated with each history entry is written to the history file, - marked with the history comment character. When the history + ated 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 previous history line. 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 is supplied as an + followed immediately by a digit are interpreted as timestamps + for the previous history line. 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 is supplied as an argument to --dd, or the history expansion supplied as an argument to --pp fails. @@ -4070,54 +4133,81 @@ 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. - --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. - --nn Display information only about jobs that have changed - status since the user was last notified of their status. + --nn Display information only about jobs that have changed + status since the user was last notified of their status. --rr Restrict output to running jobs. --ss Restrict output to 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 - _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and + _c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status. 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 [_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. kkiillll returns true - if at least one signal was successfully sent, or false if an + --ll is a number specifying either a signal number or the exit + status of a process terminated by a signal. kkiillll returns true + if at least one signal was successfully sent, or false if an error occurs or an invalid option is encountered. lleett _a_r_g [_a_r_g ...] Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH-- - MMEETTIICC EEVVAALLUUAATTIIOONN). If the last _a_r_g evaluates to 0, lleett returns + MMEETTIICC EEVVAALLUUAATTIIOONN). 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- + variable _n_a_m_e to have a visible scope restricted to that func- tion and its children. With no operands, llooccaall writes a list of - local variables to the standard output. It is an error to use + 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 [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u + nt_] _[--tt_] _[--uu _f_d_] _[--CC _c_a_l_l_b_a_c_k_] _[--cc _I_q_u_a_n_t_u_m]] [[_a_r_r_a_y]] RReeaadd lliinneess + ffrroomm tthhee ssttaannddaarrdd iinnppuutt iinnttoo aarrrraayy vvaarriiaabbllee _a_r_r_a_y, or from file + descriptor _f_d if the --uu option is supplied. The variable MMAAPP-- + FFIILLEE is the default _a_r_r_a_y. Options, if supplied, have the fol- + lowing meanings: + --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 + index is 0. + --ss Discard the first _c_o_u_n_t lines read. + --tt Remove a trailing line from each line read. + --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 option specifies _q_u_a_n_t_u_m. + --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 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, or _a_r_r_a_y is invalid or unassignable. + ppooppdd [-nn] [+_n] [-_n] Removes entries from the directory stack. With no arguments, removes the top directory from the stack, and performs a ccdd to @@ -4240,9 +4330,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 is not read within _t_i_m_e_o_u_t seconds. This - option has no effect if rreeaadd is not reading input from - the terminal or a pipe. + line of input is not read within _t_i_m_e_o_u_t seconds. _t_i_m_e_- + _o_u_t may be a decimal number with a fractional portion + following the decimal point. This option has no effect + if rreeaadd is not reading input from the terminal or a pipe. --uu _f_d Read input from file descriptor _f_d. If no _n_a_m_e_s are supplied, the line read is assigned to the vari- @@ -4511,6 +4602,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS If set, bbaasshh changes its behavior to that of version 3.1 with respect to quoted arguments to the conditional com- mand's =~ operator. + ddiirrssppeellll + 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. eexxeeccffaaiill @@ -4560,62 +4655,67 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS ble completions. See SSHHEELLLL VVAARRIIAABBLLEESS above for a description of FFIIGGNNOORREE. This option is enabled by default. + gglloobbssttaarr + If set, the pattern **** used in a filename expansion con- + text will match a files and zero or more directories and + subdirectories. If the pattern is followed by a //, only + directories and subdirectories match. ggnnuu__eerrrrffmmtt If set, shell error messages are written in the standard GNU error message format. hhiissttaappppeenndd - If set, the history list is appended to the file named - by the value of the HHIISSTTFFIILLEE variable when the shell + If set, the history list is appended to the file named + by the value of the HHIISSTTFFIILLEE variable when the shell exits, 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 If set, bbaasshh will send SSIIGGHHUUPP to all jobs when an inter- active login shell exits. 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 + and all remaining characters on that line to be ignored + in an interactive shell (see CCOOMMMMEENNTTSS above). This option is enabled by default. - lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line + lliitthhiisstt If set, and the ccmmddhhiisstt option is enabled, multi-line commands are saved to the history with embedded newlines rather than using semicolon separators where possible. llooggiinn__sshheellll - The shell sets this option if it is started as a login - shell (see IINNVVOOCCAATTIIOONN above). The value may not be + The shell sets this option if it is started as a login + shell (see IINNVVOOCCAATTIIOONN above). The value may not be changed. mmaaiillwwaarrnn - If set, and a file that bbaasshh is checking for mail has - been accessed since the last time it was checked, the - message ``The mail in _m_a_i_l_f_i_l_e has been read'' is dis- + 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. nnoo__eemmppttyy__ccmmdd__ccoommpplleettiioonn - If set, and rreeaaddlliinnee is being used, bbaasshh will not + If set, and rreeaaddlliinnee is being used, bbaasshh will not attempt to search the PPAATTHH for possible completions when completion is attempted on an empty line. nnooccaasseegglloobb - If set, bbaasshh matches filenames in a case-insensitive + If set, bbaasshh matches filenames in a case-insensitive fashion when performing pathname expansion (see PPaatthhnnaammee EExxppaannssiioonn above). nnooccaasseemmaattcchh - If set, bbaasshh matches patterns in a case-insensitive + If set, bbaasshh matches patterns in a case-insensitive fashion when performing matching while executing ccaassee or [[[[ conditional commands. nnuullllgglloobb - If set, bbaasshh allows patterns which match no files (see - PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string, + If set, bbaasshh allows patterns which match no files (see + PPaatthhnnaammee EExxppaannssiioonn above) to expand to a null string, rather than themselves. pprrooggccoommpp If set, the programmable completion facilities (see PPrroo-- @@ -4623,47 +4723,47 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS enabled by default. pprroommppttvvaarrss If set, prompt strings undergo parameter expansion, com- - mand substitution, arithmetic expansion, and quote - removal after being expanded as described in PPRROOMMPPTTIINNGG + mand substitution, arithmetic expansion, and quote + removal 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 + The shell sets this option if it is started in restricted 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- + 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. xxppgg__eecchhoo - If set, the eecchhoo builtin expands backslash-escape + If set, the eecchhoo builtin expands backslash-escape sequences by default. ssuussppeenndd [--ff] - Suspend the execution of this shell until it receives a SSIIGGCCOONNTT - signal. The --ff option says not to complain if this is a login - shell; just suspend anyway. The return status is 0 unless the + Suspend the execution of this shell until it receives a SSIIGGCCOONNTT + signal. The --ff option says not to complain if this is a login + shell; just suspend anyway. The return status is 0 unless the shell is a login shell and --ff is not supplied, or if job control is not enabled. tteesstt _e_x_p_r [[ _e_x_p_r ]] - Return a status of 0 or 1 depending on the evaluation 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 + Return a status of 0 or 1 depending on the evaluation 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, + Expressions may be combined using the following operators, listed in decreasing order of precedence. The evaluation depends on the number of arguments; see below. !! _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. @@ -4680,108 +4780,108 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS null. 2 arguments If the first argument is !!, the expression is true if and - only if the second argument is null. If the first argu- - ment is one of the unary conditional operators listed - above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is + only if the second argument is null. If the first argu- + ment is one of the unary conditional operators listed + above under CCOONNDDIITTIIOONNAALL EEXXPPRREESSSSIIOONNSS, the expression is true if the unary test is true. If the first argument is not a valid unary conditional operator, the expression is false. 3 arguments - 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 If the first argument is !!, the result is the negation of - the three-argument expression composed of the remaining + the three-argument expression composed of the remaining arguments. Otherwise, the expression is parsed and eval- - uated according to precedence using the rules listed + uated according to precedence using the rules listed above. 5 or more arguments - The expression is parsed and evaluated according to + The expression is parsed and evaluated according to precedence using the rules listed above. - ttiimmeess Print the accumulated user and system times for the shell and + ttiimmeess Print the accumulated user and system times for the shell and for processes run from the shell. The return status is 0. ttrraapp [--llpp] [[_a_r_g] _s_i_g_s_p_e_c ...] - The command _a_r_g is to be read and executed when the shell - receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a - single _s_i_g_s_p_e_c) or --, each specified signal is reset to its - original disposition (the value it had upon entrance to the - shell). If _a_r_g is the null string the signal specified by each - _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. - If _a_r_g is not present and --pp has been supplied, then the trap - commands associated with each _s_i_g_s_p_e_c are displayed. If no - arguments are supplied or if only --pp is given, ttrraapp prints the - list of commands associated with each signal. The --ll option - causes the shell to print a list of signal names and their cor- - responding numbers. Each _s_i_g_s_p_e_c is either a signal name - defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are - case insensitive and the SIG prefix is optional. If a _s_i_g_s_p_e_c - is EEXXIITT (0) the command _a_r_g is executed on exit from the shell. - If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g is executed before every + The command _a_r_g is to be read and executed when the shell + receives signal(s) _s_i_g_s_p_e_c. If _a_r_g is absent (and there is a + single _s_i_g_s_p_e_c) or --, each specified signal is reset to its + original disposition (the value it had upon entrance to the + shell). If _a_r_g is the null string the signal specified by each + _s_i_g_s_p_e_c is ignored by the shell and by the commands it invokes. + If _a_r_g is not present and --pp has been supplied, then the trap + commands associated with each _s_i_g_s_p_e_c are displayed. If no + arguments are supplied or if only --pp is given, ttrraapp prints the + list of commands associated with each signal. The --ll option + causes the shell to print a list of signal names and their cor- + responding numbers. Each _s_i_g_s_p_e_c is either a signal name + defined in <_s_i_g_n_a_l_._h>, or a signal number. Signal names are + case insensitive and the SIG prefix is optional. If a _s_i_g_s_p_e_c + is EEXXIITT (0) the command _a_r_g is executed on exit from the shell. + If a _s_i_g_s_p_e_c is DDEEBBUUGG, the command _a_r_g 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, every arithmetic _f_o_r command, and before the first command executes in - a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the - description of the eexxttddeebbuugg option to the sshhoopptt builtin for - details of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is EERRRR, - the command _a_r_g is executed whenever a simple command has 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, part of a command executed - in a &&&& or |||| list, or if the command's return value is being - inverted via !!. These are the same conditions obeyed by the + a shell function (see SSHHEELLLL GGRRAAMMMMAARR above). Refer to the + description of the eexxttddeebbuugg option to the sshhoopptt builtin for + details of its effect on the DDEEBBUUGG trap. If a _s_i_g_s_p_e_c is EERRRR, + the command _a_r_g is executed whenever a simple command has 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, part of a command executed + in a &&&& or |||| list, or if the command's return value is being + inverted via !!. These are the same conditions obeyed by the eerrrreexxiitt option. If a _s_i_g_s_p_e_c is RREETTUURRNN, the command _a_r_g is exe- cuted each time a shell function or a script executed with the .. - or ssoouurrccee builtins finishes executing. Signals ignored upon - entry to the shell cannot be trapped or reset. Trapped signals + or ssoouurrccee builtins finishes executing. Signals ignored upon + entry to the shell cannot be trapped or reset. Trapped signals that are not being ignored are reset to their original values in - a child process when it is created. The return status is false + a child process when it is created. The return status is false if any _s_i_g_s_p_e_c is invalid; otherwise ttrraapp returns true. ttyyppee [--aaffttppPP] _n_a_m_e [_n_a_m_e ...] - With no options, indicate how each _n_a_m_e would be interpreted if + 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 disk file, respectively. If the _n_a_m_e is not found, - then nothing is printed, and an exit status of false is - returned. If the --pp option is used, ttyyppee either returns the + 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 disk file, respectively. If the _n_a_m_e is not found, + then nothing is printed, and an exit status of false is + returned. If the --pp option is used, ttyyppee either returns the name of the disk file that would be executed if _n_a_m_e were speci- fied 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, + 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, not necessarily the + hashed, --pp and --PP print the hashed value, not necessarily the file that appears first in PPAATTHH. If the --aa option is used, ttyyppee - prints all of the places that contain an executable named _n_a_m_e. - This includes aliases and functions, if and only if the --pp - option is not also used. The table of hashed commands is not - consulted when using --aa. The --ff option suppresses shell func- - tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if - any of the arguments are found, false if none are found. + prints all of the places that contain an executable named _n_a_m_e. + This includes aliases and functions, if and only if the --pp + option is not also used. The table of hashed commands is not + consulted when using --aa. The --ff option suppresses shell func- + tion lookup, as with the ccoommmmaanndd builtin. ttyyppee returns true if + all of the arguments are found, false if any are not found. uulliimmiitt [--HHSSTTaabbccddeeffiillmmnnppqqrrssttuuvvxx [_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 - 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, - respectively. 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 + current hard limit, the current soft limit, and no limit, + respectively. 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 are printed before the value. Other options are inter- preted as follows: @@ -4790,7 +4890,7 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS --cc The maximum size of core files created --dd The maximum size of a process's data segment --ee The maximum scheduling priority ("nice") - --ff The maximum size of files written by the shell and its + --ff The maximum size of files written by the shell and its children --ii The maximum number of pending signals --ll The maximum size that may be locked into memory @@ -4802,65 +4902,65 @@ 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 --xx The maximum number of file locks --TT The maximum number of threads If _l_i_m_i_t is given, it is the new value of the specified resource (the --aa option is display only). If no option is given, then --ff - is assumed. Values are in 1024-byte increments, except for --tt, - which is in seconds, --pp, which is in units of 512-byte blocks, - and --TT, --bb, --nn, and --uu, which are unscaled values. The return + is assumed. Values are in 1024-byte increments, except for --tt, + which is in seconds, --pp, which is in units of 512-byte blocks, + and --TT, --bb, --nn, and --uu, which are unscaled values. 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] 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] [_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 no options are supplied, or the --vv option is given, each _n_a_m_e - refers to a shell variable. 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. Each unset vari- - able or function is removed from the environment passed to sub- - sequent commands. If any of RRAANNDDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD, + refers to a shell variable. 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. Each unset vari- + able or function is removed from the environment passed to sub- + sequent commands. If any of RRAANNDDOOMM, SSEECCOONNDDSS, LLIINNEENNOO, HHIISSTTCCMMDD, FFUUNNCCNNAAMMEE, GGRROOUUPPSS, or DDIIRRSSTTAACCKK are unset, they lose their special - properties, even if they are subsequently reset. The exit sta- + properties, even if they are subsequently reset. The exit sta- tus is true unless a _n_a_m_e is readonly. wwaaiitt [_n _._._.] - Wait for each specified process and return its termination sta- - tus. Each _n 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 _n is not given, all currently active child pro- - cesses are waited for, and the return status is zero. If _n - specifies a non-existent process or job, the return status is - 127. Otherwise, the return status is the exit status of the + Wait for each specified process and return its termination sta- + tus. Each _n 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 _n is not given, all currently active child pro- + cesses are waited for, and the return status is zero. If _n + specifies a non-existent process or job, the return status is + 127. Otherwise, the return status is the exit status of the last process or job waited for. RREESSTTRRIICCTTEEDD SSHHEELLLL If bbaasshh is started with the name rrbbaasshh, or the --rr 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. It - behaves identically to bbaasshh with the exception that the following are + invocation, the shell becomes restricted. A restricted shell is used + to set up an environment more controlled than the standard shell. It + behaves identically to bbaasshh with the exception that the following are disallowed or not performed: +o changing directories with ccdd @@ -4869,16 +4969,16 @@ RREESSTTRRIICCTTEEDD SSHHEELLLL +o specifying command names containing // - +o specifying a file name containing a // as an argument to the .. + +o specifying a file name containing a // as an argument to the .. builtin command - +o Specifying a filename containing a slash as an argument to the + +o Specifying a filename containing a slash as an argument to the --pp option to the hhaasshh builtin command - +o importing function definitions from the shell environment at + +o importing function definitions from the shell environment at startup - +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at + +o parsing the value of SSHHEELLLLOOPPTTSS from the shell environment at startup +o redirecting output using the >, >|, <>, >&, &>, and >> redirect- @@ -4887,10 +4987,10 @@ RREESSTTRRIICCTTEEDD SSHHEELLLL +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 @@ -4900,14 +5000,14 @@ RREESSTTRRIICCTTEEDD SSHHEELLLL These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed (see CCOOMM-- - MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell + MMAANNDD EEXXEECCUUTTIIOONN above), rrbbaasshh turns off any restrictions in the shell spawned to execute the script. SSEEEE AALLSSOO _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 _s_h(1), _k_s_h(1), _c_s_h(1) _e_m_a_c_s(1), _v_i(1) @@ -4923,7 +5023,7 @@ 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 _~_/_._i_n_p_u_t_r_c Individual _r_e_a_d_l_i_n_e initialization file @@ -4937,14 +5037,14 @@ AAUUTTHHOORRSS BBUUGG RREEPPOORRTTSS If you find a bug in bbaasshh,, you should report it. But first, you should - make sure that it really is a bug, and that it appears in the latest - version of bbaasshh. The latest version is always available from + make sure that it really is a bug, and that it appears in the latest + version of bbaasshh. The latest version is always available from _f_t_p_:_/_/_f_t_p_._g_n_u_._o_r_g_/_p_u_b_/_b_a_s_h_/. - 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 + 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 ggnnuu..bbaasshh..bbuugg. ALL bug reports should include: @@ -4955,7 +5055,7 @@ BBUUGG RREEPPOORRTTSS A description of the bug behaviour 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 @@ -4972,20 +5072,20 @@ BBUUGGSS Shell builtin commands and functions are not stoppable/restartable. 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 + 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. - Commands inside of $$((...)) command substitution are not parsed until - substitution is attempted. This will delay error reporting until some + Commands inside of $$((...)) command substitution are not parsed until + substitution is attempted. This will delay error reporting until some time after the command is entered. For example, unmatched parentheses, - even inside shell comments, will result in error messages while the + even inside shell comments, will result in error messages while the construct is being read. Array variables may not (yet) be exported. -GNU Bash-3.2 2008 April 5 BASH(1) +GNU Bash-4.0 2008 May 25 BASH(1) -- cgit v1.2.1