commit bash-20070125 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:02:52 -05:00
parent 1384c96f19
commit 5cfe250dad
24 changed files with 7038 additions and 7009 deletions
+1
View File
@@ -659,6 +659,7 @@ examples/scripts/showperm.bash f
examples/scripts/shprompt f
examples/scripts/spin.bash f
examples/scripts/timeout f
examples/scripts/timeout2 f
examples/scripts/vtree2 f
examples/scripts/vtree3 f
examples/scripts/vtree3a f
+724 -709
View File
File diff suppressed because it is too large Load Diff
+200 -574
View File
File diff suppressed because it is too large Load Diff
+32 -6
View File
@@ -3,7 +3,7 @@
</HEAD>
<BODY><TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2006 December 26<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>BASH(1)<TH ALIGN=CENTER width=33%>2007 January 12<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<BR><A HREF="#index">Index</A>
@@ -42,7 +42,7 @@ bash - GNU Bourne-Again SHell
<H3>COPYRIGHT</H3>
Bash is Copyright &#169; 1989-2005 by the Free Software Foundation, Inc.
Bash is Copyright &#169; 1989-2007 by the Free Software Foundation, Inc.
<A NAME="lbAE">&nbsp;</A>
<H3>DESCRIPTION</H3>
@@ -2260,6 +2260,8 @@ for <I>strftime</I>(3) to print the time stamp associated with each history
entry displayed by the <B>history</B> builtin.
If this variable is set, time stamps are written to the history file so
they may be preserved across shell sessions.
This uses the history comment character to distinguish timestamps from
other history lines.
<DT><B>HOME</B>
<DD>
@@ -7279,6 +7281,14 @@ the number of lines specified by the value of
<FONT SIZE=-1><B>HISTFILESIZE</B>.
</FONT>
When the history file is read,
lines beginning with the history comment character followed immediately
by a digit are interpreted as timestamps for the preceding history line.
These timestamps are optionally displayed depending on the value of the
<FONT SIZE=-1><B>HISTTIMEFORMAT</B>
</FONT>
variable.
When an interactive shell exits, the last
<FONT SIZE=-1><B>$HISTSIZE</B>
@@ -7305,7 +7315,16 @@ If
</FONT>
is unset, or if the history file is unwritable, the history is
not saved. After saving the history, the history file is truncated
not saved.
If the
<FONT SIZE=-1>
</FONT>
variable is set, time stamps are written to the history file, marked
with the history comment character, so
they may be preserved across shell sessions.
This uses the history comment character to distinguish timestamps from
other history lines.
After saving the history, the history file is truncated
to contain no more than
<FONT SIZE=-1><B>HISTFILESIZE</B>
@@ -7478,6 +7497,9 @@ history expansion mechanism (see the description of
above under
<B>Shell Variables</B>).
The shell uses
the history comment character to mark history timestamps when
writing the history file.
<A NAME="lbCW">&nbsp;</A>
<H4>Event Designators</H4>
@@ -9229,7 +9251,11 @@ are added.
<P>
If the <B>HISTTIMEFORMAT</B> is set, the time stamp information
associated with each history entry is written to the history file.
associated with each history entry is written to the history file,
marked with the history comment character.
When the history file is read, lines beginning with the history
comment character followed immediately by a digit are interpreted
as timestamps for the previous history line.
The return value is 0 unless an invalid option is encountered, an
error occurs while reading or writing the history file, an invalid
<I>offset</I> is supplied as an argument to <B>-d</B>, or the
@@ -11515,7 +11541,7 @@ Array variables may not (yet) be exported.
<HR>
<TABLE WIDTH=100%>
<TR>
<TH ALIGN=LEFT width=33%>GNU Bash-3.2<TH ALIGN=CENTER width=33%>2006 December 26<TH ALIGN=RIGHT width=33%>BASH(1)
<TH ALIGN=LEFT width=33%>GNU Bash-3.2<TH ALIGN=CENTER width=33%>2007 January 12<TH ALIGN=RIGHT width=33%>BASH(1)
</TR>
</TABLE>
<HR>
@@ -11619,6 +11645,6 @@ Array variables may not (yet) be exported.
</DL>
<HR>
This document was created by man2html from bash.1.<BR>
Time: 09 January 2007 09:51:43 EST
Time: 16 January 2007 11:15:22 EST
</BODY>
</HTML>
+3729 -3704
View File
File diff suppressed because it is too large Load Diff
+13 -10
View File
@@ -311,7 +311,7 @@
@xrdef{History Interaction-pg}{119}
@xrdef{History Interaction-snt}{Section@tie 9.3}
@xrdef{Event Designators-title}{Event Designators}
@xrdef{Event Designators-pg}{119}
@xrdef{Event Designators-pg}{120}
@xrdef{Event Designators-snt}{Section@tie 9.3.1}
@xrdef{Word Designators-title}{Word Designators}
@xrdef{Word Designators-pg}{120}
@@ -358,18 +358,21 @@
@xrdef{GNU Free Documentation License-title}{GNU Free Documentation License}
@xrdef{GNU Free Documentation License-pg}{139}
@xrdef{GNU Free Documentation License-snt}{Section@tie @char67.1}
@xrdef{Indexes-title}{Indexes}
@xrdef{Indexes-pg}{147}
@xrdef{Indexes-snt}{Appendix@tie @char68{}}
@xrdef{Builtin Index-title}{Index of Shell Builtin Commands}
@xrdef{Builtin Index-pg}{147}
@xrdef{Builtin Index-snt}{}
@xrdef{Builtin Index-pg}{148}
@xrdef{Builtin Index-snt}{Section@tie @char68.1}
@xrdef{Reserved Word Index-title}{Index of Shell Reserved Words}
@xrdef{Reserved Word Index-pg}{149}
@xrdef{Reserved Word Index-snt}{}
@xrdef{Reserved Word Index-snt}{Section@tie @char68.2}
@xrdef{Variable Index-title}{Parameter and Variable Index}
@xrdef{Variable Index-pg}{151}
@xrdef{Variable Index-snt}{}
@xrdef{Variable Index-pg}{149}
@xrdef{Variable Index-snt}{Section@tie @char68.3}
@xrdef{Function Index-title}{Function Index}
@xrdef{Function Index-pg}{153}
@xrdef{Function Index-snt}{}
@xrdef{Function Index-pg}{151}
@xrdef{Function Index-snt}{Section@tie @char68.4}
@xrdef{Concept Index-title}{Concept Index}
@xrdef{Concept Index-pg}{155}
@xrdef{Concept Index-snt}{}
@xrdef{Concept Index-pg}{153}
@xrdef{Concept Index-snt}{Section@tie @char68.5}
+1 -1
View File
@@ -52,5 +52,5 @@
\entry{suspend}{89}{\code {suspend}}
\entry{compgen}{113}{\code {compgen}}
\entry{complete}{113}{\code {complete}}
\entry{fc}{117}{\code {fc}}
\entry{fc}{118}{\code {fc}}
\entry{history}{118}{\code {history}}
+1 -1
View File
@@ -30,7 +30,7 @@
\entry {\code {exit}}{36}
\entry {\code {export}}{36}
\initial {F}
\entry {\code {fc}}{117}
\entry {\code {fc}}{118}
\entry {\code {fg}}{88}
\initial {G}
\entry {\code {getopts}}{37}
+2 -2
View File
@@ -109,8 +109,8 @@
\entry{history list}{117}{history list}
\entry{history builtins}{117}{history builtins}
\entry{history expansion}{119}{history expansion}
\entry{event designators}{119}{event designators}
\entry{history events}{119}{history events}
\entry{event designators}{120}{event designators}
\entry{history events}{120}{history events}
\entry{installation}{123}{installation}
\entry{configuration}{123}{configuration}
\entry{Bash installation}{123}{Bash installation}
+2 -2
View File
@@ -37,7 +37,7 @@
\entry {editing command lines}{91}
\entry {environment}{31}
\entry {evaluation, arithmetic}{76}
\entry {event designators}{119}
\entry {event designators}{120}
\entry {execution environment}{30}
\entry {exit status}{3, 31}
\entry {expansion}{17}
@@ -58,7 +58,7 @@
\entry {functions, shell}{14}
\initial {H}
\entry {history builtins}{117}
\entry {history events}{119}
\entry {history events}{120}
\entry {history expansion}{119}
\entry {history list}{117}
\entry {History, how to use}{116}
BIN
View File
Binary file not shown.
+16 -7
View File
@@ -1,6 +1,6 @@
<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on January, 11 2007 by texi2html 1.64 -->
<!-- Created on January, 16 2007 by texi2html 1.64 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
@@ -33,10 +33,10 @@ Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
<H1>Bash Reference Manual</H1></P><P>
This text is a brief description of the features that are present in
the Bash shell (version 3.2, 30 December 2006).
the Bash shell (version 3.2, 12 January 2007).
</P><P>
This is Edition 3.2, last updated 30 December 2006,
This is Edition 3.2, last updated 12 January 2007,
of <CITE>The GNU Bash Reference Manual</CITE>,
for <CODE>Bash</CODE>, Version 3.2.
</P><P>
@@ -6084,6 +6084,8 @@ for <VAR>strftime</VAR> to print the time stamp associated with each history
entry displayed by the <CODE>history</CODE> builtin.
If this variable is set, time stamps are written to the history file so
they may be preserved across shell sessions.
This uses the history comment character to distinguish timestamps from
other history lines.
<P>
<A NAME="IDX206"></A>
@@ -11160,7 +11162,11 @@ lines. If <CODE>HISTFILESIZE</CODE> is not set, no truncation is performed.
</P><P>
If the <CODE>HISTTIMEFORMAT</CODE> is set, the time stamp information
associated with each history entry is written to the history file.
associated with each history entry is written to the history file,
marked with the history comment character.
When the history file is read, lines beginning with the history
comment character followed immediately by a digit are interpreted
as timestamps for the previous history line.
</P><P>
The builtin command <CODE>fc</CODE> may be used to list or edit and re-execute
@@ -11386,7 +11392,10 @@ This is most useful in conjunction with Readline.
</P><P>
The shell allows control of the various characters used by the
history expansion mechanism with the <CODE>histchars</CODE> variable.
history expansion mechanism with the <CODE>histchars</CODE> variable,
as explained above (see section <A HREF="bashref.html#SEC65">5.2 Bash Variables</A>). The shell uses
the history comment character to mark history timestamps when
writing the history file.
</P><P>
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
@@ -15278,7 +15287,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>January, 11 2007</I>
This document was generated by <I>Chet Ramey</I> on <I>January, 16 2007</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
<P></P>
@@ -15440,7 +15449,7 @@ the following structure:
<BR>
<FONT SIZE="-1">
This document was generated
by <I>Chet Ramey</I> on <I>January, 11 2007</I>
by <I>Chet Ramey</I> on <I>January, 16 2007</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
+210 -191
View File
@@ -2,9 +2,9 @@ This is bashref.info, produced by makeinfo version 4.8 from
/Users/chet/src/bash/src/doc/bashref.texi.
This text is a brief description of the features that are present in
the Bash shell (version 3.2, 30 December 2006).
the Bash shell (version 3.2, 12 January 2007).
This is Edition 3.2, last updated 30 December 2006, of `The GNU Bash
This is Edition 3.2, last updated 12 January 2007, of `The GNU Bash
Reference Manual', for `Bash', Version 3.2.
Copyright (C) 1988-2005 Free Software Foundation, Inc.
@@ -37,9 +37,9 @@ Bash Features
*************
This text is a brief description of the features that are present in
the Bash shell (version 3.2, 30 December 2006).
the Bash shell (version 3.2, 12 January 2007).
This is Edition 3.2, last updated 30 December 2006, of `The GNU Bash
This is Edition 3.2, last updated 12 January 2007, of `The GNU Bash
Reference Manual', for `Bash', Version 3.2.
Bash contains features that appear in other popular shells, and some
@@ -73,13 +73,7 @@ on shell behavior.
between Bash and historical
versions of /bin/sh.
* Copying This Manual:: Copying this manual.
* Builtin Index:: Index of Bash builtin commands.
* Reserved Word Index:: Index of Bash reserved words.
* Variable Index:: Quick reference helps you find the
variable you want.
* Function Index:: Index of bindable Readline functions.
* Concept Index:: General index for concepts described in
this manual.
* Indexes:: Various indexes for this manual.

