commit bash-20100520 snapshot

This commit is contained in:
Chet Ramey
2011-12-12 21:59:12 -05:00
parent cdb599a168
commit eb0b2ad86b
43 changed files with 10828 additions and 9327 deletions
+106 -100
View File
@@ -617,25 +617,26 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
an error occurs.
hhaasshh [--llrr] [--pp _f_i_l_e_n_a_m_e] [--ddtt] [_n_a_m_e]
For each _n_a_m_e, the full file name of the command is determined
by searching the directories in $$PPAATTHH and remembered. If the --pp
option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e is
used as the full file name of the command. The --rr option causes
the shell to forget all remembered locations. The --dd option
causes the shell to forget the remembered location of each _n_a_m_e.
If the --tt option is supplied, the full pathname to which each
_n_a_m_e corresponds is printed. If multiple _n_a_m_e arguments are
supplied with --tt, the _n_a_m_e is printed before the hashed full
pathname. The --ll option causes output to be displayed in a for-
mat that may be reused as input. If no arguments are given, or
if only --ll is supplied, information about remembered commands is
printed. The return status is true unless a _n_a_m_e is not found
or an invalid option is supplied.
Each time hhaasshh is invoked, the full pathname of the command _n_a_m_e
is determined by searching the directories in $$PPAATTHH and remem-
bered. Any previously-remembered pathname is discarded. If the
--pp option is supplied, no path search is performed, and _f_i_l_e_n_a_m_e
is used as the full file name of the command. The --rr option
causes the shell to forget all remembered locations. The --dd
option causes the shell to forget the remembered location of
each _n_a_m_e. If the --tt option is supplied, the full pathname to
which each _n_a_m_e corresponds is printed. If multiple _n_a_m_e argu-
ments are supplied with --tt, the _n_a_m_e is printed before the
hashed full pathname. The --ll option causes output to be dis-
played in a format that may be reused as input. If no arguments
are given, or if only --ll is supplied, information about remem-
bered commands is printed. The return status is true unless a
_n_a_m_e is not found or an invalid option is supplied.
hheellpp [--ddmmss] [_p_a_t_t_e_r_n]
Display helpful information about builtin commands. If _p_a_t_t_e_r_n
is specified, hheellpp gives detailed help on all commands matching
_p_a_t_t_e_r_n; otherwise help for all the builtins and shell control
Display helpful information about builtin commands. If _p_a_t_t_e_r_n
is specified, hheellpp gives detailed help on all commands matching
_p_a_t_t_e_r_n; otherwise help for all the builtins and shell control
structures is printed.
--dd Display a short description of each _p_a_t_t_e_r_n
--mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
@@ -651,44 +652,44 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
hhiissttoorryy --ss _a_r_g [_a_r_g _._._.]
With no options, display the command history list with line num-
bers. Lines listed with a ** have been modified. An argument of
_n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE--
FFOORRMMAATT is set and not null, it is used as a format string for
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
played history entry. No intervening blank is printed between
the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is
supplied, it is used as the name of the history file; if not,
the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the
_n lists only the last _n lines. If the shell variable HHIISSTTTTIIMMEE--
FFOORRMMAATT is set and not null, it is used as a format string for
_s_t_r_f_t_i_m_e(3) to display the time stamp associated with each dis-
played history entry. No intervening blank is printed between
the formatted time stamp and the history line. If _f_i_l_e_n_a_m_e is
supplied, it is used as the name of the history file; if not,
the value of HHIISSTTFFIILLEE is used. Options, if supplied, have the
following meanings:
--cc Clear the history list by deleting all the entries.
--dd _o_f_f_s_e_t
Delete the history entry at position _o_f_f_s_e_t.
--aa Append the ``new'' history lines (history lines entered
since the beginning of the current bbaasshh session) to the
--aa Append the ``new'' history lines (history lines entered
since the beginning of the current bbaasshh session) to the
history file.
--nn Read the history lines not already read from the history
file into the current history list. These are lines
appended to the history file since the beginning of the
--nn Read the history lines not already read from the history
file into the current history list. These are lines
appended to the history file since the beginning of the
current bbaasshh session.
--rr Read the contents of the history file and use them as the
current history.
--ww Write the current history to the history file, overwrit-
--ww Write the current history to the history file, overwrit-
ing the history file's contents.
--pp Perform history substitution on the following _a_r_g_s and
display the result on the standard output. Does not
store the results in the history list. Each _a_r_g must be
--pp Perform history substitution on the following _a_r_g_s and
display the result on the standard output. Does not
store the results in the history list. Each _a_r_g must be
quoted to disable normal history expansion.
--ss Store the _a_r_g_s in the history list as a single entry.
The last command in the history list is removed before
--ss Store the _a_r_g_s in the history list as a single entry.
The last command in the history list is removed before
the _a_r_g_s are added.
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa-
tion associated with each history entry is written to the his-
tory file, marked with the history comment character. When the
history file is read, lines beginning with the history comment
character followed immediately by a digit are interpreted as
If the HHIISSTTTTIIMMEEFFOORRMMAATT variable is set, the time stamp informa-
tion associated with each history entry is written to the his-
tory file, marked with the history comment character. When the
history file is read, lines beginning with the history comment
character followed immediately by a digit are interpreted as
timestamps for the previous history line. The return value is 0
unless an invalid option is encountered, an error occurs while
reading or writing the history file, an invalid _o_f_f_s_e_t is sup-
unless an invalid option is encountered, an error occurs while
reading or writing the history file, an invalid _o_f_f_s_e_t is sup-
plied as an argument to --dd, or the history expansion supplied as
an argument to --pp fails.
@@ -697,125 +698,130 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
The first form lists the active jobs. The options have the fol-
lowing meanings:
--ll List process IDs in addition to the normal information.
--nn Display information only about jobs that have changed
status since the user was last notified of their status.
--pp List only the process ID of the job's process group
--nn Display information only about jobs that have changed
status since the user was last notified of their status.
--pp List only the process ID of the job's process group
leader.
--rr Restrict output to running jobs.
--ss Restrict output to stopped jobs.
If _j_o_b_s_p_e_c is given, output is restricted to information about
that job. The return status is 0 unless an invalid option is
If _j_o_b_s_p_e_c is given, output is restricted to information about
that job. The return status is 0 unless an invalid option is
encountered or an invalid _j_o_b_s_p_e_c is supplied.
If the --xx option is supplied, jjoobbss replaces any _j_o_b_s_p_e_c found in
_c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and
_c_o_m_m_a_n_d or _a_r_g_s with the corresponding process group ID, and
executes _c_o_m_m_a_n_d passing it _a_r_g_s, returning its exit status.
kkiillll [--ss _s_i_g_s_p_e_c | --nn _s_i_g_n_u_m | --_s_i_g_s_p_e_c] [_p_i_d | _j_o_b_s_p_e_c] ...
kkiillll --ll [_s_i_g_s_p_e_c | _e_x_i_t___s_t_a_t_u_s]
Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive
signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or
a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not
present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the
signal names. If any arguments are supplied when --ll is given,
the names of the signals corresponding to the arguments are
Send the signal named by _s_i_g_s_p_e_c or _s_i_g_n_u_m to the processes
named by _p_i_d or _j_o_b_s_p_e_c. _s_i_g_s_p_e_c is either a case-insensitive
signal name such as SSIIGGKKIILLLL (with or without the SSIIGG prefix) or
a signal number; _s_i_g_n_u_m is a signal number. If _s_i_g_s_p_e_c is not
present, then SSIIGGTTEERRMM is assumed. An argument of --ll lists the
signal names. If any arguments are supplied when --ll is given,
the names of the signals corresponding to the arguments are
listed, and the return status is 0. The _e_x_i_t___s_t_a_t_u_s argument to
--ll is a number specifying either a signal number or the exit
status of a process terminated by a signal. kkiillll returns true
if at least one signal was successfully sent, or false if an
--ll is a number specifying either a signal number or the exit
status of a process terminated by a signal. kkiillll returns true
if at least one signal was successfully sent, or false if an
error occurs or an invalid option is encountered.
lleett _a_r_g [_a_r_g ...]
Each _a_r_g is an arithmetic expression to be evaluated (see AARRIITTHH--
MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett
MMEETTIICC EEVVAALLUUAATTIIOONN above). If the last _a_r_g evaluates to 0, lleett
returns 1; 0 is returned otherwise.
llooccaall [_o_p_t_i_o_n] [_n_a_m_e[=_v_a_l_u_e] ...]
For each argument, a local variable named _n_a_m_e is created, and
assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted
For each argument, a local variable named _n_a_m_e is created, and
assigned _v_a_l_u_e. The _o_p_t_i_o_n can be any of the options accepted
by ddeeccllaarree. When llooccaall is used within a function, it causes the
variable _n_a_m_e to have a visible scope restricted to that func-
variable _n_a_m_e to have a visible scope restricted to that func-
tion and its children. With no operands, llooccaall writes a list of
local variables to the standard output. It is an error to use
local variables to the standard output. It is an error to use
llooccaall when not within a function. The return status is 0 unless
llooccaall is used outside a function, an invalid _n_a_m_e is supplied,
llooccaall is used outside a function, an invalid _n_a_m_e is supplied,
or _n_a_m_e is a readonly variable.
llooggoouutt Exit a login shell.
mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
mmaappffiillee [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
[--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
rreeaaddaarrrraayy [--nn _c_o_u_n_t] [--OO _o_r_i_g_i_n] [--ss _c_o_u_n_t] [--tt] [--uu _f_d] [--CC _c_a_l_l_b_a_c_k]
[--cc _q_u_a_n_t_u_m] [_a_r_r_a_y]
Read lines from the standard input into the indexed array vari-
able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup-
plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
Read lines from the standard input into the indexed array vari-
able _a_r_r_a_y, or from file descriptor _f_d if the --uu option is sup-
plied. The variable MMAAPPFFIILLEE is the default _a_r_r_a_y. Options, if
supplied, have the following meanings:
--nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are
--nn Copy at most _c_o_u_n_t lines. If _c_o_u_n_t is 0, all lines are
copied.
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
--OO Begin assigning to _a_r_r_a_y at index _o_r_i_g_i_n. The default
index is 0.
--ss Discard the first _c_o_u_n_t lines read.
--tt Remove a trailing newline from each line read.
--uu Read lines from file descriptor _f_d instead of the stan-
--uu Read lines from file descriptor _f_d instead of the stan-
dard input.
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
--CC Evaluate _c_a_l_l_b_a_c_k each time _q_u_a_n_t_u_m lines are read. The
--cc option specifies _q_u_a_n_t_u_m.
--cc Specify the number of lines read between each call to
--cc Specify the number of lines read between each call to
_c_a_l_l_b_a_c_k.
If --CC is specified without --cc, the default quantum is 5000.
If --CC is specified without --cc, the default quantum is 5000.
When _c_a_l_l_b_a_c_k is evaluated, it is supplied the index of the next
array element to be assigned as an additional argument. _c_a_l_l_-
_b_a_c_k is evaluated after the line is read but before the array
array element to be assigned as an additional argument. _c_a_l_l_-
_b_a_c_k is evaluated after the line is read but before the array
element is assigned.
If not supplied with an explicit origin, mmaappffiillee will clear
If not supplied with an explicit origin, mmaappffiillee will clear
_a_r_r_a_y before assigning to it.
mmaappffiillee returns successfully unless an invalid option or option
argument is supplied, _a_r_r_a_y is invalid or unassignable, or if
mmaappffiillee returns successfully unless an invalid option or option
argument is supplied, _a_r_r_a_y is invalid or unassignable, or if
_a_r_r_a_y is not an indexed array.
ppooppdd [-nn] [+_n] [-_n]
Removes entries from the directory stack. With no arguments,
removes the top directory from the stack, and performs a ccdd to
Removes entries from the directory stack. With no arguments,
removes the top directory from the stack, and performs a ccdd to
the new top directory. Arguments, if supplied, have the follow-
ing meanings:
--nn Suppresses the normal change of directory when removing
directories from the stack, so that only the stack is
--nn Suppresses the normal change of directory when removing
directories from the stack, so that only the stack is
manipulated.
++_n Removes the _nth entry counting from the left of the list
shown by ddiirrss, starting with zero. For example: ``popd
++_n Removes the _nth entry counting from the left of the list
shown by ddiirrss, starting with zero. For example: ``popd
+0'' removes the first directory, ``popd +1'' the second.
--_n Removes the _nth entry counting from the right of the list
shown by ddiirrss, starting with zero. For example: ``popd
-0'' removes the last directory, ``popd -1'' the next to
shown by ddiirrss, starting with zero. For example: ``popd
-0'' removes the last directory, ``popd -1'' the next to
last.
If the ppooppdd command is successful, a ddiirrss is performed as well,
and the return status is 0. ppooppdd returns false if an invalid
If the ppooppdd command is successful, a ddiirrss is performed as well,
and the return status is 0. ppooppdd returns false if an invalid
option is encountered, the directory stack is empty, a non-exis-
tent directory stack entry is specified, or the directory change
fails.
pprriinnttff [--vv _v_a_r] _f_o_r_m_a_t [_a_r_g_u_m_e_n_t_s]
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which
contains three types of objects: plain characters, which are
simply copied to standard output, character escape sequences,
which are converted and copied to the standard output, and for-
mat specifications, each of which causes printing of the next
Write the formatted _a_r_g_u_m_e_n_t_s to the standard output under the
control of the _f_o_r_m_a_t. The _f_o_r_m_a_t is a character string which
contains three types of objects: plain characters, which are
simply copied to standard output, character escape sequences,
which are converted and copied to the standard output, and for-
mat specifications, each of which causes printing of the next
successive _a_r_g_u_m_e_n_t. In addition to the standard _p_r_i_n_t_f(1) for-
mats, %%bb causes pprriinnttff to expand backslash escape sequences in
the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output,
mats, %%bb causes pprriinnttff to expand backslash escape sequences in
the corresponding _a_r_g_u_m_e_n_t (except that \\cc terminates output,
backslashes in \\'', \\"", and \\?? are not removed, and octal escapes
beginning with \\00 may contain up to four digits), and %%qq causes
beginning with \\00 may contain up to four digits), and %%qq causes
pprriinnttff to output the corresponding _a_r_g_u_m_e_n_t in a format that can
be reused as shell input.
Arguments to non-string format specifiers are treated as C con-
stants, 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 --vv option causes the output to be assigned to the variable
_v_a_r rather than being printed to the standard output.
@@ -1520,7 +1526,7 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--uu The maximum number of processes available to a single
user
--vv The maximum amount of virtual memory available to the
shell
shell and, on some systems, to its children
--xx The maximum number of file locks
--TT The maximum number of threads