From f4b417c62a4f272c4cf9a074d0f7a3a97201f9db Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Tue, 17 Apr 2012 11:23:35 +0200 Subject: Update to upstream bash 4.2 This upgrades bash to from 4.1-rc to 4.2-release. See CWRU/changelog for changes. Change-Id: I926269c300cf44fa25964b5b375a148fcf11c4b7 --- doc/bash.html | 597 ++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 414 insertions(+), 183 deletions(-) (limited to 'doc/bash.html') diff --git a/doc/bash.html b/doc/bash.html index 2aa2825..d1b6489 100644 --- a/doc/bash.html +++ b/doc/bash.html @@ -3,7 +3,7 @@ -
BASH(1)2009 December 29BASH(1) +BASH(1)2010 December 28BASH(1)

Index @@ -42,7 +42,7 @@ bash - GNU Bourne-Again SHell

COPYRIGHT

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

DESCRIPTION

@@ -67,8 +67,10 @@ can be configured to be POSIX-conformant by default.  

OPTIONS

-In addition to the single-character shell options documented in the -description of the set builtin command, bash +All of the single-character shell options documented in the +description of the set builtin command can be used as options +when the shell is invoked. +In addition, bash interprets the following options when it is invoked:

@@ -195,11 +197,6 @@ Turns on extended debugging mode (see the description of the option to the shopt -builtin below) -and shell function tracing (see the description of the --o functrace option to the -set - builtin below).