File: bashref.info, Node: Introduction, Next: Definitions, Prev: Top, Up: Top
@@ -4050,7 +4044,9 @@ Variables::).
format string for STRFTIME to print the time stamp associated with
each history entry displayed by the `history' builtin. If this
variable is set, time stamps are written to the history file so
they may be preserved across shell sessions.
they may be preserved across shell sessions. This uses the
history comment character to distinguish timestamps from other
history lines.
`HOSTFILE'
Contains the name of a file in the same format as `/etc/hosts' that
@@ -7417,7 +7413,11 @@ history, the history file is truncated to contain no more than
performed.
If the `HISTTIMEFORMAT' is set, the time stamp information
associated with each history entry is written to the history file.
associated with each history entry is written to the history file,
marked with the history comment character. When the history file is
read, lines beginning with the history comment character followed
immediately by a digit are interpreted as timestamps for the previous
history line.
The builtin command `fc' may be used to list or edit and re-execute
a portion of the history list. The `history' builtin may be used to
@@ -7574,7 +7574,9 @@ available for subsequent recall. This is most useful in conjunction
with Readline.
The shell allows control of the various characters used by the
history expansion mechanism with the `histchars' variable.
history expansion mechanism with the `histchars' variable, as explained
above (*note Bash Variables::). The shell uses the history comment
character to mark history timestamps when writing the history file.
* Menu:
@@ -8583,7 +8585,7 @@ many of the limitations of the SVR4.2 shell. For instance:
turns on job control).

File: bashref.info, Node: Copying This Manual, Next: Builtin Index, Prev: Major Differences From The Bourne Shell, Up: Top
File: bashref.info, Node: Copying This Manual, Next: Indexes, Prev: Major Differences From The Bourne Shell, Up: Top
Appendix C Copying This Manual
******************************
@@ -9025,10 +9027,26 @@ free software license, such as the GNU General Public License, to
permit their use in free software.

File: bashref.info, Node: Builtin Index, Next: Reserved Word Index, Prev: Copying This Manual, Up: Top
File: bashref.info, Node: Indexes, Prev: Copying This Manual, Up: Top
Index of Shell Builtin Commands
*******************************
Appendix D Indexes
******************
* Menu:
* Builtin Index:: Index of Bash builtin commands.
* Reserved Word Index:: Index of Bash reserved words.
* Variable Index:: Quick reference helps you find the
variable you want.
* Function Index:: Index of bindable Readline functions.
* Concept Index:: General index for concepts described in
this manual.

File: bashref.info, Node: Builtin Index, Next: Reserved Word Index, Up: Indexes
D.1 Index of Shell Builtin Commands
===================================
[index]
* Menu:
@@ -9126,10 +9144,10 @@ Index of Shell Builtin Commands
(line 73)

File: bashref.info, Node: Reserved Word Index, Next: Variable Index, Prev: Builtin Index, Up: Top
File: bashref.info, Node: Reserved Word Index, Next: Variable Index, Prev: Builtin Index, Up: Indexes
Index of Shell Reserved Words
*****************************
D.2 Index of Shell Reserved Words
=================================
[index]
* Menu:
@@ -9168,10 +9186,10 @@ Index of Shell Reserved Words
* }: Command Grouping. (line 21)

