X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=doc%2Fbash.html;h=bba7db6c084e447c7ffb65757414e6c4a2be78f3;hb=ac50fbac377e32b98d2de396f016ea81e8ee9961;hp=d1b64895c3c7b1b6a1fe114ad22f7ccdafcafb3b;hpb=4539d736f1aff232857a854fd2a68df0c98d9f34;p=platform%2Fupstream%2Fbash.git diff --git a/doc/bash.html b/doc/bash.html index d1b6489..bba7db6 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2010 December 28BASH(1) +BASH(1)2014 February 2BASH(1)

Index @@ -37,12 +37,12 @@ bash - GNU Bourne-Again SHell bash [options] -[file] +[command_string | file]  

COPYRIGHT

-Bash is Copyright © 1989-2010 by the Free Software Foundation, Inc. +Bash is Copyright © 1989-2013 by the Free Software Foundation, Inc.  

DESCRIPTION

@@ -76,17 +76,17 @@ interprets the following options when it is invoked:
-
-c string +
-c
If the -c -option is present, then commands are read from -string. +option is present, then commands are read from the first non-option argument +command_string. If there are arguments after the -string, +command_string, they are assigned to the positional parameters, starting with $0. @@ -275,6 +275,12 @@ This option is on by default if the shell is invoked as
Change the behavior of bash where the default operation differs from the POSIX standard to match the standard (posix mode). +See +SEE ALSO + + +below for a reference to a document that details how posix mode affects +bash's behavior.
--restricted
@@ -376,7 +382,7 @@ If any of the files exist but cannot be read, bash reports an error. -Tildes are expanded in file names as described below under +Tildes are expanded in filenames as described below under Tilde Expansion in the @@ -447,7 +453,7 @@ but the value of the PATH -variable is not used to search for the file name. +variable is not used to search for the filename.

If @@ -544,8 +550,8 @@ The option may be used to inhibit this behavior, and the --rcfile -option may be used to force another file to be read, but -rshd does not generally invoke the shell with those options +option may be used to force another file to be read, but neither +rshd nor sshd generally invoke the shell with those options or allow them to be specified.

@@ -654,7 +660,7 @@ command: -! case do done elif else esac fi for function if in select then until while { } time [[ ]] +! case coproc do done elif else esac fi for function if in select then until while { } time [[ ]]

@@ -708,11 +714,12 @@ command (see below). -If |& is used, the standard error of command is connected to -command2's standard input through the pipe; it is shorthand for -2>&1 |. -This implicit redirection of the standard error is performed after any -redirections specified by the command. +If |& is used, command's standard error, in addition to its +standard output, is connected to +command2's standard input through the pipe; +it is shorthand for 2>&1 |. +This implicit redirection of the standard error to the standard output is +performed after any redirections specified by the command.

The return status of a pipeline is the exit status of the last @@ -869,7 +876,10 @@ executed in the list.

-A compound command is one of the following: +A compound command is one of the following. +In most cases a list in a command's description may be separated from +the rest of the command by one or more newlines, and may be followed by a +newline in place of a semicolon.

(list)
list is executed in a subshell environment (see @@ -907,8 +917,9 @@ Expressions are composed of the primaries described below under Word splitting and pathname expansion are not performed on the words -between the [[ and ]]; tilde expansion, parameter and -variable expansion, arithmetic expansion, command substitution, process +between the [[ and ]]; tilde expansion, +parameter and variable expansion, +arithmetic expansion, command substitution, process substitution, and quote removal are performed. Conditional operators such as -f must be unquoted to be recognized as primaries. @@ -922,7 +933,9 @@ lexicographically using the current locale. When the == and != operators are used, the string to the right of the operator is considered a pattern and matched according -to the rules described below under Pattern Matching. +to the rules described below under Pattern Matching, +as if the extglob shell option were enabled. +The = operator is equivalent to ==. If the shell option nocasematch @@ -930,8 +943,8 @@ is enabled, the match is performed without regard to the case of alphabetic characters. The return value is 0 if the string matches (==) or does not match (!=) the pattern, and 1 otherwise. -Any part of the pattern may be quoted to force it to be matched as a -string. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string.

@@ -948,8 +961,12 @@ If the shell option is enabled, the match is performed without regard to the case of alphabetic characters. -Any part of the pattern may be quoted to force it to be matched as a -string. +Any part of the pattern may be quoted to force the quoted portion +to be matched as a string. +Bracket expressions in regular expressions must be treated carefully, +since normal quoting characters lose their meanings between brackets. +If the pattern is stored in a shell variable, quoting the variable +expansion forces the entire pattern to be matched as a string. Substrings matched by parenthesized subexpressions within the regular expression are saved in the array variable BASH_REMATCH. @@ -1113,7 +1130,7 @@ on a successful match. The exit status is zero if no pattern matches. Otherwise, it is the exit status of the last command executed in list. -

if list; then list; [ elif list; then list; ] ... [ else list; ] fi
+
if list; then list; [ elif list; then list; ] ... [ else list; ] fi
The if @@ -1167,11 +1184,11 @@ The format for a coprocess is:

This creates a coprocess named NAME. -If NAME is not supplied, the default name is COPROC. +If NAME is not supplied, the default name is COPROC. NAME must not be supplied if command is a simple command (see above); otherwise, it is interpreted as the first word of the simple command. -When the coproc is executed, the shell creates an array variable (see +When the coprocess is executed, the shell creates an array variable (see Arrays below) named NAME in the context of the executing shell. @@ -1193,12 +1210,15 @@ command (see below). The file descriptors can be utilized as arguments to shell commands and redirections using standard word expansions. +The file descriptors are not available in subshells. The process ID of the shell spawned to execute the coprocess is available as the value of the variable NAME_PID. The wait builtin command may be used to wait for the coprocess to terminate.

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

Shell Function Definitions

@@ -1224,6 +1244,8 @@ That command is usually a list of commands between { and }, but may be any command listed under Compound Commands above. compound-command is executed whenever name is specified as the name of a simple command. +When in posix mode, name may not be the name of one of the +POSIX special builtins. Any redirections (see REDIRECTION @@ -1560,6 +1582,9 @@ and local builtin commands. +When in posix mode, these builtins may appear in a command after +one or more instances of the command builtin and retain these +assignment statement properties.

In the context where an assignment statement is assigning a value @@ -1578,6 +1603,41 @@ appended to the array beginning at one greater than the array's maximum index associative array. When applied to a string-valued variable, value is expanded and appended to the variable's value. +

+ +A variable can be assigned the nameref attribute using the +-n option to the declare or local builtin commands +(see the descriptions of declare and local below) +to create a nameref, or a reference to another variable. +This allows variables to be manipulated indirectly. +Whenever the nameref variable is referenced or assigned to, the operation +is actually performed on the variable specified by the nameref variable's +value. +A nameref is commonly used within shell functions to refer to a variable +whose name is passed as an argument to the function. +For instance, if a variable name is passed to a shell function as its first +argument, running +

+

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

+inside the function creates a nameref variable ref whose value is +the variable name passed as the first argument. +References and assignments to ref are treated as references and +assignments to the variable whose name was passed as $1. +If the control variable in a for loop has the nameref attribute, +the list of words can be a list of shell variables, and a name reference +will be established for each word in the list, in turn, when the loop is +executed. +Array variables cannot be given the -n attribute. +However, nameref variables can reference array variables and subscripted +array variables. +Namerefs can be unset using the -n option to the unset builtin. +Otherwise, if unset is executed with the name of a nameref variable +as an argument, the variable referenced by the nameref variable will be unset.  

Positional Parameters

@@ -1619,8 +1679,12 @@ 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 single word +Expands to the positional parameters, starting from one. +When the expansion is not within double quotes, each positional parameter +expands to a separate word. +In contexts where it is performed, those words +are subject to further word splitting and pathname expansion. +When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of the IFS @@ -1689,8 +1753,13 @@ subshell.
!
-Expands to the process ID of the most recently executed background -(asynchronous) command. +Expands to the process ID of the job most recently placed into the +background, whether executed as an asynchronous command or using +the bg builtin (see +JOB CONTROL + + +below).
0
@@ -1712,7 +1781,7 @@ option, then 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 +to the filename used to invoke bash, as given by argument zero. @@ -1743,7 +1812,7 @@ The following variables are set by the shell:
BASH
-Expands to the full file name used to invoke this instance of +Expands to the full filename used to invoke this instance of bash.
BASHOPTS @@ -1895,7 +1964,8 @@ The shell function
BASH_SUBSHELL
-Incremented by one each time a subshell or subshell environment is spawned. +Incremented by one within each subshell or subshell environment when +the shell begins executing in that environment. The initial value is 0.
BASH_VERSINFO @@ -1907,7 +1977,6 @@ this instance of The values assigned to the array members are as follows:

-
BASH_VERSINFO[0] @@ -1936,7 +2005,6 @@ The value of MACHTYPE. -
BASH_VERSION @@ -2334,6 +2402,25 @@ below.
+
BASH_COMPAT + +
+The value is used to set the shell's compatibility level. +See the description of the shopt builtin below under +SHELL BUILTIN COMMANDS +for a description of the various compatibility +levels and their effects. +The value may be a decimal number (e.g., 4.2) or an integer (e.g., 42) +corresponding to the desired compatibility level. +If BASH_COMPAT is unset or set to the empty string, the compatibility +level is set to the default for the current version. +If BASH_COMPAT is set to a value that is not one of the valid +compatibility levels, the shell prints an error message and sets the +compatibility level to the default for the current version. +The valid compatibility levels correspond to the compatibility options +accepted by the shopt builtin described below (for example, +compat42 means that 4.2 and 42 are valid values). +The current version is also a valid value.
BASH_ENV
@@ -2347,11 +2434,11 @@ The value of is subjected to parameter expansion, command substitution, and arithmetic -expansion before being interpreted as a file name. +expansion before being interpreted as a filename. PATH -is not used to search for the resultant file name. +is not used to search for the resultant filename.
BASH_XTRACEFD
@@ -2393,11 +2480,23 @@ command. A sample value is ".:~:/usr". +
CHILD_MAX + +
+Set the number of exited child status values for the shell to remember. +Bash will not allow this value to be decreased below a POSIX-mandated +minimum, and there is a maximum value (currently 8192) that this may +not exceed. +The minimum value is system-dependent.
COLUMNS
Used by the select compound command to determine the terminal width -when printing selection lists. Automatically set upon receipt of a +when printing selection lists. +Automatically set if the +checkwinsize + +option is enabled or in an interactive shell upon receipt of a SIGWINCH. @@ -2407,6 +2506,7 @@ when printing selection lists. Automatically set upon receipt of a An array variable from which bash reads the possible completions generated by a shell function invoked by the programmable completion facility (see Programmable Completion below). +Each array element contains one possible completion.
EMACS
@@ -2514,16 +2614,20 @@ The name of the file in which command history is saved (see below). The default value is ~/.bash_history. If unset, the -command history is not saved when an interactive shell exits. +command history is not saved when a shell exits.
HISTFILESIZE
The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if -necessary, 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. +necessary, +to contain no more than that number of lines by removing the oldest entries. +The history file is also truncated to this size after +writing it when a shell exits. +If the value is 0, the history file is truncated to zero size. +Non-numeric values and numeric values less than zero inhibit truncation. +The shell sets the default value to the value of HISTSIZE +after reading any startup files.
HISTIGNORE
@@ -2551,7 +2655,11 @@ The number of commands to remember in the command history (see HISTORY -below). The default value is 500. +below). +If the value is 0, commands are not saved in the history list. +Numeric values less than zero result in every command being saved +on the history list (there is no limit). +The shell sets the default value to 500 after reading any startup files.
HISTTIMEFORMAT
@@ -2690,7 +2798,11 @@ This variable determines the locale category used for number formatting.
Used by the select compound command to determine the column length -for printing selection lists. Automatically set upon receipt of a +for printing selection lists. +Automatically set if the +checkwinsize + +option is enabled or in an interactive shell upon receipt of a SIGWINCH. @@ -2720,9 +2832,9 @@ greater than or equal to zero, the shell disables mail checking.
MAILPATH
-A colon-separated list of file names to be checked for mail. +A colon-separated list of filenames to be checked for mail. The message to be printed when mail arrives in a particular file -may be specified by separating the file name from the message with a `?'. +may be specified by separating the filename from the message with a `?'. When used in the text of the message, $_ expands to the name of the current mailfile. Example: @@ -2779,7 +2891,7 @@ and is set by the administrator who installs bash. A common value is -/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin. +/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin.
POSIXLY_CORRECT @@ -2914,9 +3026,10 @@ The value of p determines whether or not the fraction is included.
If this variable is not set, bash acts as if it had the -value $aq\nreal\t%3lR\nuser\t%3lU\nsys %3lSaq. +value $aq\nreal\t%3lR\nuser\t%3lU\nsys\t%3lSaq. If the value is null, no timing information is displayed. A trailing newline is added when the format string is displayed. +
TMOUT
@@ -2933,11 +3046,12 @@ after seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the -number of seconds to wait for input after issuing the primary prompt. +number of seconds to wait for a line of input after issuing the +primary prompt. Bash -terminates after waiting for that number of seconds if input does -not arrive. +terminates after waiting for that number of seconds if a complete +line of input does not arrive.
TMPDIR
@@ -3016,6 +3130,7 @@ be indexed or assigned contiguously. Indexed arrays are referenced using integers (including arithmetic expressions) and are zero-based; associative arrays are referenced using arbitrary strings. +Unless otherwise noted, indexed array indices must be non-negative integers.

An indexed array is created automatically if any variable is assigned to @@ -3023,12 +3138,6 @@ using the syntax name[subscript]=value. The subscript is treated as an arithmetic expression that must evaluate to a number. -If -subscript - -evaluates to a number less than zero, it is used as -an offset from one greater than the array's maximum index (so a subcript -of -1 refers to the last element of the array). To explicitly declare an indexed array, use declare -a name @@ -3060,7 +3169,7 @@ builtins. Each attribute applies to all members of an array. Arrays are assigned to using compound assignments of the form name=(value1 ... valuen), where each value is of the form [subscript]=string. -Indexed array assignments do not require the bracket and subscript. +Indexed array assignments do not require anything but string. When assigning to indexed arrays, 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 @@ -3075,6 +3184,13 @@ This syntax is also accepted by the builtin. Individual array elements may be assigned to using the name[subscript]=value syntax introduced above. +When assigning to an indexed array, if +name + +is subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +name, so negative indices count back from the end of the +array, and an index of -1 references the last element.

Any element of an array may be referenced using @@ -3105,17 +3221,33 @@ ${name[subscript]}. If subscript is * or @, the expansion is the number of elements in the array. Referencing an array variable without a subscript is equivalent to referencing the array with a subscript of 0. +If the +subscript + +used to reference an element of an indexed array +evaluates to a number less than zero, it is +interpreted as relative to one greater than the maximum index of the array, +so negative indices count back from the end of the +array, and an index of -1 references the last element.

An array variable is considered set if a subscript has been assigned a value. The null string is a valid value.

+It is possible to obtain the keys (indices) of an array as well as the values. +${!name[@]} and ${!name[*]} +expand to the indices assigned in array variable name. +The treatment when in double quotes is similar to the expansion of the +special parameters @ and * within double quotes. +

+ The unset builtin is used to destroy arrays. unset name[subscript] destroys the array element at index subscript. +Negative subscripts to indexed arrays are interpreted as described above. Care must be taken to avoid unwanted side effects caused by pathname expansion. unset name, where name is an array, or @@ -3138,6 +3270,10 @@ option to specify an indexed array and a -A option to specify an associative array. +If both options are supplied, +-A + +takes precedence. The read @@ -3175,15 +3311,19 @@ and

-The order of expansions is: brace expansion, tilde expansion, -parameter, variable and arithmetic expansion and -command substitution -(done in a left-to-right fashion), word splitting, and pathname -expansion. +The order of expansions is: +brace expansion; +tilde expansion, parameter and variable expansion, arithmetic expansion, +and command substitution (done in a left-to-right fashion); +word splitting; +and pathname expansion.

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

Only brace expansion, word splitting, and pathname expansion @@ -3231,12 +3371,14 @@ and incr, an optional increment, is an integer. When integers are supplied, the expression expands to each number between x and y, inclusive. Supplied integers may be prefixed with 0 to force each term to have the -same width. When either x or y begins with a zero, the shell +same width. +When either x or y begins with a zero, the shell attempts to force all generated terms to contain the same number of digits, zero-padding where necessary. When characters are supplied, the expression expands to each character -lexicographically between x and y, inclusive. Note that -both x and y must be of the same type. +lexicographically between x and y, inclusive, +using the default C locale. +Note that both x and y must be of the same type. When the increment is supplied, it is used as the difference between each term. The default increment is 1 or -1 as appropriate.

@@ -3377,7 +3519,7 @@ or the first =. In these cases, tilde expansion is also performed. -Consequently, one may use file names with tildes in assignments to +Consequently, one may use filenames with tildes in assignments to PATH, @@ -3421,18 +3563,20 @@ or when is followed by a character which is not to be interpreted as part of its name. +The parameter is a shell parameter as described above +PARAMETERS) or an array reference (Arrays).

If the first character of parameter is an exclamation point (!), -a level of variable indirection is introduced. +it introduces a level of variable indirection. Bash uses the value of the variable formed from the rest of parameter as the name of the variable; this variable is then expanded and that value is used in the rest of the substitution, rather than the value of parameter itself. This is known as indirect expansion. -The exceptions to this are the expansions of ${!\fPfIprefix*} and +The exceptions to this are the expansions of ${!prefix*} and ${!name[@]} described below. The exclamation point must immediately follow the left brace in order to introduce indirection. @@ -3442,7 +3586,8 @@ In each of the cases below, word is subject to tilde expansion, parameter expansion, command substitution, and arithmetic expansion.

-When not performing substring expansion, using the forms documented below, +When not performing substring expansion, using the forms documented below +(e.g., :-), bash tests for a parameter that is unset or null. Omitting the colon results in a test only for a parameter that is unset.

@@ -3502,33 +3647,50 @@ is substituted.

${parameter:offset:length}
Substring Expansion. -Expands to up to length characters of parameter +Expands to up to length characters of the value of parameter starting at the character specified by offset. -If length is omitted, expands to the substring of -parameter starting at the character specified by offset. +If parameter is @, an indexed array subscripted by +@ or *, or an associative array name, the results differ as +described below. +If length is omitted, expands to the substring of the value of +parameter starting at the character specified by offset +and extending to the end of the value. length and offset are arithmetic expressions (see ARITHMETIC EVALUATION below). +

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

If parameter is @, the result is length positional parameters beginning at offset. +A negative offset is taken relative to one greater than the greatest +positional parameter, so an offset of -1 evaluates to the last positional +parameter. +It is an expansion error if length evaluates to a number less than +zero. +

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

Substring expansion applied to an associative array produces undefined results. -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 offset is 0, and the positional parameters are used, $0 is @@ -3580,6 +3742,13 @@ or @, the value substituted is the number of elements in the array. +If +parameter + +is an indexed array name subscripted by a negative number, that number is +interpreted as relative to one greater than the maximum index of +parameter, so negative indices count back from the end of the +array, and an index of -1 references the last element.

${parameter#word}
${parameter##word}
@@ -3703,6 +3872,9 @@ array in turn, and the expansion is the resultant list. This expansion modifies the case of alphabetic characters in parameter. The pattern is expanded to produce a pattern just as in pathname expansion. +Each character in the expanded value of parameter is tested against +pattern, and, if it matches the pattern, its case is converted. +The pattern should not attempt to match more than one character. The ^ operator converts lowercase letters matching pattern to uppercase; the , operator converts matching uppercase letters to lowercase. @@ -3741,8 +3913,6 @@ array in turn, and the expansion is the resultant list. Command substitution allows the output of a command to replace the command name. There are two forms: -

-

@@ -3808,8 +3978,9 @@ The 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. +All tokens in the expression undergo parameter and variable expansion, +command substitution, and quote removal. +The result is treated as the arithmetic expression to be evaluated. Arithmetic expansions may be nested.

@@ -3868,7 +4039,8 @@ The shell treats each character of as a delimiter, and splits the results of the other -expansions into words on these characters. If +expansions into words using these characters as field terminators. +If IFS @@ -3973,8 +4145,13 @@ regarded as a pattern, and replaced with an alphabetically sorted list of -file names matching the pattern. -If no matching file names are found, +filenames matching the pattern +(see +Pattern Matching + + +below). +If no matching filenames are found, and the shell option nullglob @@ -4033,19 +4210,19 @@ The GLOBIGNORE -shell variable may be used to restrict the set of file names matching a +shell variable may be used to restrict the set of filenames matching a pattern. If GLOBIGNORE -is set, each matching file name that also matches one of the patterns in +is set, each matching filename that also matches one of the patterns in GLOBIGNORE is removed from the list of matches. -The file names +The filenames ``.'' and @@ -4062,11 +4239,11 @@ is set and not null. However, setting to a non-null value has the effect of enabling the dotglob -shell option, so all other file names beginning with a +shell option, so all other filenames beginning with a ``.'' will match. -To get the old behavior of ignoring file names beginning with a +To get the old behavior of ignoring filenames beginning with a ``.'', make @@ -4123,7 +4300,7 @@ Matches any single character. Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a range expression; -any character that sorts between those two characters, inclusive, +any character that falls between those two characters, inclusive, using the current locale's collating sequence and character set, is matched. If the first character following the [ @@ -4136,12 +4313,31 @@ 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 +the current locale and the values of the LC_COLLATE -shell variable, -if set. +or +LC_ALL + + +shell variables, if set. +To obtain the traditional interpretation of range expressions, where +[a-d] + +is equivalent to +[abcd], + +set value of the +LC_ALL + +shell variable to +C, + +or enable the +globasciiranges + +shell option. A - @@ -4257,8 +4453,13 @@ may be redirected 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 +Redirection allows commands' file handles to be +duplicated, opened, closed, +made to refer to different files, +and can change the files the command reads from and writes to. +Redirection may also be used to modify file handles in the +current shell execution environment. +The following redirection operators may precede or appear anywhere within a simple command @@ -4273,7 +4474,8 @@ Each redirection that may be preceded by a file descriptor number may instead be preceded by a word of the form {varname}. In this case, for each redirection operator except >&- and <&-, the shell will allocate a file descriptor greater -than 10 and assign it to varname. If >&- or <&- is preceded +than or equal to 10 and assign it to varname. +If >&- or <&- is preceded by {varname}, the value of varname defines the file descriptor to close.

@@ -4291,9 +4493,10 @@ the redirection refers to the standard output (file descriptor

The word following the redirection operator in the following -descriptions, unless otherwise noted, is subjected to brace expansion, -tilde expansion, parameter expansion, command substitution, arithmetic -expansion, quote removal, pathname expansion, and word splitting. +descriptions, unless otherwise noted, is subjected to +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, quote removal, +pathname expansion, and word splitting. If it expands to more than one word, bash @@ -4359,13 +4562,13 @@ File descriptor 2 is duplicated.

If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open -a TCP connection to the corresponding socket. +the corresponding TCP socket.
/dev/udp/host/port
If host is a valid hostname or Internet address, and port is an integer port number or service name, bash attempts to open -a UDP connection to the corresponding socket. +the corresponding UDP socket.
@@ -4523,6 +4726,10 @@ This is semantically equivalent to

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

Appending Standard Output and Standard Error

@@ -4553,6 +4760,9 @@ This is semantically equivalent to >>word 2>&1 +

+ +(see Duplicating File Descriptors below).  

Here Documents

@@ -4582,8 +4792,8 @@ The format of here-documents is:

-No parameter expansion, command substitution, arithmetic expansion, -or pathname expansion is performed on +No parameter and variable expansion, command substitution, +arithmetic expansion, or pathname expansion is performed on word. If any characters in @@ -4597,9 +4807,9 @@ is the result of quote removal on and the lines in the here-document are not expanded. If word is unquoted, -all lines of the here-document are subjected to parameter expansion, -command substitution, and arithmetic expansion. In the latter -case, the character sequence +all lines of the here-document are subjected to +parameter expansion, command substitution, and arithmetic expansion, +the character sequence \<newline> is ignored, and @@ -4640,8 +4850,12 @@ A variant of here documents, the format is:

-The word is expanded and supplied to the command on its standard -input. +The word undergoes +brace expansion, tilde expansion, parameter and variable expansion, +command substitution, arithmetic expansion, and quote removal. +Pathname expansion and word splitting are not performed. +The result is supplied as a single string to the command on its +standard input.  

Duplicating File Descriptors

@@ -4700,8 +4914,18 @@ If the digits in word do not specify a file descriptor open for output, a redirection error occurs. +If +word + +evaluates to +-, + +file descriptor +n + +is closed. As a special case, if n is omitted, and word does not -expand to one or more digits, the standard output and standard +expand to one or more digits or -, the standard output and standard error are redirected as described previously.  

Moving File Descriptors

@@ -5111,7 +5335,8 @@ Otherwise, numbers take the form [base#]n, where the optional base is a decimal number between 2 and 64 representing the arithmetic base, and n is a number in that base. If base# is omitted, then base 10 is used. -The digits greater than 9 are represented by the lowercase letters, +When specifying n, +the digits greater< than 9 are represented by the lowercase letters, the uppercase letters, @, and _, in that order. If base is less than or equal to 36, lowercase and uppercase letters may be used interchangeably to represent numbers between 10 @@ -5263,6 +5488,13 @@ True if the shell variable varname is set (has been assigned a value). +
-R varname + +
+True if the shell variable +varname + +is set and is a name reference.
-z string
@@ -5283,6 +5515,8 @@ is non-zero. True if the strings are equal. = should be used with the test command for POSIX conformance. +When used with the [[ command, this performs pattern matching as +described above (Compound Commands).
string1 != string2
True if the strings are not equal.
string1 < string2
@@ -5455,7 +5689,6 @@ arguments, if any. The shell has an execution environment, which consists of the following: -
*
open files inherited by the shell at invocation, as modified by @@ -5611,7 +5844,7 @@ When invokes an external command, the variable _ -is set to the full file name of the command and passed to that +is set to the full filename of the command and passed to that command in its environment.  

EXIT STATUS

@@ -6599,6 +6832,13 @@ If set to audible, readline attempts to ring the terminal's bell. If set to On, readline attempts to bind the control characters treated specially by the kernel's terminal driver to their readline equivalents. +
colored-stats (Off) + +
+If set to On, readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the LS_COLORS +environment variable.
comment-begin (``#'')
@@ -6694,8 +6934,12 @@ or next-history.
history-size (0)
-Set the maximum number of history entries saved in the history list. If -set to zero, the number of entries in the history list is not limited. +Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited.
horizontal-scroll-mode (Off)
@@ -6734,6 +6978,20 @@ the value of editing-mode also affects the default keymap. +
keyseq-timeout (500) + +
+Specifies the duration readline will wait for a character when reading an +ambiguous key sequence (one that can form a complete key sequence using +the input read so far, or can take additional input to complete a longer +key sequence). +If no input is received within the timeout, readline will use the shorter +but complete key sequence. +The value is specified in milliseconds, so a value of 1000 means that +readline will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, readline will wait until another key is pressed to +decide which key sequence to complete.
mark-directories (On)
@@ -6808,6 +7066,12 @@ words which have more than one possible completion without any possible partial completion (the possible completions don't share a common prefix) cause the matches to be listed immediately instead of ringing the bell. +
show-mode-in-prompt (Off) + +
+If set to On, add a character to the beginning of the prompt +indicating the editing mode: emacs (@), vi command (:) or vi +insertion (+).
skip-completed-text (Off)
@@ -7122,7 +7386,7 @@ the first call) of each line in turn. Any numeric argument supplied to these successive calls determines the direction to move through the history. A negative argument switches the direction through the history (back or forward). -The history expansion facilities are used to extract the last argument, +The history expansion facilities are used to extract the last word, as if the "!$" history expansion had been specified.
shell-expand-line (M-C-e) @@ -7197,16 +7461,25 @@ and emacs as the editor, in that order.
-
delete-char (C-d) +
end-of-file (usually C-d)
-Delete the character at point. If point is at the -beginning of the line, there are no characters in the line, and -the last character typed was not bound to delete-char, -then return +The character indicating end-of-file as set, for example, by +stty. + +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns EOF. +
delete-char (C-d) + +
+Delete the character at point. +If this function is bound to the +same character as the tty EOF character, as C-d +commonly is, see above for the effects.
backward-delete-char (Rubout)
@@ -7552,6 +7825,11 @@ and store the definition.
Re-execute the last keyboard macro defined, by making the characters in the macro appear as if typed at the keyboard. +
print-last-kbd-macro () + +
+Print the last keyboard macro defined in a format suitable for the +inputrc file.
  @@ -7658,12 +7936,12 @@ will be executed by the shell.
The word before point is treated as a pattern for pathname expansion, with an asterisk implicitly appended. This pattern is used to -generate a list of matching file names for possible completions. +generate a list of matching filenames for possible completions.
glob-expand-word (C-x *)
The word before point is treated as a pattern for pathname expansion, -and the list of matching file names is inserted, replacing the word. +and the list of matching filenames is inserted, replacing the word. If a numeric argument is supplied, an asterisk is appended before pathname expansion.
glob-list-expansions (C-x g) @@ -7818,10 +8096,12 @@ and variables are also set. -When the function or command is invoked, the first argument is the -name of the command whose arguments are being completed, the -second argument is the word being completed, and the third argument -is the word preceding the word being completed on the current command line. +When the function or command is invoked, +the first argument ($1) is the name of the command whose arguments are +being completed, +the second argument ($2) is the word being completed, +and the third argument ($3) is the word preceding the word being +completed on the current command line. No filtering of the generated completions against the word being completed is performed; the function or command has complete freedom in generating the matches. @@ -7834,7 +8114,7 @@ It must put the possible completions in the COMPREPLY -array variable. +array variable, one per array element.

Next, any command specified with the -C option is invoked @@ -7922,7 +8202,7 @@ completion function would load completions dynamically: }
-complete -D -F _completion_loader +complete -D -F _completion_loader -o bashdefault -o default
@@ -7980,6 +8260,8 @@ the number of lines specified by the value of HISTFILESIZE. +If HISTFILESIZE is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated. When the history file is read, lines beginning with the history comment character followed immediately by a digit are interpreted as timestamps for the preceding history line. @@ -7988,7 +8270,7 @@ These timestamps are optionally displayed depending on the value of the variable. -When an interactive shell exits, the last +When a shell with history enabled exits, the last $HISTSIZE @@ -8033,7 +8315,8 @@ lines. If HISTFILESIZE -is not set, no truncation is performed. +is unset, or set to null, a non-numeric value, +or a numeric value less than zero, the history file is not truncated.

The builtin command @@ -8248,7 +8531,7 @@ history list starting with

!?string[?]
-Refer to the most recent command preceding the current postition in the +Refer to the most recent command preceding the current position in the history list containing string. @@ -8319,7 +8602,8 @@ The first argument. That is, word 1.
$
-The last argument. +The last word. This is usually the last argument, but will expand to the +zeroth word if there is only one word in the line.
%
@@ -8367,11 +8651,11 @@ one or more of the following modifiers, each preceded by a `:'.
h
-Remove a trailing file name component, leaving only the head. +Remove a trailing filename component, leaving only the head.
t
-Remove all leading file name components, leaving the tail. +Remove all leading filename components, leaving the tail.
r
@@ -8504,7 +8788,7 @@ executed from If filename -does not contain a slash, file names in +does not contain a slash, filenames in PATH @@ -8570,7 +8854,7 @@ is not present, the shell's notion of the current job is used. returns 0 unless run when job control is disabled or, when run with job control enabled, any specified jobspec was not found or was started without job control. -
bind [-m keymap] [-lpsvPSV]
+
bind [-m keymap] [-lpsvPSVX]
bind [-m keymap] [-q function] [-u function] [-r keyseq]
bind [-m keymap] -f filename
@@ -8685,6 +8969,11 @@ or those new values will be reflected in the editing state. +
-X + +
+List all key sequences bound to shell commands and the associated commands +in a format that can be reused as input.

@@ -8739,22 +9028,26 @@ current frame is frame 0. The return value is 0 unless the shell is not executing a subroutine call or expr does not correspond to a valid position in the call stack. -

cd [-L|[-P [-e]]] [dir]
-Change the current directory to dir. The variable +
cd [-L|[-P [-e]] [-@]] [dir]
+Change the current directory to dir. +if dir is not supplied, the value of the HOME -is the -default -dir. - +shell variable is the default. +Any additional arguments following dir are ignored. The variable CDPATH defines the search path for the directory containing -dir. +dir: + +each directory name in +CDPATH + +is searched for dir. Alternative directory names in CDPATH @@ -8774,8 +9067,9 @@ then is not used. The -P -option says to use the physical directory structure instead of -following symbolic links (see also the +option causes cd to use the physical directory structure +by resolving symbolic links while traversing dir and +before processing instances of .. in dir (see also the -P option to the @@ -8784,7 +9078,11 @@ option to the builtin command); the -L -option forces symbolic links to be followed. +option forces symbolic links to be followed by resolving the link +after processing instances of .. in dir. +If .. appears in dir, it is processed by removing the +immediately previous pathname component from dir, back to a slash +or the beginning of dir. If the -e @@ -8794,13 +9092,16 @@ option is supplied with and the current working directory cannot be successfully determined after a successful directory change, cd will return an unsuccessful status. +On systems that support it, the -@ option presents the extended +attributes associated with a file as a directory. An argument of - -is equivalent to -$OLDPWD. +is converted to +$OLDPWD +before the directory change is attempted. If a non-empty directory name from CDPATH @@ -8846,7 +9147,7 @@ option is supplied, a description of is printed. The -v -option causes a single word indicating the command or file name +option causes a single word indicating the command or filename used to invoke command @@ -8953,6 +9254,11 @@ Tell readline that the compspec generates filenames, so it can perform any filename-specific processing (like adding a slash to directory names, quoting special characters, or suppressing trailing spaces). Intended to be used with shell functions. +
noquote + +
+Tell readline not to quote the completed words if they are filenames +(quoting filenames is the default).
nospace
@@ -9079,6 +9385,12 @@ used as the possible completions.
-F function
The shell function function is executed in the current shell environment. +When the function is executed, +the first argument ($1) is the name of the command whose arguments are +being completed, +the second argument ($2) is the word being completed, +and the third argument ($3) is the word preceding the word being +completed on the current command line. When it finishes, the possible completions are retrieved from the value of the COMPREPLY @@ -9162,9 +9474,9 @@ must be >= 1. If is greater than the number of enclosing loops, the last enclosing loop (the ``top-level'' loop) is resumed. The return value is 0 unless n is not greater than or equal to 1. -
declare [-aAfFgilrtux] [-p] [name[=value] ...]
+
declare [-aAfFgilnrtux] [-p] [name[=value] ...]
-
typeset [-aAfFgilrtux] [-p] [name[=value] ...]
+
typeset [-aAfFgilnrtux] [-p] [name[=value] ...]
Declare variables and/or give them attributes. If no names are given then display the values of variables. @@ -9177,7 +9489,8 @@ option will display the attributes and values of each When -p -is used with name arguments, additional options are ignored. +is used with name arguments, additional options, +other than -f and -F, are ignored. When -p @@ -9244,6 +9557,16 @@ above) is performed when the variable is assigned a value. When the variable is assigned a value, all upper-case characters are converted to lower-case. The upper-case attribute is disabled. +
-n + +
+Give each name the nameref attribute, making +it a name reference to another variable. +That other variable is defined by the value of name. +All references and assignments to name, except for changing the +-n attribute itself, are performed on the variable referenced by +name's value. +The -n attribute cannot be applied to array variables.
-r
@@ -9275,14 +9598,23 @@ turns off the attribute instead, with the exceptions that +a may not be used to destroy an array variable and +r will not remove the readonly attribute. -When used in a function, makes each -name local, as with the +When used in a function, +declare + +and +typeset + +make each +name local, as with the local command, -unless the -gP option is supplied, -If a variable name is followed by =value, the value of +unless the -g option is supplied. +If a variable name is followed by =value, the value of the variable is set to value. +When using -a or -A and the compound assignment syntax to +create array variables, additional attributes do not take effect until +subsequent assignments. The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using @@ -9298,7 +9630,7 @@ an attempt is made to turn off array status for an array variable, or an attempt is made to display a non-existent function with -f. -
dirs [+n] [-n] [-clpv] +
dirs [-clpv] [+n] [-n]
Without options, displays the list of currently remembered directories. @@ -9314,18 +9646,6 @@ command removes entries from the list.
-
+n
-Displays the nth entry counting from the left of the list -shown by -dirs - -when invoked without options, starting with zero. -
-n
-Displays the nth entry counting from the right of the list -shown by -dirs - -when invoked without options, starting with zero.
-c
@@ -9333,8 +9653,8 @@ Clears the directory stack by deleting all of the entries.
-l
-Produces a longer listing; the default listing format uses a -tilde to denote the home directory. +Produces a listing using full pathnames; +the default listing format uses a tilde to denote the home directory.
-p
@@ -9344,6 +9664,18 @@ Print the directory stack with one entry per line.
Print the directory stack with one entry per line, prefixing each entry with its index in the stack. +
+n
+Displays the nth entry counting from the left of the list +shown by +dirs + +when invoked without options, starting with zero. +
-n
+Displays the nth entry counting from the right of the list +shown by +dirs + +when invoked without options, starting with zero.

@@ -9354,15 +9686,15 @@ of the directory stack.

disown [-ar] [-h] [jobspec ...]
-Without options, each +Without options, remove each jobspec -is removed from the table of active jobs. +from the table of active jobs. If jobspec -is not present, and neither -a nor -r is supplied, -the shell's notion of the current job is used. +is not present, and neither the -a nor the -r option +is supplied, the current job is used. If the -h option is given, each jobspec @@ -9377,16 +9709,6 @@ is not sent to the job if the shell receives a If no jobspec -is present, and neither the --a - -nor the --r - -option is supplied, the current job is used. -If no -jobspec - is supplied, the -a @@ -9403,7 +9725,7 @@ The return value is 0 unless a does not specify a valid job.
echo [-neE] [arg ...]
Output the args, separated by spaces, followed by a newline. -The return status is always 0. +The return status is 0 unless a write error occurs. If -n is specified, the trailing newline is suppressed. If the -e option is given, interpretation of the following backslash-escaped characters is enabled. The @@ -9581,14 +9903,16 @@ to be executed with an empty environment. If is supplied, the shell passes name -as the zeroth argument to the executed command. If +as the zeroth argument to the executed command. +If command cannot be executed for some reason, a non-interactive shell exits, -unless the shell option +unless the execfail -is enabled, in which case it returns failure. +shell option +is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed. If command @@ -9633,7 +9957,7 @@ are given, or if the -p option is supplied, a list -of all names that are exported in this shell is printed. +of names of all exported variables is printed. The -n @@ -9656,13 +9980,13 @@ that is not a function.
fc -s [pat=rep] [cmd]
-Fix Command. In the first form, a range of commands from +The first form selects a range of commands from first to last -is selected from the history list. +from the history list and displays or edits and re-executes them. First and @@ -9731,6 +10055,7 @@ echoed and executed.

In the second form, command is re-executed after each instance of pat is replaced by rep. +Command is intepreted the same as first above. A useful alias to use with this is r='fc -s', @@ -9858,7 +10183,7 @@ can report errors in two ways. If the first character of is a colon, silent -error reporting is used. In normal operation diagnostic messages +error reporting is used. In normal operation, diagnostic messages are printed when invalid options or missing option arguments are encountered. If the variable @@ -9936,7 +10261,7 @@ If the option is supplied, no path search is performed, and filename -is used as the full file name of the command. +is used as the full filename of the command. The -r @@ -9990,11 +10315,14 @@ Display the description of each pattern in a manpage-like format

Display only a short usage synopsis for each pattern - + +

The return status is 0 unless no command matches pattern. + +

history [n]
history -c
@@ -10055,11 +10383,11 @@ current bash session.
Read the contents of the history file -and use them as the current history. +and append them to the current history list.
-w
-Write the current history to the history file, overwriting the +Write the current history list to the history file, overwriting the history file's contents.
-p @@ -10126,11 +10454,11 @@ leader.
-r
-Restrict output to running jobs. +Display only running jobs.
-s
-Restrict output to stopped jobs. +Display only stopped jobs.

@@ -10460,10 +10788,13 @@ causes printf to output the corresponding

causes printf to output the date-time string resulting from using -datefmt as a format string for strftime(3). The corresponding -argument is an integer representing the number of seconds since the -epoch. Two special argument values may be used: -1 represents the current +datefmt as a format string for strftime(3). +The corresponding argument is an integer representing the number of +seconds since the epoch. +Two special argument values may be used: -1 represents the current time, and -2 represents the time the shell was invoked. +If no argument is specified, conversion behaves as if -1 had been given. +This is an exception to the usual printf behavior.

@@ -10518,7 +10849,8 @@ Adds dir to the directory stack at the top, making it the -new current working directory. +new current working directory as if it had been supplied as the argument +to the cd builtin.

@@ -10583,7 +10915,8 @@ The characters in IFS -are used to split the line into words. +are used to split the line into words using the same rules the shell +uses for expansion (described above under Word Splitting). The backslash character (\) may be used to remove any special meaning for the next character read and for line continuation. Options, if supplied, have the following meanings: @@ -10666,14 +10999,18 @@ not echoed.

Cause read to time out and return failure if a complete line of -input is not read within timeout seconds. +input (or a specified number of characters) +is not read within timeout seconds. timeout may be a decimal number with a fractional portion following the decimal point. This option is only effective if read is reading input from a terminal, pipe, or other special file; it has no effect when reading from regular files. -If timeout is 0, read returns success if input is available on -the specified file descriptor, failure otherwise. +If read times out, read saves any partial input read into +the specified variable name. +If timeout is 0, read returns immediately, without trying to +read any data. The exit status is 0 if input is available on +the specified file descriptor, non-zero otherwise. The exit status is greater than 128 if the timeout is exceeded.
-u fd @@ -10691,11 +11028,12 @@ are supplied, the line read is assigned to the variable The return code is zero, unless end-of-file is encountered, read -times out (in which case the return code is greater than 128), or an -invalid file descriptor is supplied as the argument to -u. +times out (in which case the return code is greater than 128), +a variable assignment error (such as assigning to a readonly variable) occurs, +or an invalid file descriptor is supplied as the argument to -u. -
readonly [-aApf] [name[=word] ...]
+
readonly [-aAf] [-p] [name[=word] ...]
The given names are marked readonly; the values of these @@ -10715,6 +11053,10 @@ option restricts the variables to indexed arrays; the -A option restricts the variables to associative arrays. +If both options are supplied, +-A + +takes precedence. If no name @@ -10722,6 +11064,8 @@ arguments are given, or if the -p option is supplied, a list of all readonly names is printed. +The other options may be used to restrict the output to a subset of +the set of readonly names. The -p @@ -10741,14 +11085,18 @@ is supplied with a that is not a function.
return [n]
-Causes a function to exit with the return value specified by -n. +Causes a function to stop executing and return the value specified by +n +to its caller. If n is omitted, the return status is that of the last command -executed in the function body. If used outside a function, +executed in the function body. If +return + +is used outside a function, but during execution of a script by the . @@ -10757,9 +11105,15 @@ that script and return either n or the exit status of the last command executed within the -script as the exit status of the script. If used outside a -function and not during execution of a script by ., -the return status is false. +script as the exit status of the script. +If n is supplied, the return value is its least significant +8 bits. +The return status is non-zero if +return + +is supplied a non-numeric argument, or +is used outside a +function and not during execution of a script by . or source. Any command associated with the RETURN trap is executed before execution resumes after the function or script.
set [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]
@@ -10770,7 +11124,7 @@ Without options, the name and value of each shell variable are displayed in a format that can be reused as input for setting or resetting the currently-set variables. Read-only variables cannot be reset. -In posix mode, only shell variables are listed. +In posix mode, only shell variables are listed. The output is sorted according to the current locale. When options are specified, they set or unset shell attributes. Any arguments remaining after option processing are treated @@ -10801,14 +11155,15 @@ effective only when job control is enabled.
-e
-Exit immediately if a pipeline (which may consist of a single -simple command), a subshell command enclosed in parentheses, -or one of the commands executed as part of a command list enclosed -by braces (see +Exit immediately if a +pipeline (which may consist of a single simple command), +a list, +or a compound command +(see SHELL GRAMMAR -above) exits with a non-zero status. +above), exits with a non-zero status. The shell does not exit if the command that fails is part of the command list immediately following a while @@ -10835,6 +11190,9 @@ or if the command's return value is being inverted with !. +If a compound command other than a subshell +returns a non-zero status because a command failed +while -e was being ignored, the shell does not exit. A trap on ERR, if set, is executed before the shell exits. This option applies to the shell environment and each subshell environment separately (see @@ -10843,6 +11201,18 @@ separately (see above), and may cause subshells to exit before executing all the commands in the subshell. +

+ + +If a compound command or shell function executes in a context +where -e is being ignored, +none of the commands executed within the compound command or function body +will be affected by the -e setting, even if -e is set +and a command returns a failure status. +If a compound command or shell function sets -e while executing in +a context where -e is ignored, that setting will not have any +effect until the compound command or the command containing the function +call completes.

-f
@@ -10867,9 +11237,10 @@ it (see JOB CONTROL -above). Background processes run in a separate process -group and a line containing their exit status is printed -upon their completion. +above). +All processes run in a separate process group. +When a background job completes, the shell prints a line +containing its exit status.
-n
@@ -11026,6 +11397,12 @@ Change the behavior of where the default operation differs from the POSIX standard to match the standard (posix mode). +See +SEE ALSO + + +below for a reference to a document that details how posix mode affects +bash's behavior.
privileged
@@ -11177,7 +11554,7 @@ default when the shell is interactive.
-P
-If set, the shell does not follow symbolic links when executing +If set, the shell does not resolve symbolic links when executing commands such as cd @@ -11261,7 +11638,14 @@ is greater than or less than zero; otherwise 0.
shopt [-pqsu] [-o] [optname ...]
-Toggle the values of variables controlling optional shell behavior. +Toggle the values of settings controlling optional shell behavior. +The settings can be either those listed below, or, if the +-o + +option is used, those available with the +-o + +option to the set builtin command. With no options, or with the -p @@ -11311,8 +11695,10 @@ If either or -u -is used with no optname arguments, the display is limited to -those options which are set or unset, respectively. +is used with no optname arguments, +shopt + +shows only those options which are set or unset, respectively. Unless otherwise noted, the shopt options are disabled (unset) by default.

@@ -11353,7 +11739,7 @@ If set, minor errors in the spelling of a directory component in a command will be corrected. The errors checked for are transposed characters, a missing character, and one character too many. -If a correction is found, the corrected file name is printed, +If a correction is found, the corrected filename is printed, and the command proceeds. This option is only used by interactive shells.

checkhash @@ -11402,23 +11788,24 @@ If set, bash changes its behavior to that of version 3.1 with respect to quoted -arguments to the [[ conditional command's =~ operator. -
compat32 - -
-If set, -bash - -changes its behavior to that of version 3.2 with respect to locale-specific -string comparison when using the [[ +arguments to the [[ conditional command's =~ operator +and locale-specific string comparison when using the [[ conditional command's < and > operators. Bash versions prior to bash-4.1 use ASCII collation and strcmp(3); -bash-4.1 and later -use the current locale's collation sequence and +bash-4.1 and later use the current locale's collation sequence and strcoll(3). +
compat32 + +
+If set, +bash + +changes its behavior to that of version 3.2 with respect to +locale-specific string comparison when using the [[ +conditional command's < and > operators (see previous item).
compat40
@@ -11427,20 +11814,65 @@ If set, changes its behavior to that of version 4.0 with respect to locale-specific string comparison when using the [[ -conditional command's < and > operators (see previous item) +conditional command's < and > operators (see description of +compat31) and the effect of interrupting a command list. +Bash versions 4.0 and later interrupt the list as if the shell received the +interrupt; previous versions continue with the next command in the list.
compat41
-@item compat41 If set, bash, -when in posix mode, treats a single quote in a double-quoted +when in posix mode, treats a single quote in a double-quoted parameter expansion as a special character. The single quotes must match (an even number) and the characters between the single quotes are considered quoted. This is the behavior of posix mode through version 4.1. The default bash behavior remains as in previous versions. +
compat42 + +
+If set, +bash + +does not process the replacement string in the pattern substitution word +expansion using quote removal. +
complete_fullquote + +
+If set, +bash + +quotes all shell metacharacters in filenames and directory names when +performing completion. +If not set, +bash + +removes metacharacters such as the dollar sign from the set of +characters that will be quoted in completed filenames +when these metacharacters appear in shell variable references in words to be +completed. +This means that dollar signs in variable names that expand to directories +will not be quoted; +however, any dollar signs appearing in filenames will not be quoted, either. +This is active only when bash is using backslashes to quote completed +filenames. +This variable is set by default, which is the default bash behavior in +versions through 4.2. +
direxpand + +
+If set, +bash + +replaces directory names with the results of word expansion when performing +filename completion. This changes the contents of the readline editing +buffer. +If not set, +bash + +attempts to preserve what the user typed.
dirspell
@@ -11558,11 +11990,30 @@ above for a description of This option is enabled by default. +
globasciiranges + +
+If set, range expressions used in pattern matching bracket expressions (see +Pattern Matching + + +above) behave as if in the traditional C locale when performing +comparisons. That is, the current locale's collating sequence +is not taken into account, so +b + +will not collate between +A + +and +B, + +and upper-case and lower-case ASCII characters will collate together.
globstar
If set, the pattern ** used in a pathname expansion context will -match a files and zero or more directories and subdirectories. +match all files and zero or more directories and subdirectories. If the pattern is followed by a /, only directories and subdirectories match.
gnu_errfmt @@ -11758,6 +12209,7 @@ If set, the echo builtin expands backslash-escape sequences by default. +
suspend [-f]
Suspend the execution of this shell until it receives a SIGCONT @@ -11774,7 +12226,7 @@ is not supplied, or if job control is not enabled.
test expr
[ expr ]
-Return a status of 0 or 1 depending on +Return a status of 0 (true) or 1 (false) depending on the evaluation of the conditional expression expr. @@ -12004,7 +12456,10 @@ is the command arg -is executed whenever a simple command has a non-zero exit status, +is executed whenever a +a pipeline (which may consist of a single simple +command), a list, or a compound command returns a +non-zero exit status, subject to the following conditions. The ERR @@ -12027,11 +12482,13 @@ statement, part of a command executed in a or || -list, or if the command's return value is -being inverted via +list except the command following the final && or ||, +any command in a pipeline but the last, +or if the command's return value is +being inverted using !. -These are the same conditions obeyed by the errexit option. +These are the same conditions obeyed by the errexit (-e) option.

@@ -12115,7 +12572,7 @@ If a command is hashed, and -P -print the hashed value, not necessarily the file that appears +print the hashed value, which is not necessarily the file that appears first in PATH. @@ -12265,20 +12722,21 @@ The maximum number of threads If limit -is given, it is the new value of the specified resource (the +is given, and the -a -option is display only). +option is not used, +limit is the new value of the specified resource. If no option is given, then -f is assumed. Values are in 1024-byte increments, except for -t, -which is in seconds, +which is in seconds; -p, -which is in units of 512-byte blocks, +which is in units of 512-byte blocks; and -T, @@ -12334,18 +12792,18 @@ value is true unless a supplied name is not a defined alias. -

unset [-fv] [name ...]
+
unset [-fv] [-n] [name ...]
For each name, remove the corresponding variable or function. -If no options are supplied, or the +If the -v option is given, each name -refers to a shell variable. +refers to a shell variable, and that variable is removed. Read-only variables may not be unset. If -f @@ -12355,6 +12813,16 @@ is specified, each refers to a shell function, and the function definition is removed. +If the +-n + +option is supplied, and name is a variable with the nameref +attribute, name will be unset rather than the variable it +references. +-n has no effect if the -f option is supplied. +If no options are supplied, each name refers to a variable; if +there is no variable by that name, any function with that name is +unset. Each unset variable or function is removed from the environment passed to subsequent commands. If any of @@ -12388,8 +12856,8 @@ subsequently reset. The exit status is true unless a name is readonly. -
wait [n ...]
-Wait for each specified process and return its termination status. +
wait [-n] [n ...]
+Wait for each specified child process and return its termination status. Each n @@ -12399,7 +12867,10 @@ in that job's pipeline are waited for. If n is not given, all currently active child processes -are waited for, and the return status is zero. If +are waited for, and the return status is zero. +If the -n option is supplied, wait waits for any job to +terminate and returns its exit status. +If n specifies a non-existent process or job, the return status is @@ -12455,7 +12926,7 @@ specifying command names containing /
*
-specifying a file name containing a +specifying a filename containing a / as an argument to the @@ -12538,7 +13009,9 @@ script.
Bash Reference Manual, Brian Fox and Chet Ramey
The Gnu Readline Library, Brian Fox and Chet Ramey
The Gnu History Library, Brian Fox and Chet Ramey
-
Portable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE
+
Portable Operating System Interface (POSIX) Part 2: Shell and Utilities, IEEE --
+http://pubs.opengroup.org/onlinepubs/9699919799/ +
http://tiswww.case.edu/~chet/bash/POSIX -- a description of posix mode
sh(1), ksh(1), csh(1)
emacs(1), vi(1)
readline(3)
@@ -12643,7 +13116,7 @@ it provides for filing a bug report. Comments and bug reports concerning this manual page should be directed to -chet@po.cwru.edu. +chet.ramey@case.edu.  

BUGS

@@ -12691,7 +13164,7 @@ There may be only one active coprocess at a time.
-
GNU Bash-4.22010 December 28BASH(1) +GNU Bash 4.32014 February 2BASH(1)

@@ -12797,6 +13270,6 @@ There may be only one active coprocess at a time.
This document was created by man2html from bash.1.
-Time: 28 December 2010 14:30:29 EST +Time: 24 February 2014 08:28:34 EST