--dump-po-strings @@ -533,7 +530,7 @@ No other startup files are read. Bash attempts to determine when it is being run with its standard input -connected to a a network connection, as if by the remote shell +connected to a network connection, as when executed by the remote shell daemon, usually rshd, or the secure shell daemon sshd. If bash @@ -739,6 +736,8 @@ reserved word precedes a pipeline, the elapsed as well as user and system time consumed by its execution are reported when the pipeline terminates. The -p option changes the output format to that specified by POSIX. +When the shell is in posix mode, it does not recognize +time as a reserved word if the next token begins with a `-'. The TIMEFORMAT @@ -754,6 +753,17 @@ under below.

+When the shell is in posix mode, time +may be followed by a newline. In this case, the shell displays the +total user and system time consumed by the shell and its children. +The +TIMEFORMAT + + +variable may be used to specify the format of +the time information. +

+ Each command in a pipeline is executed as a separate process (i.e., in a subshell).   @@ -905,7 +915,7 @@ as primaries.

-When used with [[, The < and > operators sort +When used with [[, the < and > operators sort lexicographically using the current locale.

@@ -988,9 +998,7 @@ and expression2 are true. -

expression1 || expression2 -
- +
expression1 || expression2
True if either expression1 @@ -1002,9 +1010,7 @@ is true.

-The && and -|| - +The && and || operators do not evaluate expression2 if the value of expression1 is sufficient to determine the return value of the entire conditional expression. @@ -1120,26 +1126,23 @@ the corresponding then list is executed and the command completes. Otherwise, the else list is executed, if present. The exit status is the exit status of the last command executed, or zero if no condition tested true. -

while list; do list; done
+
while list-1; do list-2; done
-
until list; do list; done
+
until list-1; do list-2; done
-The while command continuously executes the do -list as long as the last command in list returns +The while command continuously executes the list +list-2 as long as the last command in the list list-1 returns an exit status of zero. The until command is identical to the while command, except that the test is negated; -the -do - -list +list-2 is executed as long as the last command in -list +list-1 returns a non-zero exit status. The exit status of the while and until commands is the exit status -of the last do list command executed, or zero if +of the last command executed in list-2, or zero if none was executed.   @@ -1190,7 +1193,7 @@ command (see below). The file descriptors can be utilized as arguments to shell commands and redirections using standard word expansions. -The process id of the shell spawned to execute the coprocess is +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. @@ -1206,7 +1209,10 @@ A shell function is an object that is called like a simple command and executes a compound command with a new set of positional parameters. Shell functions are declared as follows:
-
[ function ] name () compound-command [redirection]
+
name () compound-command [redirection]
+ +
function name [()] compound-command [redirection]
+ This defines a function named name. The reserved word function is optional. If the function reserved word is supplied, the parentheses are optional. @@ -1426,6 +1432,16 @@ the eight-bit character whose value is the octal value nnn
the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) +
\uHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHH (one to four hex digits) +
\UHHHHHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHHHHHH (one to eight hex digits)
\cx
@@ -1549,7 +1565,7 @@ 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 variable for which the integer attribute has been +When += is applied to a variable for which the integer attribute has been set, value 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 @@ -1761,14 +1777,14 @@ This variable is read-only.
BASHPID
-Expands to the process id of the current bash process. +Expands to the process ID of the current bash process. This differs from $$ under certain circumstances, such as subshells that do not require bash to be re-initialized.
BASH_ALIASES
An associative array variable whose members correspond to the internal -list of aliases as maintained by the alias builtin +list of aliases as maintained by the alias builtin. Elements added to this array appear in the alias list; unsetting array elements cause aliases to be removed from the alias list.
BASH_ARGC @@ -1838,15 +1854,16 @@ The command argument to the -c invocation option.
An array variable whose members are the line numbers in source files -corresponding to each member of -FUNCNAME. +where each corresponding member of +FUNCNAME +was invoked. ${BASH_LINENO[$i]} is the line number in the source -file where ${FUNCNAME[$i]} was called +file (${BASH_SOURCE[$i+1]}) where +${FUNCNAME[$i]} was called (or ${BASH_LINENO[$i-1]} if referenced within another shell function). -The corresponding source file name is ${BASH_SOURCE[$i]}. Use LINENO @@ -1865,12 +1882,16 @@ This variable is read-only.
BASH_SOURCE
-An array variable whose members are the source filenames corresponding -to the elements in the +An array variable whose members are the source filenames +where the corresponding shell function names in the FUNCNAME -array variable. +array variable are defined. +The shell function +${FUNCNAME[$i]} is defined in the file +${BASH_SOURCE[$i]} and called from +${BASH_SOURCE[$i+1]}.
BASH_SUBSHELL
@@ -1995,6 +2016,12 @@ as described above. This variable is available only in shell functions invoked by the programmable completion facilities (see Programmable Completion below). +
COPROC + +
+An array variable (see Arrays below) created to hold the file descriptors +for output from and input to an unnamed coprocess (see Coprocesses +above).
DIRSTACK
@@ -2033,7 +2060,7 @@ 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 bottom-most element is +The bottom-most element (the one with the highest index) is "main". This variable exists only when a shell function is executing. @@ -2048,6 +2075,17 @@ If is unset, it loses its special properties, even if it is subsequently reset. +

+ + +This variable can be used with BASH_LINENO and BASH_SOURCE. +Each element of FUNCNAME has corresponding elements in +BASH_LINENO and BASH_SOURCE to describe the call stack. +For instance, ${FUNCNAME[$i]} was called from the file +${BASH_SOURCE[$i+1]} at line number +${BASH_LINENO[$i]}. +The caller builtin displays the current call stack using this +information.

GROUPS
@@ -2111,6 +2149,11 @@ type on which is executing, in the standard GNU cpu-company-system format. The default is system-dependent. +
MAPFILE + +
+An array variable (see Arrays below) created to hold the text +read by the mapfile builtin when no variable name is supplied.
OLDPWD
@@ -2185,6 +2228,34 @@ If is unset, it loses its special properties, even if it is subsequently reset. +
READLINE_LINE + +
+The contents of the +readline + +line buffer, for use with +bind -x + +(see +SHELL BUILTIN COMMANDS + + +below). +
READLINE_POINT + +
+The position of the insertion point in the +readline + +line buffer, for use with +bind -x + +(see +SHELL BUILTIN COMMANDS + + +below).
REPLY
@@ -2281,21 +2352,6 @@ expansion before being interpreted as a file name. is not used to search for the resultant file name. -
CDPATH - -
-The search path for the -cd - -command. -This is a colon-separated list of directories in which the shell looks -for destination directories specified by the -cd - -command. -A sample value is -".:~:/usr". -
BASH_XTRACEFD
@@ -2322,11 +2378,29 @@ Note that setting to 2 (the standard error file descriptor) and then unsetting it will result in the standard error being closed. +
CDPATH + +
+The search path for the +cd + +command. +This is a colon-separated list of directories in which the shell looks +for destination directories specified by the +cd + +command. +A sample value is +".:~:/usr". +
COLUMNS
-Used by the select builtin command to determine the terminal width -when printing selection lists. Automatically set upon receipt of a SIGWINCH. +Used by the select compound command to determine the terminal width +when printing selection lists. Automatically set upon receipt of a +SIGWINCH. + +
COMPREPLY
@@ -2340,8 +2414,16 @@ If bash 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 +it assumes that the shell is running in an Emacs shell buffer and disables line editing. +
ENV + +
+Similar to +BASH_ENV; + + +used when the shell is invoked in POSIX mode.
FCEDIT
@@ -2366,6 +2448,12 @@ is excluded from the list of matched filenames. A sample value is ".o:~". +
FUNCNEST + +
+If set to a numeric value greater than 0, defines a maximum function +nesting level. Function invocations that exceed this nesting level +will cause the current command to abort.
GLOBIGNORE
@@ -2601,7 +2689,7 @@ This variable determines the locale category used for number formatting.
LINES
-Used by the select builtin command to determine the column length +Used by the select compound command to determine the column length for printing selection lists. Automatically set upon receipt of a SIGWINCH. @@ -2609,14 +2697,15 @@ for printing selection lists. Automatically set upon receipt of a
MAIL
-If this parameter is set to a file name and the +If this parameter is set to a file or directory name and the MAILPATH variable is not set, bash -informs the user of the arrival of mail in the specified file. +informs the user of the arrival of mail in the specified file or +Maildir-format directory.
MAILCHECK
@@ -2852,8 +2941,8 @@ not arrive.
TMPDIR
-If set, Bash uses its value as the name of a directory in which -Bash creates temporary files for the shell's use. +If set, bash uses its value as the name of a directory in which +bash creates temporary files for the shell's use.
auto_resume
@@ -2933,9 +3022,14 @@ An indexed array is created automatically if any variable is assigned to using the syntax name[subscript]=value. The subscript -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 +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 (see @@ -3338,7 +3432,7 @@ a level of variable indirection is introduced. 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 ${!prefix*} and +The exceptions to this are the expansions of ${!\fPfIprefix*} and ${!name[@]} described below. The exclamation point must immediately follow the left brace in order to introduce indirection. @@ -3407,7 +3501,7 @@ is substituted.
${parameter:offset:length}
-Substring Expansion. +Substring Expansion. Expands to up to length characters of parameter starting at the character specified by offset. If length is omitted, expands to the substring of @@ -3417,9 +3511,13 @@ If length is omitted, expands to the substring of below). -length must evaluate to a number greater than or equal to zero. 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. If parameter is @, the result is length positional parameters beginning at offset. If parameter is an indexed array name subscripted by @ or *, @@ -3439,7 +3537,7 @@ prefixed to the list.
${!prefix@}
-Names matching prefix. +Names matching prefix. Expands to the names of variables whose names begin with prefix, separated by the first character of the IFS @@ -3452,7 +3550,7 @@ variable name expands to a separate word.
${!name[*]}
-List of array keys. +List of array keys. If name is an array variable, expands to the list of array indices (keys) assigned in name. If name is not an array, expands to 0 if name is set and null @@ -3460,7 +3558,7 @@ otherwise. When @ is used and the expansion appears within double quotes, each key expands to a separate word.
${#parameter}
-Parameter length. +Parameter length. The length in characters of the value of parameter is substituted. If parameter @@ -3486,7 +3584,7 @@ the value substituted is the number of elements in the array.
${parameter##word}
-Remove matching prefix pattern. +Remove matching prefix pattern. The word @@ -3526,7 +3624,7 @@ array in turn, and the expansion is the resultant list.
${parameter%%word}
-Remove matching suffix pattern. +Remove matching suffix pattern. The word is expanded to produce a pattern just as in pathname expansion. If the pattern matches a trailing portion of the expanded value of @@ -3560,7 +3658,7 @@ or the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant list.
${parameter/pattern/string}
-Pattern substitution. +Pattern substitution. The pattern is expanded to produce a pattern just as in pathname expansion. Parameter is expanded and the longest match of pattern @@ -3601,7 +3699,7 @@ array in turn, and the expansion is the resultant list.
${parameter,pattern}
${parameter,,pattern}
-Case modification. +Case modification. This expansion modifies the case of alphabetic characters in parameter. The pattern is expanded to produce a pattern just as in pathname expansion. @@ -3610,7 +3708,7 @@ to uppercase; the , operator converts matching uppercase letters to lowercase. The ^^ and ,, expansions convert each matched character in the expanded value; the ^ and , expansions match and convert only -the first character in the expanded value.. +the first character in the expanded value. If pattern is omitted, it is treated like a ?, which matches every character. If @@ -4003,6 +4101,7 @@ The special pattern characters have the following meanings:

+

* @@ -4109,6 +4208,8 @@ the syntax [.symbol.] matches the collating symbol symbol.
+
+

@@ -4781,7 +4882,7 @@ during its execution. The special parameter # -is updated to reflect the change. Special parameter 0 +is updated to reflect the change. Special parameter 0 is unchanged. The first element of the FUNCNAME @@ -4831,6 +4932,12 @@ builtin command. Ordinarily, variables and their values are shared between the function and its caller.

+The FUNCNEST variable, if set to a numeric value greater +than 0, defines a maximum function nesting level. Function +invocations that exceed the limit cause the entire command to +abort. +

+ If the builtin command return @@ -4887,8 +4994,10 @@ shell's children. Care should be taken in cases where this may cause a problem.

-Functions may be recursive. No limit is imposed on the number -of recursive calls. +Functions may be recursive. +The FUNCNEST variable may be used to limit the depth of the +function call stack and restrict the number of function invocations. +By default, no limit is imposed on the number of recursive calls.  

ARITHMETIC EVALUATION

@@ -4992,13 +5101,13 @@ The value of a variable is evaluated as an arithmetic expression when it is referenced, or when a variable which has been given the integer attribute using declare -i is assigned a value. A null value evaluates to 0. -A shell variable need not have its integer attribute +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 [base#]n, where base +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. @@ -5031,8 +5140,9 @@ links and operate on the target of the link, rather than the link itself.

-When used with [[, The < and > operators sort +When used with [[, the < and > operators sort lexicographically using the current locale. +The test command sorts using ASCII ordering.

@@ -5103,10 +5213,6 @@ True if file exists and is writable.
True if file exists and is executable. -
-O file - -
-True if file exists and is owned by the effective user id.
-G file
@@ -5115,27 +5221,31 @@ True if file exists and is owned by the effective group id.
True if file exists and is a symbolic link. -
-S file - -
-True if file exists and is a socket.
-N file
True if file exists and has been modified since it was last read. +
-O file + +
+True if file exists and is owned by the effective user id. +
-S file + +
+True if file exists and is a socket. +
file1 -ef file2
+True if file1 and file2 refer to the same device and +inode numbers.
file1 -nt file2
True if file1 is newer (according to modification date) than file2, or if file1 exists and file2 does not.
file1 -ot file2
True if file1 is older than file2, or if file2 exists and file1 does not. -
file1 -ef file2
-True if file1 and file2 refer to the same device and -inode numbers.
-o optname
-True if shell option +True if the shell option optname is enabled. @@ -5146,6 +5256,13 @@ option to the set builtin below. +
-v varname + +
+True if the shell variable +varname + +is set (has been assigned a value).
-z string
@@ -5411,8 +5528,8 @@ cannot affect the shell's execution environment.

Subshells spawned to execute command substitutions inherit the value of -the -e option from the parent shell. When not in posix mode, -Bash clears the -e option in such subshells. +the -e option from the parent shell. When not in posix mode, +bash clears the -e option in such subshells.

If a command is followed by a & and job control is not active, the @@ -6077,7 +6194,7 @@ shell, unless the option is given at shell invocation. Line editing is also used when using the -e option to the read builtin. -By default, the line editing commands are similar to those of emacs. +By default, the line editing commands are similar to those of Emacs. A vi-style line editing interface is also available. Line editing can be enabled at any time using the -o emacs @@ -6108,7 +6225,7 @@ builtin.

-In this section, the emacs-style notation is used to denote +In this section, the Emacs-style notation is used to denote keystrokes. Control keys are denoted by C-key, e.g., C-n means Control-N. Similarly, meta @@ -6536,7 +6653,7 @@ mapped to self-insert.

Controls whether readline begins with a set of key bindings similar -to emacs or vi. +to Emacs or vi. editing-mode can be set to either @@ -6566,12 +6683,12 @@ the meta key is used to send eight-bit characters.
expand-tilde (Off)
-If set to on, tilde expansion is performed when readline +If set to On, tilde expansion is performed when readline attempts word completion.
history-preserve-point (Off)
-If set to on, the history code attempts to place point at the +If set to On, the history code attempts to place point at the same location on each history line retrieved with previous-history or next-history.
history-size (0) @@ -6638,8 +6755,15 @@ have a slash appended (subject to the value of
This variable, when set to On, causes readline to match files whose names begin with a `.' (hidden files) when performing filename -completion, unless the leading `.' is +completion. +If set to Off, the leading `.' must be supplied by the user in the filename to be completed. +
menu-complete-display-prefix (Off) + +
+If set to On, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list.
output-meta (Off)
@@ -6659,7 +6783,7 @@ sorted horizontally in alphabetical order, rather than down the screen.
revert-all-at-newline (Off)
-If set to on, readline will undo all changes to history lines +If set to On, readline will undo all changes to history lines before returning when accept-line is executed. By default, history lines may be modified and retain individual undo lists across calls to readline. @@ -6668,7 +6792,7 @@ calls to readline.
This alters the default behavior of the completion functions. If set to -on, +On, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell. @@ -6678,7 +6802,7 @@ matches to be listed immediately instead of ringing the bell. This alters the default behavior of the completion functions in a fashion similar to show-all-if-ambiguous. If set to -on, +On, words which have more than one possible completion without any possible partial completion (the possible completions don't share @@ -6752,7 +6876,7 @@ library sets the application name, and an initialization file can test for a particular value. This could be used to bind key sequences to functions useful for a specific program. For instance, the following command adds a -key sequence that quotes the current or previous word in Bash: +key sequence that quotes the current or previous word in bash:

@@ -6990,10 +7114,14 @@ as if the "!n" history expansion had been specified.
 
 
Insert the last argument to the previous command (the last word of -the previous history entry). With an argument, -behave exactly like yank-nth-arg. +the previous history entry). +With a numeric argument, behave exactly like yank-nth-arg. Successive calls to yank-last-arg move back through the history -list, inserting the last argument of each line in turn. +list, inserting the last word (or the word specified by the argument to +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, as if the "!$" history expansion had been specified.
shell-expand-line (M-C-e) @@ -7315,7 +7443,7 @@ of matches; a negative argument may be used to move backward through the list. This command is intended to be bound to TAB, but is unbound by default. -
menu-complete-rd +
menu-complete-backward
Identical to menu-complete, but moves backward through the list @@ -7497,7 +7625,7 @@ character. A negative count searches for previous occurrences.
A character is read and point is moved to the previous occurrence of that character. A negative count searches for subsequent occurrences. -
skip-csi-sequence () +
skip-csi-sequence
Read enough characters to consume a multi-key sequence such as those @@ -7600,7 +7728,7 @@ If the command word is a full pathname, a compspec for the full pathname is searched for first. If no compspec is found for the full pathname, an attempt is made to find a compspec for the portion following the final slash. -If those searches to not result in a compspec, any compspec defined with +If those searches do not result in a compspec, any compspec defined with the -D option to complete is used as the default.

@@ -7772,7 +7900,7 @@ exit status of 124. If a shell function returns 124, and changes the compspec associated with the command on which completion is being attempted (supplied as the first argument when the function is executed), programmable completion restarts from the beginning, with an -attempt to find a compspec for that command. This allows a set of +attempt to find a new compspec for that command. This allows a set of completions to be built dynamically as completion is attempted, rather than being loaded all at once.

@@ -8079,6 +8207,8 @@ writing the history file. An event designator is a reference to a command line entry in the history list. +Unless the reference is absolute, events are relative to the current +position in the history list.

@@ -8101,7 +8231,7 @@ Refer to command line

!-n
-Refer to the current command line minus +Refer to the current command minus n.
!! @@ -8111,13 +8241,15 @@ Refer to the previous command. This is a synonym for `!-1'.
!string
-Refer to the most recent command starting with +Refer to the most recent command preceding the current position in the +history list starting with string.
!?string[?]
-Refer to the most recent command containing +Refer to the most recent command preceding the current postition in the +history list containing string. The trailing ? may be omitted if @@ -8127,7 +8259,7 @@ is followed immediately by a newline.
^string1^string2^
-Quick substitution. Repeat the last command, replacing +Quick substitution. Repeat the previous command, replacing string1 with @@ -8596,7 +8728,7 @@ The return status is false if is not a shell builtin command.
caller [expr]
Returns the context of any active subroutine call (a shell function or -a script executed with the . or source builtins. +a script executed with the . or source builtins). Without expr, caller displays the line number and source filename of the current subroutine call. If a non-negative integer is supplied as expr, caller @@ -8607,7 +8739,7 @@ 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] [dir]
+
cd [-L|[-P [-e]]] [dir]
Change the current directory to dir. The variable HOME @@ -8652,7 +8784,17 @@ option to the builtin command); the -L -option forces symbolic links to be followed. An argument of +option forces symbolic links to be followed. +If the +-e + +option is supplied with +-P, + +and the current working directory cannot be successfully determined +after a successful directory change, cd will return an unsuccessful +status. +An argument of - is equivalent to @@ -8931,17 +9073,6 @@ User names. May also be specified as -u. Names of all shell variables. May also be specified as -v.
-
-G globpat
-The pathname expansion pattern globpat is expanded to generate -the possible completions. -
-W wordlist
-The wordlist is split using the characters in the -IFS - - -special variable as delimiters, and each resultant word is expanded. -The possible completions are the members of the resultant list which -match the word being completed.
-C command
command is executed in a subshell environment, and its output is used as the possible completions. @@ -8954,6 +9085,23 @@ of the array variable. +
-G globpat
+The pathname expansion pattern globpat is expanded to generate +the possible completions. +
-P prefix
+prefix is added at the beginning of each possible completion +after all other options have been applied. +
-S suffix
+suffix is appended to each possible completion +after all other options have been applied. +
-W wordlist
+The wordlist is split using the characters in the +IFS + + +special variable as delimiters, and each resultant word is expanded. +The possible completions are the members of the resultant list which +match the word being completed.
-X filterpat
filterpat is a pattern as used for pathname expansion. It is applied to the list of possible completions generated by the @@ -8961,12 +9109,6 @@ preceding options and arguments, and each completion matching filterpat is removed from the list. A leading ! in filterpat negates the pattern; in this case, any completion not matching filterpat is removed. -
-P prefix
-prefix is added at the beginning of each possible completion -after all other options have been applied. -
-S suffix
-suffix is appended to each possible completion -after all other options have been applied.

