📄 bash.0
字号:
\\vv vertical tab \\\\ backslash \\'' single quote \\"" double quote \\_n_n_n the eight-bit character whose value is the octal value _n_n_n (one to three digits) \\xx_H_H the eight-bit character whose value is the hexadecimal value _H_H (one or two hex digits) \\uu_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H (one to four hex digits) \\UU_H_H_H_H_H_H_H_H the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value _H_H_H_H_H_H_H_H (one to eight hex digits) \\cc_x a control-_x character The expanded result is single-quoted, as if the dollar sign had not been present. A double-quoted string preceded by a dollar sign ($$"_s_t_r_i_n_g") will cause the string to be translated according to the current locale. If the current locale is CC or PPOOSSIIXX, the dollar sign is ignored. If the string is translated and replaced, the replacement is double-quoted.PPAARRAAMMEETTEERRSS A _p_a_r_a_m_e_t_e_r is an entity that stores values. It can be a _n_a_m_e, a num- ber, or one of the special characters listed below under SSppeecciiaall PPaarraamm-- eetteerrss. A _v_a_r_i_a_b_l_e is a parameter denoted by a _n_a_m_e. A variable has a _v_a_l_u_e and zero or more _a_t_t_r_i_b_u_t_e_s. Attributes are assigned using the ddeeccllaarree builtin command (see ddeeccllaarree below in SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS). A parameter is set if it has been assigned a value. The null string is a valid value. Once a variable is set, it may be unset only by using the uunnsseett builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). A _v_a_r_i_a_b_l_e may be assigned to by a statement of the form _n_a_m_e=[_v_a_l_u_e] If _v_a_l_u_e is not given, the variable is assigned the null string. All _v_a_l_u_e_s undergo tilde expansion, parameter and variable expansion, com- mand substitution, arithmetic expansion, and quote removal (see EEXXPPAANN-- SSIIOONN below). If the variable has its iinntteeggeerr attribute set, then _v_a_l_u_e is evaluated as an arithmetic expression even if the $((...)) expansion is not used (see AArriitthhmmeettiicc EExxppaannssiioonn below). Word splitting is not performed, with the exception of ""$$@@"" as explained below under SSppeecciiaall PPaarraammeetteerrss. Pathname expansion is not performed. Assignment state- ments may also appear as arguments to the aalliiaass, ddeeccllaarree, ttyyppeesseett, eexxppoorrtt, rreeaaddoonnllyy, and llooccaall builtin commands. In the context where an assignment statement is assigning a value to a shell variable or array index, the += operator can be used to append to or add to the variable's previous value. When += is applied to a vari- able for which the _i_n_t_e_g_e_r attribute has been set, _v_a_l_u_e is evaluated as an arithmetic expression and added to the variable's current value, which is also evaluated. When += is applied to an array variable using compound assignment (see AArrrraayyss below), the variable's value is not unset (as it is when using =), and new values are appended to the array beginning at one greater than the array's maximum index (for indexed arrays) or added as additional key-value pairs in an associative array. When applied to a string-valued variable, _v_a_l_u_e is expanded and appended to the 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, 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 replaced when a shell function is executed (see FFUUNNCCTTIIOONNSS below). 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 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- 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 without intervening separators. @@ 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 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- ground pipeline. -- 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- shell. !! 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 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 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 placed in the environment exported to that command. When check- 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. BBAASSHHOOPPTTSS A colon-separated list of enabled shell options. Each word in the list is a valid argument for the --ss option to the sshhoopptt builtin command (see SSHHEELLLL BBUUIILLTTIINN CCOOMMMMAANNDDSS below). The options appearing in BBAASSHHOOPPTTSS are those reported as _o_n by sshhoopptt. If this variable is in the environment when bbaasshh starts up, each shell option in the list will be enabled before reading any startup files. This variable is read-only. BBAASSHHPPIIDD Expands to the process ID of the current bbaasshh process. This differs from $$$$ under certain circumstances, such as subshells 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. Elements 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 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 is pushed onto BBAASSHH__AARRGGCC. The shell sets BBAASSHH__AARRGGCC only when in 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- rent bbaasshh execution call stack. The final parameter of the last subroutine call is at the top of the stack; the first parameter of the initial call is at the bottom. When a subroutine is exe- cuted, the parameters supplied are pushed onto BBAASSHH__AARRGGVV. The shell sets BBAASSHH__AARRGGVV only when in extended debugging mode (see the description of the eexxttddeebbuugg option to the sshhoopptt builtin 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, unless the shell is executing a command as the result of a trap, in which case it is the command executing at the time of the trap. BBAASSHH__EEXXEECCUUTTIIOONN__SSTTRRIINNGG The command argument to the --cc invocation option. BBAASSHH__LLIINNEENNOO An array variable whose members are the line numbers in source files where each corresponding member of FFUUNNCCNNAAMMEE was invoked. $${{BBAASSHH__LLIINNEENNOO[[_$_i]]}} is the line number in the source file ($${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}) where $${{FFUUNNCCNNAAMMEE[[_$_i]]}} was called (or $${{BBAASSHH__LLIINNEENNOO[[_$_i_-_1]]}} if referenced within another shell func- tion). Use LLIINNEENNOO to obtain the current line number. 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 string matching the _nth parenthesized subexpression. This vari- able is read-only. BBAASSHH__SSOOUURRCCEE An array variable whose members are the source filenames where the corresponding shell function names in the FFUUNNCCNNAAMMEE array variable are defined. The shell function $${{FFUUNNCCNNAAMMEE[[_$_i]]}} is defined in the file $${{BBAASSHH__SSOOUURRCCEE[[_$_i]]}} and called from $${{BBAASSHH__SSOOUURRCCEE[[_$_i_+_1]]}}. BBAASSHH__SSUUBBSSHHEELLLL Incremented by one each time a subshell or subshell environment is spawned. The initial value is 0.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -