From 09767ff09d0d1c3202881d3a09325f5ddbfceb1b Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Wed, 7 Dec 2011 09:25:28 -0500 Subject: commit bash-20080703 snapshot --- doc/bash.0 | 1520 +++++++++++++++++++++++++++++++----------------------------- 1 file changed, 788 insertions(+), 732 deletions(-) (limited to 'doc/bash.0') diff --git a/doc/bash.0 b/doc/bash.0 index 7dc069cb..24f7f4d7 100644 --- a/doc/bash.0 +++ b/doc/bash.0 @@ -595,142 +595,154 @@ PPAARRAAMMEETTEERRSS which is also evaluated. When += is applied to an array variable using compound assignment (see AArrrraayyss below), the variable's value is not unset (as it is when using =), and new values are appended to the array - beginning at one greater than the array's maximum index. When applied - to a string-valued variable, _v_a_l_u_e is expanded and appended to the - variable's value. + beginning at one greater than the array's maximum index (for indexed + arrays) or added as additional key-value pairs in an associative array. + When applied to a string-valued variable, _v_a_l_u_e is expanded and + appended to the variable's value. PPoossiittiioonnaall PPaarraammeetteerrss - A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, + A _p_o_s_i_t_i_o_n_a_l _p_a_r_a_m_e_t_e_r is a parameter denoted by one or more digits, other than the single digit 0. Positional parameters are assigned from - the shell's arguments when it is invoked, and may be reassigned using - the sseett builtin command. Positional parameters may not be assigned to - with assignment statements. The positional parameters are temporarily + the shell's arguments when it is invoked, and may be reassigned using + the sseett builtin command. Positional parameters may not be assigned to + with assignment statements. The positional parameters are temporarily replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). - When a positional parameter consisting of more than a single digit is + When a positional parameter consisting of more than a single digit is expanded, it must be enclosed in braces (see EEXXPPAANNSSIIOONN below). SSppeecciiaall PPaarraammeetteerrss - The shell treats several parameters specially. These parameters may + The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. - ** Expands to the positional parameters, starting from one. When - the expansion occurs within double quotes, it expands to a sin- + ** Expands to the positional parameters, starting from one. When + the expansion occurs within double quotes, it expands to a sin- gle word with the value of each parameter separated by the first character of the IIFFSS special variable. That is, "$$**" is equiva- lent to "$$11_c$$22_c......", where _c is the first character of the value - of the IIFFSS variable. If IIFFSS is unset, the parameters are sepa- - rated by spaces. If IIFFSS is null, the parameters are joined + of the IIFFSS variable. If IIFFSS is unset, the parameters are sepa- + rated by spaces. If IIFFSS is null, the parameters are joined without intervening separators. - @@ Expands to the positional parameters, starting from one. When + @@ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$$@@" is equivalent to "$$11" - "$$22" ... If the double-quoted expansion occurs within a word, - the expansion of the first parameter is joined with the begin- - ning part of the original word, and the expansion of the last - parameter is joined with the last part of the original word. - When there are no positional parameters, "$$@@" and $$@@ expand to + "$$22" ... If the double-quoted expansion occurs within a word, + the expansion of the first parameter is joined with the begin- + ning part of the original word, and the expansion of the last + parameter is joined with the last part of the original word. + When there are no positional parameters, "$$@@" and $$@@ expand to nothing (i.e., they are removed). ## Expands to the number of positional parameters in decimal. - ?? Expands to the exit status of the most recently executed fore- + ?? Expands to the exit status of the most recently executed fore- ground pipeline. - -- Expands to the current option flags as specified upon invoca- - tion, by the sseett builtin command, or those set by the shell + -- Expands to the current option flags as specified upon invoca- + tion, by the sseett builtin command, or those set by the shell itself (such as the --ii option). - $$ Expands to the process ID of the shell. In a () subshell, it - expands to the process ID of the current shell, not the sub- + $$ Expands to the process ID of the shell. In a () subshell, it + expands to the process ID of the current shell, not the sub- shell. - !! Expands to the process ID of the most recently executed back- + !! Expands to the process ID of the most recently executed back- ground (asynchronous) command. - 00 Expands to the name of the shell or shell script. This is set + 00 Expands to the name of the shell or shell script. This is set at shell initialization. If bbaasshh is invoked with a file of com- - mands, $$00 is set to the name of that file. If bbaasshh is started - with the --cc option, then $$00 is set to the first argument after - the string to be executed, if one is present. Otherwise, it is - set to the file name used to invoke bbaasshh, as given by argument + mands, $$00 is set to the name of that file. If bbaasshh is started + with the --cc option, then $$00 is set to the first argument after + the string to be executed, if one is present. Otherwise, it is + set to the file name used to invoke bbaasshh, as given by argument zero. - __ At shell startup, set to the absolute pathname used to invoke - the shell or shell script being executed as passed in the envi- - ronment or argument list. Subsequently, expands to the last - argument to the previous command, after expansion. Also set to - the full pathname used to invoke each command executed and + __ At shell startup, set to the absolute pathname used to invoke + the shell or shell script being executed as passed in the envi- + ronment or argument list. Subsequently, expands to the last + argument to the previous command, after expansion. Also set to + the full pathname used to invoke each command executed and placed in the environment exported to that command. When check- - ing mail, this parameter holds the name of the mail file cur- + ing mail, this parameter holds the name of the mail file cur- rently being checked. SShheellll VVaarriiaabblleess The following variables are set by the shell: - BBAASSHH Expands to the full file name used to invoke this instance of + BBAASSHH Expands to the full file name used to invoke this instance of bbaasshh. BBAASSHHPPIIDD - Expands to the process id of the current bbaasshh process. This - differs from $$$$ under certain circumstances, such as subshells + Expands to the process id of the current bbaasshh process. This + differs from $$$$ under certain circumstances, such as subshells that do not require bbaasshh to be re-initialized. + BBAASSHH__AALLIIAASSEESS + An associative array variable whose members correspond to the + internal list of aliases as maintained by the aalliiaass builtin Ele- + ments added to this array appear in the alias list; unsetting + array elements cause aliases to be removed from the alias list. BBAASSHH__AARRGGCC - An array variable whose values are the number of parameters in + An array variable whose values are the number of parameters in each frame of the current bbaasshh execution call stack. The number - of parameters to the current subroutine (shell function or - script executed with .. or ssoouurrccee) is at the top of the stack. - When a subroutine is executed, the number of parameters passed + of parameters to the current subroutine (shell function or + script executed with .. or ssoouurrccee) is at the top of the stack. + When a subroutine is executed, the number of parameters passed is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in - extended debugging mode (see the description of the eexxttddeebbuugg + extended debugging mode (see the description of the eexxttddeebbuugg option to the sshhoopptt builtin below) BBAASSHH__AARRGGVV - An array variable containing all of the parameters in the cur- + An array variable containing all of the parameters in the cur- rent bbaasshh execution call stack. The final parameter of the last - subroutine call is at the top of the stack; the first parameter + subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is exe- - cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The - shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see - the description of the eexxttddeebbuugg option to the sshhoopptt builtin + cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The + shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see + the description of the eexxttddeebbuugg option to the sshhoopptt builtin below) + BBAASSHH__CCMMDDSS + An associative array variable whose members correspond to the + internal hash table of commands as maintained by the hhaasshh + builtin. Elements added to this array appear in the hash table; + unsetting array elements cause commands to be removed from the + hash table. BBAASSHH__CCOOMMMMAANNDD - The command currently being executed or about to be executed, + The command currently being executed or about to be executed, unless the shell is executing a command as the result of a trap, - in which case it is the command executing at the time of the + in which case it is the command executing at the time of the trap. BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG The command argument to the --cc invocation option. BBAASSHH__LLIINNEENNOO - An array variable whose members are the line numbers in source - files corresponding to each member of FFUUNNCCNNAAMMEE. - $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file where - $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if refer- - enced within another shell function). The corresponding source - file name is $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}}.. UUssee LLIINNEENNOO ttoo oobbttaaiinn tthhee ccuurr-- + An array variable whose members are the line numbers in source + files corresponding to each member of FFUUNNCCNNAAMMEE. + $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file where + $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if refer- + enced within another shell function). The corresponding source + file name is $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}}.. UUssee LLIINNEENNOO ttoo oobbttaaiinn tthhee ccuurr-- rreenntt lliinnee nnuummbbeerr.. BBAASSHH__RREEMMAATTCCHH - An array variable whose members are assigned by the ==~~ binary - operator to the [[[[ conditional command. The element with index - 0 is the portion of the string matching the entire regular - expression. The element with index _n is the portion of the + An array variable whose members are assigned by the ==~~ binary + operator to the [[[[ conditional command. The element with index + 0 is the portion of the string matching the entire regular + expression. The element with index _n is the portion of the string matching the _nth parenthesized subexpression. This vari- able is read-only. BBAASSHH__SSOOUURRCCEE - An array variable whose members are the source filenames corre- + An array variable whose members are the source filenames corre- sponding to the elements in the FFUUNNCCNNAAMMEE array variable. BBAASSHH__SSUUBBSSHHEELLLL - Incremented by one each time a subshell or subshell environment + Incremented by one each time a subshell or subshell environment is spawned. The initial value is 0. BBAASSHH__VVEERRSSIINNFFOO A readonly array variable whose members hold version information - for this instance of bbaasshh. The values assigned to the array + for this instance of bbaasshh. The values assigned to the array members are as follows: - BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). - BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). + BBAASSHH__VVEERRSSIINNFFOO[[0]] The major version number (the _r_e_l_e_a_s_e). + BBAASSHH__VVEERRSSIINNFFOO[[1]] The minor version number (the _v_e_r_s_i_o_n). BBAASSHH__VVEERRSSIINNFFOO[[2]] The patch level. BBAASSHH__VVEERRSSIINNFFOO[[3]] The build version. BBAASSHH__VVEERRSSIINNFFOO[[4]] The release status (e.g., _b_e_t_a_1). BBAASSHH__VVEERRSSIINNFFOO[[5]] The value of MMAACCHHTTYYPPEE. BBAASSHH__VVEERRSSIIOONN - Expands to a string describing the version of this instance of + Expands to a string describing the version of this instance of bbaasshh. CCOOMMPP__CCWWOORRDD - An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current + An index into $${{CCOOMMPP__WWOORRDDSS}} of the word containing the current cursor position. This variable is available only in shell func- - tions invoked by the programmable completion facilities (see + tions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__KKEEYY @@ -738,116 +750,116 @@ PPAARRAAMMEETTEERRSS rent completion function. CCOOMMPP__LLIINNEE - The current command line. This variable is available only in - shell functions and external commands invoked by the pro- - grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + The current command line. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__PPOOIINNTT - The index of the current cursor position relative to the begin- - ning of the current command. If the current cursor position is + The index of the current cursor position relative to the begin- + ning of the current command. If the current cursor position is at the end of the current command, the value of this variable is - equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in - shell functions and external commands invoked by the pro- - grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + equal to $${{##CCOOMMPP__LLIINNEE}}. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__TTYYPPEE - Set to an integer value corresponding to the type of completion - attempted that caused a completion function to be called: _T_A_B, - for normal completion, _?, for listing completions after succes- - sive tabs, _!, for listing alternatives on partial word comple- - tion, _@, to list completions if the word is not unmodified, or - _%, for menu completion. This variable is available only in - shell functions and external commands invoked by the pro- - grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn + Set to an integer value corresponding to the type of completion + attempted that caused a completion function to be called: _T_A_B, + for normal completion, _?, for listing completions after succes- + sive tabs, _!, for listing alternatives on partial word comple- + tion, _@, to list completions if the word is not unmodified, or + _%, for menu completion. This variable is available only in + shell functions and external commands invoked by the pro- + grammable completion facilities (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). CCOOMMPP__WWOORRDDBBRREEAAKKSS - The set of characters that the Readline library treats as word - separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS - is unset, it loses its special properties, even if it is subse- + The set of characters that the Readline library treats as word + separators when performing word completion. If CCOOMMPP__WWOORRDDBBRREEAAKKSS + is unset, it loses its special properties, even if it is subse- quently reset. CCOOMMPP__WWOORRDDSS - An array variable (see AArrrraayyss below) consisting of the individ- - ual words in the current command line. The words are split on - shell metacharacters as the shell parser would separate them. - This variable is available only in shell functions invoked by + An array variable (see AArrrraayyss below) consisting of the individ- + ual words in the current command line. The words are split on + shell metacharacters as the shell parser would separate them. + This variable is available only in shell functions invoked by the programmable completion facilities (see PPrrooggrraammmmaabbllee CCoommppllee-- ttiioonn below). DDIIRRSSTTAACCKK An array variable (see AArrrraayyss below) containing the current con- - tents of the directory stack. Directories appear in the stack - in the order they are displayed by the ddiirrss builtin. Assigning + tents of the directory stack. Directories appear in the stack + in the order they are displayed by the ddiirrss builtin. Assigning to members of this array variable may be used to modify directo- - ries already in the stack, but the ppuusshhdd and ppooppdd builtins must + ries already in the stack, but the ppuusshhdd and ppooppdd builtins must be used to add and remove directories. Assignment to this vari- - able will not change the current directory. If DDIIRRSSTTAACCKK is - unset, it loses its special properties, even if it is subse- + able will not change the current directory. If DDIIRRSSTTAACCKK is + unset, it loses its special properties, even if it is subse- quently reset. - EEUUIIDD Expands to the effective user ID of the current user, initial- + EEUUIIDD Expands to the effective user ID of the current user, initial- ized at shell startup. This variable is readonly. FFUUNNCCNNAAMMEE - An array variable containing the names of all shell functions + An array variable containing the names of all shell functions currently in the execution call stack. The element with index 0 is the name of any currently-executing shell function. The bot- - tom-most element is "main". This variable exists only when a - shell function is executing. Assignments to FFUUNNCCNNAAMMEE have no - effect and return an error status. If FFUUNNCCNNAAMMEE is unset, it - loses its special properties, even if it is subsequently reset. - - GGRROOUUPPSS An array variable containing the list of groups of which the - current user is a member. Assignments to GGRROOUUPPSS have no effect - and return an error status. If GGRROOUUPPSS is unset, it loses its + tom-most element is "main". This variable exists only when a + shell function is executing. Assignments to FFUUNNCCNNAAMMEE have no + effect and return an error status. If FFUUNNCCNNAAMMEE is unset, it + loses its special properties, even if it is subsequently reset. + + GGRROOUUPPSS An array variable containing the list of groups of which the + current user is a member. Assignments to GGRROOUUPPSS have no effect + and return an error status. If GGRROOUUPPSS is unset, it loses its special properties, even if it is subsequently reset. HHIISSTTCCMMDD The history number, or index in the history list, of the current - command. If HHIISSTTCCMMDD is unset, it loses its special properties, + command. If HHIISSTTCCMMDD is unset, it loses its special properties, even if it is subsequently reset. HHOOSSTTNNAAMMEE Automatically set to the name of the current host. HHOOSSTTTTYYPPEE - Automatically set to a string that uniquely describes the type - of machine on which bbaasshh is executing. The default is system- + Automatically set to a string that uniquely describes the type + of machine on which bbaasshh is executing. The default is system- dependent. - LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a - decimal number representing the current sequential line number - (starting with 1) within a script or function. When not in a - script or function, the value substituted is not guaranteed to + LLIINNEENNOO Each time this parameter is referenced, the shell substitutes a + decimal number representing the current sequential line number + (starting with 1) within a script or function. When not in a + script or function, the value substituted is not guaranteed to be meaningful. If LLIINNEENNOO is unset, it loses its special proper- ties, even if it is subsequently reset. MMAACCHHTTYYPPEE - Automatically set to a string that fully describes the system - type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- + Automatically set to a string that fully describes the system + type on which bbaasshh is executing, in the standard GNU _c_p_u_-_c_o_m_- _p_a_n_y_-_s_y_s_t_e_m format. The default is system-dependent. OOLLDDPPWWDD The previous working directory as set by the ccdd command. - OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss + OOPPTTAARRGG The value of the last option argument processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss + OOPPTTIINNDD The index of the next argument to be processed by the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOSSTTYYPPEE Automatically set to a string that describes the operating sys- - tem on which bbaasshh is executing. The default is system-depen- + OOSSTTYYPPEE Automatically set to a string that describes the operating sys- + tem on which bbaasshh is executing. The default is system-depen- dent. PPIIPPEESSTTAATTUUSS - An array variable (see AArrrraayyss below) containing a list of exit - status values from the processes in the most-recently-executed + An array variable (see AArrrraayyss below) containing a list of exit + status values from the processes in the most-recently-executed foreground pipeline (which may contain only a single command). - PPPPIIDD The process ID of the shell's parent. This variable is read- + PPPPIIDD The process ID of the shell's parent. This variable is read- only. PPWWDD The current working directory as set by the ccdd command. @@ -855,27 +867,27 @@ PPAARRAAMMEETTEERRSS RRAANNDDOOMM Each time this parameter is referenced, a random integer between 0 and 32767 is generated. The sequence of random numbers may be initialized by assigning a value to RRAANNDDOOMM. If RRAANNDDOOMM is unset, - it loses its special properties, even if it is subsequently + it loses its special properties, even if it is subsequently reset. - RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when + RREEPPLLYY Set to the line of input read by the rreeaadd builtin command when no arguments are supplied. SSEECCOONNDDSS - Each time this parameter is referenced, the number of seconds - since shell invocation is returned. If a value is assigned to - SSEECCOONNDDSS, the value returned upon subsequent references is the - number of seconds since the assignment plus the value assigned. + Each time this parameter is referenced, the number of seconds + since shell invocation is returned. If a value is assigned to + SSEECCOONNDDSS, the value returned upon subsequent references is the + number of seconds since the assignment plus the value assigned. If SSEECCOONNDDSS is unset, it loses its special properties, even if it is subsequently reset. SSHHEELLLLOOPPTTSS - A colon-separated list of enabled shell options. Each word in - the list is a valid argument for the --oo option to the sseett + A colon-separated list of enabled shell options. Each word in + the list is a valid argument for the --oo option to the sseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options - appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If - this variable is in the environment when bbaasshh starts up, each - shell option in the list will be enabled before reading any + appearing in SSHHEELLLLOOPPTTSS are those reported as _o_n by sseett --oo. If + this variable is in the environment when bbaasshh starts up, each + shell option in the list will be enabled before reading any startup files. This variable is read-only. SSHHLLVVLL Incremented by one each time an instance of bbaasshh is started. @@ -883,183 +895,188 @@ PPAARRAAMMEETTEERRSS UUIIDD Expands to the user ID of the current user, initialized at shell startup. This variable is readonly. - The following variables are used by the shell. In some cases, bbaasshh + The following variables are used by the shell. In some cases, bbaasshh assigns a default value to a variable; these cases are noted below. BBAASSHH__EENNVV - If this parameter is set when bbaasshh is executing a shell script, - its value is interpreted as a filename containing commands to + If this parameter is set when bbaasshh is executing a shell script, + its value is interpreted as a filename containing commands to initialize the shell, as in _~_/_._b_a_s_h_r_c. The value of BBAASSHH__EENNVV is - subjected to parameter expansion, command substitution, and - arithmetic expansion before being interpreted as a file name. + subjected to parameter expansion, command substitution, and + arithmetic expansion before being interpreted as a file name. PPAATTHH is not used to search for the resultant file name. - CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated - list of directories in which the shell looks for destination - directories specified by the ccdd command. A sample value is + CCDDPPAATTHH The search path for the ccdd command. This is a colon-separated + list of directories in which the shell looks for destination + directories specified by the ccdd command. A sample value is ".:~:/usr". CCOOLLUUMMNNSS - Used by the sseelleecctt builtin command to determine the terminal - width when printing selection lists. Automatically set upon + Used by the sseelleecctt builtin command to determine the terminal + width when printing selection lists. Automatically set upon receipt of a SIGWINCH. CCOOMMPPRREEPPLLYY An array variable from which bbaasshh reads the possible completions - generated by a shell function invoked by the programmable com- + generated by a shell function invoked by the programmable com- pletion facility (see PPrrooggrraammmmaabbllee CCoommpplleettiioonn below). - EEMMAACCSS If bbaasshh finds this variable in the environment when the shell - starts with value "t", it assumes that the shell is running in + EEMMAACCSS If bbaasshh finds this variable in the environment when the shell + starts with value "t", it assumes that the shell is running in an emacs shell buffer and disables line editing. FFCCEEDDIITT The default editor for the ffcc builtin command. FFIIGGNNOORREE - A colon-separated list of suffixes to ignore when performing + A colon-separated list of suffixes to ignore when performing filename completion (see RREEAADDLLIINNEE below). A filename whose suf- - fix matches one of the entries in FFIIGGNNOORREE is excluded from the + fix matches one of the entries in FFIIGGNNOORREE is excluded from the list of matched filenames. A sample value is ".o:~". GGLLOOBBIIGGNNOORREE A colon-separated list of patterns defining the set of filenames to be ignored by pathname expansion. If a filename matched by a - pathname expansion pattern also matches one of the patterns in + pathname expansion pattern also matches one of the patterns in GGLLOOBBIIGGNNOORREE, it is removed from the list of matches. HHIISSTTCCOONNTTRROOLL - A colon-separated list of values controlling how commands are - saved on the history list. If the list of values includes - _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not - saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines + A colon-separated list of values controlling how commands are + saved on the history list. If the list of values includes + _i_g_n_o_r_e_s_p_a_c_e, lines which begin with a ssppaaccee character are not + saved in the history list. A value of _i_g_n_o_r_e_d_u_p_s causes lines matching the previous history entry to not be saved. A value of _i_g_n_o_r_e_b_o_t_h is shorthand for _i_g_n_o_r_e_s_p_a_c_e and _i_g_n_o_r_e_d_u_p_s. A value of _e_r_a_s_e_d_u_p_s causes all previous lines matching the current line - to be removed from the history list before that line is saved. - Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is - unset, or does not include a valid value, all lines read by the + to be removed from the history list before that line is saved. + Any value not in the above list is ignored. If HHIISSTTCCOONNTTRROOLL is + unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value - of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line - compound command are not tested, and are added to the history + of HHIISSTTIIGGNNOORREE. The second and subsequent lines of a multi-line + compound command are not tested, and are added to the history regardless of the value of HHIISSTTCCOONNTTRROOLL. HHIISSTTFFIILLEE The name of the file in which command history is saved (see HHIISS-- - TTOORRYY below). The default value is _~_/_._b_a_s_h___h_i_s_t_o_r_y. If unset, - the command history is not saved when an interactive shell + TTOORRYY below). The default value is _~_/_._b_a_s_h___h_i_s_t_o_r_y. If unset, + the command history is not saved when an interactive shell exits. HHIISSTTFFIILLEESSIIZZEE The maximum number of lines contained in the history file. When - this variable is assigned a value, the history file is trun- - cated, if necessary, by removing the oldest entries, to contain - no more than that number of lines. The default value is 500. + this variable is assigned a value, the history file is trun- + cated, if necessary, by removing the oldest entries, to contain + no more than that number of lines. The default value is 500. The history file is also truncated to this size after writing it when an interactive shell exits. HHIISSTTIIGGNNOORREE - A colon-separated list of patterns used to decide which command - lines should be saved on the history list. Each pattern is - anchored at the beginning of the line and must match the com- - plete line (no implicit `**' is appended). Each pattern is - tested against the line after the checks specified by HHIISSTTCCOONN-- - TTRROOLL are applied. In addition to the normal shell pattern + A colon-separated list of patterns used to decide which command + lines should be saved on the history list. Each pattern is + anchored at the beginning of the line and must match the com- + plete line (no implicit `**' is appended). Each pattern is + tested against the line after the checks specified by HHIISSTTCCOONN-- + TTRROOLL are applied. In addition to the normal shell pattern matching characters, `&&' matches the previous history line. `&&' - may be escaped using a backslash; the backslash is removed + may be escaped using a backslash; the backslash is removed before attempting a match. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HHIISSTTIIGGNNOORREE. HHIISSTTSSIIZZEE - The number of commands to remember in the command history (see + The number of commands to remember in the command history (see HHIISSTTOORRYY below). The default value is 500. HHIISSTTTTIIMMEEFFOORRMMAATT - If this variable is set and not null, its value is used as a + If this variable is set and not null, its value is used as a format string for _s_t_r_f_t_i_m_e(3) to print the time stamp associated - with each history entry displayed by the hhiissttoorryy builtin. If - this variable is set, time stamps are written to the history - file so they may be preserved across shell sessions. This uses - the history comment character to distinguish timestamps from + with each history entry displayed by the hhiissttoorryy builtin. If + this variable is set, time stamps are written to the history + file so they may be preserved across shell sessions. This uses + the history comment character to distinguish timestamps from other history lines. HHOOMMEE The home directory of the current user; the default argument for the ccdd builtin command. The value of this variable is also used when performing tilde expansion. HHOOSSTTFFIILLEE - Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s + Contains the name of a file in the same format as _/_e_t_c_/_h_o_s_t_s that should be read when the shell needs to complete a hostname. - The list of possible hostname completions may be changed while - the shell is running; the next time hostname completion is - attempted after the value is changed, bbaasshh adds the contents of - the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has + The list of possible hostname completions may be changed while + the shell is running; the next time hostname completion is + attempted after the value is changed, bbaasshh adds the contents of + the new file to the existing list. If HHOOSSTTFFIILLEE is set, but has no value, bbaasshh attempts to read _/_e_t_c_/_h_o_s_t_s to obtain the list of - possible hostname completions. When HHOOSSTTFFIILLEE is unset, the + possible hostname completions. When HHOOSSTTFFIILLEE is unset, the hostname list is cleared. - IIFFSS The _I_n_t_e_r_n_a_l _F_i_e_l_d _S_e_p_a_r_a_t_o_r that is used for word splitting - after expansion and to split lines into words with the rreeaadd + IIFFSS The _I_n_t_e_r_n_a_l _F_i_e_l_d _S_e_p_a_r_a_t_o_r that is used for word splitting + after expansion and to split lines into words with the rreeaadd builtin command. The default value is ``''. IIGGNNOORREEEEOOFF Controls the action of an interactive shell on receipt of an EEOOFF character as the sole input. If set, the value is the number of - consecutive EEOOFF characters which must be typed as the first - characters on an input line before bbaasshh exits. If the variable - exists but does not have a numeric value, or has no value, the - default value is 10. If it does not exist, EEOOFF signifies the + consecutive EEOOFF characters which must be typed as the first + characters on an input line before bbaasshh exits. If the variable + exists but does not have a numeric value, or has no value, the + default value is 10. If it does not exist, EEOOFF signifies the end of input to the shell. IINNPPUUTTRRCC - The filename for the rreeaaddlliinnee startup file, overriding the + The filename for the rreeaaddlliinnee startup file, overriding the default of _~_/_._i_n_p_u_t_r_c (see RREEAADDLLIINNEE below). - LLAANNGG Used to determine the locale category for any category not + LLAANNGG Used to determine the locale category for any category not specifically selected with a variable starting with LLCC__. - LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ + LLCC__AALLLL This variable overrides the value of LLAANNGG and any other LLCC__ variable specifying a locale category. LLCC__CCOOLLLLAATTEE - This variable determines the collation order used when sorting - the results of pathname expansion, and determines the behavior - of range expressions, equivalence classes, and collating + This variable determines the collation order used when sorting + the results of pathname expansion, and determines the behavior + of range expressions, equivalence classes, and collating sequences within pathname expansion and pattern matching. LLCC__CCTTYYPPEE - This variable determines the interpretation of characters and - the behavior of character classes within pathname expansion and + This variable determines the interpretation of characters and + the behavior of character classes within pathname expansion and pattern matching. LLCC__MMEESSSSAAGGEESS - This variable determines the locale used to translate double- + This variable determines the locale used to translate double- quoted strings preceded by a $$. LLCC__NNUUMMEERRIICC - This variable determines the locale category used for number + This variable determines the locale category used for number formatting. - LLIINNEESS Used by the sseelleecctt builtin command to determine the column - length for printing selection lists. Automatically set upon + LLIINNEESS Used by the sseelleecctt builtin command to determine the column + length for printing selection lists. Automatically set upon receipt of a SIGWINCH. - MMAAIILL If this parameter is set to a file name and the MMAAIILLPPAATTHH vari- + MMAAIILL If this parameter is set to a file name and the MMAAIILLPPAATTHH vari- able is not set, bbaasshh informs the user of the arrival of mail in the specified file. MMAAIILLCCHHEECCKK - Specifies how often (in seconds) bbaasshh checks for mail. The - default is 60 seconds. When it is time to check for mail, the - shell does so before displaying the primary prompt. If this - variable is unset, or set to a value that is not a number + Specifies how often (in seconds) bbaasshh checks for mail. The + default is 60 seconds. When it is time to check for mail, the + shell does so before displaying the primary prompt. If this + variable is unset, or set to a value that is not a number greater than or equal to zero, the shell disables mail checking. MMAAIILLPPAATTHH - A colon-separated list of file names to be checked for mail. + A colon-separated list of file names to be checked for mail. The message to be printed when mail arrives in a particular file - may be specified by separating the file name from the message + may be specified by separating the file name from the message with a `?'. When used in the text of the message, $$__ expands to the name of the current mailfile. Example: MMAAIILLPPAATTHH='/var/mail/bfox?"You have mail":~/shell-mail?"$_ has mail!"' - BBaasshh supplies a default value for this variable, but the loca- - tion of the user mail files that it uses is system dependent + BBaasshh supplies a default value for this variable, but the loca- + tion of the user mail files that it uses is system dependent (e.g., /var/mail/$$UUSSEERR). OOPPTTEERRRR If set to the value 1, bbaasshh displays error messages generated by - the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). - OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a + the ggeettooppttss builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). + OOPPTTEERRRR is initialized to 1 each time the shell is invoked or a shell script is executed. - PPAATTHH The search path for commands. It is a colon-separated list of - directories in which the shell looks for commands (see CCOOMMMMAANNDD - EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the + PPAATTHH The search path for commands. It is a colon-separated list of + directories in which the shell looks for commands (see CCOOMMMMAANNDD + EEXXEECCUUTTIIOONN below). A zero-length (null) directory name in the value of PPAATTHH indicates the current directory. A null directory - name may appear as two adjacent colons, or as an initial or - trailing colon. The default path is system-dependent, and is - set by the administrator who installs bbaasshh. A common value is + name may appear as two adjacent colons, or as an initial or + trailing colon. The default path is system-dependent, and is + set by the administrator who installs bbaasshh. A common value is ``/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin''. PPOOSSIIXXLLYY__CCOORRRREECCTT - If this variable is in the environment when bbaasshh starts, the - shell enters _p_o_s_i_x _m_o_d_e before reading the startup files, as if - the ----ppoossiixx invocation option had been supplied. If it is set - while the shell is running, bbaasshh enables _p_o_s_i_x _m_o_d_e, as if the + If this variable is in the environment when bbaasshh starts, the + shell enters _p_o_s_i_x _m_o_d_e before reading the startup files, as if + the ----ppoossiixx invocation option had been supplied. If it is set + while the shell is running, bbaasshh enables _p_o_s_i_x _m_o_d_e, as if the command _s_e_t _-_o _p_o_s_i_x had been executed. PPRROOMMPPTT__CCOOMMMMAANNDD If set, the value is executed as a command prior to issuing each primary prompt. + PPRROOMMPPTT__DDIIRRTTRRIIMM + If set to a number greater than zero, the value is used as the + number of trailing directory components to retain when expanding + the \\ww aanndd \\WW pprroommpptt ssttrriinngg eessccaappeess ((sseeee PPRROOMMPPTTIINNGG below). + Characters removed are replaced with an ellipsis. PPSS11 The value of this parameter is expanded (see PPRROOMMPPTTIINNGG below) and used as the primary prompt string. The default value is ``\\ss--\\vv\\$$ ''. @@ -1148,59 +1165,70 @@ PPAARRAAMMEETTEERRSS shell parser to treat the rest of the line as a comment. AArrrraayyss - BBaasshh provides one-dimensional array variables. Any variable may be - used as an array; the ddeeccllaarree builtin will explicitly declare an array. - There is no maximum limit on the size of an array, nor any requirement - that members be indexed or assigned contiguously. Arrays are indexed - using integers and are zero-based. - - An array is created automatically if any variable is assigned to using - the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as an - arithmetic expression that must evaluate to a number greater than or - equal to zero. To explicitly declare an array, use ddeeccllaarree --aa _n_a_m_e - (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is also - accepted; the _s_u_b_s_c_r_i_p_t is ignored. Attributes may be specified for an - array variable using the ddeeccllaarree and rreeaaddoonnllyy builtins. Each attribute - applies to all members of an array. + BBaasshh provides one-dimensional indexed and associative array variables. + Any variable may be used as an indexed array; the ddeeccllaarree builtin will + explicitly declare an array. There is no maximum limit on the size of + an array, nor any requirement that members be indexed or assigned con- + tiguously. Indexed arrays are referenced using integers (including + arithmetic expressions) and are zero-based; associative arrays are + referenced using arbitrary strings. + + An indexed array is created automatically if any variable is assigned + to using the syntax _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e. The _s_u_b_s_c_r_i_p_t is treated as + an arithmetic expression that must evaluate to a number greater than or + equal to zero. To explicitly declare an indexed array, use ddeeccllaarree --aa + _n_a_m_e (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). ddeeccllaarree --aa _n_a_m_e[[_s_u_b_s_c_r_i_p_t]] is + also accepted; the _s_u_b_s_c_r_i_p_t is ignored. + + Associative arrays are created using ddeeccllaarree --AA _n_a_m_e. + + Attributes may be specified for an array variable using the ddeeccllaarree and + rreeaaddoonnllyy builtins. Each attribute applies to all members of an array. Arrays are assigned to using compound assignments of the form _n_a_m_e=((value_1 ... value_n)), where each _v_a_l_u_e is of the form [_s_u_b_- - _s_c_r_i_p_t]=_s_t_r_i_n_g. Only _s_t_r_i_n_g is required. If the optional brackets and - subscript are supplied, that index is assigned to; otherwise the index - of the element assigned is the last index assigned to by the statement - plus one. Indexing starts at zero. This syntax is also accepted by - the ddeeccllaarree builtin. Individual array elements may be assigned to - using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax introduced above. - - Any element of an array may be referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. + _s_c_r_i_p_t]=_s_t_r_i_n_g. Indexed array assignments do not require the bracket + and subscript. When assigning to indexed arrays, if the optional + brackets and subscript are supplied, that index is assigned to; other- + wise the index of the element assigned is the last index assigned to by + the statement plus one. Indexing starts at zero. + + When assigning to an associative array, the subscript is required. + + This syntax is also accepted by the ddeeccllaarree builtin. Individual array + elements may be assigned to using the _n_a_m_e[_s_u_b_s_c_r_i_p_t]=_v_a_l_u_e syntax + introduced above. + + Any element of an array may be referenced using ${_n_a_m_e[_s_u_b_s_c_r_i_p_t]}. The braces are required to avoid conflicts with pathname expansion. If - _s_u_b_s_c_r_i_p_t is @@ or **, the word expands to all members of _n_a_m_e. These - subscripts differ only when the word appears within double quotes. If + _s_u_b_s_c_r_i_p_t is @@ or **, the word expands to all members of _n_a_m_e. These + subscripts differ only when the word appears within double quotes. If the word is double-quoted, ${_n_a_m_e[*]} expands to a single word with the - value of each array member separated by the first character of the IIFFSS + value of each array member separated by the first character of the IIFFSS special variable, and ${_n_a_m_e[@]} expands each element of _n_a_m_e to a sep- - arate word. When there are no array members, ${_n_a_m_e[@]} expands to - nothing. If the double-quoted expansion occurs within a word, the - expansion of the first parameter is joined with the beginning part of - the original word, and the expansion of the last parameter is joined - with the last part of the original word. This is analogous to the - expansion of the special parameters ** and @@ (see SSppeecciiaall PPaarraammeetteerrss - above). ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_- - _s_c_r_i_p_t]}. If _s_u_b_s_c_r_i_p_t is ** or @@, the expansion is the number of ele- - ments in the array. Referencing an array variable without a subscript - is equivalent to referencing element zero. - - The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] - destroys the array element at index _s_u_b_s_c_r_i_p_t. Care must be taken to + arate word. When there are no array members, ${_n_a_m_e[@]} expands to + nothing. If the double-quoted expansion occurs within a word, the + expansion of the first parameter is joined with the beginning part of + the original word, and the expansion of the last parameter is joined + with the last part of the original word. This is analogous to the + expansion of the special parameters ** and @@ (see SSppeecciiaall PPaarraammeetteerrss + above). ${#_n_a_m_e[_s_u_b_s_c_r_i_p_t]} expands to the length of ${_n_a_m_e[_s_u_b_- + _s_c_r_i_p_t]}. If _s_u_b_s_c_r_i_p_t is ** or @@, the expansion is the number of ele- + ments in the array. Referencing an array variable without a subscript + is equivalent to referencing the array with a subscript of 0. + + The uunnsseett builtin is used to destroy arrays. uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t] + destroys the array element at index _s_u_b_s_c_r_i_p_t. Care must be taken to avoid unwanted side effects caused by filename generation. uunnsseett _n_a_m_e, - where _n_a_m_e is an array, or uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t], where _s_u_b_s_c_r_i_p_t is ** + where _n_a_m_e is an array, or uunnsseett _n_a_m_e[_s_u_b_s_c_r_i_p_t], where _s_u_b_s_c_r_i_p_t is ** or @@, removes the entire array. - The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to - specify an array. The rreeaadd builtin accepts a --aa option to assign a - list of words read from the standard input to an array. The sseett and - ddeeccllaarree builtins display array values in a way that allows them to be - reused as assignments. + The ddeeccllaarree, llooccaall, and rreeaaddoonnllyy builtins each accept a --aa option to + specify an indexed array and a --AA option to specify an associative + array. The rreeaadd builtin accepts a --aa option to assign a list of words + read from the standard input to an array. The sseett and ddeeccllaarree builtins + display array values in a way that allows them to be reused as assign- + ments. EEXXPPAANNSSIIOONN Expansion is performed on the command line after it has been split into @@ -1370,16 +1398,17 @@ EEXXPPAANNSSIIOONN If _o_f_f_s_e_t evaluates to a number less than zero, the value is used as an offset from the end of the value of _p_a_r_a_m_e_t_e_r. If _p_a_r_a_m_e_t_e_r is @@, the result is _l_e_n_g_t_h positional parameters - beginning at _o_f_f_s_e_t. If _p_a_r_a_m_e_t_e_r is an array name indexed by @ - or *, the result is the _l_e_n_g_t_h members of the array beginning - with ${_p_a_r_a_m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is taken relative - to one greater than the maximum index of the specified array. - Note that a negative offset must be separated from the colon by - at least one space to avoid being confused with the :- expan- - sion. Substring indexing is zero-based unless the positional - parameters are used, in which case the indexing starts at 1 by - default. If _o_f_f_s_e_t is 0, and the positional parameters are - used, $$00 is prefixed to the list. + beginning at _o_f_f_s_e_t. If _p_a_r_a_m_e_t_e_r is an indexed array name sub- + scripted by @ or *, the result is the _l_e_n_g_t_h members of the + array beginning with ${_p_a_r_a_m_e_t_e_r[_o_f_f_s_e_t]}. A negative _o_f_f_s_e_t is + taken relative to one greater than the maximum index of the + specified array. Substring expansion applied to an associative + array produces undefined results. Note that a negative offset + must be separated from the colon by at least one space to avoid + being confused with the :- expansion. Substring indexing is + zero-based unless the positional parameters are used, in which + case the indexing starts at 1 by default. If _o_f_f_s_e_t is 0, and + the positional parameters are used, $$00 is prefixed to the list. ${!!_p_r_e_f_i_x**} ${!!_p_r_e_f_i_x@@} @@ -1448,6 +1477,25 @@ EEXXPPAANNSSIIOONN each member of the array in turn, and the expansion is the resultant list. + ${_p_a_r_a_m_e_t_e_r^^_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r^^^^_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r,,_p_a_t_t_e_r_n} + ${_p_a_r_a_m_e_t_e_r,,,,_p_a_t_t_e_r_n} + This expansion modifies the case of alphabetic characters in + _p_a_r_a_m_e_t_e_r. The _p_a_t_t_e_r_n is expanded to produce a pattern just as + in pathname expansion. The ^^ operator converts lowercase let- + ters matching _p_a_t_t_e_r_n to uppercase; the ,, operator converts + matching uppercase letters to lowercase. The ^^^^ and ,,,, expan- + sions convert each matched character in the expanded value; the + ^^ and ,, expansions match and convert only the first character. + If _p_a_t_t_e_r_n is omitted, it is treated like a ??, which matches + every character. If _p_a_r_a_m_e_t_e_r is @@ or **, the case modification + operation is applied to each positional parameter in turn, and + the expansion is the resultant list. If _p_a_r_a_m_e_t_e_r is an array + variable subscripted with @@ or **, the case modification opera- + tion is applied to each member of the array in turn, and the + expansion is the resultant list. + CCoommmmaanndd SSuubbssttiittuuttiioonn _C_o_m_m_a_n_d _s_u_b_s_t_i_t_u_t_i_o_n allows the output of a command to replace the com- mand name. There are two forms: @@ -1458,160 +1506,160 @@ EEXXPPAANNSSIIOONN ``_c_o_m_m_a_n_d`` BBaasshh performs the expansion by executing _c_o_m_m_a_n_d and replacing the com- - mand substitution with the standard output of the command, with any + mand substitution with the standard output of the command, with any trailing newlines deleted. Embedded newlines are not deleted, but they - may be removed during word splitting. The command substitution $$((ccaatt + may be removed during word splitting. The command substitution $$((ccaatt _f_i_l_e)) can be replaced by the equivalent but faster $$((<< _f_i_l_e)). - When the old-style backquote form of substitution is used, backslash - retains its literal meaning except when followed by $$, ``, or \\. The + When the old-style backquote form of substitution is used, backslash + retains its literal meaning except when followed by $$, ``, or \\. The first backquote not preceded by a backslash terminates the command sub- - stitution. When using the $(_c_o_m_m_a_n_d) form, all characters between the + stitution. When using the $(_c_o_m_m_a_n_d) form, all characters between the parentheses make up the command; none are treated specially. Command substitutions may be nested. To nest when using the backquoted form, escape the inner backquotes with backslashes. - If the substitution appears within double quotes, word splitting and + If the substitution appears within double quotes, word splitting and pathname expansion are not performed on the results. AArriitthhmmeettiicc EExxppaannssiioonn - Arithmetic expansion allows the evaluation of an arithmetic expression - and the substitution of the result. The format for arithmetic expan- + Arithmetic expansion allows the evaluation of an arithmetic expression + and the substitution of the result. The format for arithmetic expan- sion is: $$((((_e_x_p_r_e_s_s_i_o_n)))) - The _e_x_p_r_e_s_s_i_o_n is treated as if it were within double quotes, but a - double quote inside the parentheses is not treated specially. All + The _e_x_p_r_e_s_s_i_o_n is treated as if it were within double quotes, but a + double quote inside the parentheses is not treated specially. All tokens in the expression undergo parameter expansion, string expansion, - command substitution, and quote removal. Arithmetic expansions may be + command substitution, and quote removal. Arithmetic expansions may be nested. - The evaluation is performed according to the rules listed below under + The evaluation is performed according to the rules listed below under AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN. If _e_x_p_r_e_s_s_i_o_n is invalid, bbaasshh prints a message indicating failure and no substitution occurs. PPrroocceessss SSuubbssttiittuuttiioonn - _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n is supported on systems that support named pipes - (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. It takes the form - of <<((_l_i_s_t)) or >>((_l_i_s_t)). The process _l_i_s_t is run with its input or out- + _P_r_o_c_e_s_s _s_u_b_s_t_i_t_u_t_i_o_n is supported on systems that support named pipes + (_F_I_F_O_s) or the //ddeevv//ffdd method of naming open files. It takes the form + of <<((_l_i_s_t)) or >>((_l_i_s_t)). The process _l_i_s_t is run with its input or out- put connected to a _F_I_F_O or some file in //ddeevv//ffdd. The name of this file - is passed as an argument to the current command as the result of the - expansion. If the >>((_l_i_s_t)) form is used, writing to the file will pro- - vide input for _l_i_s_t. If the <<((_l_i_s_t)) form is used, the file passed as + is passed as an argument to the current command as the result of the + expansion. If the >>((_l_i_s_t)) form is used, writing to the file will pro- + vide input for _l_i_s_t. If the <<((_l_i_s_t)) form is used, the file passed as an argument should be read to obtain the output of _l_i_s_t. - When available, process substitution is performed simultaneously with - parameter and variable expansion, command substitution, and arithmetic + When available, process substitution is performed simultaneously with + parameter and variable expansion, command substitution, and arithmetic expansion. WWoorrdd SSpplliittttiinngg - The shell scans the results of parameter expansion, command substitu- - tion, and arithmetic expansion that did not occur within double quotes + The shell scans the results of parameter expansion, command substitu- + tion, and arithmetic expansion that did not occur within double quotes for _w_o_r_d _s_p_l_i_t_t_i_n_g. - The shell treats each character of IIFFSS as a delimiter, and splits the + The shell treats each character of IIFFSS as a delimiter, and splits the results of the other expansions into words on these characters. If IIFFSS - is unset, or its value is exactly <><><>, the default, - then sequences of <>, <>, and <> at the beginning and - end of the results of the previous expansions are ignored, and any - sequence of IIFFSS characters not at the beginning or end serves to - delimit words. If IIFFSS has a value other than the default, then + is unset, or its value is exactly <><><>, the default, + then sequences of <>, <>, and <> at the beginning and + end of the results of the previous expansions are ignored, and any + sequence of IIFFSS characters not at the beginning or end serves to + delimit words. If IIFFSS has a value other than the default, then sequences of the whitespace characters ssppaaccee and ttaabb are ignored at the - beginning and end of the word, as long as the whitespace character is - in the value of IIFFSS (an IIFFSS whitespace character). Any character in - IIFFSS that is not IIFFSS whitespace, along with any adjacent IIFFSS whitespace - characters, delimits a field. A sequence of IIFFSS whitespace characters - is also treated as a delimiter. If the value of IIFFSS is null, no word + beginning and end of the word, as long as the whitespace character is + in the value of IIFFSS (an IIFFSS whitespace character). Any character in + IIFFSS that is not IIFFSS whitespace, along with any adjacent IIFFSS whitespace + characters, delimits a field. A sequence of IIFFSS whitespace characters + is also treated as a delimiter. If the value of IIFFSS is null, no word splitting occurs. - Explicit null arguments ("""" or '''') are retained. Unquoted implicit + Explicit null arguments ("""" or '''') are retained. Unquoted implicit null arguments, resulting from the expansion of parameters that have no - values, are removed. If a parameter with no value is expanded within + values, are removed. If a parameter with no value is expanded within double quotes, a null argument results and is retained. Note that if no expansion occurs, no splitting is performed. PPaatthhnnaammee EExxppaannssiioonn - After word splitting, unless the --ff option has been set, bbaasshh scans - each word for the characters **, ??, and [[. If one of these characters - appears, then the word is regarded as a _p_a_t_t_e_r_n, and replaced with an - alphabetically sorted list of file names matching the pattern. If no - matching file names are found, and the shell option nnuullllgglloobb is dis- - abled, the word is left unchanged. If the nnuullllgglloobb option is set, and - no matches are found, the word is removed. If the ffaaiillgglloobb shell - option is set, and no matches are found, an error message is printed - and the command is not executed. If the shell option nnooccaasseegglloobb is - enabled, the match is performed without regard to the case of alpha- - betic characters. When a pattern is used for pathname expansion, the - character ````..'''' at the start of a name or immediately following a - slash must be matched explicitly, unless the shell option ddoottgglloobb is - set. When matching a pathname, the slash character must always be - matched explicitly. In other cases, the ````..'''' character is not - treated specially. See the description of sshhoopptt below under SSHHEELLLL - BBUUIILLTTIINN CCOOMMMMAANNDDSS for a description of the nnooccaasseegglloobb, nnuullllgglloobb, ffaaiill-- + After word splitting, unless the --ff option has been set, bbaasshh scans + each word for the characters **, ??, and [[. If one of these characters + appears, then the word is regarded as a _p_a_t_t_e_r_n, and replaced with an + alphabetically sorted list of file names matching the pattern. If no + matching file names are found, and the shell option nnuullllgglloobb is dis- + abled, the word is left unchanged. If the nnuullllgglloobb option is set, and + no matches are found, the word is removed. If the ffaaiillgglloobb shell + option is set, and no matches are found, an error message is printed + and the command is not executed. If the shell option nnooccaasseegglloobb is + enabled, the match is performed without regard to the case of alpha- + betic characters. When a pattern is used for pathname expansion, the + character ````..'''' at the start of a name or immediately following a + slash must be matched explicitly, unless the shell option ddoottgglloobb is + set. When matching a pathname, the slash character must always be + matched explicitly. In other cases, the ````..'''' character is not + treated specially. See the description of sshhoopptt below under SSHHEELLLL + BBUUIILLTTIINN CCOOMMMMAANNDDSS for a description of the nnooccaasseegglloobb, nnuullllgglloobb, ffaaiill-- gglloobb, and ddoottgglloobb shell options. - The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file - names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file - name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed + The GGLLOOBBIIGGNNOORREE shell variable may be used to restrict the set of file + names matching a _p_a_t_t_e_r_n. If GGLLOOBBIIGGNNOORREE is set, each matching file + name that also matches one of the patterns in GGLLOOBBIIGGNNOORREE is removed from the list of matches. The file names ````..'''' and ````....'''' are always - ignored when GGLLOOBBIIGGNNOORREE is set and not null. However, setting GGLLOOBBIIGG-- - NNOORREE to a non-null value has the effect of enabling the ddoottgglloobb shell + ignored when GGLLOOBBIIGGNNOORREE is set and not null. However, setting GGLLOOBBIIGG-- + NNOORREE to a non-null value has the effect of enabling the ddoottgglloobb shell option, so all other file names beginning with a ````..'''' will match. To - get the old behavior of ignoring file names beginning with a ````..'''', - make ````..**'''' one of the patterns in GGLLOOBBIIGGNNOORREE. The ddoottgglloobb option is + get the old behavior of ignoring file names beginning with a ````..'''', + make ````..**'''' one of the patterns in GGLLOOBBIIGGNNOORREE. The ddoottgglloobb option is disabled when GGLLOOBBIIGGNNOORREE is unset. PPaatttteerrnn MMaattcchhiinngg Any character that appears in a pattern, other than the special pattern - characters described below, matches itself. The NUL character may not - occur in a pattern. A backslash escapes the following character; the - escaping backslash is discarded when matching. The special pattern + characters described below, matches itself. The NUL character may not + occur in a pattern. A backslash escapes the following character; the + escaping backslash is discarded when matching. The special pattern characters must be quoted if they are to be matched literally. The special pattern characters have the following meanings: - ** Matches any string, including the null string. When the gglloobb-- + ** 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 + 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 + 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: @@ -1629,48 +1677,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. @@ -1680,22 +1728,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: @@ -1703,27 +1751,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: @@ -1732,11 +1780,11 @@ RREEDDIIRREECCTTIIOONN RReeddiirreeccttiinngg 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 redirected to the + 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 @@ -1750,8 +1798,8 @@ RREEDDIIRREECCTTIIOONN AAppppeennddiinngg SSttaannddaarrdd OOuuttppuutt aanndd SSttaannddaarrdd EErrrroorr - This construct allows both the standard output (file descriptor 1) and - the standard error output (file descriptor 2) to be appended to the + This construct allows both the standard output (file descriptor 1) and + the standard error output (file descriptor 2) to be appended to the file whose name is the expansion of _w_o_r_d. The format for appending standard output and standard error is: @@ -1763,9 +1811,9 @@ RREEDDIIRREECCTTIIOONN >>>>_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: @@ -1774,18 +1822,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 @@ -1801,20 +1849,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. @@ -1823,7 +1871,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. @@ -1831,7 +1879,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 @@ -1839,108 +1887,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---- @@ -1968,39 +2016,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- @@ -2047,20 +2095,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. @@ -2076,115 +2124,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 + 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 + 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 + 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 @@ -2192,201 +2240,202 @@ 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- - 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 - job. + 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 %%--. If there is only + a single job, %%++ and %%-- can both be used to refer to that job. In out- + put pertaining to jobs (e.g., the output of the jjoobbss command), the cur- + rent job 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 @@ -2439,7 +2488,7 @@ PPRROOMMPPTTIINNGG \\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 - with a tilde + with a tilde (uses the $$PPRROOMMPPTT__DDIIRRTTRRIIMM variable) \\WW the basename of the current working directory, with $$HHOOMMEE abbreviated with a tilde \\!! the history number of this command @@ -3789,8 +3838,8 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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] ...] + ddeeccllaarree [--aaAAffFFiirrttxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] + ttyyppeesseett [--aaAAffFFiirrttxx] [--pp] [_n_a_m_e[=_v_a_l_u_e] ...] Declare variables and/or give them attributes. If no _n_a_m_es are given then display the values of variables. The --pp option will display the attributes and values of each _n_a_m_e. When --pp is used @@ -3807,7 +3856,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS played as well. The --FF option implies --ff. The following options can be used to restrict output to variables with the specified attribute or to give variables attributes: - --aa Each _n_a_m_e is an array variable (see AArrrraayyss above). + --aa Each _n_a_m_e is an indexed array variable (see AArrrraayyss + above). + --AA Each _n_a_m_e is an associative array variable (see AArrrraayyss + above). --ff Use function names only. --ii The variable is treated as an integer; arithmetic evalua- tion (see AARRIITTHHMMEETTIICC EEVVAALLUUAATTIIOONN )) is performed when the @@ -4181,126 +4233,126 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 + mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k] + [--cc _q_u_a_n_t_u_m] [_a_r_r_a_y] + Read lines from the standard input into array variable _a_r_r_a_y, or + from file descriptor _f_d if the --uu option is supplied. The vari- + able MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if supplied, have + the following 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 + --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- + --uu Read lines from file descriptor _f_d instead of the stan- dard input. - --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The + --CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The --cc option specifies _q_u_a_n_t_u_m. - --cc Specify the number of lines read between each call to + --cc Specify the number of lines read between each call to _c_a_l_l_b_a_c_k. If --CC is specified without --cc, the default quantum is 5000. - If not supplied with an explicit origin, mmaappffiillee will clear + 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 + 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 + Removes entries from the directory stack. With no arguments, + removes the top directory from the stack, and performs a ccdd to the new top directory. Arguments, if supplied, have the follow- ing meanings: - --nn Suppresses the normal change of directory when removing - directories from the stack, so that only the stack is + --nn Suppresses the normal change of directory when removing + directories from the stack, so that only the stack is manipulated. - ++_n Removes the _nth entry counting from the left of the list - shown by ddiirrss, starting with zero. For example: ``popd + ++_n Removes the _nth entry counting from the left of the list + shown by ddiirrss, starting with zero. For example: ``popd +0'' removes the first directory, ``popd +1'' the second. --_n Removes the _nth entry counting from the right of the list - shown by ddiirrss, starting with zero. For example: ``popd - -0'' removes the last directory, ``popd -1'' the next to + shown by ddiirrss, starting with zero. For example: ``popd + -0'' removes the last directory, ``popd -1'' the next to last. - If the ppooppdd command is successful, a ddiirrss is performed as well, - and the return status is 0. ppooppdd returns false if an invalid + If the ppooppdd command is successful, a ddiirrss is performed as well, + and the return status is 0. ppooppdd returns false if an invalid option is encountered, the directory stack is empty, a non-exis- tent directory stack entry is specified, or the directory change fails. pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s] - Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the - control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which - contains three types of objects: plain characters, which are - simply copied to standard output, character escape sequences, - which are converted and copied to the standard output, and for- - mat specifications, each of which causes printing of the next + Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the + control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which + contains three types of objects: plain characters, which are + simply copied to standard output, character escape sequences, + which are converted and copied to the standard output, and for- + mat specifications, each of which causes printing of the next successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(1) for- - mats, %%bb causes pprriinnttff to expand backslash escape sequences in - the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output, + mats, %%bb causes pprriinnttff to expand backslash escape sequences in + the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output, backslashes in \\'', \\"", and \\?? are not removed, and octal escapes - beginning with \\00 may contain up to four digits), and %%qq causes + beginning with \\00 may contain up to four digits), and %%qq causes pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a format that can be reused as shell input. - The --vv option causes the output to be assigned to the variable + The --vv option causes the output to be assigned to the variable _v_a_r rather than being printed to the standard output. - The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- + The _f_o_r_m_a_t is reused as necessary to consume all of the _a_r_g_u_- _m_e_n_t_s. If the _f_o_r_m_a_t requires more _a_r_g_u_m_e_n_t_s than are supplied, - the extra format specifications behave as if a zero value or - null string, as appropriate, had been supplied. The return + the extra format specifications behave as if a zero value or + null string, as appropriate, had been supplied. The return value is zero on success, non-zero on failure. ppuusshhdd [--nn] [+_n] [-_n] ppuusshhdd [--nn] [_d_i_r] - Adds a directory to the top of the directory stack, or rotates - the stack, making the new top of the stack the current working + Adds a directory to the top of the directory stack, or rotates + the stack, making the new top of the stack the current working directory. With no arguments, exchanges the top two directories - and returns 0, unless the directory stack is empty. Arguments, + and returns 0, unless the directory stack is empty. Arguments, if supplied, have the following meanings: - --nn Suppresses the normal change of directory when adding - directories to the stack, so that only the stack is + --nn Suppresses the normal change of directory when adding + directories to the stack, so that only the stack is manipulated. - ++_n Rotates the stack so that the _nth directory (counting - from the left of the list shown by ddiirrss, starting with + ++_n Rotates the stack so that the _nth directory (counting + from the left of the list shown by ddiirrss, starting with zero) is at the top. - --_n Rotates the stack so that the _nth directory (counting - from the right of the list shown by ddiirrss, starting with + --_n Rotates the stack so that the _nth directory (counting + from the right of the list shown by ddiirrss, starting with zero) is at the top. _d_i_r Adds _d_i_r to the directory stack at the top, making it the new current working directory. If the ppuusshhdd command is successful, a ddiirrss is performed as well. - If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r - fails. With the second form, ppuusshhdd returns 0 unless the direc- - tory stack is empty, a non-existent directory stack element is - specified, or the directory change to the specified new current + If the first form is used, ppuusshhdd returns 0 unless the cd to _d_i_r + fails. With the second form, ppuusshhdd returns 0 unless the direc- + tory stack is empty, a non-existent directory stack element is + specified, or the directory change to the specified new current directory fails. ppwwdd [--LLPP] - Print the absolute pathname of the current working directory. + Print the absolute pathname of the current working directory. The pathname printed contains no symbolic links if the --PP option is supplied or the --oo pphhyyssiiccaall option to the sseett builtin command - is enabled. If the --LL option is used, the pathname printed may - contain symbolic links. The return status is 0 unless an error - occurs while reading the name of the current directory or an + is enabled. If the --LL option is used, the pathname printed may + contain symbolic links. The return status is 0 unless an error + occurs while reading the name of the current directory or an invalid option is supplied. - rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [-- _t_e_x_t] [--nn _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt + rreeaadd [--eerrss] [--aa _a_n_a_m_e] [--dd _d_e_l_i_m] [-- _t_e_x_t] [--nn _n_c_h_a_r_s] [--pp _p_r_o_m_p_t] [--tt _t_i_m_e_o_u_t] [--uu _f_d] [_n_a_m_e ...] - One line is read from the standard input, or from the file - descriptor _f_d supplied as an argument to the --uu option, and the + One line is read from the standard input, or from the file + descriptor _f_d supplied as an argument to the --uu option, and the first word is assigned to the first _n_a_m_e, the second word to the - second _n_a_m_e, and so on, with leftover words and their interven- - ing separators assigned to the last _n_a_m_e. If there are fewer + second _n_a_m_e, and so on, with leftover words and their interven- + ing separators assigned to the last _n_a_m_e. If there are fewer words read from the input stream than names, the remaining names - are assigned empty values. The characters in IIFFSS are used to - split the line into words. The backslash character (\\) may be - used to remove any special meaning for the next character read - and for line continuation. Options, if supplied, have the fol- + are assigned empty values. The characters in IIFFSS are used to + split the line into words. The backslash character (\\) may be + used to remove any special meaning for the next character read + and for line continuation. Options, if supplied, have the fol- lowing meanings: --aa _a_n_a_m_e The words are assigned to sequential indices of the array @@ -4308,52 +4360,56 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS new values are assigned. Other _n_a_m_e arguments are ignored. --dd _d_e_l_i_m - The first character of _d_e_l_i_m is used to terminate the + The first character of _d_e_l_i_m is used to terminate the input line, rather than newline. --ee If the standard input is coming from a terminal, rreeaaddlliinnee (see RREEAADDLLIINNEE above) is used to obtain the line. --ii _t_e_x_t - If rreeaaddlliinnee is being used to read the line, _t_e_x_t is + If rreeaaddlliinnee is being used to read the line, _t_e_x_t is placed into the editing buffer before editing begins. --nn _n_c_h_a_r_s - rreeaadd returns after reading _n_c_h_a_r_s characters rather than + rreeaadd returns after reading _n_c_h_a_r_s characters rather than waiting for a complete line of input. --pp _p_r_o_m_p_t Display _p_r_o_m_p_t on standard error, without a trailing new- line, before attempting to read any input. The prompt is displayed only if input is coming from a terminal. --rr Backslash does not act as an escape character. The back- - slash is considered to be part of the line. In particu- - lar, a backslash-newline pair may not be used as a line + slash is considered to be part of the line. In particu- + lar, a backslash-newline pair may not be used as a line continuation. --ss Silent mode. If input is coming from a terminal, charac- ters are not echoed. --tt _t_i_m_e_o_u_t - Cause rreeaadd to time out and return failure if a complete - 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. + 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. _t_i_m_e_- + _o_u_t may be a decimal number with a fractional portion + following the decimal point. This option is only effec- + tive if rreeaadd is reading input from a terminal, pipe, or + other special file; it has no effect when reading from + regular files. The exit status is greater than 128 if + the timeout is exceeded. --uu _f_d Read input from file descriptor _f_d. If no _n_a_m_e_s are supplied, the line read is assigned to the vari- - able RREEPPLLYY. The return code is zero, unless end-of-file is - encountered, rreeaadd times out, or an invalid file descriptor is + able RREEPPLLYY. The return code is zero, unless end-of-file is + encountered, rreeaadd times out, or an invalid file descriptor is supplied as the argument to --uu. - rreeaaddoonnllyy [--aappff] [_n_a_m_e[=_w_o_r_d] ...] - The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s - may not be changed by subsequent assignment. If the --ff option - is supplied, the functions corresponding to the _n_a_m_e_s are so - marked. The --aa option restricts the variables to arrays. If no - _n_a_m_e arguments are given, or if the --pp option is supplied, a - list of all readonly names is printed. The --pp option causes - output to be displayed in a format that may be reused as input. - If a variable name is followed by =_w_o_r_d, the value of the vari- - able is set to _w_o_r_d. The return status is 0 unless an invalid - option is encountered, one of the _n_a_m_e_s is not a valid shell - variable name, or --ff is supplied with a _n_a_m_e that is not a func- - tion. + rreeaaddoonnllyy [--aaAAppff] [_n_a_m_e[=_w_o_r_d] ...] + The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s + may not be changed by subsequent assignment. If the --ff option + is supplied, the functions corresponding to the _n_a_m_e_s are so + marked. The --aa option restricts the variables to indexed + arrays; the --AA option restricts the variables to associative + arrays. If no _n_a_m_e arguments are given, or if the --pp option is + supplied, a list of all readonly names is printed. The --pp + option causes output to be displayed in a format that may be + reused as input. If a variable name is followed by =_w_o_r_d, the + value of the variable is set to _w_o_r_d. The return status is 0 + unless an invalid option is encountered, one of the _n_a_m_e_s is not + a valid shell variable name, or --ff is supplied with a _n_a_m_e that + is not a function. rreettuurrnn [_n] Causes a function to exit with the return value specified by _n. @@ -4745,10 +4801,10 @@ SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS 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 - shell is a login shell and --ff is not supplied, or if job control - is not enabled. + signal. A login shell cannot be suspended; the --ff option can be + used to override this and force the suspension. The return sta- + tus is 0 unless the shell is a login shell and --ff is not sup- + plied, 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 @@ -5088,4 +5144,4 @@ BBUUGGSS -GNU Bash-4.0 2008 May 25 BASH(1) +GNU Bash-4.0 2008 June 29 BASH(1) -- cgit v1.2.1