@@ -8981,7 +9123,7 @@ an error occurs adding a completion specification.

compopt [-o option] [-DE] [+o option] [name]
Modify completion options for each name according to the options, or for the -currently-execution completion if no names are supplied. +currently-executing completion if no names are supplied. If no options are given, display the completion options for each name or the current completion. The possible values of option are those valid for the complete @@ -8992,13 +9134,10 @@ on a command for which no completion has previously been defined. The -E option indicates that the remaining options should apply to ``empty'' command completion; that is, completion attempted on a blank line. -

- The return value is true unless an invalid option is supplied, an attempt is made to modify the options for a name for which no completion specification exists, or an output error occurs. -

continue [n]
Resume the next iteration of the enclosing for, @@ -9023,9 +9162,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 [-aAfFilrtux] [-p] [name[=value] ...]
+
declare [-aAfFgilrtux] [-p] [name[=value] ...]
-
typeset [-aAfFilrtux] [-p] [name[=value] ...]
+
typeset [-aAfFgilrtux] [-p] [name[=value] ...]
Declare variables and/or give them attributes. If no names are given then display the values of variables. @@ -9061,6 +9200,12 @@ are displayed as well. The option implies -f. +The +-g + +option forces variables to be created or modified at the global scope, +even when declare is executed in a shell function. +It is ignored in all other cases. The following options can be used to restrict output to variables with the specified attribute or to give variables attributes: @@ -9130,13 +9275,13 @@ 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 +When used in a function, makes each name local, as with the local -command. -If a variable name is followed by =value, the value of +command, +unless the -gP option is supplied, +If a variable name is followed by =value, the value of the variable is set to value. The return value is 0 unless an invalid option is encountered, an attempt is made to define a function using @@ -9153,7 +9298,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] [-cplv] +
dirs [+n] [-n] [-clpv]
Without options, displays the list of currently remembered directories. @@ -9293,6 +9438,9 @@ suppress further output
\e
+
\E + +
an escape character
\f @@ -9328,6 +9476,16 @@ the eight-bit character whose value is the octal value nnn
the eight-bit character whose value is the hexadecimal value HH (one or two hex digits) +
\uHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHH (one to four hex digits) +
\UHHHHHHHH + +
+the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value +HHHHHHHH (one to eight hex digits) @@ -9680,7 +9838,7 @@ return value greater than zero. is set to the index of the first non-option argument, -and name is set to ?. +and name is set to ?.