File: bashref.info, Node: Variable Index, Next: Function Index, Prev: Reserved Word Index, Up: Top
File: bashref.info, Node: Variable Index, Next: Function Index, Prev: Reserved Word Index, Up: Indexes
Parameter and Variable Index
****************************
D.3 Parameter and Variable Index
================================
[index]
* Menu:
@@ -9251,32 +9269,32 @@ Parameter and Variable Index
(line 13)
* horizontal-scroll-mode: Readline Init File Syntax.
(line 101)
* HOSTFILE: Bash Variables. (line 290)
* HOSTNAME: Bash Variables. (line 301)
* HOSTTYPE: Bash Variables. (line 304)
* HOSTFILE: Bash Variables. (line 292)
* HOSTNAME: Bash Variables. (line 303)
* HOSTTYPE: Bash Variables. (line 306)
* IFS: Bourne Shell Variables.
(line 18)
* IGNOREEOF: Bash Variables. (line 307)
* IGNOREEOF: Bash Variables. (line 309)
* input-meta: Readline Init File Syntax.
(line 108)
* INPUTRC: Bash Variables. (line 317)
* INPUTRC: Bash Variables. (line 319)
* isearch-terminators: Readline Init File Syntax.
(line 115)
* keymap: Readline Init File Syntax.
(line 122)
* LANG: Bash Variables. (line 321)
* LC_ALL: Bash Variables. (line 325)
* LC_COLLATE: Bash Variables. (line 329)
* LC_CTYPE: Bash Variables. (line 336)
* LANG: Bash Variables. (line 323)
* LC_ALL: Bash Variables. (line 327)
* LC_COLLATE: Bash Variables. (line 331)
* LC_CTYPE: Bash Variables. (line 338)
* LC_MESSAGES <1>: Locale Translation. (line 11)
* LC_MESSAGES: Bash Variables. (line 341)
* LC_NUMERIC: Bash Variables. (line 345)
* LINENO: Bash Variables. (line 349)
* LINES: Bash Variables. (line 353)
* MACHTYPE: Bash Variables. (line 358)
* LC_MESSAGES: Bash Variables. (line 343)
* LC_NUMERIC: Bash Variables. (line 347)
* LINENO: Bash Variables. (line 351)
* LINES: Bash Variables. (line 355)
* MACHTYPE: Bash Variables. (line 360)
* MAIL: Bourne Shell Variables.
(line 22)
* MAILCHECK: Bash Variables. (line 362)
* MAILCHECK: Bash Variables. (line 364)
* MAILPATH: Bourne Shell Variables.
(line 27)
* mark-modified-lines: Readline Init File Syntax.
@@ -9287,54 +9305,54 @@ Parameter and Variable Index
(line 145)
* meta-flag: Readline Init File Syntax.
(line 108)
* OLDPWD: Bash Variables. (line 370)
* OLDPWD: Bash Variables. (line 372)
* OPTARG: Bourne Shell Variables.
(line 34)
* OPTERR: Bash Variables. (line 373)
* OPTERR: Bash Variables. (line 375)
* OPTIND: Bourne Shell Variables.
(line 38)
* OSTYPE: Bash Variables. (line 377)
* OSTYPE: Bash Variables. (line 379)
* output-meta: Readline Init File Syntax.
(line 152)
* page-completions: Readline Init File Syntax.
(line 157)
* PATH: Bourne Shell Variables.
(line 42)
* PIPESTATUS: Bash Variables. (line 380)
* POSIXLY_CORRECT: Bash Variables. (line 385)
* PPID: Bash Variables. (line 394)
* PROMPT_COMMAND: Bash Variables. (line 398)
* PIPESTATUS: Bash Variables. (line 382)
* POSIXLY_CORRECT: Bash Variables. (line 387)
* PPID: Bash Variables. (line 396)
* PROMPT_COMMAND: Bash Variables. (line 400)
* PS1: Bourne Shell Variables.
(line 48)
* PS2: Bourne Shell Variables.
(line 53)
* PS3: Bash Variables. (line 402)
* PS4: Bash Variables. (line 407)
* PWD: Bash Variables. (line 413)
* RANDOM: Bash Variables. (line 416)
* REPLY: Bash Variables. (line 421)
* SECONDS: Bash Variables. (line 424)
* SHELL: Bash Variables. (line 430)
* SHELLOPTS: Bash Variables. (line 435)
* SHLVL: Bash Variables. (line 444)
* PS3: Bash Variables. (line 404)
* PS4: Bash Variables. (line 409)
* PWD: Bash Variables. (line 415)
* RANDOM: Bash Variables. (line 418)
* REPLY: Bash Variables. (line 423)
* SECONDS: Bash Variables. (line 426)
* SHELL: Bash Variables. (line 432)
* SHELLOPTS: Bash Variables. (line 437)
* SHLVL: Bash Variables. (line 446)
* show-all-if-ambiguous: Readline Init File Syntax.
(line 167)
* show-all-if-unmodified: Readline Init File Syntax.
(line 173)
* TEXTDOMAIN: Locale Translation. (line 11)
* TEXTDOMAINDIR: Locale Translation. (line 11)
* TIMEFORMAT: Bash Variables. (line 449)
* TMOUT: Bash Variables. (line 487)
* TMPDIR: Bash Variables. (line 499)
* UID: Bash Variables. (line 503)
* TIMEFORMAT: Bash Variables. (line 451)
* TMOUT: Bash Variables. (line 489)
* TMPDIR: Bash Variables. (line 501)
* UID: Bash Variables. (line 505)
* visible-stats: Readline Init File Syntax.
(line 182)

File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Top
File: bashref.info, Node: Function Index, Next: Concept Index, Prev: Variable Index, Up: Indexes
Function Index
**************
D.4 Function Index
==================
[index]
* Menu:
@@ -9433,10 +9451,10 @@ Function Index
* yank-pop (M-y): Commands For Killing. (line 62)

File: bashref.info, Node: Concept Index, Prev: Function Index, Up: Top
File: bashref.info, Node: Concept Index, Prev: Function Index, Up: Indexes
Concept Index
*************
D.5 Concept Index
=================
[index]
* Menu:
@@ -9594,131 +9612,132 @@ Concept Index

