commit bash-20110311 snapshot

This commit is contained in:
Chet Ramey
2011-12-29 13:05:08 -05:00
parent 40647963e2
commit d9e1f41e7f
49 changed files with 13947 additions and 12188 deletions
+80
View File
@@ -11210,3 +11210,83 @@ lib/readline/display.c
- fix rl_message to use a dynamically-allocated buffer instead of a
fixed-size buffer of 128 chars for the `local message prompt'. Bug
report and fix from Micah Cowan <micah@cowan.name>
3/7
---
jobs.c
- add sentinel to wait_sigint_handler so it only sets wait_sigint_received
if waiting_for_child is non-zero; otherwise, it restores the old
SIGINT handler and sends itself the SIGINT
- set waiting_for_child around the calls to waitchld that use it to
synchronously wait for a process
- change logic that decides whether or not the child process blocked
or handled SIGINT based on whether or not waitpid returns -1/EINTR
and the shell receives a SIGINT and the child does not exit. If
the child later exits due to SIGINT, cancel the assumoption that it
was handled
- instead of testing whether or not the child exited due to SIGINT
when deciding whether the shell should act on a SIGINT it received
while waiting, test whether or not we think the child caught
SIGINT. If it did, we let it go (unless the shell has it trapped);
if it did not catch it, the shell acts on the SIGINT. Fix from
Linus Torvalds <torvalds@linux-foundation.org>, bug report originally
from Oleg Nesterov <oleg@redhat.com>
3/8
---
shell.c
- initialize no_line_editing to 1 if READLINE is not defined -- we
can't have line editing without readline
3/12
----
lib/readline/signals.c
- add SIGHUP to the set of signals readline handles
lib/readline/doc/rltech.texi
- document that SIGHUP is now part of the set of signals readline
handles
lib/readline/input.c
- if _rl_caught_signal indicates that read() was interrupted by a
SIGHUP or SIGTERM, return READERR or EOF as appropriate
- call rl_event_hook, if it's set, if call to read in rl_getc
returns -1/EINTR. If rl_event_hook doesn't do anything, this
continues the loop as before. This handles the other fatal
signals
execute_cmd.c
- add a couple of QUIT; calls to execute_disk_command and
execute_simple_command to improve responsiveness to interrupts
and fatal signals
input.c
- rearrange getc_with_restart so that the return values from read()
are handled right
parse.y
- don't need to set terminate_immediately in yy_stream_get, since
getc_with_restart checks for terminating signals itself
- since readline returns READERR on SIGHUP or SIGTERM, don't need
to set terminate_immediately. Still doesn't handle other
signals well -- will have to check that some more
bashline.c
- new function, bash_event_hook, for rl_event_hook. Just checks for
terminating signals and acts on them using CHECK_TERMSIG.
- set rl_event_hook to bash_event_hook
builtins/read.def
- take out setting terminate_immediately; add calls to CHECK_TERMSIG
after read calls
doc/{bash.1,bashref.texi}
- move the text describing the effect of negative subscripts used to
reference indexed array elements to the paragraphs describing
${parameter[subscript]}, since that's where they are implemented.
Pointed out by Christopher F. A. Johnson <cfajohnson@gmail.com>
arrayfunc.[ch],subst.c
- array_expand_index now takes a new first argument: a SHELL_VAR *
of the array variable being subscripted. Can be used later to fully
implement negative subscripts
+81 -1
View File
@@ -11162,7 +11162,7 @@ execute_cmd.c
- fix expand_word_unsplit to add the W_NOSPLIT2 flag to the word to
be expanded, so "" doesn't add CTLNUL. Similar to fix of 2/18 to
expand_string_for_rhs. Fixes bug reported by Nathanael D. Noblet
<nathanael@gnat.ca>
<nathanael@gnat.ca> and Matthias Klose <doko@debian.org>
parse.y
- fix extended_glob case of read_token_word to allocate an extra
@@ -11210,3 +11210,83 @@ lib/readline/display.c
- fix rl_message to use a dynamically-allocated buffer instead of a
fixed-size buffer of 128 chars for the `local message prompt'. Bug
report and fix from Micah Cowan <micah@cowan.name>
3/7
---
jobs.c
- add sentinel to wait_sigint_handler so it only sets wait_sigint_received
if waiting_for_child is non-zero; otherwise, it restores the old
SIGINT handler and sends itself the SIGINT
- set waiting_for_child around the calls to waitchld that use it to
synchronously wait for a process
- change logic that decides whether or not the child process blocked
or handled SIGINT based on whether or not waitpid returns -1/EINTR
and the shell receives a SIGINT and the child does not exit. If
the child later exits due to SIGINT, cancel the assumoption that it
was handled
- instead of testing whether or not the child exited due to SIGINT
when deciding whether the shell should act on a SIGINT it received
while waiting, test whether or not we think the child caught
SIGINT. If it did, we let it go (unless the shell has it trapped);
if it did not catch it, the shell acts on the SIGINT. Fix from
Linus Torvalds <torvalds@linux-foundation.org>, bug report originally
from Oleg Nesterov <oleg@redhat.com>
3/8
---
shell.c
- initialize no_line_editing to 1 if READLINE is not defined -- we
can't have line editing without readline
3/12
----
lib/readline/signals.c
- add SIGHUP to the set of signals readline handles
lib/readline/doc/rltech.texi
- document that SIGHUP is now part of the set of signals readline
handles
lib/readline/input.c
- if _rl_caught_signal indicates that read() was interrupted by a
SIGHUP or SIGTERM, return READERR or EOF as appropriate
- call rl_event_hook, if it's set, if call to read in rl_getc
returns -1/EINTR. If rl_event_hook doesn't do anything, this
continues the loop as before. This handles the other fatal
signals
execute_cmd.c
- add a couple of QUIT; calls to execute_disk_command and
execute_simple_command to improve responsiveness to interrupts
and fatal signals
input.c
- rearrange getc_with_restart so that the return values from read()
are handled right
parse.y
- don't need to set terminate_immediately in yy_stream_get, since
getc_with_restart checks for terminating signals itself
- since readline returns READERR on SIGHUP or SIGTERM, don't need
to set terminate_immediately. Still doesn't handle other
signals well -- will have to check that some more
bashline.c
- new function, bash_event_hook, for rl_event_hook. Just checks for
terminating signals and acts on them using CHECK_TERMSIG.
- set rl_event_hook to bash_event_hook
builtins/read.def
- take out setting terminate_immediately; add calls to CHECK_TERMSIG
after read calls
doc/{bash.1,bashref.texi}
- move the text describing the effect of negative subscripts used to
reference indexed array elements to the paragraphs describing
${parameter[subscript]}, since that's where they are implemented.
Pointed out by Christopher F. A. Johnson <cfajohnson@gmail.com>
arrayfunc.[ch],subst.c
- array_expand_index now takes a new first argument: a SHELL_VAR *
of the variable being subscripted. Can be used later to fully
implement negative subscripts
+6 -5
View File
@@ -271,7 +271,7 @@ assign_array_element (name, value, flags)
}
else
{
ind = array_expand_index (sub, sublen);
ind = array_expand_index (entry, sub, sublen);
if (ind < 0)
{
free (vname);
@@ -485,7 +485,7 @@ assign_compound_array_list (var, nlist, flags)
if (array_p (var))
{
ind = array_expand_index (w + 1, len);
ind = array_expand_index (var, w + 1, len);
if (ind < 0)
{
err_badarraysub (w);
@@ -662,7 +662,7 @@ unbind_array_element (var, sub)
}
else
{
ind = array_expand_index (sub, len+1);
ind = array_expand_index (var, sub, len+1);
if (ind < 0)
{
builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg));
@@ -752,7 +752,8 @@ valid_array_reference (name)
/* Expand the array index beginning at S and extending LEN characters. */
arrayind_t
array_expand_index (s, len)
array_expand_index (var, s, len)
SHELL_VAR *var;
char *s;
int len;
{
@@ -934,7 +935,7 @@ array_value_internal (s, quoted, flags, rtype, indp)
{
if ((flags & AV_USEIND) == 0 || indp == 0)
{
ind = array_expand_index (t, len);
ind = array_expand_index (var, t, len);
if (ind < 0)
{
/* negative subscripts to indexed arrays count back from end */
+1042
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -54,7 +54,7 @@ extern int skipsubscript __P((const char *, int, int));
extern void print_array_assignment __P((SHELL_VAR *, int));
extern void print_assoc_assignment __P((SHELL_VAR *, int));
extern arrayind_t array_expand_index __P((char *, int));
extern arrayind_t array_expand_index __P((SHELL_VAR *, char *, int));
extern int valid_array_reference __P((char *));
extern char *array_value __P((char *, int, int, int *, arrayind_t *));
extern char *get_array_value __P((char *, int, int *, arrayind_t *));
+69
View File
@@ -0,0 +1,69 @@
/* arrayfunc.h -- declarations for miscellaneous array functions in arrayfunc.c */
/* Copyright (C) 2001-2010 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined (_ARRAYFUNC_H_)
#define _ARRAYFUNC_H_
/* Must include variables.h before including this file. */
#if defined (ARRAY_VARS)
/* Flags for array_value_internal and callers array_value/get_array_value */
#define AV_ALLOWALL 0x001
#define AV_QUOTED 0x002
#define AV_USEIND 0x004
extern SHELL_VAR *convert_var_to_array __P((SHELL_VAR *));
extern SHELL_VAR *convert_var_to_assoc __P((SHELL_VAR *));
extern SHELL_VAR *bind_array_variable __P((char *, arrayind_t, char *, int));
extern SHELL_VAR *bind_array_element __P((SHELL_VAR *, arrayind_t, char *, int));
extern SHELL_VAR *assign_array_element __P((char *, char *, int));
extern SHELL_VAR *bind_assoc_variable __P((SHELL_VAR *, char *, char *, char *, int));
extern SHELL_VAR *find_or_make_array_variable __P((char *, int));
extern SHELL_VAR *assign_array_from_string __P((char *, char *, int));
extern SHELL_VAR *assign_array_var_from_word_list __P((SHELL_VAR *, WORD_LIST *, int));
extern WORD_LIST *expand_compound_array_assignment __P((SHELL_VAR *, char *, int));
extern void assign_compound_array_list __P((SHELL_VAR *, WORD_LIST *, int));
extern SHELL_VAR *assign_array_var_from_string __P((SHELL_VAR *, char *, int));
extern int unbind_array_element __P((SHELL_VAR *, char *));
extern int skipsubscript __P((const char *, int, int));
extern void print_array_assignment __P((SHELL_VAR *, int));
extern void print_assoc_assignment __P((SHELL_VAR *, int));
extern arrayind_t array_expand_index __P((char *, int));
extern int valid_array_reference __P((char *));
extern char *array_value __P((char *, int, int, int *, arrayind_t *));
extern char *get_array_value __P((char *, int, int *, arrayind_t *));
extern char *array_keys __P((char *, int));
extern char *array_variable_name __P((char *, char **, int *));
extern SHELL_VAR *array_variable_part __P((char *, char **, int *));
#endif
#endif /* !_ARRAYFUNC_H_ */
+11
View File
@@ -161,6 +161,8 @@ static int set_saved_history __P((void));
static int posix_edit_macros __P((int, int));
#endif
static int bash_event_hook __P((void));
#if defined (PROGRAMMABLE_COMPLETION)
static int find_cmd_start __P((int));
static int find_cmd_end __P((int));
@@ -535,6 +537,8 @@ initialize_readline ()
rl_filename_dequoting_function = bash_dequote_filename;
rl_char_is_quoted_p = char_is_quoted;
rl_event_hook = bash_event_hook;
#if 0
/* This is superfluous and makes it impossible to use tab completion in
vi mode even when explicitly binding it in ~/.inputrc. sv_strict_posix()
@@ -3701,4 +3705,11 @@ bash_dequote_text (text)
dtxt = bash_dequote_filename ((char *)text, qc);
return (dtxt);
}
static int
bash_event_hook ()
{
CHECK_TERMSIG;
}
#endif /* READLINE */
+1 -2
View File
@@ -455,7 +455,6 @@ read_builtin (list)
of the unwind-protect stack after the realloc() works right. */
add_unwind_protect (xfree, input_string);
interrupt_immediately++;
terminate_immediately++;
unbuffered_read = (nchars > 0) || (delim != '\n') || input_is_pipe;
@@ -512,6 +511,7 @@ read_builtin (list)
if (retval <= 0)
{
CHECK_TERMSIG;
eof = 1;
break;
}
@@ -622,7 +622,6 @@ add_char:
assign_vars:
interrupt_immediately--;
terminate_immediately--;
#if defined (ARRAY_VARS)
/* If -a was given, take the string read, break it into a list of words,
+1530 -1563
View File
File diff suppressed because it is too large Load Diff
+8 -7
View File
@@ -5,12 +5,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
.\" Last Change: Tue Dec 28 13:41:43 EST 2010
.\" Last Change: Sat Mar 12 21:44:43 EST 2011
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
.TH BASH 1 "2010 December 28" "GNU Bash-4.2"
.TH BASH 1 "2011 March 12" "GNU Bash-4.2"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -2360,11 +2360,6 @@ An indexed array is created automatically if any variable is assigned to
using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The
.I subscript
is treated as an arithmetic expression that must evaluate to a number.
If
.I 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
.B declare \-a \fIname\fP
(see
@@ -2426,6 +2421,12 @@ ${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or
\fB@\fP, 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
.I subscript
used to reference an element of an indexed array
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).
.PP
An array variable is considered set if a subscript has been assigned a
value. The null string is a valid value.
+10 -9
View File
@@ -706,8 +706,8 @@ is enabled, the match is performed without regard to the case
of alphabetic characters.
The return value is 0 if the string matches (\fB==\fP) or does not match
(\fB!=\fP) 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.
.if t .sp 0.5
.if n .sp 1
An additional binary operator, \fB=~\fP, is available, with the same
@@ -722,8 +722,8 @@ If the shell option
.B nocasematch
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.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the array variable
.SM
@@ -2360,11 +2360,6 @@ An indexed array is created automatically if any variable is assigned to
using the syntax \fIname\fP[\fIsubscript\fP]=\fIvalue\fP. The
.I subscript
is treated as an arithmetic expression that must evaluate to a number.
If
.I 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
.B declare \-a \fIname\fP
(see
@@ -2426,6 +2421,12 @@ ${\fIname\fP[\fIsubscript\fP]}. If \fIsubscript\fP is \fB*\fP or
\fB@\fP, 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
.I subscript
used to reference an element of an indexed array
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).
.PP
An array variable is considered set if a subscript has been assigned a
value. The null string is a valid value.
+33 -22
View File
@@ -42,7 +42,7 @@ bash - GNU Bourne-Again SHell
<H3>COPYRIGHT</H3>
Bash is Copyright &#169; 1989-2010 by the Free Software Foundation, Inc.
Bash is Copyright &#169; 1989-2011 by the Free Software Foundation, Inc.
<A NAME="lbAE">&nbsp;</A>
<H3>DESCRIPTION</H3>
@@ -930,8 +930,8 @@ is enabled, the match is performed without regard to the case
of alphabetic characters.
The return value is 0 if the string matches (<B>==</B>) or does not match
(<B>!=</B>) 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.
<P>
@@ -948,8 +948,8 @@ 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.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the array variable
<FONT SIZE=-1><B>BASH_REMATCH</B>.
@@ -1907,7 +1907,6 @@ this instance of
The values assigned to the array members are as follows:
<P>
<DL COMPACT><DT><DD>
<DL COMPACT>
<DT><B>BASH_VERSINFO[</B>0]
@@ -1936,7 +1935,6 @@ The value of
<FONT SIZE=-1><B>MACHTYPE</B>.
</FONT>
</DL></DL>
<DT><B>BASH_VERSION</B>
@@ -2917,6 +2915,7 @@ If this variable is not set, <B>bash</B> acts as if it had the
value <B>$aq\nreal\t%3lR\nuser\t%3lU\nsys %3lSaq</B>.
If the value is null, no timing information is displayed.
A trailing newline is added when the format string is displayed.
<DT><B>TMOUT</B>
<DD>
@@ -3138,6 +3137,10 @@ option to specify an indexed array and a
<B>-A</B>
option to specify an associative array.
If both options are supplied,
<B>-A</B>
takes precedence.
The
<B>read</B>
@@ -3432,7 +3435,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 <I>parameter</I> itself.
This is known as <I>indirect expansion</I>.
The exceptions to this are the expansions of ${<B>!\fPfIprefix</B><B>*</B>} and
The exceptions to this are the expansions of ${<B>!</B><I>prefix</I><B>*</B>} and
${<B>!</B><I>name</I>[<I>@</I>]} described below.
The exclamation point must immediately follow the left brace in order to
introduce indirection.
@@ -3741,8 +3744,6 @@ array in turn, and the expansion is the resultant list.
<I>Command substitution</I> allows the output of a command to replace
the command name. There are two forms:
<P>
<DL COMPACT><DT><DD>
<P>
@@ -4640,8 +4641,10 @@ A variant of here documents, the format is:
<P>
The <I>word</I> is expanded and supplied to the command on its standard
input.
The <I>word</I>
is expanded as described above, with the exception that
pathname expansion is not applied, and supplied as a single string
to the command on its standard input.
<A NAME="lbBQ">&nbsp;</A>
<H4>Duplicating File Descriptors</H4>
@@ -5455,7 +5458,6 @@ arguments, if any.
The shell has an <I>execution environment</I>, which consists of the
following:
<DL COMPACT>
<DT>*<DD>
open files inherited by the shell at invocation, as modified by
@@ -9276,12 +9278,12 @@ with the exceptions that <B>+a</B>
may not be used to destroy an array variable and <B>+r</B> will not
remove the readonly attribute.
When used in a function, makes each
<I>name</I> local, as with the
<I>name</I> local, as with the
<B>local</B>
command,
unless the <B>-gP option is supplied,
If a variable name is followed by =</B><I>value</I>, the value of
unless the <B>-g</B> option is supplied,
If a variable name is followed by =<I>value</I>, the value of
the variable is set to <I>value</I>.
The return value is 0 unless an invalid option is encountered,
an attempt is made to define a function using
@@ -9990,11 +9992,14 @@ Display the description of each <I>pattern</I> in a manpage-like format
<DD>
Display only a short usage synopsis for each <I>pattern</I>
</DL></DL>
</DL>
<P>
The return status is 0 unless no command matches
<I>pattern</I>.
</DL>
<DT><B>history [</B><I>n</I>]<DD>
<DT><B>history</B> <B>-c</B><DD>
@@ -10695,7 +10700,7 @@ times out (in which case the return code is greater than 128), or an
invalid file descriptor is supplied as the argument to <B>-u</B>.
</DL>
<DT><B>readonly</B> [<B>-aApf</B>] [<I>name</I>[=<I>word</I>] ...]<DD>
<DT><B>readonly</B> [<B>-aAf</B>] [<B>-p</B>] [<I>name</I>[=<I>word</I>] ...]<DD>
The given
<I>names</I> are marked readonly; the values of these
@@ -10715,6 +10720,10 @@ option restricts the variables to indexed arrays; the
<B>-A</B>
option restricts the variables to associative arrays.
If both options are supplied,
<B>-A</B>
takes precedence.
If no
<I>name</I>
@@ -10722,6 +10731,8 @@ arguments are given, or if the
<B>-p</B>
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
<B>-p</B>
@@ -11432,7 +11443,6 @@ and the effect of interrupting a command list.
<DT><B>compat41</B>
<DD>
@item compat41
If set,
<B>bash</B>,
@@ -11562,7 +11572,7 @@ This option is enabled by default.
<DD>
If set, the pattern <B>**</B> 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 <B>/</B>, only directories and
subdirectories match.
<DT><B>gnu_errfmt</B>
@@ -11758,6 +11768,7 @@ If set, the <B>echo</B> builtin expands backslash-escape sequences
by default.
</DL></DL>
<DT><B>suspend</B> [<B>-f</B>]<DD>
Suspend the execution of this shell until it receives a
<FONT SIZE=-1><B>SIGCONT</B>
@@ -12643,7 +12654,7 @@ it provides for filing a bug report.
Comments and bug reports concerning
this manual page should be directed to
<I><A HREF="mailto:chet@po.cwru.edu">chet@po.cwru.edu</A></I>.
<I><A HREF="mailto:chet.ramey@case.edu">chet.ramey@case.edu</A></I>.
<A NAME="lbDH">&nbsp;</A>
<H3>BUGS</H3>
@@ -12797,6 +12808,6 @@ There may be only one active coprocess at a time.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 28 December 2010 14:30:29 EST
Time: 09 March 2011 17:05:44 EST
</BODY>
</HTML>
BIN
View File
Binary file not shown.
+2427 -2425
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+19 -13
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on December, 28 2010 by texi2html 1.64 -->
<!-- Created on March, 9 2011 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -1351,8 +1351,8 @@ is enabled, the match is performed without regard to the case
of alphabetic characters.
The return value is 0 if the string matches (<SAMP>`=='</SAMP>) or does not
match (<SAMP>`!='</SAMP>)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.
</P><P>
An additional binary operator, <SAMP>`=~'</SAMP>, is available, with the same
@@ -1367,8 +1367,8 @@ If the shell option <CODE>nocasematch</CODE>
(see the description of <CODE>shopt</CODE> in <A HREF="bashref.html#SEC64">4.3.2 The Shopt Builtin</A>)
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.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the array variable <CODE>BASH_REMATCH</CODE>.
The element of <CODE>BASH_REMATCH</CODE> with index 0 is the portion of the string
@@ -3198,8 +3198,10 @@ A variant of here documents, the format is:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;&#60;&#60; <VAR>word</VAR>
</pre></td></tr></table><P>
The <VAR>word</VAR> is expanded and supplied to the command on its standard
input.
The <VAR>word</VAR>
is expanded as described above, with the exception that
pathname expansion is not applied, and supplied as a single string
to the command on its standard input.
</P><P>
<HR SIZE="6">
@@ -4172,7 +4174,7 @@ is supplied.
<DT><CODE>readonly</CODE>
<DD><A NAME="IDX80"></A>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>readonly [-aApf] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>readonly [-aAf] [-p] [<VAR>name</VAR>[=<VAR>value</VAR>]] <small>...</small>
</pre></td></tr></table>Mark each <VAR>name</VAR> as readonly.
The values of these names may not be changed by subsequent assignment.
If the <SAMP>`-f'</SAMP> option is supplied, each <VAR>name</VAR> refers to a shell
@@ -4180,8 +4182,11 @@ function.
The <SAMP>`-a'</SAMP> option means each <VAR>name</VAR> refers to an indexed
array variable; the <SAMP>`-A'</SAMP> option means each <VAR>name</VAR> refers
to an associative array variable.
If both options are supplied, <SAMP>`-A'</SAMP> takes precedence.
If no <VAR>name</VAR> arguments are given, or if the <SAMP>`-p'</SAMP>
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 <SAMP>`-p'</SAMP> option causes output to be displayed in a format that
may be reused as input.
If a variable name is followed by =<VAR>value</VAR>, the value of
@@ -4651,7 +4656,7 @@ the function is defined are displayed as well.
</P><P>
The <SAMP>`-g'</SAMP> option forces variables to be created or modified at
the global scope, even when \fBdeclare\fP is executed in a shell function.
the global scope, even when <CODE>declare</CODE> is executed in a shell function.
It is ignored in all other cases.
</P><P>
@@ -5883,7 +5888,7 @@ This option is enabled by default.
<DT><CODE>globstar</CODE>
<DD>If set, the pattern <SAMP>`**'</SAMP> used in a filename 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 <SAMP>`/'</SAMP>, only directories and
subdirectories match.
<P>
@@ -8201,7 +8206,7 @@ There is no maximum
limit on the size of an array, nor any requirement that members
be indexed or assigned contiguously.
Indexed arrays are referenced using integers (including arithmetic
expressions (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>) and are zero-based;
expressions (see section <A HREF="bashref.html#SEC84">6.5 Shell Arithmetic</A>)) and are zero-based;
associative arrays use arbitrary strings.
</P><P>
@@ -8295,6 +8300,7 @@ entire array.
The <CODE>declare</CODE>, <CODE>local</CODE>, and <CODE>readonly</CODE>
builtins each accept a <SAMP>`-a'</SAMP> option to specify an indexed
array and a <SAMP>`-A'</SAMP> option to specify an associative array.
If both options are supplied, <SAMP>`-A'</SAMP> takes precedence.
The <CODE>read</CODE> builtin accepts a <SAMP>`-a'</SAMP>
option to assign a list of words read from the standard input
to an array, and can read values from the standard input into
@@ -16380,7 +16386,7 @@ to permit their use in free software.
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="bashref.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1>About this document</H1>
This document was generated by <I>Chet Ramey</I> on <I>December, 28 2010</I>
This document was generated by <I>Chet Ramey</I> on <I>March, 9 2011</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -16542,7 +16548,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>December, 28 2010</I>
by <I>Chet Ramey</I> on <I>March, 9 2011</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+148 -144
View File
@@ -7,7 +7,7 @@ the Bash shell (version 4.2, 28 December 2010).
This is Edition 4.2, last updated 28 December 2010, of `The GNU Bash
Reference Manual', for `Bash', Version 4.2.
Copyright (C) 1988-2010 Free Software Foundation, Inc.
Copyright (C) 1988-2011 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -887,7 +887,7 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
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.
be quoted to force the quoted portion to be matched as a string.
An additional binary operator, `=~', is available, with the same
precedence as `==' and `!='. When it is used, the string to the
@@ -899,13 +899,13 @@ File: bashref.info, Node: Conditional Constructs, Next: Command Grouping, Pre
(see the description of `shopt' in *note The Shopt Builtin::) 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. Substrings matched by
parenthesized subexpressions within the regular expression are
saved in the array variable `BASH_REMATCH'. The element of
`BASH_REMATCH' with index 0 is the portion of the string matching
the entire regular expression. The element of `BASH_REMATCH' with
index N is the portion of the string matching the Nth
parenthesized subexpression.
force the quoted portion to be matched as a string. Substrings
matched by parenthesized subexpressions within the regular
expression are saved in the array variable `BASH_REMATCH'. The
element of `BASH_REMATCH' with index 0 is the portion of the string
matching the entire regular expression. The element of
`BASH_REMATCH' with index N is the portion of the string matching
the Nth parenthesized subexpression.
Expressions may be combined using the following operators, listed
in decreasing order of precedence:
@@ -2068,8 +2068,9 @@ indented in a natural fashion.
A variant of here documents, the format is:
<<< WORD
The WORD is expanded and supplied to the command on its standard
input.
The WORD is expanded as described above, with the exception that
pathname expansion is not applied, and supplied as a single string to
the command on its standard input.
3.6.8 Duplicating File Descriptors
----------------------------------
@@ -2689,20 +2690,22 @@ standard.
current directory or an invalid option is supplied.
`readonly'
readonly [-aApf] [NAME[=VALUE]] ...
readonly [-aAf] [-p] [NAME[=VALUE]] ...
Mark each NAME as readonly. The values of these names may not be
changed by subsequent assignment. If the `-f' option is supplied,
each NAME refers to a shell function. The `-a' option means each
NAME refers to an indexed array variable; the `-A' option means
each NAME refers to an associative array variable. If no NAME
arguments are given, or if the `-p' option is supplied, a list of
all readonly names is printed. The `-p' option causes output to
be displayed in a format that may be reused as input. If a
variable name is followed by =VALUE, the value of the variable is
set to VALUE. The return status is zero unless an invalid option
is supplied, one of the NAME arguments is not a valid shell
variable or function name, or the `-f' option is supplied with a
name that is not a shell function.
each NAME refers to an associative array variable. If both
options are supplied, `-A' takes precedence. If no NAME 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' option causes output to be displayed in a format that may be
reused as input. If a variable name is followed by =VALUE, the
value of the variable is set to VALUE. The return status is zero
unless an invalid option is supplied, one of the NAME arguments is
not a valid shell variable or function name, or the `-f' option is
supplied with a name that is not a shell function.
`return'
return [N]
@@ -3044,8 +3047,8 @@ POSIX standard.
are displayed as well. `-F' implies `-f'.
The `-g' option forces variables to be created or modified at the
global scope, even when \fBdeclare\fP is executed in a shell
function. It is ignored in all other cases.
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 attributes or to give variables attributes:
@@ -4011,7 +4014,7 @@ This builtin allows you to change additional shell optional behavior.
`globstar'
If set, the pattern `**' used in a filename expansion context
will match a files and zero or more directories and
will match all files and zero or more directories and
subdirectories. If the pattern is followed by a `/', only
directories and subdirectories match.
@@ -5524,7 +5527,7 @@ Any variable may be used as an indexed array; the `declare' builtin
will explicitly declare an array. There is no maximum limit on the
size of an array, nor any requirement that members be indexed or
assigned contiguously. Indexed arrays are referenced using integers
(including arithmetic expressions (*note Shell Arithmetic::) and are
(including arithmetic expressions (*note Shell Arithmetic::)) and are
zero-based; associative arrays use arbitrary strings.
An indexed array is created automatically if any variable is
@@ -5592,11 +5595,12 @@ array. A subscript of `*' or `@' also removes the entire array.
The `declare', `local', and `readonly' builtins each accept a `-a'
option to specify an indexed array and a `-A' option to specify an
associative array. The `read' builtin accepts a `-a' option to assign
a list of words read from the standard input to an array, and can read
values from the standard input into individual array elements. The
`set' and `declare' builtins display array values in a way that allows
them to be reused as input.
associative array. If both options are supplied, `-A' takes precedence.
The `read' builtin accepts a `-a' option to assign a list of words read
from the standard input to an array, and can read values from the
standard input into individual array elements. The `set' and `declare'
builtins display array values in a way that allows them to be reused as
input.

File: bashref.info, Node: The Directory Stack, Next: Printing a Prompt, Prev: Arrays, Up: Bash Features
@@ -9884,7 +9888,7 @@ D.1 Index of Shell Builtin Commands
* :: Bourne Shell Builtins.
(line 11)
* [: Bourne Shell Builtins.
(line 217)
(line 219)
* alias: Bash Builtins. (line 11)
* bg: Job Control Builtins.
(line 7)
@@ -9950,28 +9954,28 @@ D.1 Index of Shell Builtin Commands
* readonly: Bourne Shell Builtins.
(line 176)
* return: Bourne Shell Builtins.
(line 192)
(line 194)
* set: The Set Builtin. (line 11)
* shift: Bourne Shell Builtins.
(line 205)
(line 207)
* shopt: The Shopt Builtin. (line 9)
* source: Bash Builtins. (line 535)
* suspend: Job Control Builtins.
(line 94)
* test: Bourne Shell Builtins.
(line 217)
(line 219)
* times: Bourne Shell Builtins.
(line 290)
(line 292)
* trap: Bourne Shell Builtins.
(line 295)
(line 297)
* type: Bash Builtins. (line 539)
* typeset: Bash Builtins. (line 570)
* ulimit: Bash Builtins. (line 576)
* umask: Bourne Shell Builtins.
(line 341)
(line 343)
* unalias: Bash Builtins. (line 665)
* unset: Bourne Shell Builtins.
(line 358)
(line 360)
* wait: Job Control Builtins.
(line 73)
@@ -10496,111 +10500,111 @@ Node: Lists23743
Node: Compound Commands25472
Node: Looping Constructs26276
Node: Conditional Constructs28735
Node: Command Grouping36848
Node: Coprocesses38327
Node: GNU Parallel39992
Node: Shell Functions42460
Node: Shell Parameters47404
Node: Positional Parameters49820
Node: Special Parameters50720
Node: Shell Expansions53684
Node: Brace Expansion55609
Node: Tilde Expansion58364
Node: Shell Parameter Expansion60715
Node: Command Substitution69850
Node: Arithmetic Expansion71183
Node: Process Substitution72033
Node: Word Splitting73083
Node: Filename Expansion74706
Node: Pattern Matching76845
Node: Quote Removal80484
Node: Redirections80779
Node: Executing Commands89304
Node: Simple Command Expansion89974
Node: Command Search and Execution91904
Node: Command Execution Environment94241
Node: Environment97227
Node: Exit Status98887
Node: Signals100508
Node: Shell Scripts102476
Node: Shell Builtin Commands104994
Node: Bourne Shell Builtins107022
Node: Bash Builtins124952
Node: Modifying Shell Behavior151166
Node: The Set Builtin151511
Node: The Shopt Builtin161045
Node: Special Builtins173217
Node: Shell Variables174196
Node: Bourne Shell Variables174636
Node: Bash Variables176663
Node: Bash Features201572
Node: Invoking Bash202455
Node: Bash Startup Files208219
Node: Interactive Shells213240
Node: What is an Interactive Shell?213650
Node: Is this Shell Interactive?214299
Node: Interactive Shell Behavior215114
Node: Bash Conditional Expressions218394
Node: Shell Arithmetic222183
Node: Aliases224942
Node: Arrays227514
Node: The Directory Stack231629
Node: Directory Stack Builtins232343
Node: Printing a Prompt235235
Node: The Restricted Shell237987
Node: Bash POSIX Mode239819
Node: Job Control248480
Node: Job Control Basics248940
Node: Job Control Builtins253657
Node: Job Control Variables258021
Node: Command Line Editing259179
Node: Introduction and Notation260746
Node: Readline Interaction262368
Node: Readline Bare Essentials263559
Node: Readline Movement Commands265348
Node: Readline Killing Commands266313
Node: Readline Arguments268233
Node: Searching269277
Node: Readline Init File271463
Node: Readline Init File Syntax272610
Node: Conditional Init Constructs287952
Node: Sample Init File290485
Node: Bindable Readline Commands293602
Node: Commands For Moving294809
Node: Commands For History295953
Node: Commands For Text299388
Node: Commands For Killing302061
Node: Numeric Arguments304518
Node: Commands For Completion305657
Node: Keyboard Macros309849
Node: Miscellaneous Commands310420
Node: Readline vi Mode316226
Node: Programmable Completion317133
Node: Programmable Completion Builtins324343
Node: Using History Interactively333479
Node: Bash History Facilities334163
Node: Bash History Builtins337077
Node: History Interaction340934
Node: Event Designators343639
Node: Word Designators344861
Node: Modifiers346500
Node: Installing Bash347904
Node: Basic Installation349041
Node: Compilers and Options351733
Node: Compiling For Multiple Architectures352474
Node: Installation Names354138
Node: Specifying the System Type354956
Node: Sharing Defaults355672
Node: Operation Controls356345
Node: Optional Features357303
Node: Reporting Bugs366871
Node: Major Differences From The Bourne Shell368072
Node: GNU Free Documentation License384759
Node: Indexes409955
Node: Builtin Index410409
Node: Reserved Word Index417236
Node: Variable Index419684
Node: Function Index432779
Node: Concept Index439788
Node: Command Grouping36880
Node: Coprocesses38359
Node: GNU Parallel40024
Node: Shell Functions42492
Node: Shell Parameters47436
Node: Positional Parameters49852
Node: Special Parameters50752
Node: Shell Expansions53716
Node: Brace Expansion55641
Node: Tilde Expansion58396
Node: Shell Parameter Expansion60747
Node: Command Substitution69882
Node: Arithmetic Expansion71215
Node: Process Substitution72065
Node: Word Splitting73115
Node: Filename Expansion74738
Node: Pattern Matching76877
Node: Quote Removal80516
Node: Redirections80811
Node: Executing Commands89434
Node: Simple Command Expansion90104
Node: Command Search and Execution92034
Node: Command Execution Environment94371
Node: Environment97357
Node: Exit Status99017
Node: Signals100638
Node: Shell Scripts102606
Node: Shell Builtin Commands105124
Node: Bourne Shell Builtins107152
Node: Bash Builtins125246
Node: Modifying Shell Behavior151455
Node: The Set Builtin151800
Node: The Shopt Builtin161334
Node: Special Builtins173508
Node: Shell Variables174487
Node: Bourne Shell Variables174927
Node: Bash Variables176954
Node: Bash Features201863
Node: Invoking Bash202746
Node: Bash Startup Files208510
Node: Interactive Shells213531
Node: What is an Interactive Shell?213941
Node: Is this Shell Interactive?214590
Node: Interactive Shell Behavior215405
Node: Bash Conditional Expressions218685
Node: Shell Arithmetic222474
Node: Aliases225233
Node: Arrays227805
Node: The Directory Stack231974
Node: Directory Stack Builtins232688
Node: Printing a Prompt235580
Node: The Restricted Shell238332
Node: Bash POSIX Mode240164
Node: Job Control248825
Node: Job Control Basics249285
Node: Job Control Builtins254002
Node: Job Control Variables258366
Node: Command Line Editing259524
Node: Introduction and Notation261091
Node: Readline Interaction262713
Node: Readline Bare Essentials263904
Node: Readline Movement Commands265693
Node: Readline Killing Commands266658
Node: Readline Arguments268578
Node: Searching269622
Node: Readline Init File271808
Node: Readline Init File Syntax272955
Node: Conditional Init Constructs288297
Node: Sample Init File290830
Node: Bindable Readline Commands293947
Node: Commands For Moving295154
Node: Commands For History296298
Node: Commands For Text299733
Node: Commands For Killing302406
Node: Numeric Arguments304863
Node: Commands For Completion306002
Node: Keyboard Macros310194
Node: Miscellaneous Commands310765
Node: Readline vi Mode316571
Node: Programmable Completion317478
Node: Programmable Completion Builtins324688
Node: Using History Interactively333824
Node: Bash History Facilities334508
Node: Bash History Builtins337422
Node: History Interaction341279
Node: Event Designators343984
Node: Word Designators345206
Node: Modifiers346845
Node: Installing Bash348249
Node: Basic Installation349386
Node: Compilers and Options352078
Node: Compiling For Multiple Architectures352819
Node: Installation Names354483
Node: Specifying the System Type355301
Node: Sharing Defaults356017
Node: Operation Controls356690
Node: Optional Features357648
Node: Reporting Bugs367216
Node: Major Differences From The Bourne Shell368417
Node: GNU Free Documentation License385104
Node: Indexes410300
Node: Builtin Index410754
Node: Reserved Word Index417581
Node: Variable Index420029
Node: Function Index433124
Node: Concept Index440133

End Tag Table
+10 -10
View File
@@ -1,4 +1,4 @@
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 13 FEB 2011 12:17
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2008.12.11) 9 MAR 2011 17:05
**/Users/chet/src/bash/src/doc/bashref.texi
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2009-01-18.17]:
@@ -232,7 +232,7 @@ arallel -k traceroute[]
[15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29]
[30] [31] [32] [33] [34] Chapter 4 [35] [36] [37] [38] [39] [40] [41] [42]
[43]
Underfull \hbox (badness 5231) in paragraph at lines 3417--3430
Underfull \hbox (badness 5231) in paragraph at lines 3419--3432
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
@@ -245,7 +245,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
.etc.
[44] [45] [46] [47] [48] [49]
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3875--3875
Overfull \hbox (172.34125pt too wide) in paragraph at lines 3877--3877
[]@texttt read [-ers] [-a @textttsl aname@texttt ] [-d @textttsl de-lim@texttt
] [-i @textttsl text@texttt ] [-n @textttsl nchars@texttt ] [-N @textttsl ncha
rs@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl time-
@@ -260,7 +260,7 @@ rs@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl time-
[50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] Chapter 5 [62]
[63] [64] [65] [66] [67] [68] [69] [70] [71] Chapter 6 [72]
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5496--5496
Overfull \hbox (51.96864pt too wide) in paragraph at lines 5498--5498
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -273,7 +273,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5497--5497
Overfull \hbox (76.23077pt too wide) in paragraph at lines 5499--5499
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
-
@@ -287,7 +287,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 5497--5497
.etc.
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5498--5498
Overfull \hbox (34.72258pt too wide) in paragraph at lines 5500--5500
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -300,7 +300,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
[73] [74]
Underfull \hbox (badness 2245) in paragraph at lines 5671--5673
Underfull \hbox (badness 2245) in paragraph at lines 5673--5675
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
the file
@@ -313,7 +313,7 @@ the file
.etc.
[75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88]
Underfull \hbox (badness 2521) in paragraph at lines 6842--6845
Underfull \hbox (badness 2521) in paragraph at lines 6844--6847
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
e[] @textrm when build-ing (see Sec-tion 10.8
@@ -382,7 +382,7 @@ Underfull \hbox (badness 2753) in paragraph at lines 1929--1932
[121] [122]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[123] [124] [125] [126] [127] [128]) Chapter 10 [129] [130] [131] [132]
[133]
Underfull \hbox (badness 2772) in paragraph at lines 7443--7447
Underfull \hbox (badness 2772) in paragraph at lines 7445--7449
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
s/large_
@@ -408,4 +408,4 @@ Here is how much of TeX's memory you used:
51 hyphenation exceptions out of 8191
16i,6n,14p,315b,702s stack positions out of 5000i,500n,6000p,200000b,5000s
Output written on bashref.dvi (168 pages, 680368 bytes).
Output written on bashref.dvi (168 pages, 680528 bytes).
BIN
View File
Binary file not shown.
+252 -245
View File
@@ -11,7 +11,7 @@
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips -D 600 -t letter -o bashref.ps bashref.dvi
%DVIPSParameters: dpi=600
%DVIPSSource: TeX output 2010.12.28:1430
%DVIPSSource: TeX output 2011.03.09:1705
%%BeginProcSet: tex.pro 0 0
%!
/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -4332,7 +4332,7 @@ TeXDict begin 2 1 bop 150 2889 a Ft(This)35 b(text)h(is)g(a)g(brief)f
(dated)d(28)i(Decem)m(b)s(er)h(2010,)h(of)d Fq(The)g(GNU)i(Bash)e
(Reference)i(Man)m(ual)p Ft(,)150 3243 y(for)e Fs(Bash)p
Ft(,)g(V)-8 b(ersion)31 b(4.2.)150 3377 y(Cop)m(yrigh)m(t)602
3374 y(c)577 3377 y Fp(\015)f Ft(1988{2010)35 b(F)-8
3374 y(c)577 3377 y Fp(\015)f Ft(1988{2011)35 b(F)-8
b(ree)31 b(Soft)m(w)m(are)h(F)-8 b(oundation,)31 b(Inc.)150
3512 y(P)m(ermission)h(is)h(gran)m(ted)g(to)f(mak)m(e)i(and)d
(distribute)h(v)m(erbatim)h(copies)g(of)f(this)g(man)m(ual)h(pro)m
@@ -5620,14 +5620,14 @@ y(c)m(haracters.)h(The)28 b(return)e(v)-5 b(alue)28 b(is)g(0)g(if)g
(the)g(string)g(matc)m(hes)h(\(`)p Fs(==)p Ft('\))f(or)g(do)s(es)f(not)
h(matc)m(h)630 628 y(\(`)p Fs(!=)p Ft('\)the)33 b(pattern,)g(and)f(1)g
(otherwise.)47 b(An)m(y)32 b(part)g(of)h(the)f(pattern)g(ma)m(y)h(b)s
(e)f(quoted)g(to)630 737 y(force)f(it)g(to)g(b)s(e)f(matc)m(hed)h(as)f
(a)h(string.)630 867 y(An)i(additional)i(binary)e(op)s(erator,)i(`)p
Fs(=~)p Ft(',)g(is)f(a)m(v)-5 b(ailable,)37 b(with)c(the)h(same)g
(precedence)h(as)630 976 y(`)p Fs(==)p Ft(')29 b(and)f(`)p
Fs(!=)p Ft('.)40 b(When)29 b(it)g(is)g(used,)f(the)h(string)g(to)h(the)
e(righ)m(t)i(of)f(the)g(op)s(erator)g(is)g(consid-)630
1086 y(ered)34 b(an)g(extended)g(regular)g(expression)g(and)f(matc)m
(hed)i(accordingly)g(\(as)f(in)g Fk(r)-5 b(e)g(gex)11
(e)f(quoted)g(to)630 737 y(force)f(the)g(quoted)f(p)s(ortion)g(to)h(b)s
(e)f(matc)m(hed)h(as)g(a)f(string.)630 867 y(An)j(additional)i(binary)e
(op)s(erator,)i(`)p Fs(=~)p Ft(',)g(is)f(a)m(v)-5 b(ailable,)37
b(with)c(the)h(same)g(precedence)h(as)630 976 y(`)p Fs(==)p
Ft(')29 b(and)f(`)p Fs(!=)p Ft('.)40 b(When)29 b(it)g(is)g(used,)f(the)
h(string)g(to)h(the)e(righ)m(t)i(of)f(the)g(op)s(erator)g(is)g(consid-)
630 1086 y(ered)34 b(an)g(extended)g(regular)g(expression)g(and)f(matc)
m(hed)i(accordingly)g(\(as)f(in)g Fk(r)-5 b(e)g(gex)11
b Ft(3\)\).)630 1196 y(The)29 b(return)f(v)-5 b(alue)30
b(is)g(0)g(if)f(the)h(string)g(matc)m(hes)g(the)g(pattern,)g(and)f(1)h
(otherwise.)41 b(If)29 b(the)630 1305 y(regular)e(expression)g(is)h
@@ -5638,50 +5638,49 @@ g(of)f Fs(shopt)f Ft(in)630 1524 y(Section)32 b(4.3.2)g([The)f(Shopt)f
(Builtin],)i(page)g(57\))g(is)f(enabled,)g(the)g(matc)m(h)h(is)e(p)s
(erformed)630 1634 y(without)36 b(regard)g(to)h(the)f(case)h(of)f
(alphab)s(etic)h(c)m(haracters.)59 b(An)m(y)36 b(part)g(of)h(the)f
(pattern)630 1744 y(ma)m(y)g(b)s(e)g(quoted)g(to)g(force)g(it)h(to)f(b)
s(e)f(matc)m(hed)i(as)f(a)g(string.)57 b(Substrings)34
b(matc)m(hed)j(b)m(y)630 1853 y(paren)m(thesized)44 b(sub)s
(expressions)e(within)i(the)g(regular)g(expression)g(are)g(sa)m(v)m(ed)
h(in)f(the)630 1963 y(arra)m(y)38 b(v)-5 b(ariable)38
b Fs(BASH_REMATCH)p Ft(.)59 b(The)36 b(elemen)m(t)j(of)f
Fs(BASH_REMATCH)c Ft(with)j(index)g(0)h(is)630 2072 y(the)c(p)s(ortion)
f(of)h(the)f(string)h(matc)m(hing)g(the)g(en)m(tire)h(regular)e
(expression.)50 b(The)33 b(elemen)m(t)630 2182 y(of)39
b Fs(BASH_REMATCH)c Ft(with)j(index)g Fq(n)f Ft(is)i(the)f(p)s(ortion)g
(of)h(the)f(string)h(matc)m(hing)g(the)g Fq(n)p Ft(th)630
2292 y(paren)m(thesized)31 b(sub)s(expression.)630 2421
y(Expressions)23 b(ma)m(y)h(b)s(e)e(com)m(bined)i(using)f(the)h(follo)m
(wing)h(op)s(erators,)g(listed)f(in)f(decreasing)630
2531 y(order)30 b(of)g(precedence:)630 2681 y Fs(\()g
Fi(expression)38 b Fs(\))1110 2790 y Ft(Returns)30 b(the)h(v)-5
b(alue)31 b(of)g Fq(expression)p Ft(.)42 b(This)30 b(ma)m(y)i(b)s(e)e
(used)g(to)i(o)m(v)m(erride)g(the)1110 2900 y(normal)e(precedence)h(of)
g(op)s(erators.)630 3049 y Fs(!)f Fi(expression)1110
3159 y Ft(T)-8 b(rue)30 b(if)g Fq(expression)g Ft(is)h(false.)630
3309 y Fi(expression1)38 b Fs(&&)30 b Fi(expression2)1110
3418 y Ft(T)-8 b(rue)30 b(if)g(b)s(oth)g Fq(expression1)38
b Ft(and)29 b Fq(expression2)38 b Ft(are)31 b(true.)630
3568 y Fi(expression1)38 b Fs(||)30 b Fi(expression2)1110
3678 y Ft(T)-8 b(rue)30 b(if)g(either)h Fq(expression1)38
b Ft(or)30 b Fq(expression2)38 b Ft(is)30 b(true.)630
3827 y(The)25 b Fs(&&)g Ft(and)g Fs(||)f Ft(op)s(erators)i(do)f(not)h
(ev)-5 b(aluate)27 b Fq(expression2)33 b Ft(if)26 b(the)f(v)-5
b(alue)26 b(of)g Fq(expression1)630 3937 y Ft(is)k(su\016cien)m(t)h(to)
g(determine)g(the)f(return)g(v)-5 b(alue)31 b(of)f(the)h(en)m(tire)g
(conditional)h(expression.)150 4126 y Fj(3.2.4.3)63 b(Grouping)43
b(Commands)150 4273 y Ft(Bash)30 b(pro)m(vides)g(t)m(w)m(o)h(w)m(a)m
(ys)f(to)h(group)e(a)h(list)g(of)g(commands)f(to)i(b)s(e)e(executed)h
(as)g(a)h(unit.)40 b(When)29 b(com-)150 4383 y(mands)h(are)i(group)s
(ed,)f(redirections)h(ma)m(y)g(b)s(e)e(applied)i(to)g(the)f(en)m(tire)h
(command)g(list.)44 b(F)-8 b(or)32 b(example,)150 4493
y(the)f(output)f(of)g(all)h(the)g(commands)f(in)g(the)h(list)g(ma)m(y)g
(b)s(e)e(redirected)i(to)g(a)g(single)g(stream.)150 4642
y Fs(\(\))870 4772 y(\()47 b Fi(list)58 b Fs(\))630 4902
y Ft(Placing)30 b(a)f(list)g(of)g(commands)f(b)s(et)m(w)m(een)i(paren)m
(theses)e(causes)i(a)f(subshell)e(en)m(vironmen)m(t)630
5011 y(to)k(b)s(e)e(created)j(\(see)f(Section)g(3.7.3)h([Command)d
(Execution)i(En)m(vironmen)m(t],)g(page)f(32\),)630 5121
y(and)d(eac)m(h)i(of)e(the)h(commands)f(in)g Fq(list)j
(pattern)630 1744 y(ma)m(y)j(b)s(e)e(quoted)i(to)g(force)g(the)f
(quoted)g(p)s(ortion)g(to)h(b)s(e)f(matc)m(hed)h(as)f(a)h(string.)64
b(Sub-)630 1853 y(strings)30 b(matc)m(hed)g(b)m(y)g(paren)m(thesized)g
(sub)s(expressions)e(within)h(the)h(regular)g(expression)630
1963 y(are)k(sa)m(v)m(ed)i(in)d(the)h(arra)m(y)h(v)-5
b(ariable)35 b Fs(BASH_REMATCH)p Ft(.)48 b(The)34 b(elemen)m(t)h(of)f
Fs(BASH_REMATCH)630 2072 y Ft(with)27 b(index)f(0)h(is)g(the)g(p)s
(ortion)g(of)g(the)g(string)g(matc)m(hing)h(the)f(en)m(tire)h(regular)f
(expression.)630 2182 y(The)c(elemen)m(t)h(of)f Fs(BASH_REMATCH)d
Ft(with)j(index)f Fq(n)h Ft(is)g(the)g(p)s(ortion)f(of)i(the)f(string)g
(matc)m(hing)630 2292 y(the)31 b Fq(n)p Ft(th)e(paren)m(thesized)i(sub)
s(expression.)630 2421 y(Expressions)23 b(ma)m(y)h(b)s(e)e(com)m(bined)
i(using)f(the)h(follo)m(wing)h(op)s(erators,)g(listed)f(in)f
(decreasing)630 2531 y(order)30 b(of)g(precedence:)630
2681 y Fs(\()g Fi(expression)38 b Fs(\))1110 2790 y Ft(Returns)30
b(the)h(v)-5 b(alue)31 b(of)g Fq(expression)p Ft(.)42
b(This)30 b(ma)m(y)i(b)s(e)e(used)g(to)i(o)m(v)m(erride)g(the)1110
2900 y(normal)e(precedence)h(of)g(op)s(erators.)630 3049
y Fs(!)f Fi(expression)1110 3159 y Ft(T)-8 b(rue)30 b(if)g
Fq(expression)g Ft(is)h(false.)630 3309 y Fi(expression1)38
b Fs(&&)30 b Fi(expression2)1110 3418 y Ft(T)-8 b(rue)30
b(if)g(b)s(oth)g Fq(expression1)38 b Ft(and)29 b Fq(expression2)38
b Ft(are)31 b(true.)630 3568 y Fi(expression1)38 b Fs(||)30
b Fi(expression2)1110 3678 y Ft(T)-8 b(rue)30 b(if)g(either)h
Fq(expression1)38 b Ft(or)30 b Fq(expression2)38 b Ft(is)30
b(true.)630 3827 y(The)25 b Fs(&&)g Ft(and)g Fs(||)f
Ft(op)s(erators)i(do)f(not)h(ev)-5 b(aluate)27 b Fq(expression2)33
b Ft(if)26 b(the)f(v)-5 b(alue)26 b(of)g Fq(expression1)630
3937 y Ft(is)k(su\016cien)m(t)h(to)g(determine)g(the)f(return)g(v)-5
b(alue)31 b(of)f(the)h(en)m(tire)g(conditional)h(expression.)150
4126 y Fj(3.2.4.3)63 b(Grouping)43 b(Commands)150 4273
y Ft(Bash)30 b(pro)m(vides)g(t)m(w)m(o)h(w)m(a)m(ys)f(to)h(group)e(a)h
(list)g(of)g(commands)f(to)i(b)s(e)e(executed)h(as)g(a)h(unit.)40
b(When)29 b(com-)150 4383 y(mands)h(are)i(group)s(ed,)f(redirections)h
(ma)m(y)g(b)s(e)e(applied)i(to)g(the)f(en)m(tire)h(command)g(list.)44
b(F)-8 b(or)32 b(example,)150 4493 y(the)f(output)f(of)g(all)h(the)g
(commands)f(in)g(the)h(list)g(ma)m(y)g(b)s(e)e(redirected)i(to)g(a)g
(single)g(stream.)150 4642 y Fs(\(\))870 4772 y(\()47
b Fi(list)58 b Fs(\))630 4902 y Ft(Placing)30 b(a)f(list)g(of)g
(commands)f(b)s(et)m(w)m(een)i(paren)m(theses)e(causes)i(a)f(subshell)e
(en)m(vironmen)m(t)630 5011 y(to)k(b)s(e)e(created)j(\(see)f(Section)g
(3.7.3)h([Command)d(Execution)i(En)m(vironmen)m(t],)g(page)f(32\),)630
5121 y(and)d(eac)m(h)i(of)e(the)h(commands)f(in)g Fq(list)j
Ft(to)f(b)s(e)e(executed)h(in)f(that)h(subshell.)39 b(Since)28
b(the)f Fq(list)630 5230 y Ft(is)i(executed)g(in)f(a)h(subshell,)g(v)-5
b(ariable)29 b(assignmen)m(ts)g(do)g(not)g(remain)f(in)g(e\013ect)j
@@ -7009,59 +7008,61 @@ eop end
TeXDict begin 30 35 bop 150 -116 a Ft(30)2572 b(Bash)31
b(Reference)g(Man)m(ual)150 299 y Fj(3.6.7)63 b(Here)41
b(Strings)150 446 y Ft(A)30 b(v)-5 b(arian)m(t)32 b(of)e(here)h(do)s
(cumen)m(ts,)f(the)g(format)h(is:)390 602 y Fs(<<<)47
b Fi(word)275 758 y Ft(The)29 b Fq(w)m(ord)34 b Ft(is)c(expanded)g(and)
g(supplied)f(to)i(the)f(command)h(on)f(its)h(standard)e(input.)150
979 y Fj(3.6.8)63 b(Duplicating)41 b(File)g(Descriptors)150
1126 y Ft(The)30 b(redirection)h(op)s(erator)390 1282
y Fs([)p Fi(n)11 b Fs(]<&)p Fi(word)150 1438 y Ft(is)35
(cumen)m(ts,)f(the)g(format)h(is:)390 596 y Fs(<<<)47
b Fi(word)275 745 y Ft(The)28 b Fq(w)m(ord)k Ft(is)d(expanded)f(as)h
(describ)s(ed)f(ab)s(o)m(v)m(e,)i(with)f(the)g(exception)h(that)f
(pathname)g(expansion)150 855 y(is)h(not)h(applied,)f(and)g(supplied)f
(as)i(a)g(single)g(string)f(to)h(the)g(command)f(on)g(its)h(standard)e
(input.)150 1069 y Fj(3.6.8)63 b(Duplicating)41 b(File)g(Descriptors)
150 1216 y Ft(The)30 b(redirection)h(op)s(erator)390
1366 y Fs([)p Fi(n)11 b Fs(]<&)p Fi(word)150 1516 y Ft(is)35
b(used)e(to)j(duplicate)f(input)f(\014le)g(descriptors.)53
b(If)34 b Fq(w)m(ord)k Ft(expands)c(to)h(one)g(or)g(more)g(digits,)h
(the)f(\014le)150 1547 y(descriptor)e(denoted)h(b)m(y)g
(the)f(\014le)150 1626 y(descriptor)e(denoted)h(b)m(y)g
Fq(n)f Ft(is)g(made)h(to)g(b)s(e)f(a)h(cop)m(y)g(of)g(that)g(\014le)g
(descriptor.)50 b(If)33 b(the)h(digits)g(in)f Fq(w)m(ord)150
1657 y Ft(do)c(not)h(sp)s(ecify)f(a)h(\014le)f(descriptor)g(op)s(en)g
1735 y Ft(do)c(not)h(sp)s(ecify)f(a)h(\014le)f(descriptor)g(op)s(en)g
(for)g(input,)g(a)h(redirection)g(error)f(o)s(ccurs.)40
b(If)29 b Fq(w)m(ord)j Ft(ev)-5 b(aluates)150 1766 y(to)31
b(If)29 b Fq(w)m(ord)j Ft(ev)-5 b(aluates)150 1845 y(to)31
b(`)p Fs(-)p Ft(',)g(\014le)g(descriptor)g Fq(n)f Ft(is)g(closed.)43
b(If)30 b Fq(n)g Ft(is)g(not)h(sp)s(eci\014ed,)f(the)h(standard)f
(input)g(\(\014le)h(descriptor)f(0\))150 1876 y(is)g(used.)275
2032 y(The)f(op)s(erator)390 2188 y Fs([)p Fi(n)11 b
Fs(]>&)p Fi(word)150 2344 y Ft(is)40 b(used)g(similarly)h(to)g
(input)g(\(\014le)h(descriptor)f(0\))150 1954 y(is)g(used.)275
2104 y(The)f(op)s(erator)390 2254 y Fs([)p Fi(n)11 b
Fs(]>&)p Fi(word)150 2404 y Ft(is)40 b(used)g(similarly)h(to)g
(duplicate)f(output)g(\014le)h(descriptors.)70 b(If)40
b Fq(n)f Ft(is)i(not)f(sp)s(eci\014ed,)i(the)f(standard)150
2454 y(output)30 b(\(\014le)g(descriptor)g(1\))h(is)f(used.)39
2513 y(output)30 b(\(\014le)g(descriptor)g(1\))h(is)f(used.)39
b(If)30 b(the)g(digits)h(in)e Fq(w)m(ord)34 b Ft(do)29
b(not)i(sp)s(ecify)e(a)i(\014le)f(descriptor)g(op)s(en)150
2563 y(for)38 b(output,)i(a)e(redirection)h(error)f(o)s(ccurs.)63
2623 y(for)38 b(output,)i(a)e(redirection)h(error)f(o)s(ccurs.)63
b(As)38 b(a)h(sp)s(ecial)f(case,)k(if)c Fq(n)f Ft(is)h(omitted,)k(and)
37 b Fq(w)m(ord)k Ft(do)s(es)150 2673 y(not)28 b(expand)f(to)i(one)f
37 b Fq(w)m(ord)k Ft(do)s(es)150 2732 y(not)28 b(expand)f(to)i(one)f
(or)f(more)h(digits,)i(the)e(standard)e(output)i(and)f(standard)g
(error)g(are)i(redirected)f(as)150 2783 y(describ)s(ed)h(previously)-8
b(.)150 3003 y Fj(3.6.9)63 b(Mo)m(ving)41 b(File)h(Descriptors)150
3150 y Ft(The)30 b(redirection)h(op)s(erator)390 3306
y Fs([)p Fi(n)11 b Fs(]<&)p Fi(digit)g Fs(-)150 3462
(error)g(are)i(redirected)f(as)150 2842 y(describ)s(ed)h(previously)-8
b(.)150 3057 y Fj(3.6.9)63 b(Mo)m(ving)41 b(File)h(Descriptors)150
3203 y Ft(The)30 b(redirection)h(op)s(erator)390 3353
y Fs([)p Fi(n)11 b Fs(]<&)p Fi(digit)g Fs(-)150 3503
y Ft(mo)m(v)m(es)33 b(the)f(\014le)g(descriptor)f Fq(digit)k
Ft(to)d(\014le)g(descriptor)g Fq(n)p Ft(,)f(or)h(the)g(standard)f
(input)f(\(\014le)j(descriptor)e(0\))150 3572 y(if)f
(input)f(\(\014le)j(descriptor)e(0\))150 3613 y(if)f
Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)40 b Fq(digit)33
b Ft(is)e(closed)g(after)g(b)s(eing)f(duplicated)g(to)h
Fq(n)p Ft(.)275 3728 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s
(erator)390 3884 y Fs([)p Fi(n)11 b Fs(]>&)p Fi(digit)g
Fs(-)150 4040 y Ft(mo)m(v)m(es)29 b(the)g(\014le)f(descriptor)f
Fq(n)p Ft(.)275 3762 y(Similarly)-8 b(,)31 b(the)f(redirection)h(op)s
(erator)390 3912 y Fs([)p Fi(n)11 b Fs(]>&)p Fi(digit)g
Fs(-)150 4062 y Ft(mo)m(v)m(es)29 b(the)g(\014le)f(descriptor)f
Fq(digit)k Ft(to)e(\014le)f(descriptor)g Fq(n)p Ft(,)g(or)g(the)g
(standard)f(output)h(\(\014le)g(descriptor)g(1\))150
4150 y(if)i Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)150
4370 y Fj(3.6.10)63 b(Op)s(ening)42 b(File)g(Descriptors)g(for)g
(Reading)e(and)h(W)-10 b(riting)150 4517 y Ft(The)30
b(redirection)h(op)s(erator)390 4673 y Fs([)p Fi(n)11
b Fs(]<>)p Fi(word)150 4829 y Ft(causes)39 b(the)g(\014le)g(whose)g
4172 y(if)i Fq(n)g Ft(is)h(not)f(sp)s(eci\014ed.)150
4386 y Fj(3.6.10)63 b(Op)s(ening)42 b(File)g(Descriptors)g(for)g
(Reading)e(and)h(W)-10 b(riting)150 4533 y Ft(The)30
b(redirection)h(op)s(erator)390 4683 y Fs([)p Fi(n)11
b Fs(]<>)p Fi(word)150 4833 y Ft(causes)39 b(the)g(\014le)g(whose)g
(name)g(is)g(the)g(expansion)g(of)g Fq(w)m(ord)j Ft(to)d(b)s(e)g(op)s
(ened)f(for)g(b)s(oth)h(reading)g(and)150 4939 y(writing)33
(ened)f(for)g(b)s(oth)h(reading)g(and)150 4942 y(writing)33
b(on)f(\014le)h(descriptor)f Fq(n)p Ft(,)h(or)g(on)f(\014le)h
(descriptor)g(0)g(if)f Fq(n)g Ft(is)h(not)g(sp)s(eci\014ed.)47
b(If)32 b(the)h(\014le)f(do)s(es)h(not)150 5049 y(exist,)e(it)g(is)g
(created.)150 5313 y Fr(3.7)68 b(Executing)46 b(Commands)p
b(If)32 b(the)h(\014le)f(do)s(es)h(not)150 5052 y(exist,)e(it)g(is)g
(created.)150 5307 y Fr(3.7)68 b(Executing)46 b(Commands)p
eop end
%%Page: 31 37
TeXDict begin 31 36 bop 150 -116 a Ft(Chapter)30 b(3:)41
@@ -7732,7 +7733,7 @@ b(is)g(supplied,)i(the)e(pathname)f(prin)m(ted)h(ma)m(y)g(con)m(tain)h
b(status)h(is)h(zero)g(unless)e(an)h(error)g(is)g(encoun)m(tered)g
(while)h(determining)f(the)g(name)630 3039 y(of)k(the)f(curren)m(t)g
(directory)h(or)f(an)h(in)m(v)-5 b(alid)31 b(option)g(is)f(supplied.)
150 3203 y Fs(readonly)870 3340 y(readonly)46 b([-aApf])f([)p
150 3203 y Fs(readonly)870 3340 y(readonly)46 b([-aAf])g([-p])g([)p
Fi(name)11 b Fs([=)p Fi(value)g Fs(]])43 b(...)630 3477
y Ft(Mark)24 b(eac)m(h)h Fq(name)k Ft(as)24 b(readonly)-8
b(.)39 b(The)24 b(v)-5 b(alues)24 b(of)g(these)g(names)g(ma)m(y)g(not)g
@@ -7741,95 +7742,99 @@ b(.)39 b(The)24 b(v)-5 b(alues)24 b(of)g(these)g(names)g(ma)m(y)g(not)g
(h)h Fq(name)k Ft(refers)22 b(to)i(a)f(shell)630 3696
y(function.)39 b(The)26 b(`)p Fs(-a)p Ft(')h(option)g(means)g(eac)m(h)h
Fq(name)k Ft(refers)26 b(to)i(an)e(indexed)h(arra)m(y)g(v)-5
b(ariable;)630 3806 y(the)33 b(`)p Fs(-A)p Ft(')g(option)g(means)g(eac)
m(h)h Fq(name)k Ft(refers)32 b(to)h(an)g(asso)s(ciativ)m(e)j(arra)m(y)d
(v)-5 b(ariable.)49 b(If)32 b(no)630 3915 y Fq(name)f
Ft(argumen)m(ts)26 b(are)g(giv)m(en,)i(or)d(if)h(the)g(`)p
Fs(-p)p Ft(')f(option)h(is)g(supplied,)f(a)h(list)h(of)e(all)i
(readonly)630 4025 y(names)37 b(is)g(prin)m(ted.)59 b(The)37
b(`)p Fs(-p)p Ft(')f(option)i(causes)f(output)g(to)g(b)s(e)f(displa)m
(y)m(ed)i(in)e(a)i(format)630 4134 y(that)25 b(ma)m(y)g(b)s(e)e(reused)
h(as)g(input.)38 b(If)24 b(a)g(v)-5 b(ariable)25 b(name)g(is)f(follo)m
(w)m(ed)i(b)m(y)e(=)p Fq(v)-5 b(alue)5 b Ft(,)26 b(the)e(v)-5
b(alue)630 4244 y(of)26 b(the)h(v)-5 b(ariable)27 b(is)f(set)h(to)g
Fq(v)-5 b(alue)5 b Ft(.)40 b(The)26 b(return)f(status)i(is)f(zero)h
(unless)e(an)i(in)m(v)-5 b(alid)26 b(option)630 4354
y(is)k(supplied,)f(one)h(of)g(the)g Fq(name)35 b Ft(argumen)m(ts)30
b(is)g(not)g(a)g(v)-5 b(alid)31 b(shell)f(v)-5 b(ariable)30
b(or)g(function)630 4463 y(name,)h(or)f(the)h(`)p Fs(-f)p
Ft(')f(option)h(is)f(supplied)f(with)h(a)h(name)f(that)h(is)g(not)f(a)h
(shell)g(function.)150 4628 y Fs(return)870 4765 y(return)46
b([)p Fi(n)11 b Fs(])630 4902 y Ft(Cause)30 b(a)g(shell)g(function)g
(to)h(exit)f(with)g(the)g(return)f(v)-5 b(alue)31 b Fq(n)p
Ft(.)40 b(If)29 b Fq(n)h Ft(is)g(not)g(supplied,)f(the)630
5011 y(return)35 b(v)-5 b(alue)37 b(is)f(the)g(exit)h(status)f(of)h
(the)f(last)h(command)f(executed)h(in)f(the)g(function.)630
5121 y(This)21 b(ma)m(y)i(also)g(b)s(e)e(used)g(to)i(terminate)g
(execution)g(of)f(a)h(script)f(b)s(eing)f(executed)i(with)f(the)630
5230 y Fs(.)27 b Ft(\(or)g Fs(source)p Ft(\))f(builtin,)i(returning)e
(either)h Fq(n)g Ft(or)g(the)g(exit)h(status)g(of)f(the)g(last)h
(command)630 5340 y(executed)46 b(within)f(the)g(script)g(as)h(the)f
(exit)h(status)g(of)f(the)h(script.)85 b(An)m(y)45 b(command)p
b(ariable;)630 3806 y(the)26 b(`)p Fs(-A)p Ft(')g(option)h(means)f(eac)
m(h)h Fq(name)32 b Ft(refers)25 b(to)i(an)f(asso)s(ciativ)m(e)j(arra)m
(y)e(v)-5 b(ariable.)40 b(If)26 b(b)s(oth)630 3915 y(options)h(are)g
(supplied,)f(`)p Fs(-A)p Ft(')g(tak)m(es)i(precedence.)40
b(If)26 b(no)h Fq(name)32 b Ft(argumen)m(ts)26 b(are)h(giv)m(en,)i(or)
630 4025 y(if)h(the)h(`)p Fs(-p)p Ft(')f(option)h(is)g(supplied,)e(a)i
(list)g(of)g(all)g(readonly)f(names)h(is)f(prin)m(ted.)41
b(The)30 b(other)630 4134 y(options)36 b(ma)m(y)g(b)s(e)g(used)f(to)h
(restrict)h(the)f(output)f(to)h(a)h(subset)e(of)h(the)g(set)g(of)g
(readonly)630 4244 y(names.)63 b(The)37 b(`)p Fs(-p)p
Ft(')h(option)g(causes)g(output)f(to)i(b)s(e)e(displa)m(y)m(ed)h(in)g
(a)g(format)g(that)g(ma)m(y)630 4354 y(b)s(e)32 b(reused)h(as)g(input.)
48 b(If)33 b(a)g(v)-5 b(ariable)34 b(name)f(is)h(follo)m(w)m(ed)g(b)m
(y)f(=)p Fq(v)-5 b(alue)5 b Ft(,)35 b(the)e(v)-5 b(alue)33
b(of)h(the)630 4463 y(v)-5 b(ariable)38 b(is)f(set)h(to)g
Fq(v)-5 b(alue)5 b Ft(.)62 b(The)37 b(return)f(status)h(is)h(zero)g
(unless)e(an)h(in)m(v)-5 b(alid)38 b(option)g(is)630
4573 y(supplied,)f(one)g(of)g(the)g Fq(name)42 b Ft(argumen)m(ts)37
b(is)g(not)g(a)g(v)-5 b(alid)37 b(shell)g(v)-5 b(ariable)38
b(or)e(function)630 4682 y(name,)31 b(or)f(the)h(`)p
Fs(-f)p Ft(')f(option)h(is)f(supplied)f(with)h(a)h(name)f(that)h(is)g
(not)f(a)h(shell)g(function.)150 4847 y Fs(return)870
4984 y(return)46 b([)p Fi(n)11 b Fs(])630 5121 y Ft(Cause)30
b(a)g(shell)g(function)g(to)h(exit)f(with)g(the)g(return)f(v)-5
b(alue)31 b Fq(n)p Ft(.)40 b(If)29 b Fq(n)h Ft(is)g(not)g(supplied,)f
(the)630 5230 y(return)35 b(v)-5 b(alue)37 b(is)f(the)g(exit)h(status)f
(of)h(the)f(last)h(command)f(executed)h(in)f(the)g(function.)630
5340 y(This)21 b(ma)m(y)i(also)g(b)s(e)e(used)g(to)i(terminate)g
(execution)g(of)f(a)h(script)f(b)s(eing)f(executed)i(with)f(the)p
eop end
%%Page: 41 47
TeXDict begin 41 46 bop 150 -116 a Ft(Chapter)30 b(4:)41
b(Shell)30 b(Builtin)h(Commands)2069 b(41)630 299 y(asso)s(ciated)30
b(with)e(the)g Fs(RETURN)f Ft(trap)h(is)g(executed)h(b)s(efore)f
(execution)h(resumes)f(after)h(the)630 408 y(function)38
b(or)f(script.)63 b(The)38 b(return)e(status)i(is)g(non-zero)h(if)e
Fs(return)g Ft(is)g(used)g(outside)i(a)630 518 y(function)30
b(and)g(not)g(during)g(the)g(execution)i(of)e(a)h(script)f(b)m(y)h
Fs(.)f Ft(or)g Fs(source)p Ft(.)150 682 y Fs(shift)870
819 y(shift)46 b([)p Fi(n)11 b Fs(])630 956 y Ft(Shift)41
b(the)g(p)s(ositional)h(parameters)g(to)g(the)f(left)h(b)m(y)g
Fq(n)p Ft(.)73 b(The)40 b(p)s(ositional)j(parameters)630
1066 y(from)34 b Fq(n)p Fs(+)p Ft(1)39 b(.)22 b(.)h(.)45
b(Shell)30 b(Builtin)h(Commands)2069 b(41)630 299 y Fs(.)27
b Ft(\(or)g Fs(source)p Ft(\))f(builtin,)i(returning)e(either)h
Fq(n)g Ft(or)g(the)g(exit)h(status)g(of)f(the)g(last)h(command)630
408 y(executed)46 b(within)f(the)g(script)g(as)h(the)f(exit)h(status)g
(of)f(the)h(script.)85 b(An)m(y)45 b(command)630 518
y(asso)s(ciated)30 b(with)e(the)g Fs(RETURN)f Ft(trap)h(is)g(executed)h
(b)s(efore)f(execution)h(resumes)f(after)h(the)630 628
y(function)38 b(or)f(script.)63 b(The)38 b(return)e(status)i(is)g
(non-zero)h(if)e Fs(return)g Ft(is)g(used)g(outside)i(a)630
737 y(function)30 b(and)g(not)g(during)g(the)g(execution)i(of)e(a)h
(script)f(b)m(y)h Fs(.)f Ft(or)g Fs(source)p Ft(.)150
883 y Fs(shift)870 1011 y(shift)46 b([)p Fi(n)11 b Fs(])630
1139 y Ft(Shift)41 b(the)g(p)s(ositional)h(parameters)g(to)g(the)f
(left)h(b)m(y)g Fq(n)p Ft(.)73 b(The)40 b(p)s(ositional)j(parameters)
630 1249 y(from)34 b Fq(n)p Fs(+)p Ft(1)39 b(.)22 b(.)h(.)45
b Fs($#)34 b Ft(are)g(renamed)g(to)h Fs($1)k Ft(.)22
b(.)g(.)46 b Fs($#)p Ft(-)p Fq(n)p Ft(.)51 b(P)m(arameters)36
b(represen)m(ted)e(b)m(y)g(the)630 1176 y(n)m(um)m(b)s(ers)25
b(represen)m(ted)e(b)m(y)g(the)630 1358 y(n)m(um)m(b)s(ers)25
b Fs($#)i Ft(to)g Fs($#)p Ft(-)p Fq(n)p Fs(+)p Ft(1)g(are)g(unset.)39
b Fq(n)26 b Ft(m)m(ust)h(b)s(e)f(a)i(non-negativ)m(e)h(n)m(um)m(b)s(er)
c(less)i(than)g(or)630 1285 y(equal)33 b(to)h Fs($#)p
c(less)i(than)g(or)630 1468 y(equal)33 b(to)h Fs($#)p
Ft(.)47 b(If)33 b Fq(n)f Ft(is)h(zero)g(or)g(greater)h(than)f
Fs($#)p Ft(,)g(the)g(p)s(ositional)g(parameters)g(are)h(not)630
1395 y(c)m(hanged.)48 b(If)32 b Fq(n)g Ft(is)h(not)f(supplied,)h(it)g
1577 y(c)m(hanged.)48 b(If)32 b Fq(n)g Ft(is)h(not)f(supplied,)h(it)g
(is)f(assumed)g(to)h(b)s(e)f(1.)48 b(The)32 b(return)g(status)h(is)f
(zero)630 1504 y(unless)e Fq(n)f Ft(is)i(greater)g(than)g
(zero)630 1687 y(unless)e Fq(n)f Ft(is)i(greater)g(than)g
Fs($#)e Ft(or)i(less)f(than)h(zero,)g(non-zero)g(otherwise.)150
1669 y Fs(test)150 1778 y([)432 b Ft(Ev)-5 b(aluate)31
1833 y Fs(test)150 1943 y([)432 b Ft(Ev)-5 b(aluate)31
b(a)g(conditional)g(expression)f Fq(expr)7 b Ft(.)40
b(Eac)m(h)30 b(op)s(erator)h(and)e(op)s(erand)g(m)m(ust)h(b)s(e)g(a)630
1888 y(separate)d(argumen)m(t.)40 b(Expressions)25 b(are)i(comp)s(osed)
2052 y(separate)d(argumen)m(t.)40 b(Expressions)25 b(are)i(comp)s(osed)
e(of)i(the)f(primaries)g(describ)s(ed)f(b)s(elo)m(w)630
1998 y(in)34 b(Section)g(6.4)h([Bash)g(Conditional)f(Expressions],)h
2162 y(in)34 b(Section)g(6.4)h([Bash)g(Conditional)f(Expressions],)h
(page)g(78.)52 b Fs(test)33 b Ft(do)s(es)g(not)h(accept)630
2107 y(an)m(y)27 b(options,)i(nor)d(do)s(es)h(it)g(accept)i(and)d
2271 y(an)m(y)27 b(options,)i(nor)d(do)s(es)h(it)g(accept)i(and)d
(ignore)i(an)f(argumen)m(t)g(of)g(`)p Fs(--)p Ft(')g(as)h(signifying)f
(the)630 2217 y(end)j(of)g(options.)630 2354 y(When)g(the)h
(the)630 2381 y(end)j(of)g(options.)630 2509 y(When)g(the)h
Fs([)f Ft(form)g(is)g(used,)g(the)g(last)i(argumen)m(t)e(to)i(the)e
(command)g(m)m(ust)h(b)s(e)e(a)i Fs(])p Ft(.)630 2491
(command)g(m)m(ust)h(b)s(e)e(a)i Fs(])p Ft(.)630 2637
y(Expressions)23 b(ma)m(y)h(b)s(e)e(com)m(bined)i(using)f(the)h(follo)m
(wing)h(op)s(erators,)g(listed)f(in)f(decreasing)630
2600 y(order)30 b(of)h(precedence.)43 b(The)30 b(ev)-5
2746 y(order)30 b(of)h(precedence.)43 b(The)30 b(ev)-5
b(aluation)33 b(dep)s(ends)28 b(on)j(the)g(n)m(um)m(b)s(er)f(of)h
(argumen)m(ts;)g(see)630 2710 y(b)s(elo)m(w.)41 b(Op)s(erator)30
(argumen)m(ts;)g(see)630 2856 y(b)s(elo)m(w.)41 b(Op)s(erator)30
b(precedence)h(is)f(used)g(when)f(there)i(are)f(\014v)m(e)h(or)f(more)h
(argumen)m(ts.)630 2874 y Fs(!)f Fi(expr)210 b Ft(T)-8
b(rue)30 b(if)g Fq(expr)37 b Ft(is)30 b(false.)630 3039
(argumen)m(ts.)630 3002 y Fs(!)f Fi(expr)210 b Ft(T)-8
b(rue)30 b(if)g Fq(expr)37 b Ft(is)30 b(false.)630 3148
y Fs(\()g Fi(expr)40 b Fs(\))122 b Ft(Returns)23 b(the)h(v)-5
b(alue)24 b(of)g Fq(expr)7 b Ft(.)37 b(This)23 b(ma)m(y)i(b)s(e)e(used)
g(to)h(o)m(v)m(erride)h(the)f(normal)1110 3148 y(precedence)31
b(of)f(op)s(erators.)630 3313 y Fi(expr1)39 b Fs(-a)30
b Fi(expr2)1110 3422 y Ft(T)-8 b(rue)30 b(if)g(b)s(oth)g
g(to)h(o)m(v)m(erride)h(the)f(normal)1110 3258 y(precedence)31
b(of)f(op)s(erators.)630 3404 y Fi(expr1)39 b Fs(-a)30
b Fi(expr2)1110 3513 y Ft(T)-8 b(rue)30 b(if)g(b)s(oth)g
Fq(expr1)37 b Ft(and)30 b Fq(expr2)38 b Ft(are)30 b(true.)630
3587 y Fi(expr1)39 b Fs(-o)30 b Fi(expr2)1110 3696 y
3660 y Fi(expr1)39 b Fs(-o)30 b Fi(expr2)1110 3769 y
Ft(T)-8 b(rue)30 b(if)g(either)h Fq(expr1)38 b Ft(or)30
b Fq(expr2)37 b Ft(is)31 b(true.)630 3861 y(The)37 b
b Fq(expr2)37 b Ft(is)31 b(true.)630 3915 y(The)37 b
Fs(test)f Ft(and)g Fs([)h Ft(builtins)g(ev)-5 b(aluate)39
b(conditional)f(expressions)f(using)g(a)g(set)h(of)f(rules)630
3970 y(based)30 b(on)g(the)h(n)m(um)m(b)s(er)e(of)h(argumen)m(ts.)630
4134 y(0)h(argumen)m(ts)1110 4244 y(The)f(expression)g(is)g(false.)630
4408 y(1)h(argumen)m(t)1110 4518 y(The)f(expression)g(is)g(true)h(if)f
4025 y(based)30 b(on)g(the)h(n)m(um)m(b)s(er)e(of)h(argumen)m(ts.)630
4171 y(0)h(argumen)m(ts)1110 4281 y(The)f(expression)g(is)g(false.)630
4427 y(1)h(argumen)m(t)1110 4536 y(The)f(expression)g(is)g(true)h(if)f
(and)g(only)g(if)h(the)f(argumen)m(t)h(is)f(not)h(n)m(ull.)630
4682 y(2)g(argumen)m(ts)1110 4792 y(If)f(the)h(\014rst)f(argumen)m(t)h
(is)g(`)p Fs(!)p Ft(',)g(the)g(expression)g(is)g(true)f(if)h(and)f
@@ -8171,15 +8176,15 @@ b(If)30 b(the)g Fs(extdebug)e Ft(shell)i(option)g(is)g(enabled)g(using)
b(`)p Fs(-F)p Ft(')38 b(implies)630 2096 y(`)p Fs(-f)p
Ft('.)630 2236 y(The)32 b(`)p Fs(-g)p Ft(')h(option)g(forces)g(v)-5
b(ariables)33 b(to)h(b)s(e)e(created)h(or)g(mo)s(di\014ed)e(at)j(the)f
(global)h(scop)s(e,)630 2346 y(ev)m(en)39 b(when)f Fs(\\)p
Ft(fBdeclare)p Fs(\\)p Ft(fP)h(is)g(executed)h(in)e(a)h(shell)g
(function.)66 b(It)39 b(is)g(ignored)g(in)f(all)630 2456
y(other)31 b(cases.)630 2596 y(The)c(follo)m(wing)h(options)g(can)f(b)s
(e)g(used)f(to)i(restrict)g(output)e(to)i(v)-5 b(ariables)28
b(with)f(the)g(sp)s(ec-)630 2705 y(i\014ed)j(attributes)h(or)f(to)h
(giv)m(e)h(v)-5 b(ariables)31 b(attributes:)630 2876
y Fs(-a)384 b Ft(Eac)m(h)36 b Fq(name)k Ft(is)34 b(an)h(indexed)g(arra)
m(y)g(v)-5 b(ariable)36 b(\(see)f(Section)h(6.7)g([Arra)m(ys],)1110
(global)h(scop)s(e,)630 2346 y(ev)m(en)k(when)e Fs(declare)f
Ft(is)j(executed)g(in)f(a)g(shell)h(function.)61 b(It)37
b(is)g(ignored)h(in)f(all)h(other)630 2456 y(cases.)630
2596 y(The)27 b(follo)m(wing)h(options)g(can)f(b)s(e)g(used)f(to)i
(restrict)g(output)e(to)i(v)-5 b(ariables)28 b(with)f(the)g(sp)s(ec-)
630 2705 y(i\014ed)j(attributes)h(or)f(to)h(giv)m(e)h(v)-5
b(ariables)31 b(attributes:)630 2876 y Fs(-a)384 b Ft(Eac)m(h)36
b Fq(name)k Ft(is)34 b(an)h(indexed)g(arra)m(y)g(v)-5
b(ariable)36 b(\(see)f(Section)h(6.7)g([Arra)m(ys],)1110
2986 y(page)31 b(82\).)630 3157 y Fs(-A)384 b Ft(Eac)m(h)24
b Fq(name)k Ft(is)23 b(an)g(asso)s(ciativ)m(e)j(arra)m(y)e(v)-5
b(ariable)24 b(\(see)g(Section)g(6.7)g([Arra)m(ys],)1110
@@ -9126,12 +9131,13 @@ Fs(FIGNORE)p Ft(.)37 b(This)22 b(option)1110 3216 y(is)30
b(enabled)h(b)m(y)f(default.)630 3378 y Fs(globstar)96
b Ft(If)38 b(set,)j(the)e(pattern)f(`)p Fs(**)p Ft(')h(used)e(in)i(a)f
(\014lename)h(expansion)f(con)m(text)j(will)1110 3487
y(matc)m(h)f(a)g(\014les)f(and)f(zero)i(or)g(more)f(directories)h(and)f
(sub)s(directories.)66 b(If)1110 3597 y(the)30 b(pattern)g(is)g(follo)m
(w)m(ed)i(b)m(y)d(a)i(`)p Fs(/)p Ft(',)f(only)g(directories)h(and)f
(sub)s(directories)1110 3707 y(matc)m(h.)630 3868 y Fs(gnu_errfmt)1110
3978 y Ft(If)35 b(set,)j(shell)e(error)g(messages)g(are)h(written)e(in)
h(the)g(standard)f Fl(gnu)g Ft(error)1110 4088 y(message)c(format.)630
y(matc)m(h)36 b(all)g(\014les)f(and)f(zero)i(or)f(more)g(directories)h
(and)e(sub)s(directories.)54 b(If)1110 3597 y(the)30
b(pattern)g(is)g(follo)m(w)m(ed)i(b)m(y)d(a)i(`)p Fs(/)p
Ft(',)f(only)g(directories)h(and)f(sub)s(directories)1110
3707 y(matc)m(h.)630 3868 y Fs(gnu_errfmt)1110 3978 y
Ft(If)35 b(set,)j(shell)e(error)g(messages)g(are)h(written)e(in)h(the)g
(standard)f Fl(gnu)g Ft(error)1110 4088 y(message)c(format.)630
4249 y Fs(histappend)1110 4359 y Ft(If)c(set,)j(the)e(history)g(list)g
(is)g(app)s(ended)e(to)j(the)f(\014le)g(named)f(b)m(y)h(the)g(v)-5
b(alue)29 b(of)1110 4468 y(the)d Fs(HISTFILE)d Ft(v)-5
@@ -10685,46 +10691,45 @@ Fs(declare)e Ft(builtin)h(will)i(explicitly)g(declare)g(an)f(arra)m(y)
m(t)f(that)h(mem)m(b)s(ers)e(b)s(e)g(indexed)150 2489
y(or)26 b(assigned)h(con)m(tiguously)-8 b(.)41 b(Indexed)25
b(arra)m(ys)i(are)f(referenced)g(using)g(in)m(tegers)i(\(including)e
(arithmetic)150 2598 y(expressions)41 b(\(see)h(Section)g(6.5)h([Shell)
e(Arithmetic],)46 b(page)c(80\))g(and)f(are)g(zero-based;)48
b(asso)s(ciativ)m(e)150 2708 y(arra)m(ys)31 b(use)f(arbitrary)g
(strings.)275 2841 y(An)c(indexed)h(arra)m(y)h(is)f(created)h
(automatically)j(if)c(an)m(y)g(v)-5 b(ariable)28 b(is)g(assigned)f(to)h
(using)f(the)g(syn)m(tax)390 2974 y Fs(name[)p Fi(subscript)11
b Fs(]=)p Fi(value)150 3108 y Ft(The)37 b Fq(subscript)h
Ft(is)f(treated)h(as)f(an)g(arithmetic)i(expression)e(that)g(m)m(ust)g
(ev)-5 b(aluate)39 b(to)f(a)g(n)m(um)m(b)s(er.)59 b(If)150
3217 y Fq(subscript)29 b Ft(ev)-5 b(aluates)29 b(to)g(a)g(n)m(um)m(b)s
(er)d(less)j(than)e(zero,)j(it)e(is)h(used)e(as)h(an)g(o\013set)h(from)
f(one)g(greater)h(than)150 3327 y(the)h(arra)m(y's)h(maxim)m(um)e
(index)h(\(so)g(a)h(sub)s(cript)d(of)i(-1)h(refers)e(to)i(the)f(last)h
(elemen)m(t)g(of)f(the)g(arra)m(y\).)41 b(T)-8 b(o)150
3436 y(explicitly)32 b(declare)f(an)g(arra)m(y)-8 b(,)31
b(use)390 3570 y Fs(declare)46 b(-a)h Fi(name)150 3703
y Ft(The)30 b(syn)m(tax)390 3836 y Fs(declare)46 b(-a)h
Fi(name)11 b Fs([)p Fi(subscript)g Fs(])150 3969 y Ft(is)30
b(also)i(accepted;)g(the)e Fq(subscript)h Ft(is)g(ignored.)275
4102 y(Asso)s(ciativ)m(e)h(arra)m(ys)f(are)g(created)g(using)390
4236 y Fs(declare)46 b(-A)h Fi(name)11 b Fs(.)275 4369
y Ft(A)m(ttributes)46 b(ma)m(y)h(b)s(e)e(sp)s(eci\014ed)g(for)h(an)g
(arra)m(y)g(v)-5 b(ariable)47 b(using)e(the)h Fs(declare)e
Ft(and)h Fs(readonly)150 4478 y Ft(builtins.)40 b(Eac)m(h)31
b(attribute)g(applies)g(to)g(all)g(mem)m(b)s(ers)f(of)g(an)h(arra)m(y)
-8 b(.)275 4612 y(Arra)m(ys)30 b(are)h(assigned)f(to)h(using)f(comp)s
(ound)f(assignmen)m(ts)i(of)g(the)f(form)390 4745 y Fs(name=\(value)p
Fi(1)55 b Fs(...)47 b(value)p Fi(n)11 b Fs(\))150 4878
y Ft(where)37 b(eac)m(h)i Fq(v)-5 b(alue)42 b Ft(is)c(of)g(the)f(form)g
Fs([)p Fi(subscript)11 b Fs(]=)p Fq(string)d Ft(.)58
b(Indexed)36 b(arra)m(y)i(assignmen)m(ts)g(do)g(not)150
4988 y(require)c(the)g(brac)m(k)m(et)h(and)e(subscript.)50
b(When)34 b(assigning)g(to)g(indexed)g(arra)m(ys,)h(if)f(the)g
(optional)h(sub-)150 5097 y(script)c(is)h(supplied,)f(that)h(index)f
(is)h(assigned)g(to;)h(otherwise)f(the)f(index)h(of)f(the)h(elemen)m(t)
h(assigned)f(is)150 5207 y(the)f(last)g(index)f(assigned)g(to)h(b)m(y)g
(the)f(statemen)m(t)i(plus)e(one.)41 b(Indexing)30 b(starts)g(at)i
(zero.)275 5340 y(When)e(assigning)h(to)g(an)f(asso)s(ciativ)m(e)j
(arra)m(y)-8 b(,)32 b(the)e(subscript)f(is)i(required.)p
eop end
(arithmetic)150 2598 y(expressions)38 b(\(see)h(Section)g(6.5)h([Shell)
e(Arithmetic],)k(page)d(80\)\))h(and)d(are)i(zero-based;)k(asso)s
(ciativ)m(e)150 2708 y(arra)m(ys)31 b(use)f(arbitrary)g(strings.)275
2841 y(An)c(indexed)h(arra)m(y)h(is)f(created)h(automatically)j(if)c
(an)m(y)g(v)-5 b(ariable)28 b(is)g(assigned)f(to)h(using)f(the)g(syn)m
(tax)390 2974 y Fs(name[)p Fi(subscript)11 b Fs(]=)p
Fi(value)150 3108 y Ft(The)37 b Fq(subscript)h Ft(is)f(treated)h(as)f
(an)g(arithmetic)i(expression)e(that)g(m)m(ust)g(ev)-5
b(aluate)39 b(to)f(a)g(n)m(um)m(b)s(er.)59 b(If)150 3217
y Fq(subscript)29 b Ft(ev)-5 b(aluates)29 b(to)g(a)g(n)m(um)m(b)s(er)d
(less)j(than)e(zero,)j(it)e(is)h(used)e(as)h(an)g(o\013set)h(from)f
(one)g(greater)h(than)150 3327 y(the)h(arra)m(y's)h(maxim)m(um)e(index)
h(\(so)g(a)h(sub)s(cript)d(of)i(-1)h(refers)e(to)i(the)f(last)h(elemen)
m(t)g(of)f(the)g(arra)m(y\).)41 b(T)-8 b(o)150 3436 y(explicitly)32
b(declare)f(an)g(arra)m(y)-8 b(,)31 b(use)390 3570 y
Fs(declare)46 b(-a)h Fi(name)150 3703 y Ft(The)30 b(syn)m(tax)390
3836 y Fs(declare)46 b(-a)h Fi(name)11 b Fs([)p Fi(subscript)g
Fs(])150 3969 y Ft(is)30 b(also)i(accepted;)g(the)e Fq(subscript)h
Ft(is)g(ignored.)275 4102 y(Asso)s(ciativ)m(e)h(arra)m(ys)f(are)g
(created)g(using)390 4236 y Fs(declare)46 b(-A)h Fi(name)11
b Fs(.)275 4369 y Ft(A)m(ttributes)46 b(ma)m(y)h(b)s(e)e(sp)s
(eci\014ed)g(for)h(an)g(arra)m(y)g(v)-5 b(ariable)47
b(using)e(the)h Fs(declare)e Ft(and)h Fs(readonly)150
4478 y Ft(builtins.)40 b(Eac)m(h)31 b(attribute)g(applies)g(to)g(all)g
(mem)m(b)s(ers)f(of)g(an)h(arra)m(y)-8 b(.)275 4612 y(Arra)m(ys)30
b(are)h(assigned)f(to)h(using)f(comp)s(ound)f(assignmen)m(ts)i(of)g
(the)f(form)390 4745 y Fs(name=\(value)p Fi(1)55 b Fs(...)47
b(value)p Fi(n)11 b Fs(\))150 4878 y Ft(where)37 b(eac)m(h)i
Fq(v)-5 b(alue)42 b Ft(is)c(of)g(the)f(form)g Fs([)p
Fi(subscript)11 b Fs(]=)p Fq(string)d Ft(.)58 b(Indexed)36
b(arra)m(y)i(assignmen)m(ts)g(do)g(not)150 4988 y(require)c(the)g(brac)
m(k)m(et)h(and)e(subscript.)50 b(When)34 b(assigning)g(to)g(indexed)g
(arra)m(ys,)h(if)f(the)g(optional)h(sub-)150 5097 y(script)c(is)h
(supplied,)f(that)h(index)f(is)h(assigned)g(to;)h(otherwise)f(the)f
(index)h(of)f(the)h(elemen)m(t)h(assigned)f(is)150 5207
y(the)f(last)g(index)f(assigned)g(to)h(b)m(y)g(the)f(statemen)m(t)i
(plus)e(one.)41 b(Indexing)30 b(starts)g(at)i(zero.)275
5340 y(When)e(assigning)h(to)g(an)f(asso)s(ciativ)m(e)j(arra)m(y)-8
b(,)32 b(the)e(subscript)f(is)i(required.)p eop end
%%Page: 83 89
TeXDict begin 83 88 bop 150 -116 a Ft(Chapter)30 b(6:)41
b(Bash)30 b(F)-8 b(eatures)2484 b(83)275 299 y(This)30
@@ -10732,87 +10737,89 @@ b(syn)m(tax)j(is)e(also)i(accepted)g(b)m(y)f(the)f Fs(declare)f
Ft(builtin.)44 b(Individual)31 b(arra)m(y)h(elemen)m(ts)h(ma)m(y)g(b)s
(e)150 408 y(assigned)e(to)g(using)f(the)g Fs(name[)p
Fq(subscript)r Fs(]=)p Fq(v)-5 b(alue)33 b Ft(syn)m(tax)e(in)m(tro)s
(duced)f(ab)s(o)m(v)m(e.)275 554 y(An)m(y)j(elemen)m(t)i(of)f(an)f
(duced)f(ab)s(o)m(v)m(e.)275 543 y(An)m(y)j(elemen)m(t)i(of)f(an)f
(arra)m(y)h(ma)m(y)g(b)s(e)f(referenced)g(using)g Fs(${name[)p
Fq(subscript)r Fs(]})p Ft(.)46 b(The)33 b(braces)h(are)150
663 y(required)28 b(to)j(a)m(v)m(oid)f(con\015icts)g(with)f(the)h
652 y(required)28 b(to)j(a)m(v)m(oid)f(con\015icts)g(with)f(the)h
(shell's)f(\014lename)h(expansion)f(op)s(erators.)41
b(If)28 b(the)i Fq(subscript)g Ft(is)150 773 y(`)p Fs(@)p
b(If)28 b(the)i Fq(subscript)g Ft(is)150 762 y(`)p Fs(@)p
Ft(')f(or)g(`)p Fs(*)p Ft(',)g(the)g(w)m(ord)g(expands)f(to)i(all)f
(mem)m(b)s(ers)f(of)h(the)g(arra)m(y)h Fq(name)5 b Ft(.)40
b(These)29 b(subscripts)e(di\013er)i(only)150 883 y(when)36
b(These)29 b(subscripts)e(di\013er)i(only)150 872 y(when)36
b(the)g(w)m(ord)g(app)s(ears)g(within)g(double)g(quotes.)60
b(If)36 b(the)h(w)m(ord)f(is)g(double-quoted,)j Fs(${name[*]})150
992 y Ft(expands)20 b(to)h(a)g(single)g(w)m(ord)f(with)h(the)g(v)-5
981 y Ft(expands)20 b(to)h(a)g(single)g(w)m(ord)f(with)h(the)g(v)-5
b(alue)21 b(of)f(eac)m(h)i(arra)m(y)f(mem)m(b)s(er)f(separated)h(b)m(y)
g(the)f(\014rst)g(c)m(haracter)150 1102 y(of)38 b(the)g
g(the)f(\014rst)g(c)m(haracter)150 1091 y(of)38 b(the)g
Fs(IFS)f Ft(v)-5 b(ariable,)41 b(and)c Fs(${name[@]})e
Ft(expands)i(eac)m(h)i(elemen)m(t)g(of)f Fq(name)43 b
Ft(to)c(a)f(separate)h(w)m(ord.)150 1211 y(When)32 b(there)h(are)f(no)g
Ft(to)c(a)f(separate)h(w)m(ord.)150 1200 y(When)32 b(there)h(are)f(no)g
(arra)m(y)h(mem)m(b)s(ers,)f Fs(${name[@]})e Ft(expands)h(to)i
(nothing.)47 b(If)31 b(the)i(double-quoted)150 1321 y(expansion)39
(nothing.)47 b(If)31 b(the)i(double-quoted)150 1310 y(expansion)39
b(o)s(ccurs)h(within)f(a)h(w)m(ord,)i(the)d(expansion)h(of)g(the)f
(\014rst)g(parameter)h(is)g(joined)f(with)h(the)150 1431
(\014rst)g(parameter)h(is)g(joined)f(with)h(the)150 1420
y(b)s(eginning)j(part)h(of)g(the)g(original)h(w)m(ord,)j(and)43
b(the)h(expansion)g(of)g(the)g(last)h(parameter)f(is)g(joined)150
1540 y(with)35 b(the)g(last)h(part)f(of)g(the)g(original)h(w)m(ord.)55
1529 y(with)35 b(the)g(last)h(part)f(of)g(the)g(original)h(w)m(ord.)55
b(This)34 b(is)h(analogous)h(to)g(the)f(expansion)g(of)g(the)g(sp)s
(ecial)150 1650 y(parameters)28 b(`)p Fs(@)p Ft(')g(and)f(`)p
(ecial)150 1639 y(parameters)28 b(`)p Fs(@)p Ft(')g(and)f(`)p
Fs(*)p Ft('.)39 b Fs(${#name[)p Fq(subscript)r Fs(]})24
b Ft(expands)j(to)h(the)g(length)g(of)f Fs(${name[)p
Fq(subscript)r Fs(]})p Ft(.)150 1759 y(If)j Fq(subscript)i
Fq(subscript)r Fs(]})p Ft(.)150 1748 y(If)j Fq(subscript)i
Ft(is)f(`)p Fs(@)p Ft(')f(or)h(`)p Fs(*)p Ft(',)g(the)g(expansion)g(is)
g(the)g(n)m(um)m(b)s(er)e(of)i(elemen)m(ts)h(in)f(the)g(arra)m(y)-8
b(.)42 b(Referencing)150 1869 y(an)30 b(arra)m(y)h(v)-5
b(.)42 b(Referencing)150 1858 y(an)30 b(arra)m(y)h(v)-5
b(ariable)31 b(without)g(a)f(subscript)g(is)g(equiv)-5
b(alen)m(t)32 b(to)f(referencing)g(with)f(a)g(subscript)g(of)g(0.)275
2014 y(An)35 b(arra)m(y)i(v)-5 b(ariable)37 b(is)g(considered)f(set)h
1992 y(An)35 b(arra)m(y)i(v)-5 b(ariable)37 b(is)g(considered)f(set)h
(if)f(a)h(subscript)e(has)h(b)s(een)g(assigned)g(a)h(v)-5
b(alue.)59 b(The)36 b(n)m(ull)150 2124 y(string)30 b(is)h(a)g(v)-5
b(alid)30 b(v)-5 b(alue.)275 2269 y(The)32 b Fs(unset)g
b(alue.)59 b(The)36 b(n)m(ull)150 2102 y(string)30 b(is)h(a)g(v)-5
b(alid)30 b(v)-5 b(alue.)275 2236 y(The)32 b Fs(unset)g
Ft(builtin)h(is)g(used)g(to)h(destro)m(y)g(arra)m(ys.)50
b Fs(unset)31 b Fq(name)5 b Ft([)p Fq(subscript)r Ft(])33
b(destro)m(ys)h(the)f(arra)m(y)150 2379 y(elemen)m(t)i(at)g(index)f
b(destro)m(ys)h(the)f(arra)m(y)150 2346 y(elemen)m(t)i(at)g(index)f
Fq(subscript)r Ft(.)50 b(Care)34 b(m)m(ust)f(b)s(e)h(tak)m(en)h(to)f(a)
m(v)m(oid)i(un)m(w)m(an)m(ted)e(side)g(e\013ects)h(caused)f(b)m(y)150
2488 y(\014lename)40 b(expansion.)69 b Fs(unset)39 b
2456 y(\014lename)40 b(expansion.)69 b Fs(unset)39 b
Fq(name)5 b Ft(,)42 b(where)e Fq(name)45 b Ft(is)39 b(an)h(arra)m(y)-8
b(,)44 b(remo)m(v)m(es)d(the)f(en)m(tire)h(arra)m(y)-8
b(.)70 b(A)150 2598 y(subscript)29 b(of)i(`)p Fs(*)p
b(.)70 b(A)150 2565 y(subscript)29 b(of)i(`)p Fs(*)p
Ft(')f(or)h(`)p Fs(@)p Ft(')f(also)h(remo)m(v)m(es)h(the)f(en)m(tire)g
(arra)m(y)-8 b(.)275 2743 y(The)41 b Fs(declare)p Ft(,)i
(arra)m(y)-8 b(.)275 2700 y(The)41 b Fs(declare)p Ft(,)i
Fs(local)p Ft(,)h(and)d Fs(readonly)f Ft(builtins)h(eac)m(h)j(accept)f
(a)f(`)p Fs(-a)p Ft(')g(option)h(to)f(sp)s(ecify)g(an)150
2853 y(indexed)34 b(arra)m(y)h(and)f(a)h(`)p Fs(-A)p
Ft(')g(option)g(to)g(sp)s(ecify)g(an)f(asso)s(ciativ)m(e)j(arra)m(y)-8
b(.)55 b(The)34 b Fs(read)f Ft(builtin)i(accepts)150
2963 y(a)h(`)p Fs(-a)p Ft(')f(option)h(to)g(assign)g(a)f(list)h(of)g(w)
m(ords)f(read)g(from)g(the)h(standard)e(input)h(to)h(an)f(arra)m(y)-8
b(,)38 b(and)d(can)150 3072 y(read)c(v)-5 b(alues)31
b(from)f(the)h(standard)f(input)g(in)m(to)i(individual)e(arra)m(y)h
(elemen)m(ts.)44 b(The)30 b Fs(set)g Ft(and)g Fs(declare)150
3182 y Ft(builtins)g(displa)m(y)g(arra)m(y)h(v)-5 b(alues)31
b(in)f(a)h(w)m(a)m(y)g(that)g(allo)m(ws)h(them)e(to)h(b)s(e)f(reused)g
(as)g(input.)150 3431 y Fr(6.8)68 b(The)45 b(Directory)g(Stac)l(k)150
3590 y Ft(The)21 b(directory)h(stac)m(k)h(is)e(a)h(list)g(of)f(recen)m
2809 y(indexed)25 b(arra)m(y)h(and)e(a)i(`)p Fs(-A)p
Ft(')f(option)h(to)g(sp)s(ecify)f(an)g(asso)s(ciativ)m(e)j(arra)m(y)-8
b(.)40 b(If)25 b(b)s(oth)g(options)g(are)h(supplied,)150
2919 y(`)p Fs(-A)p Ft(')k(tak)m(es)i(precedence.)41 b(The)30
b Fs(read)f Ft(builtin)g(accepts)j(a)e(`)p Fs(-a)p Ft(')g(option)h(to)g
(assign)g(a)f(list)h(of)f(w)m(ords)g(read)150 3028 y(from)40
b(the)g(standard)f(input)h(to)h(an)f(arra)m(y)-8 b(,)44
b(and)39 b(can)i(read)f(v)-5 b(alues)40 b(from)g(the)g(standard)g
(input)f(in)m(to)150 3138 y(individual)26 b(arra)m(y)h(elemen)m(ts.)41
b(The)26 b Fs(set)f Ft(and)h Fs(declare)f Ft(builtins)g(displa)m(y)i
(arra)m(y)g(v)-5 b(alues)27 b(in)f(a)h(w)m(a)m(y)g(that)150
3248 y(allo)m(ws)32 b(them)e(to)h(b)s(e)f(reused)f(as)i(input.)150
3480 y Fr(6.8)68 b(The)45 b(Directory)g(Stac)l(k)150
3639 y Ft(The)21 b(directory)h(stac)m(k)h(is)e(a)h(list)g(of)f(recen)m
(tly-visited)j(directories.)39 b(The)20 b Fs(pushd)g
Ft(builtin)h(adds)g(directories)150 3700 y(to)42 b(the)f(stac)m(k)i(as)
Ft(builtin)h(adds)g(directories)150 3749 y(to)42 b(the)f(stac)m(k)i(as)
e(it)h(c)m(hanges)g(the)f(curren)m(t)g(directory)-8 b(,)45
b(and)40 b(the)i Fs(popd)e Ft(builtin)g(remo)m(v)m(es)j(sp)s(eci\014ed)
150 3809 y(directories)29 b(from)f(the)h(stac)m(k)h(and)d(c)m(hanges)j
150 3859 y(directories)29 b(from)f(the)h(stac)m(k)h(and)d(c)m(hanges)j
(the)e(curren)m(t)g(directory)h(to)g(the)g(directory)f(remo)m(v)m(ed.)
41 b(The)150 3919 y Fs(dirs)29 b Ft(builtin)h(displa)m(ys)h(the)f(con)m
(ten)m(ts)i(of)f(the)f(directory)h(stac)m(k.)275 4064
41 b(The)150 3968 y Fs(dirs)29 b Ft(builtin)h(displa)m(ys)h(the)f(con)m
(ten)m(ts)i(of)f(the)f(directory)h(stac)m(k.)275 4103
y(The)k(con)m(ten)m(ts)i(of)f(the)h(directory)f(stac)m(k)h(are)f(also)h
(visible)g(as)f(the)g(v)-5 b(alue)36 b(of)g(the)g Fs(DIRSTACK)e
Ft(shell)150 4174 y(v)-5 b(ariable.)150 4384 y Fj(6.8.1)63
b(Directory)40 b(Stac)m(k)g(Builtins)150 4561 y Fs(dirs)870
4701 y(dirs)47 b([+)p Fi(N)57 b Fs(|)48 b(-)p Fi(N)11
b Fs(])46 b([-clpv])630 4841 y Ft(Displa)m(y)35 b(the)f(list)g(of)g
Ft(shell)150 4212 y(v)-5 b(ariable.)150 4411 y Fj(6.8.1)63
b(Directory)40 b(Stac)m(k)g(Builtins)150 4583 y Fs(dirs)870
4717 y(dirs)47 b([+)p Fi(N)57 b Fs(|)48 b(-)p Fi(N)11
b Fs(])46 b([-clpv])630 4852 y Ft(Displa)m(y)35 b(the)f(list)g(of)g
(curren)m(tly)g(remem)m(b)s(ered)f(directories.)51 b(Directories)36
b(are)e(added)f(to)630 4951 y(the)28 b(list)h(with)f(the)g
b(are)e(added)f(to)630 4962 y(the)28 b(list)h(with)f(the)g
Fs(pushd)f Ft(command;)i(the)f Fs(popd)f Ft(command)h(remo)m(v)m(es)h
(directories)g(from)630 5060 y(the)i(list.)630 5230 y
(directories)g(from)630 5071 y(the)i(list.)630 5230 y
Fs(+)p Fi(N)384 b Ft(Displa)m(ys)23 b(the)f Fq(N)10 b
Ft(th)21 b(directory)h(\(coun)m(ting)h(from)e(the)h(left)g(of)g(the)g
(list)g(prin)m(ted)1110 5340 y(b)m(y)30 b Fs(dirs)f Ft(when)h(in)m(v)m
+5 -3
View File
@@ -6248,9 +6248,6 @@ name[@var{subscript}]=@var{value}
@noindent
The @var{subscript}
is treated as an arithmetic expression that must evaluate to a number.
If @var{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 array, use
@example
declare -a @var{name}
@@ -6317,6 +6314,11 @@ If @var{subscript} is @samp{@@} or
@samp{*}, the expansion is the number of elements in the array.
Referencing an array variable without a subscript is equivalent to
referencing with a subscript of 0.
If the @var{subscript}
used to reference an element of an indexed array
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).
An array variable is considered set if a subscript has been assigned a
value. The null string is a valid value.
+5 -5
View File
@@ -1007,8 +1007,8 @@ is enabled, the match is performed without regard to the case
of alphabetic characters.
The return value is 0 if the string matches (@samp{==}) or does not
match (@samp{!=})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.
An additional binary operator, @samp{=~}, is available, with the same
precedence as @samp{==} and @samp{!=}.
@@ -1022,8 +1022,8 @@ If the shell option @code{nocasematch}
(see the description of @code{shopt} in @ref{The Shopt Builtin})
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.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the array variable @code{BASH_REMATCH}.
The element of @code{BASH_REMATCH} with index 0 is the portion of the string
@@ -6236,7 +6236,7 @@ There is no maximum
limit on the size of an array, nor any requirement that members
be indexed or assigned contiguously.
Indexed arrays are referenced using integers (including arithmetic
expressions (@pxref{Shell Arithmetic}) and are zero-based;
expressions (@pxref{Shell Arithmetic})) and are zero-based;
associative arrays use arbitrary strings.
An indexed array is created automatically if any variable is assigned to
+32 -27
View File
@@ -395,13 +395,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
the exceptions that ++aa may not be used to destroy an array vari-
able and ++rr will not remove the readonly attribute. When used
in a function, makes each _n_a_m_e local, as with the llooccaall command,
unless the --ggPP ooppttiioonn iiss ssuupppplliieedd,, IIff aa vvaarriiaabbllee nnaammee iiss ffooll--
lloowweedd bbyy ==_v_a_l_u_e,, tthhee vvaalluuee ooff tthhee vvaarriiaabbllee iiss sseett ttoo _v_a_l_u_e.. TThhee
rreettuurrnn vvaalluuee iiss 00 uunnlleessss aann iinnvvaalliidd ooppttiioonn iiss eennccoouunntteerreedd,, aann
aatttteemmpptt iiss mmaaddee ttoo ddeeffiinnee aa ffuunnccttiioonn uussiinngg ````--ff ffoooo==bbaarr'''',, aann
aatttteemmpptt iiss mmaaddee ttoo aassssiiggnn aa vvaalluuee ttoo aa rreeaaddoonnllyy vvaarriiaabbllee,, aann
aatttteemmpptt iiss mmaaddee ttoo aassssiiggnn aa vvaalluuee ttoo aann aarrrraayy vvaarriiaabbllee wwiitthhoouutt
uussiinngg tthhee ccoommppoouunndd aassssiiggnnmmeenntt ssyynnttaaxx ((sseeee AArrrraayyss above), one of
unless the --gg option is supplied, If a variable name is followed
by =_v_a_l_u_e, the value of the variable is set to _v_a_l_u_e. The
return value is 0 unless an invalid option is encountered, an
attempt is made to define a function using ``-f foo=bar'', an
attempt is made to assign a value to a readonly variable, an
attempt is made to assign a value to an array variable without
using the compound assignment syntax (see AArrrraayyss above), one of
the _n_a_m_e_s is not a valid shell variable name, an attempt is made
to turn off readonly status for a readonly variable, an attempt
is made to turn off array status for an array variable, or an
@@ -654,7 +654,8 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
--mm Display the description of each _p_a_t_t_e_r_n in a manpage-like
format
--ss Display only a short usage synopsis for each _p_a_t_t_e_r_n
The return status is 0 unless no command matches _p_a_t_t_e_r_n.
The return status is 0 unless no command matches _p_a_t_t_e_r_n.
hhiissttoorryy [[_n]]
hhiissttoorryy --cc
@@ -956,20 +957,22 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
greater than 128), or an invalid file descriptor is supplied as
the argument to --uu.
rreeaaddoonnllyy [--aaAAppff] [_n_a_m_e[=_w_o_r_d] ...]
rreeaaddoonnllyy [--aaAAff] [--pp] [_n_a_m_e[=_w_o_r_d] ...]
The given _n_a_m_e_s are marked readonly; the values of these _n_a_m_e_s
may not be changed by subsequent assignment. If the --ff option
is supplied, the functions corresponding to the _n_a_m_e_s are so
marked. The --aa option restricts the variables to indexed
arrays; the --AA option restricts the variables to associative
arrays. If no _n_a_m_e arguments are given, or if the --pp option is
supplied, a list of all readonly names is printed. The --pp
option causes output to be displayed in a format that may be
reused as input. If a variable name is followed by =_w_o_r_d, the
value of the variable is set to _w_o_r_d. The return status is 0
unless an invalid option is encountered, one of the _n_a_m_e_s is not
a valid shell variable name, or --ff is supplied with a _n_a_m_e that
is not a function.
arrays. If both options are supplied, --AA takes precedence. If
no _n_a_m_e arguments are given, or if the --pp option is supplied, a
list of all readonly names is printed. The other options may be
used to restrict the output to a subset of the set of readonly
names. The --pp option causes output to be displayed in a format
that may be reused as input. If a variable name is followed by
=_w_o_r_d, the value of the variable is set to _w_o_r_d. The return
status is 0 unless an invalid option is encountered, one of the
_n_a_m_e_s is not a valid shell variable name, or --ff is supplied with
a _n_a_m_e that is not a function.
rreettuurrnn [_n]
Causes a function to exit with the return value specified by _n.
@@ -1243,13 +1246,13 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
(see previous item) and the effect of interrupting a
command list.
ccoommppaatt4411
@item compat41 If set, bbaasshh, 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 behav-
ior remains as in previous versions.
If set, bbaasshh, 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 num-
ber) 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.
ddiirrssppeellll
If set, bbaasshh attempts spelling correction on directory
names during word completion if the directory name ini-
@@ -1305,9 +1308,9 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
default.
gglloobbssttaarr
If set, the pattern **** used in a pathname expansion con-
text will match a files and zero or more directories and
subdirectories. If the pattern is followed by a //, only
directories and subdirectories match.
text will match all files and zero or more directories
and subdirectories. If the pattern is followed by a //,
only directories and subdirectories match.
ggnnuu__eerrrrffmmtt
If set, shell error messages are written in the standard
GNU error message format.
@@ -1395,12 +1398,14 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
xxppgg__eecchhoo
If set, the eecchhoo builtin expands backslash-escape
sequences by default.
ssuussppeenndd [--ff]
Suspend the execution of this shell until it receives a SSIIGGCCOONNTT
signal. A login shell cannot be suspended; the --ff option can be
used to override this and force the suspension. The return sta-
tus is 0 unless the shell is a login shell and --ff is not sup-
plied, or if job control is not enabled.
tteesstt _e_x_p_r
[[ _e_x_p_r ]]
Return a status of 0 or 1 depending on the evaluation of the
+599 -593
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
%!PS-Adobe-3.0
%%Creator: groff version 1.19.2
%%CreationDate: Tue Dec 28 14:30:24 2010
%%CreationDate: Wed Mar 9 17:05:39 2011
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 2
+3 -3
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2011 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Tue Dec 28 13:41:22 EST 2010
@set LASTCHANGE Sat Mar 12 21:44:16 EST 2011
@set EDITION 4.2
@set VERSION 4.2
@set UPDATED 28 December 2010
@set UPDATED-MONTH December 2010
@set UPDATED 12 March 2011
@set UPDATED-MONTH March 2011
+10
View File
@@ -0,0 +1,10 @@
@ignore
Copyright (C) 1988-2011 Free Software Foundation, Inc.
@end ignore
@set LASTCHANGE Tue Dec 28 13:41:22 EST 2010
@set EDITION 4.2
@set VERSION 4.2
@set UPDATED 28 December 2010
@set UPDATED-MONTH December 2010
+4 -10
View File
@@ -3651,6 +3651,8 @@ execute_simple_command (simple_command, pipe_in, pipe_out, async, fds_to_close)
special_builtin_failed = builtin_is_special = 0;
command_line = (char *)0;
QUIT;
/* If we're in a function, update the line number information. */
if (variable_context && interactive_shell && sourcelevel == 0)
line_number -= function_line_number;
@@ -4028,11 +4030,6 @@ execute_builtin (builtin, words, flags, subshell)
int isbltinenv;
char *error_trap;
#if 0
/* XXX -- added 12/11 */
terminate_immediately++;
#endif
error_trap = 0;
old_e_flag = exit_immediately_on_error;
/* The eval builtin calls parse_and_execute, which does not know about
@@ -4114,11 +4111,6 @@ execute_builtin (builtin, words, flags, subshell)
discard_unwind_frame ("eval_builtin");
}
#if 0
/* XXX -- added 12/11 */
terminate_immediately--;
#endif
return (result);
}
@@ -4751,6 +4743,8 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
else
{
parent_return:
QUIT;
/* Make sure that the pipes are closed in the parent. */
close_pipes (pipe_in, pipe_out);
#if defined (PROCESS_SUBSTITUTION) && defined (HAVE_DEV_FD)
+6 -1
View File
@@ -87,6 +87,11 @@ getc_with_restart (stream)
local_bufused = read (fileno (stream), localbuf, sizeof(localbuf));
if (local_bufused > 0)
break;
else if (local_bufused == 0)
{
local_index = 0;
return EOF;
}
else if (errno == X_EAGAIN || errno == X_EWOULDBLOCK)
{
if (sh_unset_nodelay_mode (fileno (stream)) < 0)
@@ -96,7 +101,7 @@ getc_with_restart (stream)
}
continue;
}
else if (local_bufused == 0 || errno != EINTR)
else if (errno != EINTR)
{
local_index = 0;
return EOF;
+41 -13
View File
@@ -3,7 +3,7 @@
/* This file works with both POSIX and BSD systems. It implements job
control. */
/* Copyright (C) 1989-2010 Free Software Foundation, Inc.
/* Copyright (C) 1989-2011 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -2212,6 +2212,10 @@ wait_for_background_pids ()
#define INVALID_SIGNAL_HANDLER (SigHandler *)wait_for_background_pids
static SigHandler *old_sigint_handler = INVALID_SIGNAL_HANDLER;
static int wait_sigint_received;
static int child_caught_sigint;
static int waiting_for_child;
static void
restore_sigint_handler ()
{
@@ -2219,11 +2223,10 @@ restore_sigint_handler ()
{
set_signal_handler (SIGINT, old_sigint_handler);
old_sigint_handler = INVALID_SIGNAL_HANDLER;
waiting_for_child = 0;
}
}
static int wait_sigint_received;
/* Handle SIGINT while we are waiting for children in a script to exit.
The `wait' builtin should be interruptible, but all others should be
effectively ignored (i.e. not cause the shell to exit). */
@@ -2256,7 +2259,14 @@ wait_sigint_handler (sig)
/* XXX - should this be interrupt_state? If it is, the shell will act
as if it got the SIGINT interrupt. */
wait_sigint_received = 1;
if (waiting_for_child)
wait_sigint_received = 1;
else
{
last_command_exit_value = 128+SIGINT;
restore_sigint_handler ();
kill (getpid (), SIGINT);
}
/* Otherwise effectively ignore the SIGINT and allow the running job to
be killed. */
@@ -2392,10 +2402,11 @@ wait_for (pid)
substitution. */
/* This is possibly a race condition -- should it go in stop_pipeline? */
wait_sigint_received = 0;
wait_sigint_received = child_caught_sigint = 0;
if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB))
{
old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
waiting_for_child = 0;
if (old_sigint_handler == SIG_IGN)
set_signal_handler (SIGINT, old_sigint_handler);
}
@@ -2447,7 +2458,9 @@ wait_for (pid)
sigaction (SIGCHLD, &act, &oact);
# endif
queue_sigchld = 1;
waiting_for_child++;
r = waitchld (pid, 1);
waiting_for_child--;
# if defined (MUST_UNBLOCK_CHLD)
sigaction (SIGCHLD, &oact, (struct sigaction *)NULL);
sigprocmask (SIG_SETMASK, &chldset, (sigset_t *)NULL);
@@ -2489,6 +2502,9 @@ wait_for (pid)
}
while (PRUNNING (child) || (job != NO_JOB && RUNNING (job)));
/* Restore the original SIGINT signal handler before we return. */
restore_sigint_handler ();
/* The exit state of the command is either the termination state of the
child, or the termination state of the job. If a job, the status
of the last child in the pipeline is the significant one. If the command
@@ -2524,9 +2540,6 @@ if (job == NO_JOB)
give_terminal_to (shell_pgrp, 0);
}
/* Restore the original SIGINT signal handler before we return. */
restore_sigint_handler ();
/* If the command did not exit cleanly, or the job is just
being stopped, then reset the tty state back to what it
was before this command. Reset the tty state and notify
@@ -2588,8 +2601,8 @@ if (job == NO_JOB)
and being killed by the SIGINT to pass the status back to our
parent. */
s = job_signal_status (job);
if (WIFSIGNALED (s) && WTERMSIG (s) == SIGINT && signal_is_trapped (SIGINT) == 0)
if (child_caught_sigint == 0 && signal_is_trapped (SIGINT) == 0)
{
UNBLOCK_CHILD (oset);
old_sigint_handler = set_signal_handler (SIGINT, SIG_DFL);
@@ -3116,9 +3129,23 @@ waitchld (wpid, block)
/* If waitpid returns 0, there are running children. If it returns -1,
the only other error POSIX says it can return is EINTR. */
CHECK_TERMSIG;
/* If waitpid returns -1/EINTR and the shell saw a SIGINT, then we
assume the child has blocked or handled SIGINT. In that case, we
require the child to actually die due to SIGINT to act on the
SIGINT we received; otherwise we assume the child handled it and
let it go. */
if (pid < 0 && errno == EINTR && wait_sigint_received)
child_caught_sigint = 1;
if (pid <= 0)
continue; /* jumps right to the test */
/* If the child process did die due to SIGINT, forget our assumption
that it caught or otherwise handled it. */
if (WIFSIGNALED (status) && WTERMSIG (status) == SIGINT)
child_caught_sigint = 0;
/* children_exited is used to run traps on SIGCHLD. We don't want to
run the trap if a process is just being continued. */
if (WIFCONTINUED(status) == 0)
@@ -3306,7 +3333,7 @@ set_job_status_and_cleanup (job)
does not exit due to SIGINT, run the trap handler but do not
otherwise act as if we got the interrupt. */
if (wait_sigint_received && interactive_shell == 0 &&
WIFSIGNALED (child->status) == 0 && IS_FOREGROUND (job) &&
child_caught_sigint && IS_FOREGROUND (job) &&
signal_is_trapped (SIGINT))
{
int old_frozen;
@@ -3328,7 +3355,8 @@ set_job_status_and_cleanup (job)
signals are sent to process groups) or via kill(2) to the foreground
process by another process (or itself). If the shell did receive the
SIGINT, it needs to perform normal SIGINT processing. */
else if (wait_sigint_received && (WTERMSIG (child->status) == SIGINT) &&
else if (wait_sigint_received &&
child_caught_sigint == 0 &&
IS_FOREGROUND (job) && IS_JOBCONTROL (job) == 0)
{
int old_frozen;
@@ -3368,7 +3396,7 @@ set_job_status_and_cleanup (job)
temp_handler = trap_to_sighandler (SIGINT);
restore_sigint_handler ();
if (temp_handler == SIG_DFL)
termsig_handler (SIGINT);
termsig_handler (SIGINT); /* XXX */
else if (temp_handler != SIG_IGN)
(*temp_handler) (SIGINT);
}
+3 -2
View File
@@ -1365,6 +1365,7 @@ functions to do so manually.
Readline contains an internal signal handler that is installed for a
number of signals (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM},
@code{SIGHUP},
@code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}).
When one of these signals is received, the signal handler
will reset the terminal attributes to those that were in effect before
@@ -1397,7 +1398,7 @@ a signal handler, so Readline's internal signal state is not corrupted.
@deftypevar int rl_catch_signals
If this variable is non-zero, Readline will install signal handlers for
@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGALRM},
@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM}, @code{SIGHUP}, @code{SIGALRM},
@code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}.
The default value of @code{rl_catch_signals} is 1.
@@ -1477,7 +1478,7 @@ The following functions install and remove Readline's signal handlers.
@deftypefun int rl_set_signals (void)
Install Readline's signal handler for @code{SIGINT}, @code{SIGQUIT},
@code{SIGTERM}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN},
@code{SIGTERM}, @code{SIGHUP}, @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN},
@code{SIGTTOU}, and @code{SIGWINCH}, depending on the values of
@code{rl_catch_signals} and @code{rl_catch_sigwinch}.
@end deftypefun
+7 -1
View File
@@ -1,6 +1,6 @@
/* input.c -- character input functions for readline. */
/* Copyright (C) 1994-2010 Free Software Foundation, Inc.
/* Copyright (C) 1994-2011 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -464,6 +464,8 @@ rl_getc (stream)
{
RL_CHECK_SIGNALS ();
/* We know at this point that _rl_caught_signal == 0 */
#if defined (__MINGW32__)
if (isatty (fileno (stream)))
return (getch ());
@@ -510,6 +512,10 @@ rl_getc (stream)
Otherwise, some error ocurred, also signifying EOF. */
if (errno != EINTR)
return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
else if (rl_event_hook)
(*rl_event_hook) ();
}
}
+7 -3
View File
@@ -1,6 +1,6 @@
/* signals.c -- signal handling support for readline. */
/* Copyright (C) 1987-2009 Free Software Foundation, Inc.
/* Copyright (C) 1987-2011 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -87,7 +87,7 @@ static RETSIGTYPE _rl_handle_signal PARAMS((int));
/* Exported variables for use by applications. */
/* If non-zero, readline will install its own signal handlers for
SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
SIGINT, SIGTERM, SIGHUP, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
int rl_catch_signals = 1;
/* If non-zero, readline will install a signal handler for SIGWINCH. */
@@ -118,7 +118,7 @@ static int sigwinch_set_flag;
/* */
/* **************************************************************** */
static sighandler_cxt old_int, old_term, old_alrm, old_quit;
static sighandler_cxt old_int, old_term, old_hup, old_alrm, old_quit;
#if defined (SIGTSTP)
static sighandler_cxt old_tstp, old_ttou, old_ttin;
#endif
@@ -189,6 +189,7 @@ _rl_handle_signal (sig)
/* FALLTHROUGH */
case SIGTERM:
case SIGHUP:
#if defined (SIGTSTP)
case SIGTSTP:
case SIGTTOU:
@@ -349,6 +350,7 @@ rl_set_signals ()
sigaddset (&bset, SIGINT);
sigaddset (&bset, SIGTERM);
sigaddset (&bset, SIGHUP);
#if defined (SIGQUIT)
sigaddset (&bset, SIGQUIT);
#endif
@@ -377,6 +379,7 @@ rl_set_signals ()
rl_maybe_set_sighandler (SIGINT, rl_signal_handler, &old_int);
rl_maybe_set_sighandler (SIGTERM, rl_signal_handler, &old_term);
rl_maybe_set_sighandler (SIGHUP, rl_signal_handler, &old_hup);
#if defined (SIGQUIT)
rl_maybe_set_sighandler (SIGQUIT, rl_signal_handler, &old_quit);
#endif
@@ -436,6 +439,7 @@ rl_clear_signals ()
rl_sigaction (SIGINT, &old_int, &dummy);
rl_sigaction (SIGTERM, &old_term, &dummy);
rl_sigaction (SIGHUP, &old_hup, &dummy);
#if defined (SIGQUIT)
rl_sigaction (SIGQUIT, &old_quit, &dummy);
#endif
+8 -10
View File
@@ -1438,12 +1438,11 @@ yy_readline_get ()
interrupt_immediately++;
old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler);
}
terminate_immediately = 1;
current_readline_line = readline (current_readline_prompt ?
current_readline_prompt : "");
terminate_immediately = 0;
CHECK_TERMSIG;
if (signal_is_ignored (SIGINT) == 0)
{
interrupt_immediately--;
@@ -1603,16 +1602,15 @@ yy_stream_get ()
if (bash_input.location.file)
{
if (interactive)
{
interrupt_immediately++;
terminate_immediately++;
}
interrupt_immediately++;
/* XXX - don't need terminate_immediately; getc_with_restart checks
for terminating signals itself if read returns < 0 */
result = getc_with_restart (bash_input.location.file);
if (interactive)
{
interrupt_immediately--;
terminate_immediately--;
}
interrupt_immediately--;
}
return (result);
}
+1 -1
View File
@@ -1,2 +1,2 @@
# Set of available languages.
en@quot en@boldquot af bg ca cs de eo es et fi fr ga hu id ja lt nl pl pt_BR ro ru sk sv tr uk vi zh_CN zh_TW
en@quot en@boldquot af bg ca cs de eo es et fi fr ga hu id ja lt nl pl pt_BR ro ru sk sl sv tr uk vi zh_CN zh_TW
+2
View File
@@ -0,0 +1,2 @@
# Set of available languages.
en@quot en@boldquot af bg ca cs de eo es et fi fr ga hu id ja lt nl pl pt_BR ro ru sk sv tr uk vi zh_CN zh_TW
+368 -718
View File
File diff suppressed because it is too large Load Diff
+569 -1243
View File
File diff suppressed because it is too large Load Diff
+277 -391
View File
File diff suppressed because it is too large Load Diff
+639 -1340
View File
File diff suppressed because it is too large Load Diff
+417 -875
View File
File diff suppressed because it is too large Load Diff
+340 -658
View File
File diff suppressed because it is too large Load Diff
+735 -1321
View File
File diff suppressed because it is too large Load Diff
+3859
View File
File diff suppressed because it is too large Load Diff
+253 -512
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -214,7 +214,11 @@ static int make_login_shell; /* Make this shell be a `-bash' shell. */
static int want_initial_help; /* --help option */
int debugging_mode = 0; /* In debugging mode with --debugger */
int no_line_editing = 0; /* Don't do fancy line editing. */
#if defined (READLINE)
int no_line_editing = 0; /* non-zero -> don't do fancy line editing. */
#else
int no_line_editing = 1; /* can't have line editing without readline */
#endif
int dump_translatable_strings; /* Dump strings in $"...", don't execute. */
int dump_po_strings; /* Dump strings in $"..." in po format */
int wordexp_only = 0; /* Do word expansion only */
+6 -1
View File
@@ -46,6 +46,7 @@
#if defined (READLINE)
# include "bashline.h"
# include <readline/readline.h>
#endif
#if defined (HISTORY)
@@ -62,6 +63,7 @@ extern int parse_and_execute_level, shell_initialized;
#if defined (HISTORY)
extern int history_lines_this_session;
#endif
extern int no_line_editing;
extern void initialize_siglist ();
@@ -505,7 +507,10 @@ termsig_sighandler (sig)
{
#if defined (HISTORY)
/* XXX - will inhibit history file being written */
history_lines_this_session = 0;
# if defined (READLINE)
if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0))
# endif
history_lines_this_session = 0;
#endif
terminate_immediately = 0;
termsig_handler (sig);
+1 -1
View File
@@ -5527,7 +5527,7 @@ array_length_reference (s)
}
else
{
ind = array_expand_index (t, len);
ind = array_expand_index (var, t, len);
if (ind < 0)
{
err_badarraysub (t);
+16 -7
View File
@@ -89,6 +89,7 @@ extern int errno;
#define PF_NOCOMSUB 0x01 /* Do not perform command substitution */
#define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */
#define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */
#define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */
/* These defs make it easier to use the editor. */
#define LBRACE '{'
@@ -4192,7 +4193,7 @@ match_wpattern (wstring, indices, wstrlen, wpat, mtype, sp, ep)
mlen = wmatchlen (wpat, wstrlen);
itrace("wmatchlen (%ls) -> %d", wpat, mlen);
/* itrace("wmatchlen (%ls) -> %d", wpat, mlen); */
switch (mtype)
{
case MATCH_ANY:
@@ -4311,9 +4312,15 @@ match_pattern (string, pat, mtype, sp, ep)
if (MB_CUR_MAX > 1)
{
#if 0
slen = STRLEN (string);
mslen = MBSLEN (string);
plen = STRLEN (pat);
mplen = MBSLEN (pat);
if (slen == mslen && plen == mplen)
#else
if (mbsmbchar (string) == 0 && mbsmbchar (pat) == 0)
return (match_upattern (string, pat, mtype, sp, ep));
#endif
return (match_upattern (string, pat, mtype, sp, ep));
n = xdupmbstowcs (&wpat, NULL, pat);
if (n == (size_t)-1)
@@ -4605,6 +4612,7 @@ expand_word_unsplit (word, quoted)
if (ifs_firstc == 0)
#endif
word->flags |= W_NOSPLIT;
word->flags |= W_NOSPLIT2;
result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL);
expand_no_split_dollar_star = 0;
@@ -7603,17 +7611,16 @@ param_expand (string, sindex, quoted, expanded_something,
if (contains_dollar_at)
*contains_dollar_at = 1;
#if 0
if (pflags & PF_NOSPLIT2)
temp = string_list_internal (quoted ? quote_list (list) : list, " ");
else
#endif
/* We want to separate the positional parameters with the first
character of $IFS in case $IFS is something other than a space.
We also want to make sure that splitting is done no matter what --
according to POSIX.2, this expands to a list of the positional
parameters no matter what IFS is set to. */
#if 0
temp = string_list_dollar_at (list, quoted);
#else
temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted);
#endif
dispose_words (list);
break;
@@ -8107,6 +8114,8 @@ add_string:
pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
if (word->flags & W_NOSPLIT2)
pflags |= PF_NOSPLIT2;
if (word->flags & W_ASSIGNRHS)
pflags |= PF_ASSIGNRHS;
tword = param_expand (string, &sindex, quoted, expanded_something,
&has_dollar_at, &quoted_dollar_at,
&had_quoted_null, pflags);