getopts @@ -9763,14 +9921,15 @@ returns true if an option, specified or unspecified, is found. It returns false if the end of options is encountered or an error occurs.

hash [-lr] [-p filename] [-dt] [name]
-For each -name, +Each time hash is invoked, +the full pathname of the command +name -the full file name of the command is determined by searching +is determined by searching the directories in $PATH -and remembered. +and remembered. Any previously-remembered pathname is discarded. If the -p @@ -9954,16 +10113,16 @@ meanings:
List process IDs in addition to the normal information. -
-p - -
-List only the process ID of the job's process group -leader.
-n
Display information only about jobs that have changed status since the user was last notified of their status. +
-p + +
+List only the process ID of the job's process group +leader.
-r
@@ -10196,7 +10355,8 @@ is specified without the default quantum is 5000. When callback is evaluated, it is supplied the index of the next -array element to be assigned as an additional argument. +array element to be assigned and the line to be assigned to that element +as additional arguments. callback is evaluated after the line is read but before the array element is assigned.

@@ -10270,27 +10430,57 @@ directory change fails.

printf [-v var] format [arguments]
Write the formatted arguments to the standard output under the control of the format. +The -v option causes the output to be assigned to the variable +var rather than being printed to the standard output. +

The format 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 format specifications, each of which causes printing of the next successive argument. -In addition to the standard printf(1) formats, %b causes +In addition to the standard printf(1) format specifications, +printf interprets the following extensions: +