Tag Table:
Node: Top1357
Node: Introduction3438
Node: What is Bash?3666
Node: What is a shell?4779
Node: Definitions7319
Node: Basic Shell Features10087
Node: Shell Syntax11306
Node: Shell Operation12336
Node: Quoting13630
Node: Escape Character14933
Node: Single Quotes15418
Node: Double Quotes15766
Node: ANSI-C Quoting16891
Node: Locale Translation17847
Node: Comments18743
Node: Shell Commands19361
Node: Simple Commands20127
Node: Pipelines20758
Node: Lists22633
Node: Compound Commands24264
Node: Looping Constructs25048
Node: Conditional Constructs27495
Node: Command Grouping34967
Node: Shell Functions36416
Node: Shell Parameters40825
Node: Positional Parameters43155
Node: Special Parameters44055
Node: Shell Expansions47019
Node: Brace Expansion48944
Node: Tilde Expansion51270
Node: Shell Parameter Expansion53621
Node: Command Substitution61321
Node: Arithmetic Expansion62654
Node: Process Substitution63504
Node: Word Splitting64554
Node: Filename Expansion66177
Node: Pattern Matching68317
Node: Quote Removal71635
Node: Redirections71930
Node: Executing Commands79660
Node: Simple Command Expansion80330
Node: Command Search and Execution82260
Node: Command Execution Environment84266
Node: Environment87065
Node: Exit Status88725
Node: Signals89929
Node: Shell Scripts91897
Node: Shell Builtin Commands94415
Node: Bourne Shell Builtins96092
Node: Bash Builtins113203
Node: Modifying Shell Behavior133191
Node: The Set Builtin133536
Node: The Shopt Builtin142158
Node: Special Builtins152388
Node: Shell Variables153367
Node: Bourne Shell Variables153807
Node: Bash Variables155788
Node: Bash Features176980
Node: Invoking Bash177863
Node: Bash Startup Files183672
Node: Interactive Shells188531
Node: What is an Interactive Shell?188941
Node: Is this Shell Interactive?189590
Node: Interactive Shell Behavior190405
Node: Bash Conditional Expressions193685
Node: Shell Arithmetic197264
Node: Aliases200010
Node: Arrays202582
Node: The Directory Stack205931
Node: Directory Stack Builtins206645
Node: Printing a Prompt209537
Node: The Restricted Shell212251
Node: Bash POSIX Mode214083
Node: Job Control221842
Node: Job Control Basics222309
Node: Job Control Builtins226818
Node: Job Control Variables231145
Node: Command Line Editing232303
Node: Introduction and Notation233302
Node: Readline Interaction234924
Node: Readline Bare Essentials236115
Node: Readline Movement Commands237904
Node: Readline Killing Commands238869
Node: Readline Arguments240789
Node: Searching241833
Node: Readline Init File244019
Node: Readline Init File Syntax245166
Node: Conditional Init Constructs257497
Node: Sample Init File260030
Node: Bindable Readline Commands263147
Node: Commands For Moving264354
Node: Commands For History265215
Node: Commands For Text268370
Node: Commands For Killing271043
Node: Numeric Arguments273185
Node: Commands For Completion274324
Node: Keyboard Macros277917
Node: Miscellaneous Commands278488
Node: Readline vi Mode283799
Node: Programmable Completion284713
Node: Programmable Completion Builtins290531
Node: Using History Interactively298127
Node: Bash History Facilities298807
Node: Bash History Builtins301502
Node: History Interaction305359
Node: Event Designators307915
Node: Word Designators308930
Node: Modifiers310569
Node: Installing Bash311973
Node: Basic Installation313103
Node: Compilers and Options315795
Node: Compiling For Multiple Architectures316536
Node: Installation Names318200
Node: Specifying the System Type319018
Node: Sharing Defaults319734
Node: Operation Controls320407
Node: Optional Features321365
Node: Reporting Bugs330296
Node: Major Differences From The Bourne Shell331490
Node: Copying This Manual348159
Node: GNU Free Documentation License348435
Node: Builtin Index370841
Node: Reserved Word Index377390
Node: Variable Index379826
Node: Function Index390978
Node: Concept Index397698
Node: Top1355
Node: Introduction3163
Node: What is Bash?3391
Node: What is a shell?4504
Node: Definitions7044
Node: Basic Shell Features9812
Node: Shell Syntax11031
Node: Shell Operation12061
Node: Quoting13355
Node: Escape Character14658
Node: Single Quotes15143
Node: Double Quotes15491
Node: ANSI-C Quoting16616
Node: Locale Translation17572
Node: Comments18468
Node: Shell Commands19086
Node: Simple Commands19852
Node: Pipelines20483
Node: Lists22358
Node: Compound Commands23989
Node: Looping Constructs24773
Node: Conditional Constructs27220
Node: Command Grouping34692
Node: Shell Functions36141
Node: Shell Parameters40550
Node: Positional Parameters42880
Node: Special Parameters43780
Node: Shell Expansions46744
Node: Brace Expansion48669
Node: Tilde Expansion50995
Node: Shell Parameter Expansion53346
Node: Command Substitution61046
Node: Arithmetic Expansion62379
Node: Process Substitution63229
Node: Word Splitting64279
Node: Filename Expansion65902
Node: Pattern Matching68042
Node: Quote Removal71360
Node: Redirections71655
Node: Executing Commands79385
Node: Simple Command Expansion80055
Node: Command Search and Execution81985
Node: Command Execution Environment83991
Node: Environment86790
Node: Exit Status88450
Node: Signals89654
Node: Shell Scripts91622
Node: Shell Builtin Commands94140
Node: Bourne Shell Builtins95817
Node: Bash Builtins112928
Node: Modifying Shell Behavior132916
Node: The Set Builtin133261
Node: The Shopt Builtin141883
Node: Special Builtins152113
Node: Shell Variables153092
Node: Bourne Shell Variables153532
Node: Bash Variables155513
Node: Bash Features176808
Node: Invoking Bash177691
Node: Bash Startup Files183500
Node: Interactive Shells188359
Node: What is an Interactive Shell?188769
Node: Is this Shell Interactive?189418
Node: Interactive Shell Behavior190233
Node: Bash Conditional Expressions193513
Node: Shell Arithmetic197092
Node: Aliases199838
Node: Arrays202410
Node: The Directory Stack205759
Node: Directory Stack Builtins206473
Node: Printing a Prompt209365
Node: The Restricted Shell212079
Node: Bash POSIX Mode213911
Node: Job Control221670
Node: Job Control Basics222137
Node: Job Control Builtins226646
Node: Job Control Variables230973
Node: Command Line Editing232131
Node: Introduction and Notation233130
Node: Readline Interaction234752
Node: Readline Bare Essentials235943
Node: Readline Movement Commands237732
Node: Readline Killing Commands238697
Node: Readline Arguments240617
Node: Searching241661
Node: Readline Init File243847
Node: Readline Init File Syntax244994
Node: Conditional Init Constructs257325
Node: Sample Init File259858
Node: Bindable Readline Commands262975
Node: Commands For Moving264182
Node: Commands For History265043
Node: Commands For Text268198
Node: Commands For Killing270871
Node: Numeric Arguments273013
Node: Commands For Completion274152
Node: Keyboard Macros277745
Node: Miscellaneous Commands278316
Node: Readline vi Mode283627
Node: Programmable Completion284541
Node: Programmable Completion Builtins290359
Node: Using History Interactively297955
Node: Bash History Facilities298635
Node: Bash History Builtins301549
Node: History Interaction305406
Node: Event Designators308111
Node: Word Designators309126
Node: Modifiers310765
Node: Installing Bash312169
Node: Basic Installation313299
Node: Compilers and Options315991
Node: Compiling For Multiple Architectures316732
Node: Installation Names318396
Node: Specifying the System Type319214
Node: Sharing Defaults319930
Node: Operation Controls320603
Node: Optional Features321561
Node: Reporting Bugs330492
Node: Major Differences From The Bourne Shell331686
Node: Copying This Manual348355
Node: GNU Free Documentation License348625
Node: Indexes371031
Node: Builtin Index371474
Node: Reserved Word Index378007
Node: Variable Index380455
Node: Function Index391619
Node: Concept Index398351

End Tag Table
+30 -32
View File
@@ -1,4 +1,4 @@
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2006.11.28) 2 JAN 2007 10:25
This is TeX, Version 3.141592 (Web2C 7.5.4) (format=tex 2006.11.28) 16 JAN 2007 11:15
**/Users/chet/src/bash/src/doc/bashref.texi
(/Users/chet/src/bash/src/doc/bashref.texi (./texinfo.tex
Loading texinfo [version 2003-02-03.16]: Basics,
@@ -158,7 +158,7 @@ localization,
[1]
Chapter 2 [2] [3] Chapter 3 [4] [5] [6] [7] [8] [9] [10]
Overfull \hbox (43.33539pt too wide) in paragraph at lines 845--845
Overfull \hbox (43.33539pt too wide) in paragraph at lines 839--839
[]@texttt case @textttsl word @texttt in [ [(] @textttsl pat-tern @texttt [| @
textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[][]
@@ -173,7 +173,7 @@ textttsl pat-tern@texttt ][]) @textttsl command-list @texttt ;;][] esac[][]
[11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]
[26] [27] [28] [29] [30] [31] [32] Chapter 4 [33] [34] [35] [36] [37] [38]
[39] [40] [41]
Underfull \hbox (badness 5231) in paragraph at lines 3127--3140
Underfull \hbox (badness 5231) in paragraph at lines 3121--3134
@texttt emacs-meta[]@textrm , @texttt emacs-ctlx[]@textrm , @texttt vi[]@textr
m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
@@ -186,7 +186,7 @@ m , @texttt vi-move[]@textrm , @texttt vi-command[]@textrm , and
.etc.
[42] [43] [44] [45]
Overfull \hbox (43.33536pt too wide) in paragraph at lines 3470--3470
Overfull \hbox (43.33536pt too wide) in paragraph at lines 3464--3464
[]@texttt read [-ers] [-a @textttsl aname@texttt ] [-d @textttsl de-lim@texttt
] [-n @textttsl nchars@texttt ] [-p @textttsl prompt@texttt ] [-t @textttsl ti
me-
@@ -200,7 +200,7 @@ me-
.etc.
[46] [47] [48] [49] [50] [51] [52] [53]
Underfull \hbox (badness 2573) in paragraph at lines 4092--4096
Underfull \hbox (badness 2573) in paragraph at lines 4086--4090
[] []@textrm Error trac-ing is en-abled: com-mand sub-sti-tu-tion, shell
@hbox(7.60416+2.12917)x433.62, glue set 2.95305
@@ -217,7 +217,7 @@ Underfull \hbox (badness 2573) in paragraph at lines 4092--4096
[54] [55] [56] Chapter 5 [57] [58] [59] [60] [61] [62] [63] [64] [65] [66]
Chapter 6 [67] [68]
Overfull \hbox (51.96864pt too wide) in paragraph at lines 4906--4906
Overfull \hbox (51.96864pt too wide) in paragraph at lines 4902--4902
[]@texttt bash [long-opt] [-ir] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@t
exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -230,7 +230,7 @@ exttt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
Overfull \hbox (76.23077pt too wide) in paragraph at lines 4907--4907
Overfull \hbox (76.23077pt too wide) in paragraph at lines 4903--4903
[]@texttt bash [long-opt] [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@texttt
] [-O @textttsl shopt_option@texttt ] -c @textttsl string @texttt [@textttsl ar
-
@@ -244,7 +244,7 @@ Overfull \hbox (76.23077pt too wide) in paragraph at lines 4907--4907
.etc.
Overfull \hbox (34.72258pt too wide) in paragraph at lines 4908--4908
Overfull \hbox (34.72258pt too wide) in paragraph at lines 4904--4904
[]@texttt bash [long-opt] -s [-abefhkmnptuvxdBCDHP] [-o @textttsl op-tion@text
tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
@@ -257,7 +257,7 @@ tt ] [-O @textttsl shopt_option@texttt ] [@textttsl ar-
.etc.
[69] [70]
Underfull \hbox (badness 2245) in paragraph at lines 5082--5084
Underfull \hbox (badness 2245) in paragraph at lines 5078--5080
[]@textrm When a lo-gin shell ex-its, Bash reads and ex-e-cutes com-mands from
the file
@@ -270,7 +270,7 @@ the file
.etc.
[71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84]
Underfull \hbox (badness 2521) in paragraph at lines 6196--6199
Underfull \hbox (badness 2521) in paragraph at lines 6192--6195
@textrm `@texttt --enable-strict-posix-default[]@textrm '[] to @texttt configur
e[] @textrm when build-ing (see Sec-tion 10.8
@@ -337,7 +337,7 @@ Underfull \hbox (badness 2753) in paragraph at lines 1768--1771
[115]) (/Users/chet/src/bash/src/lib/readline/doc/hsuser.texi Chapter 9
[116] [117] [118] [119] [120]) Chapter 10 [121] [122] [123] [124] [125]
Underfull \hbox (badness 2772) in paragraph at lines 6792--6796
Underfull \hbox (badness 2772) in paragraph at lines 6788--6792
[]@textrm Enable sup-port for large files (@texttt http://www.sas.com/standard
s/large_
@@ -351,35 +351,33 @@ s/large_
[126] [127] [128] Appendix A [129] [130] Appendix B [131] [132] [133] [134]
[135] [136] [137] Appendix C [138] (./fdl.texi [139] [140] [141] [142] [143]
[144]) (Index of Shell Builtin Commands) [145] [146] (./bashref.bts)
(Index of Shell Reserved Words)
Overfull \vbox (42.26959pt too high) has occurred while \output is active
\vbox(643.19986+0.0)x433.62, glue set - 1.0
.\glue(\topskip) 24.00002
.\vbox(11.99998+0.0)x433.62
..\hbox(11.99998+0.0)x433.62, glue set 148.745fil
[144]) Appendix D [145] [146] (./bashref.bts) [147]
Overfull \vbox (45.46959pt too high) has occurred while \output is active
\vbox(643.19986+2.0)x433.62, glue set - 1.0
.\glue(\topskip) 26.00002
.\vbox(9.99998+0.0)x433.62
..\hbox(9.99998+0.0)x433.62, glue set 163.10767fil
...\hbox(0.0+0.0)x0.0
...\chaprm I
...\chaprm n
...\chaprm d
...\chaprm e
...\secrm D
...\secrm .
...\secrm 1
...\kern 8.09999
...etc.
.\penalty 10000
.\glue 12.0 plus 4.0 minus 4.0
.\kern 13.2
.\penalty 10000
.etc.
[147] [148] (./bashref.rws) (Parameter and Variable Index) [149] [150]
(./bashref.vrs [151]) (Function Index) [152] (./bashref.fns [153])
(Concept Index) [154] (./bashref.cps [155]) [156] )
[148] (./bashref.rws) (./bashref.vrs [149] [150]) (./bashref.fns [151])
[152] (./bashref.cps [153]) [154] )
Here is how much of TeX's memory you used:
1732 strings out of 97980
23671 string characters out of 1221004
52464 words of memory out of 1000000
2583 multiletter control sequences out of 10000+50000
1735 strings out of 97980
23708 string characters out of 1221004
55365 words of memory out of 1000000
2586 multiletter control sequences out of 10000+50000
31953 words of font info for 111 fonts, out of 500000 for 2000
19 hyphenation exceptions out of 1000
15i,8n,11p,269b,471s stack positions out of 1500i,500n,5000p,200000b,5000s
15i,8n,11p,269b,474s stack positions out of 1500i,500n,5000p,200000b,5000s
Output written on bashref.dvi (162 pages, 610668 bytes).
Output written on bashref.dvi (160 pages, 611796 bytes).
+1145 -1131
View File
File diff suppressed because it is too large Load Diff
+6 -5
View File
@@ -129,8 +129,9 @@
\appendixentry{Copying This Manual}{C}{139}
\secentry{GNU Free Documentation License}{C}{1}{139}
\subsecentry{ADDENDUM: How to use this License for your documents}{C}{1}{1}{145}
\unnumbchapentry{Index of Shell Builtin Commands}{10}{147}
\unnumbchapentry{Index of Shell Reserved Words}{10}{149}
\unnumbchapentry{Parameter and Variable Index}{10}{151}
\unnumbchapentry{Function Index}{10}{153}
\unnumbchapentry{Concept Index}{10}{155}
\appendixentry{Indexes}{D}{147}
\secentry{Index of Shell Builtin Commands}{D}{1}{147}
\secentry{Index of Shell Reserved Words}{D}{2}{149}
\secentry{Parameter and Variable Index}{D}{3}{149}
\secentry{Function Index}{D}{4}{151}
\secentry{Concept Index}{D}{5}{152}
+1 -1
View File
@@ -78,7 +78,7 @@
\entry{OSTYPE}{65}{\code {OSTYPE}}
\entry{PIPESTATUS}{65}{\code {PIPESTATUS}}
\entry{POSIXLY_CORRECT}{65}{\code {POSIXLY_CORRECT}}
\entry{PPID}{65}{\code {PPID}}
\entry{PPID}{66}{\code {PPID}}
\entry{PROMPT_COMMAND}{66}{\code {PROMPT_COMMAND}}
\entry{PS3}{66}{\code {PS3}}
\entry{PS4}{66}{\code {PS4}}
+1 -1
View File
@@ -117,7 +117,7 @@
\entry {\code {PATH}}{59}
\entry {\code {PIPESTATUS}}{65}
\entry {\code {POSIXLY_CORRECT}}{65}
\entry {\code {PPID}}{65}
\entry {\code {PPID}}{66}
\entry {\code {PROMPT_COMMAND}}{66}
\entry {\code {PS1}}{59}
\entry {\code {PS2}}{59}
+9 -5
View File
@@ -631,11 +631,15 @@ BBAASSHH BBUUIILLTTIINN CCOOMMMMAANNDDSS
the _a_r_g_s are added.
If the HHIISSTTTTIIMMEEFFOORRMMAATT is set, the time stamp information associ-
ated with each history entry is written to the history file.
The return value is 0 unless an invalid option is encountered,
an error occurs while reading or writing the history file, an
invalid _o_f_f_s_e_t is supplied as an argument to --dd, or the history
expansion supplied as an argument to --pp fails.
ated with each history entry is written to the history file,
marked with the history comment character. When the history
file is read, lines beginning with the history comment character
followed immediately by a digit are interpreted as timestamps
for the previous history line. The return value is 0 unless an
invalid option is encountered, an error occurs while reading or
writing the history file, an invalid _o_f_f_s_e_t is supplied as an
argument to --dd, or the history expansion supplied as an argument
to --pp fails.
jjoobbss [--llnnpprrss] [ _j_o_b_s_p_e_c ... ]
jjoobbss --xx _c_o_m_m_a_n_d [ _a_r_g_s ... ]
+638 -626
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.1
%%CreationDate: Tue Jan 2 10:25:15 2007
%%CreationDate: Tue Jan 16 11:15:09 2007
%%DocumentNeededResources: font Times-Roman
%%+ font Times-Bold
%%DocumentSuppliedResources: procset grops 1.19 1
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
# Author: P@draigBrady.com
# V1.0 : Nov 3 2006
#
# Execute a command with a timeout.
# If the timeout occurs the exit status is 128
#
# Note there is an asynchronous equivalent of this
# script packaged with bash (under /usr/share/doc/ in my distro),
# which I only noticed after writing this.
if [ "$#" -lt "2" ]; then
echo "Usage: `basename $0` timeout_in_seconds command" >&2
echo "Example: `basename $0` 2 sleep 3 || echo timeout" >&2
exit 1
fi
cleanup()
{
kill %1 2>/dev/null #kill sleep $timeout if running
kill %2 2>/dev/null && exit 128 #kill monitored job if running
}
set -m #enable job control
trap "cleanup" 17 #cleanup after timeout or command
timeout=$1 && shift #first param is timeout in seconds
sleep $timeout& #start the timeout
"$@" #start the job
+127
View File
@@ -0,0 +1,127 @@
/* Copyright (C) 2003 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 2, 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; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/*
* shmatch.c -- shell interface to posix regular expression matching.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if defined (HAVE_POSIX_REGEXP)
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "bashansi.h"
#include <stdio.h>
#include <regex.h>
#include "shell.h"
#include "variables.h"
#include "externs.h"
extern int glob_ignore_case, match_ignore_case;
int
sh_regmatch (string, pattern, flags)
const char *string;
const char *pattern;
int flags;
{
regex_t regex = { 0 };
regmatch_t *matches;
int rflags;
#if defined (ARRAY_VARS)
SHELL_VAR *rematch;
ARRAY *amatch;
int subexp_ind;
char *subexp_str;
int subexp_len;
#endif
int result, r;
#if defined (ARRAY_VARS)
rematch = (SHELL_VAR *)NULL;
#endif
rflags = REG_EXTENDED;
if (glob_ignore_case || match_ignore_case)
rflags |= REG_ICASE;
#if !defined (ARRAY_VARS)
rflags |= REG_NOSUB;
#endif
if (regcomp (&regex, pattern, rflags))
return 2; /* flag for printing a warning here. */
#if defined (ARRAY_VARS)
matches = (regmatch_t *)malloc (sizeof (regmatch_t) * (regex.re_nsub + 1));
#else
matches = NULL;
#endif
if (r = regexec (&regex, string, regex.re_nsub + 1, matches, 0))
result = EXECUTION_FAILURE;
else
result = EXECUTION_SUCCESS; /* match */
if (r != 0) {
char errbuf[1024];
regerror(r, &regex, errbuf, sizeof(errbuf));
fprintf(stderr, "sh_regmatch: match failed: %s\n", errbuf);
}
#if defined (ARRAY_VARS)
subexp_len = strlen (string) + 10;
subexp_str = malloc (subexp_len + 1);
/* Store the parenthesized subexpressions in the array BASH_REMATCH.
Element 0 is the portion that matched the entire regexp. Element 1
is the part that matched the first subexpression, and so on. */
unbind_variable ("BASH_REMATCH");
rematch = make_new_array_variable ("BASH_REMATCH");
amatch = array_cell (rematch);
if ((flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
{
for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++)
{
memset (subexp_str, 0, subexp_len);
strncpy (subexp_str, string + matches[subexp_ind].rm_so,
matches[subexp_ind].rm_eo - matches[subexp_ind].rm_so);
array_insert (amatch, subexp_ind, subexp_str);
}
}
VSETATTR (rematch, att_readonly);
free (subexp_str);
free (matches);
#endif /* ARRAY_VARS */
regfree (&regex);
return result;
}
#endif /* HAVE_POSIX_REGEXP */
+120
View File
@@ -0,0 +1,120 @@
/* Copyright (C) 2003 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 2, 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; see the file COPYING. If not, write to the Free Software
Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
/*
* shmatch.c -- shell interface to posix regular expression matching.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if defined (HAVE_POSIX_REGEXP)
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "bashansi.h"
#include <stdio.h>
#include <regex.h>
#include "shell.h"
#include "variables.h"
#include "externs.h"
extern int glob_ignore_case, match_ignore_case;
int
sh_regmatch (string, pattern, flags)
const char *string;
const char *pattern;
int flags;
{
regex_t regex = { 0 };
regmatch_t *matches;
int rflags;
#if defined (ARRAY_VARS)
SHELL_VAR *rematch;
ARRAY *amatch;
int subexp_ind;
char *subexp_str;
int subexp_len;
#endif
int result;
#if defined (ARRAY_VARS)
rematch = (SHELL_VAR *)NULL;
#endif
rflags = REG_EXTENDED;
if (glob_ignore_case || match_ignore_case)
rflags |= REG_ICASE;
#if !defined (ARRAY_VARS)
rflags |= REG_NOSUB;
#endif
if (regcomp (&regex, pattern, rflags))
return 2; /* flag for printing a warning here. */
#if defined (ARRAY_VARS)
matches = (regmatch_t *)malloc (sizeof (regmatch_t) * (regex.re_nsub + 1));
#else
matches = NULL;
#endif
if (regexec (&regex, string, regex.re_nsub + 1, matches, 0))
result = EXECUTION_FAILURE;
else
result = EXECUTION_SUCCESS; /* match */
#if defined (ARRAY_VARS)
subexp_len = strlen (string) + 10;
subexp_str = malloc (subexp_len + 1);
/* Store the parenthesized subexpressions in the array BASH_REMATCH.
Element 0 is the portion that matched the entire regexp. Element 1
is the part that matched the first subexpression, and so on. */
unbind_variable ("BASH_REMATCH");
rematch = make_new_array_variable ("BASH_REMATCH");
amatch = array_cell (rematch);
if ((flags & SHMAT_SUBEXP) && result == EXECUTION_SUCCESS && subexp_str)
{
for (subexp_ind = 0; subexp_ind <= regex.re_nsub; subexp_ind++)
{
memset (subexp_str, 0, subexp_len);
strncpy (subexp_str, string + matches[subexp_ind].rm_so,
matches[subexp_ind].rm_eo - matches[subexp_ind].rm_so);
array_insert (amatch, subexp_ind, subexp_str);
}
}
VSETATTR (rematch, att_readonly);
free (subexp_str);
free (matches);
#endif /* ARRAY_VARS */
regfree (&regex);
return result;
}
#endif /* HAVE_POSIX_REGEXP */