+ +
+
%b + +
+causes printf to expand backslash escape sequences in the corresponding argument (except that \c terminates output, backslashes in \aq, \", and \? are not removed, and octal escapes -beginning with \0 may contain up to four digits), -and %q causes printf to output the corresponding +beginning with \0 may contain up to four digits). +
%q + +
+causes printf to output the corresponding argument in a format that can be reused as shell input. +
%(datefmt)T + +
+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 +time, and -2 represents the time the shell was invoked. + +

-The -v option causes the output to be assigned to the variable -var rather than being printed to the standard output. + +Arguments to non-string format specifiers are treated as C constants, +except that a leading plus or minus sign is allowed, and if the leading +character is a single or double quote, the value is the ASCII value of +the following character.

+ The format is reused as necessary to consume all of the arguments. If the format requires more arguments than are supplied, 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. +appropriate, had been supplied. +The return value is zero on success, non-zero on failure. +

+
pushd [-n] [+n] [-n]
pushd [-n] [dir]
@@ -10572,9 +10762,9 @@ function and not during execution of a script by ., the return status is false. Any command associated with the RETURN trap is executed before execution resumes after the function or script. -
set [--abefhkmnptuvxBCEHPT] [-o option] [arg ...]
+
set [--abefhkmnptuvxBCEHPT] [-o option-name] [arg ...]
-
set [+abefhkmnptuvxBCEHPT] [+o option] [arg ...]
+
set [+abefhkmnptuvxBCEHPT] [+o option-name] [arg ...]
Without options, the name and value of each shell variable are displayed in a format that can be reused as input @@ -11212,7 +11402,7 @@ If set, bash changes its behavior to that of version 3.1 with respect to quoted -arguments to the conditional command's =~ operator. +arguments to the [[ conditional command's =~ operator.
compat32
@@ -11220,7 +11410,15 @@ 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. +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 +strcoll(3). +
compat40
@@ -11228,8 +11426,21 @@ If set, bash changes its behavior to that of version 4.0 with respect to locale-specific -string comparison when using the conditional command's < and > operators +string comparison when using the [[ +conditional command's < and > operators (see previous item) and the effect of interrupting a command list. +
compat41 + +
+@item compat41 +If set, +bash, + +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.
dirspell
@@ -11311,7 +11522,7 @@ subshells invoked with ( command ) inherit the
Error tracing is enabled: command substitution, shell functions, and subshells invoked with ( command ) inherit the -ERROR trap. +ERR trap.
extglob @@ -11421,6 +11632,11 @@ line to be ignored in an interactive shell (see above). This option is enabled by default. +
lastpipe + +
+If set, and job control is not active, the shell runs the last command of +a pipeline not executed in the background in the current shell environment.
lithist
@@ -11575,6 +11791,7 @@ an argument of -- as signifying the end of options. Expressions may be combined using the following operators, listed in decreasing order of precedence. The evaluation depends on the number of arguments; see below. +Operator precedence is used when there are five or more arguments.
@@ -11633,6 +11850,7 @@ the expression is true if the unary test is true. If the first argument is not a valid unary conditional operator, the expression is false.
3 arguments
+The following conditions are applied in the order listed. If the second argument is one of the binary conditional operators listed above under CONDITIONAL EXPRESSIONS, @@ -11656,7 +11874,15 @@ precedence using the rules listed above.
5 or more arguments
The expression is parsed and evaluated according to precedence using the rules listed above. -
+

+ + + +

+ +When used with test or [, the < and > operators +sort lexicographically using ASCII ordering. +

times @@ -11715,7 +11941,11 @@ Each is either a signal name defined in <signal.h>, or a signal number. -Signal names are case insensitive and the SIG prefix is optional. +Signal names are case insensitive and the +SIG + + +prefix is optional.

@@ -11759,8 +11989,8 @@ is the command arg -is executed each time a shell function or a script executed with the -. or source builtins finishes executing. +is executed each time a shell function or a script executed with +the . or source builtins finishes executing.

@@ -12018,7 +12248,8 @@ The maximum number of processes available to a single user

-v
-The maximum amount of virtual memory available to the shell +The maximum amount of virtual memory available to the shell and, on +some systems, to its children
-x
@@ -12232,7 +12463,7 @@ as an argument to the builtin command
*
-Specifying a filename containing a slash as an argument to the +specifying a filename containing a slash as an argument to the -p option to the @@ -12266,7 +12497,7 @@ options to the builtin command
*
-Using the enable builtin command to enable disabled shell builtins +using the enable builtin command to enable disabled shell builtins
*
specifying the -p @@ -12375,7 +12606,7 @@ version of bash. The latest version is always available from -ftp://ftp.gnu.org/pub/bash/. +ftp://ftp.gnu.org/pub/gnu/bash/.

Once you have determined that a bug actually exists, use the @@ -12460,7 +12691,7 @@ There may be only one active coprocess at a time.


-
GNU Bash-4.12009 December 29BASH(1) +GNU Bash-4.22010 December 28BASH(1)

@@ -12566,6 +12797,6 @@ There may be only one active coprocess at a time.
This document was created by man2html from bash.1.
-Time: 30 December 2009 13:07:38 EST +Time: 28 December 2010 14:30:29 EST -- cgit v1.1