aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/CMakeLists.txt95
-rw-r--r--doc/ChangeLog112
-rw-r--r--doc/Makefile.am14
-rw-r--r--doc/Makefile.in30
-rw-r--r--doc/awkcard.in3
-rw-r--r--doc/gawk.172
-rw-r--r--doc/gawk.info1859
-rw-r--r--doc/gawk.texi551
-rw-r--r--doc/gawktexi.in551
9 files changed, 2445 insertions, 842 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 00000000..e12f5de0
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,95 @@
+#
+# doc/CMakeLists.txt --- CMake input file for gawk
+#
+# Copyright (C) 2013
+# the Free Software Foundation, Inc.
+#
+# This file is part of GAWK, the GNU implementation of the
+# AWK Programming Language.
+#
+# GAWK 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.
+#
+# GAWK 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 this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+
+## process this file with CMake to produce Makefile
+
+MACRO(DocDependency outfile)
+ add_dependencies(doc ${outfile})
+ add_custom_target(
+ ${outfile}
+ DEPENDS ${ARGN}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND ${CMAKE_SOURCE_DIR}/cmake/docmaker ${outfile} ${ARGN}
+ )
+ENDMACRO(DocDependency)
+
+find_program(TEXI2DVI_CONVERTER texi2dvi)
+if (TEXI2DVI_CONVERTER)
+ add_custom_target(doc)
+ DocDependency(gawk.texi gawktexi.in rflashlight.eps api-figure1.fig api-figure2.fig api-figure3.fig general-program.fig process-flow.fig)
+ DocDependency(rflashlight.eps)
+ DocDependency(api-figure1.fig)
+ DocDependency(api-figure2.fig)
+ DocDependency(api-figure3.fig)
+ DocDependency(general-program.fig)
+ DocDependency(process-flow.fig)
+ DocDependency(gawk.dvi gawk.texi)
+ DocDependency(gawk.info gawk.texi)
+ DocDependency(gawkinet.dvi gawkinet.texi)
+ DocDependency(gawkinet.info gawkinet.texi)
+ DocDependency(gawkinet.texi statist.eps)
+ DocDependency(gawk.1.ps gawk.1)
+ DocDependency(igawk.1.ps igawk.1)
+ find_program(DVIPS_CONVERTER dvips)
+ if (DVIPS_CONVERTER)
+ DocDependency(gawk.ps gawk.dvi)
+ DocDependency(gawkinet.ps gawkinet.dvi)
+ find_program(PS2PDF_CONVERTER ps2pdf)
+ if (PS2PDF_CONVERTER)
+ DocDependency(gawk.1.pdf gawk.1.ps)
+ DocDependency(igawk.1.pdf igawk.1.ps)
+ DocDependency(gawk.pdf gawk.ps)
+ DocDependency(gawkinet.pdf gawkinet.ps)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawk.1.pdf DESTINATION doc)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/igawk.1.pdf DESTINATION doc)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawk.info DESTINATION doc)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawk.pdf DESTINATION doc)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawkinet.info DESTINATION doc)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawkinet.pdf DESTINATION doc)
+
+ set(CARDSRC macros cardfonts colors awkcard.tr)
+ set(CARDSRC_N macros cardfonts no.colors awkcard.tr)
+ set(CARDFILES ${CARDSRC} ad.block awkcard.in setter.outline)
+ DocDependency(awkcard.tr awkcard.in)
+ DocDependency(awkcard.nc ${CARDFILES})
+ DocDependency(awkcard.ps ${CARDFILES})
+ DocDependency(awkcard.pdf awkcard.ps)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/awkcard.pdf DESTINATION doc)
+
+ else()
+ message(WARNING "Found no ps2pdf tool; no doc will be generated")
+ install(CODE "MESSAGE(\"doc generated only in .ps files\")")
+ endif()
+ else()
+ message(WARNING "Found no dvips tool; no doc will be generated")
+ install(CODE "MESSAGE(\"doc generated only in .dvi files and man pages in .ps files\")")
+ endif()
+else()
+ message(WARNING "Found no texi2dvi tool; no doc will be generated")
+ add_custom_command(
+ TARGET doc
+ COMMAND echo no doc generated because of missing texi2dvi
+ )
+endif()
+
diff --git a/doc/ChangeLog b/doc/ChangeLog
index a5c546e3..f38b795a 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -2,6 +2,10 @@
* 4.1.2: Release tar ball made.
+2015-04-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Undocumented): More info added.
+
2015-04-08 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Update feature history section.
@@ -23,6 +27,11 @@
* gawktexi.in: Fix a figure caption. Thanks to Antonio Colombo
for pointing this out.
+ * gawktexi.in: Additional typo fix, also thanks to Antonio.
+
+2015-04-02 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in, gawk.1, awkcard.in: Name change: div() --> intdiv().
2015-03-31 Arnold D. Robbins <arnold@skeeve.com>
@@ -30,10 +39,17 @@
indirectly. Small additional fix relating to rand(). Thanks
to Antonio Colombo.
+2015-03-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Minor edits.
+
2015-03-24 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Minor fixes from Antonio Colombo and new exercise
in chapter 16.
+ * gawk.1: Minor edits.
+ * gawktexi.in: Edits in material on errno and retryable and get_file
+ API.
2015-03-17 Andrew J. Schorr <aschorr@telemetry-investments.com>
@@ -47,6 +63,12 @@
Thanks to Nicholas Mills <nlmills@clemson.edu> for pointing out
the issue.
+2015-03-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Briefly describe that nonfatal I/O overrides
+ GAWK_SOCK_RETRIES, in the env var part and in the nonfatal I/O
+ part.
+
2015-03-01 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Change quotes to @dfn for pseudorandom.
@@ -103,6 +125,7 @@
2015-02-08 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: O'Reilly fixes.
+ Make non-fatal i/o use "NONFATAL".
2015-02-06 Arnold D. Robbins <arnold@skeeve.com>
@@ -111,6 +134,7 @@
2015-02-04 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: O'Reilly fixes.
+ * gawktexi.in: Update various version-related bits of info.
2015-02-02 Arnold D. Robbins <arnold@skeeve.com>
@@ -140,7 +164,7 @@
2015-01-25 Arnold D. Robbins <arnold@skeeve.com>
- * gawktexi.in: Fix a bad URL.
+ * gawktexi.in: Fix a bad URL. And another one.
More O'Reilly fixes.
2015-01-23 Arnold D. Robbins <arnold@skeeve.com>
@@ -162,12 +186,40 @@
* gawkinet.texi: Fix capitalization in document title.
* gawktexi.in: Here we go again: Starting on more O'Reilly fixes.
+2014-12-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Add info that nonfatal I/O works with stdout and
+ stderr. Revise version info and what was added when.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Improve get_file documentation.
+
+2015-01-05 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Replace "Retrying I/O" with "Retrying Input", since this
+ feature pertains to input, not output.
+
+2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Document the get_file API function.
+
+2015-01-04 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawk.1: Document new features PROCINFO["errno"] and
+ PROCINFO["input", "RETRY"], and new getline return value of -2.
+ * gawktexi.in: Ditto.
+
2014-12-26 Antonio Giovanni Colombo <azc100@gmail.com>
* gawktexi.in (Glossary): Really sort the items.
2014-12-24 Arnold D. Robbins <arnold@skeeve.com>
+ * gawktexi.in: Start documenting nonfatal output.
+
+2014-12-24 Arnold D. Robbins <arnold@skeeve.com>
+
* gawktexi.in: Add one more paragraph to new foreword.
* gawktexi.in: Fix exponentiation in TeX mode. Thanks to
Marco Curreli by way of Antonio Giovanni Colombo.
@@ -199,6 +251,11 @@
* gawktexi.in: Various minor fixes and updates.
+2014-11-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Update that TZ env. var can influnce mktime
+ in running program. Thanks to Hermann Peifer.
+
2014-11-19 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Update that RFC 4180 documents CSV data.
@@ -212,6 +269,11 @@
* gawktexi.in: Comment out that I need an owner for awk.info.
I may have found one or two people.
+2014-10-29 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawktexi.in: Document new extras directory containing shell startup
+ files to manipulate AWKPATH and AWKLIBPATH environment variables.
+
2014-10-28 Arnold D. Robbins <arnold@skeeve.com>
* gawk.1: Clarification that debugger reads stdin.
@@ -225,6 +287,7 @@
2014-10-25 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Minor typo fixes.
+ Fix discussion of \x, per note from Antonio Colombo.
2014-10-17 Arnold D. Robbins <arnold@skeeve.com>
@@ -266,10 +329,25 @@
* gawktexi.in: Pretty much done!
+ Unrelated:
+
+ * gawktexi.in: Fix braino in awk version of div function.
+ Thanks to Katie Wasserman for the catch.
+
2014-10-01 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: More fixes after reading through the MS.
+ Unrelated:
+
+ * gawktexi.in: Add Katie Wasserman's program to compute
+ the digits of PI.
+
+ Unrelated:
+
+ * gawktexi.in: Document the differences between profiling
+ and pretty printing.
+
2014-09-30 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: More fixes after reading through the MS.
@@ -365,6 +443,10 @@
exercises. Remove use of LC_ALL in an example; doesn't seem
to be needed anymore.
+ Unrelated:
+
+ * gawktexi.in: Document that MirBSD is no longer supported.
+
2014-08-25 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Exercises are excluded from print edition.
@@ -398,6 +480,10 @@
* gawktexi.in: Starting on reviewer comments.
Update acknowledgements.
+2014-08-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Cause div.awk to get into the example files.
+
2014-08-06 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Misc minor additions.
@@ -412,6 +498,18 @@
* gawktexi.in: Fix doc for API get_record - errcode needs to
be greater than zero.
+2014-07-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Numeric Functions): For `div()', clarify
+ truncation is towards zero. Thanks to Michal Jaegermann
+ for pointing out the need to clarify this.
+
+2014-07-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in (Numeric Functions): Document new `div()' function.
+ (Arbitrary Precision Integers): Document raison d'etre for div().
+ * gawk.1, awkcard.in: Document `div()'.
+
2014-07-04 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Bracket Expressions): Add a note about how to
@@ -422,6 +520,11 @@
* gawktexi.in: Update permissions on copyright page per
latest maintain.texi. Add GPL to print version of book.
+2014-06-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Document that --pretty-print no longer runs the
+ program. Remove mention of GAWK_NO_PP_RUN env var.
+
2014-06-22 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Typo fixes and minor corrections.
@@ -718,7 +821,7 @@
2013-12-26 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: More minor additions / fixes.
- (Bugs): Add John Malmberg for VMS.
+ (Bugs): Add John Malmberg for VMS. Other minor edits.
2013-12-25 Arnold D. Robbins <arnold@skeeve.com>
@@ -792,6 +895,11 @@
* gawktexi.in (FN, FFN, DF,DDF, PVERSION, CTL): Remove macros.
They have no alternate versions and are just in the way.
+2013-08-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawk.1: Document that ENVIRON updates affect the environment.
+ * gawktexi.in: Ditto.
+
2013-06-27 Arnold D. Robbins <arnold@skeeve.com>
* texinfo.tex: Update from Karl, fixes a formating problem.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 86321bbc..8a0442a7 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -26,7 +26,7 @@
info_TEXINFOS = gawk.texi gawkinet.texi
-man_MANS = gawk.1 igawk.1
+man_MANS = gawk.1
EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
@@ -50,7 +50,7 @@ EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
bc_notes
# Get rid of generated files when cleaning
-CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
MAKEINFO = @MAKEINFO@ --no-split --force
@@ -75,9 +75,9 @@ AWKCARD = awkcard.ps
gawk.texi: $(srcdir)/gawktexi.in $(srcdir)/sidebar.awk
awk -f $(srcdir)/sidebar.awk < $(srcdir)/gawktexi.in > gawk.texi
-postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
+postscript: gawk.ps gawkinet.ps gawk.1.ps $(AWKCARD)
-pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
gawk.ps: gawk.dvi
TEXINPUTS=$(srcdir): dvips -o gawk.ps gawk.dvi
@@ -91,12 +91,6 @@ gawk.1.ps: gawk.1
gawk.1.pdf: gawk.1.ps
ps2pdf gawk.1.ps gawk.1.pdf
-igawk.1.ps: igawk.1
- -groff -man $(srcdir)/igawk.1 > igawk.1.ps
-
-igawk.1.pdf: igawk.1.ps
- ps2pdf igawk.1.ps igawk.1.pdf
-
awkcard.tr: awkcard.in
sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 30a371d7..0219bc97 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -116,14 +116,14 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
- $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \
- $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
- $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
- $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/mpfr.m4 \
- $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/noreturn.m4 \
- $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
- $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/socket.m4 \
- $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libsigsegv.m4 $(top_srcdir)/m4/longlong.m4 \
+ $(top_srcdir)/m4/mpfr.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/noreturn.m4 $(top_srcdir)/m4/po.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/readline.m4 \
+ $(top_srcdir)/m4/socket.m4 $(top_srcdir)/m4/ulonglong.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
@@ -353,7 +353,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
info_TEXINFOS = gawk.texi gawkinet.texi
-man_MANS = gawk.1 igawk.1
+man_MANS = gawk.1
EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
awkcard.in awkforai.txt texinfo.tex cardfonts \
api-figure1.eps api-figure1.fig api-figure1.pdf \
@@ -377,7 +377,7 @@ EXTRA_DIST = ChangeLog ChangeLog.0 README.card ad.block setter.outline \
# Get rid of generated files when cleaning
-CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+CLEANFILES = *.ps *.html *.dvi *~ awkcard.nc awkcard.tr gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
TROFF = groff -t -Tps -U
SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
-e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
@@ -878,9 +878,9 @@ uninstall-man: uninstall-man1
gawk.texi: $(srcdir)/gawktexi.in $(srcdir)/sidebar.awk
awk -f $(srcdir)/sidebar.awk < $(srcdir)/gawktexi.in > gawk.texi
-postscript: gawk.ps gawkinet.ps gawk.1.ps igawk.1.ps $(AWKCARD)
+postscript: gawk.ps gawkinet.ps gawk.1.ps $(AWKCARD)
-pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf igawk.1.pdf
+pdf: postscript gawk.pdf gawkinet.pdf awkcard.pdf gawk.1.pdf
gawk.ps: gawk.dvi
TEXINPUTS=$(srcdir): dvips -o gawk.ps gawk.dvi
@@ -894,12 +894,6 @@ gawk.1.ps: gawk.1
gawk.1.pdf: gawk.1.ps
ps2pdf gawk.1.ps gawk.1.pdf
-igawk.1.ps: igawk.1
- -groff -man $(srcdir)/igawk.1 > igawk.1.ps
-
-igawk.1.pdf: igawk.1.ps
- ps2pdf igawk.1.ps igawk.1.pdf
-
awkcard.tr: awkcard.in
sed 's:SRCDIR:$(srcdir):' < $(srcdir)/awkcard.in > awkcard.tr
diff --git a/doc/awkcard.in b/doc/awkcard.in
index 310eb22d..6cfa1df1 100644
--- a/doc/awkcard.in
+++ b/doc/awkcard.in
@@ -1611,6 +1611,9 @@ l lw(2i).
\*(FCcos(\*(FIexpr\*(FC)\*(FR The cosine of \*(FIexpr\fP, which is in radians.
\*(FCexp(\*(FIexpr\*(FC)\*(FR The exponential function (\*(FIe \*(FC^ \*(FIx\*(FR).
\*(FCint(\*(FIexpr\*(FC)\*(FR Truncate to integer.
+\*(CB\*(FCintdiv(\*(FIn\*(FR\*(FC,\*(FI d\*(FR\*(FC,\*(FI res\*(FR\*(FC)\*(FR T{
+Return the result of integer division in \*(FIres\*(FR.\*(CD
+T}
\*(FClog(\*(FIexpr\*(FC)\*(FR The natural logarithm function (base \*(FIe\^\*(FR).
\*(FCrand()\fP A random number \*(FIN\fP such that 0 \(<= \*(FIN\fP < 1.
\*(FCsin(\*(FIexpr\*(FC)\*(FR The sine of \*(FIexpr\fP, which is in radians.
diff --git a/doc/gawk.1 b/doc/gawk.1
index 0a37d5a8..cbc15d15 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Aug 03 2014" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Apr 02 2015" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -918,11 +918,17 @@ An array containing the values of the current environment.
The array is indexed by the environment variables, each element being
the value of that variable (e.g., \fBENVIRON["HOME"]\fP might be
\fB"/home/arnold"\fR).
-Changing this array does not affect the environment seen by programs which
+.sp
+In POSIX mode,
+changing this array does not affect the environment seen by programs which
.I gawk
spawns via redirection or the
.B system()
function.
+Otherwise,
+.I gawk
+updates its real environment so that programs it spawns see
+the changes.
.TP
.B ERRNO
If a system error occurs either doing a redirection for
@@ -936,6 +942,15 @@ then
will contain
a string describing the error.
The value is subject to translation in non-English locales.
+If the string in
+.B ERRNO
+corresponds to a system error in the
+.IR errno (3)
+variable, then the numeric value can be found in
+.B PROCINFO["errno"].
+For non-system errors,
+.B PROCINFO["errno"]
+will be zero.
.TP
.B FIELDWIDTHS
A whitespace separated list of field widths. When set,
@@ -1097,6 +1112,13 @@ system call.
The default time format string for
.BR strftime() .
.TP
+\fBPROCINFO["errno"]\fP
+The value of
+.IR errno (3)
+when
+.BR ERRNO
+is set to the associated error message.
+.TP
\fBPROCINFO["euid"]\fP
The value of the
.IR geteuid (2)
@@ -1215,6 +1237,28 @@ where
is a redirection string or a filename. A value of zero or
less than zero means no timeout.
.TP
+\fBPROCINFO["input", "RETRY"]\fP
+If an I/O error that may be retried occurs when reading data from
+.IR input ,
+and this array entry exists, then
+.B getline
+will return \-2 instead of following the default behavior of returning \-1
+and configuring
+.IR input
+to return no further data.
+An I/O error that may be retried is one where
+.IR errno (3)
+has the value
+.IR EAGAIN ,
+.IR EWOULDBLOCK ,
+.IR EINTR ,
+or
+.IR ETIMEDOUT .
+This may be useful in conjunction with
+\fBPROCINFO["input", "READ_TIMEOUT"]\fP
+or situations where a file descriptor has been configured to behave in a
+non-blocking fashion.
+.TP
\fBPROCINFO["mpfr_version"]\fP
The version of the GNU MPFR library used for arbitrary precision
number support in
@@ -2283,6 +2327,13 @@ below.)
The
.B getline
command returns 1 on success, 0 on end of file, and \-1 on an error.
+If the
+.IR errno (3)
+value indicates that the I/O operation may be retried,
+and \fBPROCINFO["input", "RETRY"]\fP
+is set, then \-2 will be returned instead of \-1, and further calls to
+.B getline
+may be attempted.
Upon an error,
.B ERRNO
is set to a string describing the problem.
@@ -2635,6 +2686,23 @@ The exponential function.
.BI int( expr )
Truncate to integer.
.TP
+.BI intdiv( num ", " denom ", " result )
+Truncate
+.I num
+and
+.I denom
+to integers. Return the quotient of
+.I num
+divided by
+.I denom
+in \fIresult\fB["quotient"]\fR
+and the remainder in
+in \fIresult\fB["remainder"]\fR.
+This is a
+.I gawk
+extension, primarily of value when working with
+arbitrarily large integers.
+.TP
.BI log( expr )
The natural logarithm function.
.TP
diff --git a/doc/gawk.info b/doc/gawk.info
index eb9aec15..c7fd5c36 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -217,6 +217,7 @@ entitled "GNU Free Documentation License".
`getline'.
* Getline Summary:: Summary of `getline' Variants.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -246,6 +247,7 @@ entitled "GNU Free Documentation License".
* Special Caveats:: Things to watch out for.
* Close Files And Pipes:: Closing Input and Output Files and
Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
* Values:: Constants, Variables, and Regular
@@ -557,6 +559,7 @@ entitled "GNU Free Documentation License".
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
+* Redirection API:: How to access and manipulate redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
@@ -615,6 +618,7 @@ entitled "GNU Free Documentation License".
* Unix Installation:: Installing `gawk' under
various versions of Unix.
* Quick Installation:: Compiling `gawk' under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
@@ -2640,10 +2644,8 @@ The following list describes options mandated by the POSIX standard:
different file name for the output. No space is allowed between
the `-o' and FILE, if FILE is supplied.
- NOTE: Due to the way `gawk' has evolved, with this option
- your program still executes. This will change in the next
- major release, such that `gawk' will only pretty-print the
- program and not run it.
+ NOTE: In the past, this option would also execute your
+ program. This is no longer the case.
`-O'
`--optimize'
@@ -2943,6 +2945,9 @@ Since `.' is included at the beginning, `gawk' searches first in the
current directory and then in `/usr/local/share/awk'. In practice,
this means that you will rarely need to change the value of `AWKPATH'.
+ *Note Shell Startup Files::, for information on functions that help
+to manipulate the `AWKPATH' variable.
+
`gawk' places the value of the search path that it used into
`ENVIRON["AWKPATH"]'. This provides access to the actual search path
value from within an `awk' program.
@@ -2982,6 +2987,9 @@ empty value, `gawk' uses a default path; this is typically
`/usr/local/lib/gawk', although it can vary depending upon how `gawk'
was built.
+ *Note Shell Startup Files::, for information on functions that help
+to manipulate the `AWKLIBPATH' variable.
+
`gawk' places the value of the search path that it used into
`ENVIRON["AWKLIBPATH"]'. This provides access to the actual search path
value from within an `awk' program.
@@ -3008,7 +3016,8 @@ used by regular users:
`GAWK_SOCK_RETRIES'
Controls the number of times `gawk' attempts to retry a two-way
TCP/IP (socket) connection before giving up. *Note TCP/IP
- Networking::.
+ Networking::. Note that when nonfatal I/O is enabled (*note
+ Nonfatal::), `gawk' only tries to open a TCP/IP socket once.
`POSIXLY_CORRECT'
Causes `gawk' to switch to POSIX-compatibility mode, disabling all
@@ -3053,13 +3062,6 @@ change. The variables are:
supposed to be differences, but occasionally theory and practice
don't coordinate with each other.)
-`GAWK_NO_PP_RUN'
- When `gawk' is invoked with the `--pretty-print' option, it will
- not run the program if this environment variable exists.
-
- CAUTION: This variable will not survive into the next major
- release.
-
`GAWK_STACKSIZE'
This specifies the amount by which `gawk' should grow its internal
evaluation stack, when needed.
@@ -3451,15 +3453,18 @@ sequences apply to both string constants and regexp constants:
`\xHH...'
The hexadecimal value HH, where HH stands for a sequence of
- hexadecimal digits (`0'-`9', and either `A'-`F' or `a'-`f'). Like
- the same construct in ISO C, the escape sequence continues until
- the first nonhexadecimal digit is seen. (c.e.) However, using
- more than two hexadecimal digits produces undefined results. (The
- `\x' escape sequence is not allowed in POSIX `awk'.)
-
- CAUTION: The next major release of `gawk' will change, such
- that a maximum of two hexadecimal digits following the `\x'
- will be used.
+ hexadecimal digits (`0'-`9', and either `A'-`F' or `a'-`f'). A
+ maximum of two digts are allowed after the `\x'. Any further
+ hexadecimal digits are treated as simple letters or numbers.
+ (c.e.) (The `\x' escape sequence is not allowed in POSIX awk.)
+
+ CAUTION: In ISO C, the escape sequence continues until the
+ first nonhexadecimal digit is seen. For many years, `gawk'
+ would continue incorporating hexadecimal digits into the
+ value until a non-hexadecimal digit or the end of the string
+ was encountered. However, using more than two hexadecimal
+ digits produced undefined results. As of version 4.2, only
+ two digits are processed.
`\/'
A literal slash (necessary for regexp constants only). This
@@ -4175,6 +4180,7 @@ have to be named on the `awk' command line (*note Getline::).
* Getline:: Reading files under explicit program control
using the `getline' function.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -5447,6 +5453,11 @@ record, such as a file that cannot be opened, then `getline' returns
-1. In this case, `gawk' sets the variable `ERRNO' to a string
describing the error that occurred.
+ If `ERRNO' indicates that the I/O operation may be retried, and
+`PROCINFO["INPUT", "RETRY"]' is set, then `getline' returns -2 instead
+of -1, and further calls to `getline' may be attemped. *Note Retrying
+Input::, for further information about this feature.
+
In the following examples, COMMAND stands for a string value that
represents a shell command.
@@ -5883,7 +5894,7 @@ VAR
Table 4.1: `getline' variants and what they set

-File: gawk.info, Node: Read Timeout, Next: Command-line directories, Prev: Getline, Up: Reading Files
+File: gawk.info, Node: Read Timeout, Next: Retrying Input, Prev: Getline, Up: Reading Files
4.10 Reading Input with a Timeout
=================================
@@ -5962,7 +5973,8 @@ a per-command or per-connection basis.
`gawk' considers a timeout event to be an error even though the
attempt to read from the underlying device may succeed in a later
attempt. This is a limitation, and it also means that you cannot use
-this to multiplex input from two or more sources.
+this to multiplex input from two or more sources. *Note Retrying
+Input::, for a way to enable later I/O attempts to succeed.
Assigning a timeout value prevents read operations from blocking
indefinitely. But bear in mind that there are other ways `gawk' can
@@ -5977,9 +5989,36 @@ writing.
(1) This assumes that standard input is the keyboard.

-File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Read Timeout, Up: Reading Files
+File: gawk.info, Node: Retrying Input, Next: Command-line directories, Prev: Read Timeout, Up: Reading Files
+
+4.11 Retrying Reads After Certain Input Errors
+==============================================
+
+This minor node describes a feature that is specific to `gawk'.
+
+ When `gawk' encounters an error while reading input, by default
+`getline' returns -1, and subsequent attempts to read from that file
+result in an end-of-file indication. However, you may optionally
+instruct `gawk' to allow I/O to be retried when certain errors are
+encountered by setting a special element in the `PROCINFO' array (*note
+Auto-set::):
+
+ PROCINFO["INPUT_NAME", "RETRY"] = 1
+
+ When this element exists, `gawk' checks the value of the system (C
+language) `errno' variable when an I/O error occurs. If `errno'
+indicates a subsequent I/O attempt may succeed, `getline' instead
+returns -2 and further calls to `getline' may succeed. This applies to
+the `errno' values `EAGAIN', `EWOULDBLOCK', `EINTR', or `ETIMEDOUT'.
+
+ This feature is useful in conjunction with `PROCINFO["INPUT_NAME",
+"READ_TIMEOUT"]' or situations where a file descriptor has been
+configured to behave in a non-blocking fashion.
+
+
+File: gawk.info, Node: Command-line directories, Next: Input Summary, Prev: Retrying Input, Up: Reading Files
-4.11 Directories on the Command Line
+4.12 Directories on the Command Line
====================================
According to the POSIX standard, files named on the `awk' command line
@@ -6002,7 +6041,7 @@ usable data from an `awk' program.

File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-line directories, Up: Reading Files
-4.12 Summary
+4.13 Summary
============
* Input is split into records based on the value of `RS'. The
@@ -6076,7 +6115,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li

File: gawk.info, Node: Input Exercises, Prev: Input Summary, Up: Reading Files
-4.13 Exercises
+4.14 Exercises
==============
1. Using the `FIELDWIDTHS' variable (*note Constant Size::), write a
@@ -6127,6 +6166,7 @@ function.
`gawk' allows access to inherited file
descriptors.
* Close Files And Pipes:: Closing Input and Output Files and Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
@@ -7040,7 +7080,7 @@ that `gawk' provides:
behavior.

-File: gawk.info, Node: Close Files And Pipes, Next: Output Summary, Prev: Special Files, Up: Printing
+File: gawk.info, Node: Close Files And Pipes, Next: Nonfatal, Prev: Special Files, Up: Printing
5.9 Closing Input and Output Redirections
=========================================
@@ -7209,9 +7249,68 @@ call. See the system manual pages for information on how to decode this
value.

-File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Files And Pipes, Up: Printing
+File: gawk.info, Node: Nonfatal, Next: Output Summary, Prev: Close Files And Pipes, Up: Printing
+
+5.10 Enabling Nonfatal Output
+=============================
+
+This minor node describes a `gawk'-specific feature.
+
+ In standard `awk', output with `print' or `printf' to a nonexistent
+file, or some other I/O error (such as filling up the disk) is a fatal
+error.
+
+ $ gawk 'BEGIN { print "hi" > "/no/such/file" }'
+ error--> gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory)
+
+ `gawk' makes it possible to detect that an error has occurred,
+allowing you to possibly recover from the error, or at least print an
+error message of your choosing before exiting. You can do this in one
+of two ways:
+
+ * For all output files, by assigning any value to
+ `PROCINFO["NONFATAL"]'.
+
+ * On a per-file basis, by assigning any value to `PROCINFO[FILENAME,
+ "NONFATAL"]'. Here, FILENAME is the name of the file to which you
+ wish output to be nonfatal.
+
+ Once you have enabled nonfatal output, you must check `ERRNO' after
+every relevant `print' or `printf' statement to see if something went
+wrong. It is also a good idea to initialize `ERRNO' to zero before
+attempting the output. For example:
+
+ $ gawk '
+ > BEGIN {
+ > PROCINFO["NONFATAL"] = 1
+ > ERRNO = 0
+ > print "hi" > "/no/such/file"
+ > if (ERRNO) {
+ > print("Output failed:", ERRNO) > "/dev/stderr"
+ > exit 1
+ > }
+ > }'
+ error--> Output failed: No such file or directory
+
+ Here, `gawk' did not produce a fatal error; instead it let the `awk'
+program code detect the problem and handle it.
+
+ This mechanism works also for standard output and standard error.
+For standard output, you may use `PROCINFO["-", "NONFATAL"]' or
+`PROCINFO["/dev/stdout", "NONFATAL"]'. For standard error, use
+`PROCINFO["/dev/stderr", "NONFATAL"]'.
+
+ When attempting to open a TCP/IP socket (*note TCP/IP Networking::),
+`gawk' tries multiple times. The `GAWK_SOCK_RETRIES' environment
+variable (*note Other Environment Variables::) allows you to override
+`gawk''s builtin default number of attempts. However, once nonfatal
+I/O is enabled for a given socket, `gawk' only retries once, relying on
+`awk'-level code to notice that there was a problem.
+
+
+File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Nonfatal, Up: Printing
-5.10 Summary
+5.11 Summary
============
* The `print' statement prints comma-separated expressions. Each
@@ -7233,11 +7332,16 @@ File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Fi
For coprocesses, it is possible to close only one direction of the
communications.
+ * Normally errors with `print' or `printf' are fatal. `gawk' lets
+ you make output errors be nonfatal either for all files or on a
+ per-file basis. You must then check for errors after every
+ relevant output statement.
+

File: gawk.info, Node: Output Exercises, Prev: Output Summary, Up: Printing
-5.11 Exercises
+5.12 Exercises
==============
1. Rewrite the program:
@@ -10332,10 +10436,24 @@ Options::), they are not special:
An associative array containing the values of the environment.
The array indices are the environment variable names; the elements
are the values of the particular environment variables. For
- example, `ENVIRON["HOME"]' might be `"/home/arnold"'. Changing
- this array does not affect the environment passed on to any
- programs that `awk' may spawn via redirection or the `system()'
- function. (In a future version of `gawk', it may do so.)
+ example, `ENVIRON["HOME"]' might be `/home/arnold'.
+
+ For POSIX `awk', changing this array does not affect the
+ environment passed on to any programs that `awk' may spawn via
+ redirection or the `system()' function.
+
+ However, beginning with version 4.2, if not in POSIX compatibility
+ mode, `gawk' does update its own environment when `ENVIRON' is
+ changed, thus changing the environment seen by programs that it
+ creates. You should therefore be especially careful if you modify
+ `ENVIRON["PATH"]', which is the search path for finding executable
+ programs.
+
+ This can also affect the running `gawk' program, since some of the
+ built-in functions may pay attention to certain environment
+ variables. The most notable instance of this is `mktime()' (*note
+ Time Functions::), which pays attention the value of the `TZ'
+ environment variable on many systems.
Some operating systems may not have environment variables. On
such systems, the `ENVIRON' array is empty (except for
@@ -10358,6 +10476,11 @@ Options::), they are not special:
`getline' returning -1. You are, of course, free to clear it
yourself before doing an I/O operation.
+ If the value of `ERRNO' corresponds to a system error in the C
+ `errno' variable, then `PROCINFO["errno"]' will be set to the value
+ of `errno'. For non-system errors, `PROCINFO["errno"]' will be
+ zero.
+
`FILENAME'
The name of the current input file. When no data files are listed
on the command line, `awk' reads from the standard input and
@@ -10406,6 +10529,10 @@ Options::), they are not special:
`PROCINFO["egid"]'
The value of the `getegid()' system call.
+ `PROCINFO["errno"]'
+ The value of the C `errno' variable when `ERRNO' is set to
+ the associated error message.
+
`PROCINFO["euid"]'
The value of the `geteuid()' system call.
@@ -10516,6 +10643,10 @@ Options::), they are not special:
open input file, pipe, or coprocess. *Note Read Timeout::,
for more information.
+ * It may be used to indicate that input may be retried when it
+ fails due to certain errors. *Note Retrying Input::, for
+ more information.
+
* It may be used to cause coprocesses to communicate over
pseudo-ttys instead of through two-way pipes; this is
discussed further in *note Two-way I/O::.
@@ -11910,6 +12041,21 @@ brackets ([ ]):
truncated toward zero. For example, `int(3)' is 3, `int(3.9)' is
3, `int(-3.9)' is -3, and `int(-3)' is -3 as well.
+`intdiv(NUMERATOR, DENOMINATOR, RESULT)'
+ Perform integer division, similar to the standard C function of the
+ same name. First, truncate `numerator' and `denominator' towards
+ zero, creating integer values. Clear the `result' array, and then
+ set `result["quotient"]' to the result of `numerator /
+ denominator', truncated towards zero to an integer, and set
+ `result["remainder"]' to the result of `numerator % denominator',
+ truncated towards zero to an integer. This function is primarily
+ intended for use with arbitrary length integers; it avoids
+ creating MPFR arbitrary precision floating-point values (*note
+ Arbitrary Precision Integers::).
+
+ This function is a `gawk' extension. It is not available in
+ compatibility mode (*note Options::).
+
`log(X)'
Return the natural logarithm of X, if X is positive; otherwise,
return `NaN' ("not a number") on IEEE 754 systems. Additionally,
@@ -19912,8 +20058,7 @@ output. They are as follows:
you typed when you wrote it. This is because `gawk' creates the
profiled version by "pretty-printing" its internal representation of
the program. The advantage to this is that `gawk' can produce a
-standard representation. The disadvantage is that all source code
-comments are lost. Also, things such as:
+standard representation. Also, things such as:
/foo/
@@ -19972,8 +20117,24 @@ the `Ctrl-\' key.
called this way, `gawk' "pretty-prints" the program into `awkprof.out',
without any execution counts.
- NOTE: The `--pretty-print' option still runs your program. This
- will change in the next major release.
+ NOTE: Once upon a time, the `--pretty-print' option would also run
+ your program. This is is no longer the case.
+
+ There is a significant difference between the output created when
+profiling, and that created when pretty-printing. Pretty-printed output
+preserves the original comments that were in the program, although their
+placement may not correspond exactly to their original locations in the
+source code.
+
+ However, as a deliberate design decision, profiling output _omits_
+the original program's comments. This allows you to focus on the
+execution count data and helps you avoid the temptation to use the
+profiler for pretty-printing.
+
+ Additionally, pretty-printed output does not have the leading
+indentation that the profiling output does. This makes it easy to
+pretty-print your code once development is completed, and then use the
+result as the final version of your program.

File: gawk.info, Node: Advanced Features Summary, Prev: Profiling, Up: Advanced Features
@@ -22453,6 +22614,63 @@ the following:
gawk -M 'BEGIN { n = 13; print n % 2 }'
+ When dividing two arbitrary precision integers with either `/' or
+`%', the result is typically an arbitrary precision floating point
+value (unless the denominator evenly divides into the numerator). In
+order to do integer division or remainder with arbitrary precision
+integers, use the built-in `intdiv()' function (*note Numeric
+Functions::).
+
+ You can simulate the `intdiv()' function in standard `awk' using
+this user-defined function:
+
+ # intdiv --- do integer division
+
+ function intdiv(numerator, denominator, result)
+ {
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+ }
+
+ The following example program, contributed by Katie Wasserman, uses
+`intdiv()' to compute the digits of pi to as many places as you choose
+to set:
+
+ # pi.awk --- compute the digits of pi
+
+ BEGIN {
+ digits = 100000
+ two = 2 * 10 ^ digits
+ pi = two
+ for (m = digits * 4; m > 0; --m) {
+ d = m * 2 + 1
+ x = pi * m
+ intdiv(x, d, result)
+ pi = result["quotient"]
+ pi = pi + two
+ }
+ print pi
+ }
+
+ When asked about the algorithm used, Katie replied:
+
+ It's not that well known but it's not that obscure either. It's
+ Euler's modification to Newton's method for calculating pi. Take
+ a look at lines (23) - (25) here:
+ `http://mathworld.wolfram.com/PiFormulas.html'.
+
+ The algorithm I wrote simply expands the multiply by 2 and works
+ from the innermost expression outwards. I used this to program HP
+ calculators because it's quite easy to modify for tiny memory
+ devices with smallish word sizes. See
+ `http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=899'.
+
---------- Footnotes ----------
(1) Weisstein, Eric W. `Sylvester's Sequence'. From MathWorld--A
@@ -22813,6 +23031,7 @@ describes the API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
+* Redirection API:: How to access and manipulate redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
@@ -22873,6 +23092,9 @@ operations:
- Flattening an array for easy C-style looping over all its
indices and elements
+ * Accessing and manipulating redirections.
+
+
Some points about using the API:
* The following types, macros, and/or functions are referenced in
@@ -24084,7 +24306,7 @@ using `release_value()'.
`double' to store.

-File: gawk.info, Node: Array Manipulation, Next: Extension API Variables, Prev: Symbol Table Access, Up: Extension API Description
+File: gawk.info, Node: Array Manipulation, Next: Redirection API, Prev: Symbol Table Access, Up: Extension API Description
16.4.11 Array Manipulation
--------------------------
@@ -24569,9 +24791,78 @@ array:
environment variable.)

-File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Array Manipulation, Up: Extension API Description
+File: gawk.info, Node: Redirection API, Next: Extension API Variables, Prev: Array Manipulation, Up: Extension API Description
+
+16.4.12 Accessing and Manipulating Redirections
+-----------------------------------------------
+
+The following function allows extensions to access and manipulate
+redirections.
+
+`awk_bool_t get_file(const char *name,'
+` size_t name_len,'
+` const char *filetype,'
+` int fd,'
+` const awk_input_buf_t **ibufp,'
+` const awk_output_buf_t **obufp);'
+ Look up a file in `gawk''s internal redirection table. If `name'
+ is `NULL' or `name_len' is zero, return data for the currently
+ open input file corresponding to `FILENAME'. (This does not
+ access the `filetype' argument, so that may be undefined). If the
+ file is not already open, attempt to open it. The `filetype'
+ argument must be zero-terminated and should be one of:
+
+ `">"'
+ A file opened for output.
+
+ `">>"'
+ A file opened for append.
+
+ `"<"'
+ A file opened for input.
+
+ `"|>"'
+ A pipe opened for output.
+
+ `"|<"'
+ A pipe opened for input.
+
+ `"|&"'
+ A two-way coprocess.
+
+ On error, return a `false' value. Otherwise, return `true', and
+ return additional information about the redirection in the `ibufp'
+ and `obufp' pointers. For input redirections, the `*ibufp' value
+ should be non-`NULL', and `*obufp' should be `NULL'. For output
+ redirections, the `*obufp' value should be non-`NULL', and `*ibufp'
+ should be `NULL'. For two-way coprocesses, both values should be
+ non-`NULL'.
+
+ In the usual case, the extension is interested in `(*ibufp)->fd'
+ and/or `fileno((*obufp)->fp)'. If the file is not already open,
+ and the `fd' argument is non-negative, `gawk' will use that file
+ descriptor instead of opening the file in the usual way. If `fd'
+ is non-negative, but the file exists already, `gawk' ignores `fd'
+ and returns the existing file. It is the caller's responsibility
+ to notice that neither the `fd' in the returned `awk_input_buf_t'
+ nor the `fd' in the returned `awk_output_buf_t' matches the
+ requested value.
+
+ Note that supplying a file descriptor is currently _not_ supported
+ for pipes. However, supplying a file descriptor should work for
+ input, output, append, and two-way (coprocess) sockets. If
+ `filetype' is two-way, `gawk' assumes that it is a socket! Note
+ that in the two-way case, the input and output file descriptors
+ may differ. To check for success, you must check whether either
+ matches.
+
+ It is anticipated that this API function will be used to implement
+I/O multiplexing and a socket library.
+
+
+File: gawk.info, Node: Extension API Variables, Next: Extension API Boilerplate, Prev: Redirection API, Up: Extension API Description
-16.4.12 API Variables
+16.4.13 API Variables
---------------------
The API provides two sets of variables. The first provides information
@@ -24588,7 +24879,7 @@ information about how `gawk' was invoked.

File: gawk.info, Node: Extension Versioning, Next: Extension API Informational Variables, Up: Extension API Variables
-16.4.12.1 API Version Constants and Variables
+16.4.13.1 API Version Constants and Variables
.............................................
The API provides both a "major" and a "minor" version number. The API
@@ -24637,7 +24928,7 @@ Boilerplate::).

File: gawk.info, Node: Extension API Informational Variables, Prev: Extension Versioning, Up: Extension API Variables
-16.4.12.2 Informational Variables
+16.4.13.2 Informational Variables
.................................
The API provides access to several variables that describe whether the
@@ -24672,7 +24963,7 @@ not change during execution.

File: gawk.info, Node: Extension API Boilerplate, Prev: Extension API Variables, Up: Extension API Description
-16.4.13 Boilerplate Code
+16.4.14 Boilerplate Code
------------------------
As mentioned earlier (*note Extension Mechanism Outline::), the function
@@ -25977,15 +26268,17 @@ project.
* GD graphics library extension
+ * MPFR library extension (this provides access to a number of MPFR
+ functions that `gawk''s native MPFR support does not)
+
* PDF extension
* PostgreSQL extension
- * MPFR library extension (this provides access to a number of MPFR
- functions that `gawk''s native MPFR support does not)
-
* Redis extension
+ * Select extension
+
* XML parser extension, using the Expat
(http://expat.sourceforge.net) XML parsing library
@@ -26402,6 +26695,9 @@ the current version of `gawk'.
- Directories on the command line produce a warning and are
skipped (*note Command-line directories::)
+ - Output with `print' and `printf' need not be fatal (*note
+ Nonfatal::)
+
* New keywords:
- The `BEGINFILE' and `ENDFILE' special patterns (*note
@@ -26451,6 +26747,9 @@ the current version of `gawk'.
- The `bindtextdomain()', `dcgettext()', and `dcngettext()'
functions for internationalization (*note Programmer i18n::)
+ - The `intdiv()' function for doing integer division and
+ remainder (*note Numeric Functions::)
+
* Changes and/or additions in the command-line options:
- The `AWKPATH' environment variable for specifying a path
@@ -26505,6 +26804,11 @@ the current version of `gawk'.
- Ultrix
+ * Support for the following systems was removed from the code for
+ `gawk' version 4.2:
+
+ - MirBSD
+

File: gawk.info, Node: Feature History, Next: Common Extensions, Prev: POSIX/GNU, Up: Language History
@@ -26896,6 +27200,28 @@ in POSIX `awk', in the order they were added to `gawk'.
* The `where' command was added to the debugger (*note Execution
Stack::).
+ * Support for Ultrix was removed.
+
+
+ Version 4.2 introduced the following changes:
+
+ * Changes to `ENVIRON' are reflected into `gawk''s environment and
+ that of programs that it runs. *Note Auto-set::.
+
+ * The `--pretty-print' option no longer runs the `awk' program too.
+ *Note Options::.
+
+ * The `igawk' program and its manual page are no longer installed
+ when `gawk' is built. *Note Igawk Program::.
+
+ * The `intdiv()' function. *Note Numeric Functions::.
+
+ * The maximum number of hexdecimal digits in `\x' escapes is now two.
+ *Note Escape Sequences::.
+
+ * Nonfatal output with `print' and `printf'. *Note Nonfatal::.
+
+ * Support for MirBSD was removed.

File: gawk.info, Node: Common Extensions, Next: Ranges and Locales, Prev: Feature History, Up: Language History
@@ -27413,7 +27739,9 @@ Various `.c', `.y', and `.h' files
`doc/igawk.1'
The `troff' source for a manual page describing the `igawk'
- program presented in *note Igawk Program::.
+ program presented in *note Igawk Program::. (Since `gawk' can do
+ its own `@include' processing, neither `igawk' nor `igawk.1' are
+ installed.)
`doc/Makefile.in'
The input file used during the configuration process to generate
@@ -27455,17 +27783,23 @@ Various `.c', `.y', and `.h' files
contains a `Makefile.in' file, which `configure' uses to generate
a `Makefile'. `Makefile.am' is used by GNU Automake to create
`Makefile.in'. The library functions from *note Library
- Functions::, and the `igawk' program from *note Igawk Program::,
- are included as ready-to-use files in the `gawk' distribution.
- They are installed as part of the installation process. The rest
- of the programs in this Info file are available in appropriate
- subdirectories of `awklib/eg'.
+ Functions::, are included as ready-to-use files in the `gawk'
+ distribution. They are installed as part of the installation
+ process. The rest of the programs in this Info file are available
+ in appropriate subdirectories of `awklib/eg'.
`extension/*'
The source code, manual pages, and infrastructure files for the
sample extensions included with `gawk'. *Note Dynamic
Extensions::, for more information.
+`extras/*'
+ Additional non-essential files. Currently, this directory
+ contains some shell startup files to be installed in
+ `/etc/profile.d' to aid in manipulating the `AWKPATH' and
+ `AWKLIBPATH' environment variables. *Note Shell Startup Files::,
+ for more information.
+
`posix/*'
Files needed for building `gawk' on POSIX-compliant systems.
@@ -27496,11 +27830,12 @@ configure `gawk' for your system yourself.
* Menu:
* Quick Installation:: Compiling `gawk' under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.

-File: gawk.info, Node: Quick Installation, Next: Additional Configuration Options, Up: Unix Installation
+File: gawk.info, Node: Quick Installation, Next: Shell Startup Files, Up: Unix Installation
B.2.1 Compiling `gawk' for Unix-Like Systems
--------------------------------------------
@@ -27556,9 +27891,43 @@ will be asked for your password, and you will have to have been set up
previously as a user who is allowed to run the `sudo' command.

-File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Quick Installation, Up: Unix Installation
+File: gawk.info, Node: Shell Startup Files, Next: Additional Configuration Options, Prev: Quick Installation, Up: Unix Installation
+
+B.2.2 Shell Startup Files
+-------------------------
+
+The distribution contains shell startup files `gawk.sh' and `gawk.csh'
+containing functions to aid in manipulating the `AWKPATH' and
+`AWKLIBPATH' environment variables. On a Fedora system, these files
+should be installed in `/etc/profile.d'; on other platforms, the
+appropriate location may be different.
+
+`gawkpath_default'
+ Reset the `AWKPATH' environment variable to its default value.
+
+`gawkpath_prepend'
+ Add the argument to the front of the `AWKPATH' environment
+ variable.
+
+`gawkpath_append'
+ Add the argument to the end of the `AWKPATH' environment variable.
+
+`gawklibpath_default'
+ Reset the `AWKLIBPATH' environment variable to its default value.
+
+`gawklibpath_prepend'
+ Add the argument to the front of the `AWKLIBPATH' environment
+ variable.
+
+`gawklibpath_append'
+ Add the argument to the end of the `AWKLIBPATH' environment
+ variable.
+
+
+
+File: gawk.info, Node: Additional Configuration Options, Next: Configuration Philosophy, Prev: Shell Startup Files, Up: Unix Installation
-B.2.2 Additional Configuration Options
+B.2.3 Additional Configuration Options
--------------------------------------
There are several additional options you may use on the `configure'
@@ -27602,7 +27971,7 @@ supplied by `configure'.

File: gawk.info, Node: Configuration Philosophy, Prev: Additional Configuration Options, Up: Unix Installation
-B.2.3 The Configuration Process
+B.2.4 The Configuration Process
-------------------------------
This minor node is of interest only if you know something about using
@@ -31554,20 +31923,20 @@ Index
* --include option: Options. (line 159)
* --lint option <1>: Options. (line 185)
* --lint option: Command Line. (line 20)
-* --lint-old option: Options. (line 297)
+* --lint-old option: Options. (line 295)
* --load option: Options. (line 173)
* --non-decimal-data option <1>: Nondecimal Data. (line 6)
* --non-decimal-data option: Options. (line 211)
* --non-decimal-data option, strtonum() function and: Nondecimal Data.
(line 35)
-* --optimize option: Options. (line 238)
-* --posix option: Options. (line 256)
-* --posix option, --traditional option and: Options. (line 275)
+* --optimize option: Options. (line 236)
+* --posix option: Options. (line 254)
+* --posix option, --traditional option and: Options. (line 273)
* --pretty-print option: Options. (line 225)
* --profile option <1>: Profiling. (line 12)
-* --profile option: Options. (line 244)
-* --re-interval option: Options. (line 281)
-* --sandbox option: Options. (line 288)
+* --profile option: Options. (line 242)
+* --re-interval option: Options. (line 279)
+* --sandbox option: Options. (line 286)
* --sandbox option, disabling system() function: I/O Functions.
(line 129)
* --sandbox option, input redirection with getline: Getline. (line 19)
@@ -31575,9 +31944,9 @@ Index
(line 6)
* --source option: Options. (line 117)
* --traditional option: Options. (line 81)
-* --traditional option, --posix option and: Options. (line 275)
+* --traditional option, --posix option and: Options. (line 273)
* --use-lc-numeric option: Options. (line 220)
-* --version option: Options. (line 302)
+* --version option: Options. (line 300)
* --with-whiny-user-strftime configuration option: Additional Configuration Options.
(line 37)
* -b option: Options. (line 68)
@@ -31585,32 +31954,32 @@ Index
* -c option: Options. (line 81)
* -D option: Options. (line 108)
* -d option: Options. (line 93)
-* -e option: Options. (line 338)
+* -e option: Options. (line 336)
* -E option: Options. (line 125)
* -e option: Options. (line 117)
* -f option: Options. (line 25)
* -F option: Options. (line 21)
* -f option: Long. (line 12)
-* -F option, -Ft sets FS to TAB: Options. (line 310)
+* -F option, -Ft sets FS to TAB: Options. (line 308)
* -F option, command-line: Command Line Field Separator.
(line 6)
-* -f option, multiple uses: Options. (line 315)
+* -f option, multiple uses: Options. (line 313)
* -g option: Options. (line 147)
* -h option: Options. (line 154)
* -i option: Options. (line 159)
-* -L option: Options. (line 297)
+* -L option: Options. (line 295)
* -l option: Options. (line 173)
* -M option: Options. (line 205)
* -N option: Options. (line 220)
* -n option: Options. (line 211)
-* -O option: Options. (line 238)
+* -O option: Options. (line 236)
* -o option: Options. (line 225)
-* -P option: Options. (line 256)
-* -p option: Options. (line 244)
-* -r option: Options. (line 281)
-* -S option: Options. (line 288)
+* -P option: Options. (line 254)
+* -p option: Options. (line 242)
+* -r option: Options. (line 279)
+* -S option: Options. (line 286)
* -v option: Assignment Options. (line 12)
-* -V option: Options. (line 302)
+* -V option: Options. (line 300)
* -v option: Options. (line 32)
* -W option: Options. (line 46)
* . (period), regexp operator: Regexp Operators. (line 44)
@@ -31672,10 +32041,10 @@ Index
(line 8)
* [] (square brackets), regexp operator: Regexp Operators. (line 56)
* \ (backslash): Comments. (line 50)
-* \ (backslash), \" escape sequence: Escape Sequences. (line 82)
+* \ (backslash), \" escape sequence: Escape Sequences. (line 85)
* \ (backslash), \' operator (gawk): GNU Regexp Operators.
(line 56)
-* \ (backslash), \/ escape sequence: Escape Sequences. (line 73)
+* \ (backslash), \/ escape sequence: Escape Sequences. (line 76)
* \ (backslash), \< operator (gawk): GNU Regexp Operators.
(line 30)
* \ (backslash), \> operator (gawk): GNU Regexp Operators.
@@ -31715,7 +32084,7 @@ Index
* \ (backslash), in bracket expressions: Bracket Expressions. (line 17)
* \ (backslash), in escape sequences: Escape Sequences. (line 6)
* \ (backslash), in escape sequences, POSIX and: Escape Sequences.
- (line 105)
+ (line 108)
* \ (backslash), in regexp constants: Computed Regexps. (line 30)
* \ (backslash), in shell commands: Quoting. (line 48)
* \ (backslash), regexp operator: Regexp Operators. (line 18)
@@ -31883,7 +32252,7 @@ Index
* awf (amazingly workable formatter) program: Glossary. (line 24)
* awk debugging, enabling: Options. (line 108)
* awk language, POSIX version: Assignment Ops. (line 137)
-* awk profiling, enabling: Options. (line 244)
+* awk profiling, enabling: Options. (line 242)
* awk programs <1>: Two Rules. (line 6)
* awk programs <2>: Executable Scripts. (line 6)
* awk programs: Getting Started. (line 12)
@@ -31941,10 +32310,10 @@ Index
* awkvars.out file: Options. (line 93)
* b debugger command (alias for break): Breakpoint Control. (line 11)
* backslash (\): Comments. (line 50)
-* backslash (\), \" escape sequence: Escape Sequences. (line 82)
+* backslash (\), \" escape sequence: Escape Sequences. (line 85)
* backslash (\), \' operator (gawk): GNU Regexp Operators.
(line 56)
-* backslash (\), \/ escape sequence: Escape Sequences. (line 73)
+* backslash (\), \/ escape sequence: Escape Sequences. (line 76)
* backslash (\), \< operator (gawk): GNU Regexp Operators.
(line 30)
* backslash (\), \> operator (gawk): GNU Regexp Operators.
@@ -31984,7 +32353,7 @@ Index
* backslash (\), in bracket expressions: Bracket Expressions. (line 17)
* backslash (\), in escape sequences: Escape Sequences. (line 6)
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
- (line 105)
+ (line 108)
* backslash (\), in regexp constants: Computed Regexps. (line 30)
* backslash (\), in shell commands: Quoting. (line 48)
* backslash (\), regexp operator: Regexp Operators. (line 18)
@@ -32090,7 +32459,7 @@ Index
(line 67)
* Brian Kernighan's awk <12>: GNU Regexp Operators.
(line 82)
-* Brian Kernighan's awk <13>: Escape Sequences. (line 109)
+* Brian Kernighan's awk <13>: Escape Sequences. (line 112)
* Brian Kernighan's awk: When. (line 21)
* Brian Kernighan's awk, extensions: BTL. (line 6)
* Brian Kernighan's awk, source code: Other Versions. (line 13)
@@ -32284,7 +32653,7 @@ Index
* cosine: Numeric Functions. (line 15)
* counting: Wc Program. (line 6)
* csh utility: Statements/Lines. (line 44)
-* csh utility, POSIXLY_CORRECT environment variable: Options. (line 356)
+* csh utility, POSIXLY_CORRECT environment variable: Options. (line 354)
* csh utility, |& operator, comparison with: Two-way I/O. (line 25)
* ctime() user-defined function: Function Example. (line 74)
* currency symbols, localization: Explaining gettext. (line 104)
@@ -32315,12 +32684,12 @@ Index
* dark corner, CONVFMT variable: Strings And Numbers. (line 40)
* dark corner, escape sequences: Other Arguments. (line 38)
* dark corner, escape sequences, for metacharacters: Escape Sequences.
- (line 140)
+ (line 143)
* dark corner, exit statement: Exit Statement. (line 30)
* dark corner, field separators: Full Line Fields. (line 22)
-* dark corner, FILENAME variable <1>: Auto-set. (line 90)
+* dark corner, FILENAME variable <1>: Auto-set. (line 109)
* dark corner, FILENAME variable: Getline Notes. (line 19)
-* dark corner, FNR/NR variables: Auto-set. (line 314)
+* dark corner, FNR/NR variables: Auto-set. (line 341)
* dark corner, format-control characters: Control Letters. (line 18)
* dark corner, FS as null string: Single Character Fields.
(line 20)
@@ -32470,7 +32839,7 @@ Index
* debugger, read commands from a file: Debugger Info. (line 97)
* debugging awk programs: Debugger. (line 6)
* debugging gawk, bug reports: Bugs. (line 9)
-* decimal point character, locale specific: Options. (line 272)
+* decimal point character, locale specific: Options. (line 270)
* decrement operators: Increment Ops. (line 35)
* default keyword: Switch Statement. (line 6)
* Deifik, Scott <1>: Bugs. (line 71)
@@ -32509,12 +32878,12 @@ Index
(line 81)
* differences in awk and gawk, command-line directories: Command-line directories.
(line 6)
-* differences in awk and gawk, ERRNO variable: Auto-set. (line 74)
+* differences in awk and gawk, ERRNO variable: Auto-set. (line 88)
* differences in awk and gawk, error messages: Special FD. (line 19)
* differences in awk and gawk, FIELDWIDTHS variable: User-modified.
(line 37)
* differences in awk and gawk, FPAT variable: User-modified. (line 43)
-* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 116)
+* differences in awk and gawk, FUNCTAB variable: Auto-set. (line 135)
* differences in awk and gawk, function arguments (gawk): Calling Built-in.
(line 16)
* differences in awk and gawk, getline command: Getline. (line 19)
@@ -32537,7 +32906,7 @@ Index
(line 263)
* differences in awk and gawk, print/printf statements: Format Modifiers.
(line 13)
-* differences in awk and gawk, PROCINFO array: Auto-set. (line 130)
+* differences in awk and gawk, PROCINFO array: Auto-set. (line 149)
* differences in awk and gawk, read timeouts: Read Timeout. (line 6)
* differences in awk and gawk, record separators: awk split records.
(line 125)
@@ -32545,9 +32914,11 @@ Index
(line 43)
* differences in awk and gawk, regular expressions: Case-sensitivity.
(line 26)
+* differences in awk and gawk, retrying input: Retrying Input.
+ (line 6)
* differences in awk and gawk, RS/RT variables: gawk split records.
(line 58)
-* differences in awk and gawk, RT variable: Auto-set. (line 265)
+* differences in awk and gawk, RT variable: Auto-set. (line 292)
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
@@ -32555,7 +32926,7 @@ Index
* differences in awk and gawk, strings: Scalar Constants. (line 20)
* differences in awk and gawk, strings, storing: gawk split records.
(line 77)
-* differences in awk and gawk, SYMTAB variable: Auto-set. (line 269)
+* differences in awk and gawk, SYMTAB variable: Auto-set. (line 296)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
(line 151)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
@@ -32591,12 +32962,12 @@ Index
* dump debugger command: Miscellaneous Debugger Commands.
(line 9)
* dupword.awk program: Dupword Program. (line 31)
-* dynamic profiling: Profiling. (line 179)
+* dynamic profiling: Profiling. (line 178)
* dynamically loaded extensions: Dynamic Extensions. (line 6)
* e debugger command (alias for enable): Breakpoint Control. (line 73)
* EBCDIC: Ordinal Functions. (line 45)
-* effective group ID of gawk user: Auto-set. (line 135)
-* effective user ID of gawk user: Auto-set. (line 139)
+* effective group ID of gawk user: Auto-set. (line 154)
+* effective user ID of gawk user: Auto-set. (line 162)
* egrep utility <1>: Egrep Program. (line 6)
* egrep utility: Bracket Expressions. (line 26)
* egrep.awk program: Egrep Program. (line 54)
@@ -32651,13 +33022,13 @@ Index
(line 11)
* EREs (Extended Regular Expressions): Bracket Expressions. (line 26)
* ERRNO variable <1>: TCP/IP Networking. (line 54)
-* ERRNO variable: Auto-set. (line 74)
+* ERRNO variable: Auto-set. (line 88)
* ERRNO variable, with BEGINFILE pattern: BEGINFILE/ENDFILE. (line 26)
* ERRNO variable, with close() function: Close Files And Pipes.
(line 141)
* ERRNO variable, with getline command: Getline. (line 19)
* error handling: Special FD. (line 19)
-* error handling, ERRNO variable and: Auto-set. (line 74)
+* error handling, ERRNO variable and: Auto-set. (line 88)
* error output: Special FD. (line 6)
* escape processing, gsub()/gensub()/sub() functions: Gory Details.
(line 6)
@@ -32692,7 +33063,7 @@ Index
(line 99)
* exp: Numeric Functions. (line 18)
* expand utility: Very Simple. (line 73)
-* Expat XML parser library: gawkextlib. (line 35)
+* Expat XML parser library: gawkextlib. (line 37)
* exponent: Numeric Functions. (line 18)
* expressions: Expressions. (line 6)
* expressions, as patterns: Expression Patterns. (line 6)
@@ -32711,7 +33082,7 @@ Index
(line 6)
* extension API version: Extension Versioning.
(line 6)
-* extension API, version number: Auto-set. (line 232)
+* extension API, version number: Auto-set. (line 255)
* extension example: Extension Example. (line 6)
* extension registration: Registration Functions.
(line 6)
@@ -32792,7 +33163,7 @@ Index
* file names, distinguishing: Auto-set. (line 56)
* file names, in compatibility mode: Special Caveats. (line 9)
* file names, standard streams in gawk: Special FD. (line 48)
-* FILENAME variable <1>: Auto-set. (line 90)
+* FILENAME variable <1>: Auto-set. (line 109)
* FILENAME variable: Reading Files. (line 6)
* FILENAME variable, getline, setting with: Getline Notes. (line 19)
* filenames, assignments as: Ignoring Assigns. (line 6)
@@ -32860,9 +33231,9 @@ Index
* flush buffered output: I/O Functions. (line 28)
* fnmatch() extension function: Extension Sample Fnmatch.
(line 12)
-* FNR variable <1>: Auto-set. (line 100)
+* FNR variable <1>: Auto-set. (line 119)
* FNR variable: Records. (line 6)
-* FNR variable, changing: Auto-set. (line 314)
+* FNR variable, changing: Auto-set. (line 341)
* for statement: For Statement. (line 6)
* for statement, looping over arrays: Scanning an Array. (line 20)
* fork() extension function: Extension Sample Fork.
@@ -32899,7 +33270,7 @@ Index
* FS variable, --field-separator option and: Options. (line 21)
* FS variable, as null string: Single Character Fields.
(line 20)
-* FS variable, as TAB character: Options. (line 268)
+* FS variable, as TAB character: Options. (line 266)
* FS variable, changing value of: Field Separators. (line 35)
* FS variable, running awk programs and: Cut Program. (line 63)
* FS variable, setting from command line: Command Line Field Separator.
@@ -32912,7 +33283,7 @@ Index
* FSF (Free Software Foundation): Manual History. (line 6)
* fts() extension function: Extension Sample File Functions.
(line 61)
-* FUNCTAB array: Auto-set. (line 116)
+* FUNCTAB array: Auto-set. (line 135)
* function calls: Function Calls. (line 6)
* function calls, indirect: Indirect Calls. (line 6)
* function calls, indirect, @-notation for: Indirect Calls. (line 47)
@@ -32961,8 +33332,8 @@ Index
(line 44)
* G-d: Acknowledgments. (line 94)
* Garfinkle, Scott: Contributors. (line 34)
-* gawk program, dynamic profiling: Profiling. (line 179)
-* gawk version: Auto-set. (line 207)
+* gawk program, dynamic profiling: Profiling. (line 178)
+* gawk version: Auto-set. (line 230)
* gawk, ARGIND variable in: Other Arguments. (line 15)
* gawk, awk and <1>: This Manual. (line 14)
* gawk, awk and: Preface. (line 21)
@@ -32980,13 +33351,13 @@ Index
* gawk, distribution: Distribution contents.
(line 6)
* gawk, ERRNO variable in <1>: TCP/IP Networking. (line 54)
-* gawk, ERRNO variable in <2>: Auto-set. (line 74)
+* gawk, ERRNO variable in <2>: Auto-set. (line 88)
* gawk, ERRNO variable in <3>: BEGINFILE/ENDFILE. (line 26)
* gawk, ERRNO variable in <4>: Close Files And Pipes.
(line 141)
* gawk, ERRNO variable in: Getline. (line 19)
-* gawk, escape sequences: Escape Sequences. (line 117)
-* gawk, extensions, disabling: Options. (line 256)
+* gawk, escape sequences: Escape Sequences. (line 120)
+* gawk, extensions, disabling: Options. (line 254)
* gawk, features, adding: Adding Code. (line 6)
* gawk, features, advanced: Advanced Features. (line 6)
* gawk, field separators and: User-modified. (line 71)
@@ -32997,7 +33368,7 @@ Index
* gawk, FPAT variable in <1>: User-modified. (line 43)
* gawk, FPAT variable in: Splitting By Content.
(line 25)
-* gawk, FUNCTAB array in: Auto-set. (line 116)
+* gawk, FUNCTAB array in: Auto-set. (line 135)
* gawk, function arguments and: Calling Built-in. (line 16)
* gawk, hexadecimal numbers and: Nondecimal-numbers. (line 42)
* gawk, IGNORECASE variable in <1>: Array Sorting Functions.
@@ -33029,7 +33400,7 @@ Index
* gawk, predefined variables and: Built-in Variables. (line 14)
* gawk, PROCINFO array in <1>: Two-way I/O. (line 99)
* gawk, PROCINFO array in <2>: Time Functions. (line 47)
-* gawk, PROCINFO array in: Auto-set. (line 130)
+* gawk, PROCINFO array in: Auto-set. (line 149)
* gawk, regexp constants and: Using Constant Regexps.
(line 28)
* gawk, regular expressions, case sensitivity: Case-sensitivity.
@@ -33037,23 +33408,29 @@ Index
* gawk, regular expressions, operators: GNU Regexp Operators.
(line 6)
* gawk, regular expressions, precedence: Regexp Operators. (line 161)
-* gawk, RT variable in <1>: Auto-set. (line 265)
+* gawk, RT variable in <1>: Auto-set. (line 292)
* gawk, RT variable in <2>: Multiple Line. (line 129)
* gawk, RT variable in: awk split records. (line 125)
* gawk, See Also awk: Preface. (line 34)
* gawk, source code, obtaining: Getting. (line 6)
* gawk, splitting fields and: Constant Size. (line 87)
* gawk, string-translation functions: I18N Functions. (line 6)
-* gawk, SYMTAB array in: Auto-set. (line 269)
+* gawk, SYMTAB array in: Auto-set. (line 296)
* gawk, TEXTDOMAIN variable in: User-modified. (line 151)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 34)
-* gawk, versions of, information about, printing: Options. (line 302)
+* gawk, versions of, information about, printing: Options. (line 300)
* gawk, VMS version of: VMS Installation. (line 6)
* gawk, word-boundary operator: GNU Regexp Operators.
(line 63)
* gawkextlib: gawkextlib. (line 6)
* gawkextlib project: gawkextlib. (line 6)
+* gawklibpath_append shell function: Shell Startup Files. (line 29)
+* gawklibpath_default shell function: Shell Startup Files. (line 22)
+* gawklibpath_prepend shell function: Shell Startup Files. (line 25)
+* gawkpath_append shell function: Shell Startup Files. (line 19)
+* gawkpath_default shell function: Shell Startup Files. (line 12)
+* gawkpath_prepend shell function: Shell Startup Files. (line 15)
* General Public License (GPL): Glossary. (line 399)
* General Public License, See GPL: Manual History. (line 11)
* generate time values: Time Functions. (line 25)
@@ -33106,7 +33483,7 @@ Index
* git utility <2>: Accessing The Source.
(line 10)
* git utility <3>: Other Versions. (line 29)
-* git utility: gawkextlib. (line 29)
+* git utility: gawkextlib. (line 31)
* Git, use of for gawk source code: Derived Files. (line 6)
* GNITS mailing list: Acknowledgments. (line 52)
* GNU awk, See gawk: Preface. (line 51)
@@ -33130,7 +33507,7 @@ Index
* Grigera, Juan: Contributors. (line 57)
* group database, reading: Group Functions. (line 6)
* group file: Group Functions. (line 6)
-* group ID of gawk user: Auto-set. (line 180)
+* group ID of gawk user: Auto-set. (line 203)
* groups, information about: Group Functions. (line 6)
* gsub <1>: String Functions. (line 140)
* gsub: Using Constant Regexps.
@@ -33152,7 +33529,7 @@ Index
* history expansion, in debugger: Readline Support. (line 6)
* histsort.awk program: History Sorting. (line 25)
* Hughes, Phil: Acknowledgments. (line 43)
-* HUP signal, for dynamic profiling: Profiling. (line 211)
+* HUP signal, for dynamic profiling: Profiling. (line 210)
* hyphen (-), - operator: Precedence. (line 52)
* hyphen (-), -- operator <1>: Precedence. (line 46)
* hyphen (-), -- operator: Increment Ops. (line 48)
@@ -33232,7 +33609,8 @@ Index
* installing gawk: Installation. (line 6)
* instruction tracing, in debugger: Debugger Info. (line 90)
* int: Numeric Functions. (line 23)
-* INT signal (MS-Windows): Profiling. (line 214)
+* INT signal (MS-Windows): Profiling. (line 213)
+* intdiv: Numeric Functions. (line 28)
* integer array indices: Numeric Array Subscripts.
(line 31)
* integers, arbitrary precision: Arbitrary Precision Integers.
@@ -33288,7 +33666,7 @@ Index
* Kernighan, Brian <9>: Acknowledgments. (line 78)
* Kernighan, Brian <10>: Conventions. (line 38)
* Kernighan, Brian: History. (line 17)
-* kill command, dynamic profiling: Profiling. (line 188)
+* kill command, dynamic profiling: Profiling. (line 187)
* Knights, jedi: Undocumented. (line 6)
* Kwok, Conrad: Contributors. (line 34)
* l debugger command (alias for list): Miscellaneous Debugger Commands.
@@ -33360,7 +33738,7 @@ Index
* lint checking, empty programs: Command Line. (line 16)
* lint checking, issuing warnings: Options. (line 185)
* lint checking, POSIXLY_CORRECT environment variable: Options.
- (line 341)
+ (line 339)
* lint checking, undefined functions: Pass By Value/Reference.
(line 85)
* LINT variable: User-modified. (line 87)
@@ -33376,14 +33754,14 @@ Index
* loading, extensions: Options. (line 173)
* local variables, in a function: Variable Scope. (line 6)
* locale categories: Explaining gettext. (line 81)
-* locale decimal point character: Options. (line 272)
+* locale decimal point character: Options. (line 270)
* locale, definition of: Locales. (line 6)
* localization: I18N and L10N. (line 6)
* localization, See internationalization, localization: I18N and L10N.
(line 6)
-* log: Numeric Functions. (line 28)
+* log: Numeric Functions. (line 43)
* log files, timestamps in: Time Functions. (line 6)
-* logarithm: Numeric Functions. (line 28)
+* logarithm: Numeric Functions. (line 43)
* logical false/true: Truth Values. (line 6)
* logical operators, See Boolean expressions: Boolean Ops. (line 6)
* login information: Passwd Functions. (line 16)
@@ -33424,8 +33802,8 @@ Index
* mawk utility <2>: Nextfile Statement. (line 47)
* mawk utility <3>: Concatenation. (line 36)
* mawk utility <4>: Getline/Pipe. (line 62)
-* mawk utility: Escape Sequences. (line 117)
-* maximum precision supported by MPFR library: Auto-set. (line 221)
+* mawk utility: Escape Sequences. (line 120)
+* maximum precision supported by MPFR library: Auto-set. (line 244)
* McIlroy, Doug: Glossary. (line 258)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 42)
@@ -33437,8 +33815,8 @@ Index
(line 54)
* messages from extensions: Printing Messages. (line 6)
* metacharacters in regular expressions: Regexp Operators. (line 6)
-* metacharacters, escape sequences for: Escape Sequences. (line 136)
-* minimum precision required by MPFR library: Auto-set. (line 224)
+* metacharacters, escape sequences for: Escape Sequences. (line 139)
+* minimum precision required by MPFR library: Auto-set. (line 247)
* mktime: Time Functions. (line 25)
* modifiers, in format specifiers: Format Modifiers. (line 6)
* monetary information, localization: Explaining gettext. (line 104)
@@ -33458,7 +33836,7 @@ Index
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines <1>: Boolean Ops. (line 69)
-* newlines <2>: Options. (line 262)
+* newlines <2>: Options. (line 260)
* newlines: Statements/Lines. (line 6)
* newlines, as field separators: Default Field Splitting.
(line 6)
@@ -33487,7 +33865,7 @@ Index
(line 47)
* nexti debugger command: Debugger Execution Control.
(line 49)
-* NF variable <1>: Auto-set. (line 105)
+* NF variable <1>: Auto-set. (line 124)
* NF variable: Fields. (line 33)
* NF variable, decrementing: Changing Fields. (line 107)
* ni debugger command (alias for nexti): Debugger Execution Control.
@@ -33496,9 +33874,9 @@ Index
* non-existent array elements: Reference to Elements.
(line 23)
* not Boolean-logic operator: Boolean Ops. (line 6)
-* NR variable <1>: Auto-set. (line 125)
+* NR variable <1>: Auto-set. (line 144)
* NR variable: Records. (line 6)
-* NR variable, changing: Auto-set. (line 314)
+* NR variable, changing: Auto-set. (line 341)
* null strings <1>: Basic Data Typing. (line 26)
* null strings <2>: Truth Values. (line 6)
* null strings <3>: Regexp Field Splitting.
@@ -33612,7 +33990,7 @@ Index
* p debugger command (alias for print): Viewing And Changing Data.
(line 36)
* Papadopoulos, Panos: Contributors. (line 128)
-* parent process ID of gawk process: Auto-set. (line 189)
+* parent process ID of gawk process: Auto-set. (line 212)
* parentheses (), in a profile: Profiling. (line 146)
* parentheses (), regexp operator: Regexp Operators. (line 81)
* password file: Passwd Functions. (line 16)
@@ -33654,14 +34032,14 @@ Index
* plus sign (+), += operator: Assignment Ops. (line 82)
* plus sign (+), regexp operator: Regexp Operators. (line 105)
* pointers to functions: Indirect Calls. (line 6)
-* portability: Escape Sequences. (line 100)
+* portability: Escape Sequences. (line 103)
* portability, #! (executable scripts): Executable Scripts. (line 33)
* portability, ** operator and: Arithmetic Ops. (line 81)
* portability, **= operator and: Assignment Ops. (line 143)
* portability, ARGV variable: Executable Scripts. (line 59)
* portability, backslash continuation and: Statements/Lines. (line 30)
* portability, backslash in escape sequences: Escape Sequences.
- (line 105)
+ (line 108)
* portability, close() function and: Close Files And Pipes.
(line 81)
* portability, data files as single record: gawk split records.
@@ -33679,7 +34057,7 @@ Index
* portability, NF variable, decrementing: Changing Fields. (line 115)
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 98)
-* portability, POSIXLY_CORRECT environment variable: Options. (line 361)
+* portability, POSIXLY_CORRECT environment variable: Options. (line 359)
* portability, substr() function: String Functions. (line 513)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 37)
@@ -33700,7 +34078,7 @@ Index
* POSIX awk, < operator and: Getline/File. (line 26)
* POSIX awk, arithmetic operators and: Arithmetic Ops. (line 30)
* POSIX awk, backslashes in string constants: Escape Sequences.
- (line 105)
+ (line 108)
* POSIX awk, BEGIN/END patterns: I/O And BEGIN/END. (line 16)
* POSIX awk, bracket expressions and: Bracket Expressions. (line 26)
* POSIX awk, bracket expressions and, character classes: Bracket Expressions.
@@ -33727,11 +34105,11 @@ Index
* POSIX awk, regular expressions and: Regexp Operators. (line 161)
* POSIX awk, timestamps and: Time Functions. (line 6)
* POSIX awk, | I/O operator and: Getline/Pipe. (line 55)
-* POSIX mode: Options. (line 256)
+* POSIX mode: Options. (line 254)
* POSIX, awk and: Preface. (line 21)
* POSIX, gawk extensions not included in: POSIX/GNU. (line 6)
* POSIX, programs, implementing in awk: Clones. (line 6)
-* POSIXLY_CORRECT environment variable: Options. (line 341)
+* POSIXLY_CORRECT environment variable: Options. (line 339)
* PREC variable: User-modified. (line 123)
* precedence <1>: Precedence. (line 6)
* precedence: Increment Ops. (line 60)
@@ -33778,24 +34156,24 @@ Index
* printing, unduplicated lines of text: Uniq Program. (line 6)
* printing, user information: Id Program. (line 6)
* private variables: Library Names. (line 11)
-* process group ID of gawk process: Auto-set. (line 183)
-* process ID of gawk process: Auto-set. (line 186)
+* process group ID of gawk process: Auto-set. (line 206)
+* process ID of gawk process: Auto-set. (line 209)
* processes, two-way communications with: Two-way I/O. (line 6)
* processing data: Basic High Level. (line 6)
* PROCINFO array <1>: Passwd Functions. (line 6)
* PROCINFO array <2>: Time Functions. (line 47)
-* PROCINFO array: Auto-set. (line 130)
+* PROCINFO array: Auto-set. (line 149)
* PROCINFO array, and communications via ptys: Two-way I/O. (line 99)
* PROCINFO array, and group membership: Group Functions. (line 6)
* PROCINFO array, and user and group ID numbers: Id Program. (line 15)
* PROCINFO array, testing the field splitting: Passwd Functions.
(line 154)
-* PROCINFO array, uses: Auto-set. (line 242)
+* PROCINFO array, uses: Auto-set. (line 265)
* PROCINFO, values of sorted_in: Controlling Scanning.
(line 26)
* profiling awk programs: Profiling. (line 6)
-* profiling awk programs, dynamically: Profiling. (line 179)
-* program identifiers: Auto-set. (line 148)
+* profiling awk programs, dynamically: Profiling. (line 178)
+* program identifiers: Auto-set. (line 171)
* program, definition of: Getting Started. (line 21)
* programming conventions, --non-decimal-data option: Nondecimal Data.
(line 35)
@@ -33830,7 +34208,7 @@ Index
* QuikTrim Awk: Other Versions. (line 139)
* quit debugger command: Miscellaneous Debugger Commands.
(line 99)
-* QUIT signal (MS-Windows): Profiling. (line 214)
+* QUIT signal (MS-Windows): Profiling. (line 213)
* quoting in gawk command lines: Long. (line 26)
* quoting in gawk command lines, tricks for: Quoting. (line 91)
* quoting, for small awk programs: Comments. (line 27)
@@ -33839,12 +34217,12 @@ Index
* Rakitzis, Byron: History Sorting. (line 25)
* Ramey, Chet <1>: General Data Types. (line 6)
* Ramey, Chet: Acknowledgments. (line 60)
-* rand: Numeric Functions. (line 33)
+* rand: Numeric Functions. (line 48)
* random numbers, Cliff: Cliff Random Function.
(line 6)
* random numbers, rand()/srand() functions: Numeric Functions.
- (line 33)
-* random numbers, seed of: Numeric Functions. (line 63)
+ (line 48)
+* random numbers, seed of: Numeric Functions. (line 78)
* range expressions (regexps): Bracket Expressions. (line 6)
* range patterns: Ranges. (line 6)
* range patterns, line continuation and: Ranges. (line 65)
@@ -33913,7 +34291,7 @@ Index
(line 60)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 70)
-* regular expressions, interval expressions and: Options. (line 281)
+* regular expressions, interval expressions and: Options. (line 279)
* regular expressions, leftmost longest match: Leftmost Longest.
(line 6)
* regular expressions, operators <1>: Regexp Operators. (line 6)
@@ -33930,6 +34308,7 @@ Index
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
* replace in string: String Functions. (line 409)
+* retrying input: Retrying Input. (line 6)
* return debugger command: Debugger Execution Control.
(line 54)
* return statement, user-defined functions: Return Statement. (line 6)
@@ -33953,7 +34332,7 @@ Index
* right shift: Bitwise Functions. (line 53)
* right shift, bitwise: Bitwise Functions. (line 32)
* Ritchie, Dennis: Basic Data Typing. (line 54)
-* RLENGTH variable: Auto-set. (line 252)
+* RLENGTH variable: Auto-set. (line 279)
* RLENGTH variable, match() function and: String Functions. (line 228)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 71)
@@ -33979,9 +34358,9 @@ Index
* RS variable: awk split records. (line 12)
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift: Bitwise Functions. (line 53)
-* RSTART variable: Auto-set. (line 258)
+* RSTART variable: Auto-set. (line 285)
* RSTART variable, match() function and: String Functions. (line 228)
-* RT variable <1>: Auto-set. (line 265)
+* RT variable <1>: Auto-set. (line 292)
* RT variable <2>: Multiple Line. (line 129)
* RT variable: awk split records. (line 125)
* Rubin, Paul <1>: Contributors. (line 15)
@@ -33994,14 +34373,14 @@ Index
(line 68)
* sample debugging session: Sample Debugging Session.
(line 6)
-* sandbox mode: Options. (line 288)
+* sandbox mode: Options. (line 286)
* save debugger options: Debugger Info. (line 85)
* scalar or array: Type Functions. (line 11)
* scalar values: Basic Data Typing. (line 13)
* scanning arrays: Scanning an Array. (line 6)
* scanning multidimensional arrays: Multiscanning. (line 11)
* Schorr, Andrew <1>: Contributors. (line 133)
-* Schorr, Andrew <2>: Auto-set. (line 297)
+* Schorr, Andrew <2>: Auto-set. (line 324)
* Schorr, Andrew: Acknowledgments. (line 60)
* Schreiber, Bert: Acknowledgments. (line 38)
* Schreiber, Rita: Acknowledgments. (line 38)
@@ -34020,7 +34399,7 @@ Index
* sed utility <1>: Glossary. (line 16)
* sed utility <2>: Simple Sed. (line 6)
* sed utility: Full Line Fields. (line 22)
-* seeding random number generator: Numeric Functions. (line 63)
+* seeding random number generator: Numeric Functions. (line 78)
* semicolon (;), AWKPATH variable and: PC Using. (line 10)
* semicolon (;), separating statements in actions <1>: Statements.
(line 10)
@@ -34081,14 +34460,14 @@ Index
* sidebar, A Constant's Base Does Not Affect Its Value: Nondecimal-numbers.
(line 64)
* sidebar, Backslash Before Regular Characters: Escape Sequences.
- (line 103)
+ (line 106)
* sidebar, Changing FS Does Not Affect the Fields: Full Line Fields.
(line 14)
-* sidebar, Changing NR and FNR: Auto-set. (line 312)
+* sidebar, Changing NR and FNR: Auto-set. (line 339)
* sidebar, Controlling Output Buffering with system(): I/O Functions.
(line 139)
* sidebar, Escape Sequences for Metacharacters: Escape Sequences.
- (line 134)
+ (line 137)
* sidebar, FS and IGNORECASE: Field Splitting Summary.
(line 38)
* sidebar, Interactive Versus Noninteractive Buffering: I/O Functions.
@@ -34110,19 +34489,19 @@ Index
(line 58)
* sidebar, Using close()'s Return Value: Close Files And Pipes.
(line 131)
-* SIGHUP signal, for dynamic profiling: Profiling. (line 211)
-* SIGINT signal (MS-Windows): Profiling. (line 214)
-* signals, HUP/SIGHUP, for profiling: Profiling. (line 211)
-* signals, INT/SIGINT (MS-Windows): Profiling. (line 214)
-* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 214)
-* signals, USR1/SIGUSR1, for profiling: Profiling. (line 188)
+* SIGHUP signal, for dynamic profiling: Profiling. (line 210)
+* SIGINT signal (MS-Windows): Profiling. (line 213)
+* signals, HUP/SIGHUP, for profiling: Profiling. (line 210)
+* signals, INT/SIGINT (MS-Windows): Profiling. (line 213)
+* signals, QUIT/SIGQUIT (MS-Windows): Profiling. (line 213)
+* signals, USR1/SIGUSR1, for profiling: Profiling. (line 187)
* signature program: Signature Program. (line 6)
-* SIGQUIT signal (MS-Windows): Profiling. (line 214)
-* SIGUSR1 signal, for dynamic profiling: Profiling. (line 188)
+* SIGQUIT signal (MS-Windows): Profiling. (line 213)
+* SIGUSR1 signal, for dynamic profiling: Profiling. (line 187)
* silent debugger command: Debugger Execution Control.
(line 10)
-* sin: Numeric Functions. (line 74)
-* sine: Numeric Functions. (line 74)
+* sin: Numeric Functions. (line 89)
+* sine: Numeric Functions. (line 89)
* single quote ('): One-shot. (line 15)
* single quote (') in gawk command lines: Long. (line 35)
* single quote ('), in shell commands: Quoting. (line 48)
@@ -34172,10 +34551,10 @@ Index
* sprintf() function, OFMT variable and: User-modified. (line 113)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
-* sqrt: Numeric Functions. (line 77)
+* sqrt: Numeric Functions. (line 92)
* square brackets ([]), regexp operator: Regexp Operators. (line 56)
-* square root: Numeric Functions. (line 77)
-* srand: Numeric Functions. (line 81)
+* square root: Numeric Functions. (line 92)
+* srand: Numeric Functions. (line 96)
* stack frame: Debugging Terms. (line 10)
* Stallman, Richard <1>: Glossary. (line 375)
* Stallman, Richard <2>: Contributors. (line 23)
@@ -34246,9 +34625,9 @@ Index
* substr: String Functions. (line 482)
* substring: String Functions. (line 482)
* Sumner, Andrew: Other Versions. (line 68)
-* supplementary groups of gawk process: Auto-set. (line 237)
+* supplementary groups of gawk process: Auto-set. (line 260)
* switch statement: Switch Statement. (line 6)
-* SYMTAB array: Auto-set. (line 269)
+* SYMTAB array: Auto-set. (line 296)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
* system: I/O Functions. (line 107)
@@ -34315,7 +34694,7 @@ Index
(line 37)
* troubleshooting, awk uses FS not IFS: Field Separators. (line 30)
* troubleshooting, backslash before nonspecial character: Escape Sequences.
- (line 105)
+ (line 108)
* troubleshooting, division: Arithmetic Ops. (line 44)
* troubleshooting, fatal errors, field widths, specifying: Constant Size.
(line 22)
@@ -34371,7 +34750,7 @@ Index
* uniq.awk program: Uniq Program. (line 65)
* Unix: Glossary. (line 753)
* Unix awk, backslashes in escape sequences: Escape Sequences.
- (line 117)
+ (line 120)
* Unix awk, close() function and: Close Files And Pipes.
(line 133)
* Unix awk, password files, field separators and: Command Line Field Separator.
@@ -34391,7 +34770,7 @@ Index
* user-modifiable variables: User-modified. (line 6)
* users, information about, printing: Id Program. (line 6)
* users, information about, retrieving: Passwd Functions. (line 16)
-* USR1 signal, for dynamic profiling: Profiling. (line 188)
+* USR1 signal, for dynamic profiling: Profiling. (line 187)
* values, numeric: Basic Data Typing. (line 13)
* values, string: Basic Data Typing. (line 13)
* variable assignments and input files: Other Arguments. (line 26)
@@ -34425,10 +34804,10 @@ Index
* variables, uninitialized, as array subscripts: Uninitialized Subscripts.
(line 6)
* variables, user-defined: Variables. (line 6)
-* version of gawk: Auto-set. (line 207)
-* version of gawk extension API: Auto-set. (line 232)
-* version of GNU MP library: Auto-set. (line 218)
-* version of GNU MPFR library: Auto-set. (line 214)
+* version of gawk: Auto-set. (line 230)
+* version of gawk extension API: Auto-set. (line 255)
+* version of GNU MP library: Auto-set. (line 241)
+* version of GNU MPFR library: Auto-set. (line 237)
* vertical bar (|): Regexp Operators. (line 70)
* vertical bar (|), | operator (I/O) <1>: Precedence. (line 65)
* vertical bar (|), | operator (I/O): Getline/Pipe. (line 9)
@@ -34465,7 +34844,7 @@ Index
* whitespace, as field separators: Default Field Splitting.
(line 6)
* whitespace, functions, calling: Calling Built-in. (line 10)
-* whitespace, newlines as: Options. (line 262)
+* whitespace, newlines as: Options. (line 260)
* Williams, Kent: Contributors. (line 34)
* Woehlke, Matthew: Contributors. (line 79)
* Woods, John: Contributors. (line 27)
@@ -34518,559 +34897,563 @@ Index

Tag Table:
Node: Top1204
-Node: Foreword342156
-Node: Foreword446600
-Node: Preface48131
-Ref: Preface-Footnote-151002
-Ref: Preface-Footnote-251109
-Ref: Preface-Footnote-351342
-Node: History51484
-Node: Names53835
-Ref: Names-Footnote-154929
-Node: This Manual55075
-Ref: This Manual-Footnote-161575
-Node: Conventions61675
-Node: Manual History64012
-Ref: Manual History-Footnote-167005
-Ref: Manual History-Footnote-267046
-Node: How To Contribute67120
-Node: Acknowledgments68249
-Node: Getting Started73115
-Node: Running gawk75554
-Node: One-shot76744
-Node: Read Terminal78008
-Node: Long80039
-Node: Executable Scripts81552
-Ref: Executable Scripts-Footnote-184341
-Node: Comments84444
-Node: Quoting86926
-Node: DOS Quoting92444
-Node: Sample Data Files93119
-Node: Very Simple95714
-Node: Two Rules100613
-Node: More Complex102499
-Node: Statements/Lines105361
-Ref: Statements/Lines-Footnote-1109816
-Node: Other Features110081
-Node: When111017
-Ref: When-Footnote-1112771
-Node: Intro Summary112836
-Node: Invoking Gawk113720
-Node: Command Line115234
-Node: Options116032
-Ref: Options-Footnote-1131954
-Ref: Options-Footnote-2132183
-Node: Other Arguments132208
-Node: Naming Standard Input135156
-Node: Environment Variables136249
-Node: AWKPATH Variable136807
-Ref: AWKPATH Variable-Footnote-1140104
-Ref: AWKPATH Variable-Footnote-2140149
-Node: AWKLIBPATH Variable140409
-Node: Other Environment Variables141552
-Node: Exit Status145310
-Node: Include Files145986
-Node: Loading Shared Libraries149575
-Node: Obsolete151002
-Node: Undocumented151694
-Node: Invoking Summary151961
-Node: Regexp153624
-Node: Regexp Usage155078
-Node: Escape Sequences157115
-Node: Regexp Operators163125
-Ref: Regexp Operators-Footnote-1170535
-Ref: Regexp Operators-Footnote-2170682
-Node: Bracket Expressions170780
-Ref: table-char-classes172795
-Node: Leftmost Longest175737
-Node: Computed Regexps177039
-Node: GNU Regexp Operators180468
-Node: Case-sensitivity184140
-Ref: Case-sensitivity-Footnote-1187025
-Ref: Case-sensitivity-Footnote-2187260
-Node: Regexp Summary187368
-Node: Reading Files188835
-Node: Records190928
-Node: awk split records191661
-Node: gawk split records196590
-Ref: gawk split records-Footnote-1201129
-Node: Fields201166
-Ref: Fields-Footnote-1203944
-Node: Nonconstant Fields204030
-Ref: Nonconstant Fields-Footnote-1206268
-Node: Changing Fields206471
-Node: Field Separators212402
-Node: Default Field Splitting215106
-Node: Regexp Field Splitting216223
-Node: Single Character Fields219573
-Node: Command Line Field Separator220632
-Node: Full Line Fields223849
-Ref: Full Line Fields-Footnote-1225370
-Ref: Full Line Fields-Footnote-2225416
-Node: Field Splitting Summary225517
-Node: Constant Size227591
-Node: Splitting By Content232170
-Ref: Splitting By Content-Footnote-1236135
-Node: Multiple Line236298
-Ref: Multiple Line-Footnote-1242179
-Node: Getline242358
-Node: Plain Getline244565
-Node: Getline/Variable247205
-Node: Getline/File248354
-Node: Getline/Variable/File249739
-Ref: Getline/Variable/File-Footnote-1251342
-Node: Getline/Pipe251429
-Node: Getline/Variable/Pipe254107
-Node: Getline/Coprocess255238
-Node: Getline/Variable/Coprocess256502
-Node: Getline Notes257241
-Node: Getline Summary260035
-Ref: table-getline-variants260447
-Node: Read Timeout261276
-Ref: Read Timeout-Footnote-1265113
-Node: Command-line directories265171
-Node: Input Summary266076
-Node: Input Exercises269461
-Node: Printing270189
-Node: Print271966
-Node: Print Examples273423
-Node: Output Separators276202
-Node: OFMT278220
-Node: Printf279575
-Node: Basic Printf280360
-Node: Control Letters281932
-Node: Format Modifiers285917
-Node: Printf Examples291923
-Node: Redirection294409
-Node: Special FD301247
-Ref: Special FD-Footnote-1304413
-Node: Special Files304487
-Node: Other Inherited Files305104
-Node: Special Network306104
-Node: Special Caveats306966
-Node: Close Files And Pipes307915
-Ref: Close Files And Pipes-Footnote-1315106
-Ref: Close Files And Pipes-Footnote-2315254
-Node: Output Summary315404
-Node: Output Exercises316402
-Node: Expressions317082
-Node: Values318271
-Node: Constants318948
-Node: Scalar Constants319639
-Ref: Scalar Constants-Footnote-1320501
-Node: Nondecimal-numbers320751
-Node: Regexp Constants323761
-Node: Using Constant Regexps324287
-Node: Variables327450
-Node: Using Variables328107
-Node: Assignment Options330018
-Node: Conversion331893
-Node: Strings And Numbers332417
-Ref: Strings And Numbers-Footnote-1335482
-Node: Locale influences conversions335591
-Ref: table-locale-affects338337
-Node: All Operators338929
-Node: Arithmetic Ops339558
-Node: Concatenation342063
-Ref: Concatenation-Footnote-1344882
-Node: Assignment Ops344989
-Ref: table-assign-ops349968
-Node: Increment Ops351278
-Node: Truth Values and Conditions354709
-Node: Truth Values355792
-Node: Typing and Comparison356841
-Node: Variable Typing357657
-Node: Comparison Operators361324
-Ref: table-relational-ops361734
-Node: POSIX String Comparison365229
-Ref: POSIX String Comparison-Footnote-1366301
-Node: Boolean Ops366440
-Ref: Boolean Ops-Footnote-1370918
-Node: Conditional Exp371009
-Node: Function Calls372747
-Node: Precedence376627
-Node: Locales380287
-Node: Expressions Summary381919
-Node: Patterns and Actions384490
-Node: Pattern Overview385610
-Node: Regexp Patterns387289
-Node: Expression Patterns387832
-Node: Ranges391612
-Node: BEGIN/END394719
-Node: Using BEGIN/END395480
-Ref: Using BEGIN/END-Footnote-1398216
-Node: I/O And BEGIN/END398322
-Node: BEGINFILE/ENDFILE400637
-Node: Empty403543
-Node: Using Shell Variables403860
-Node: Action Overview406133
-Node: Statements408459
-Node: If Statement410307
-Node: While Statement411802
-Node: Do Statement413830
-Node: For Statement414978
-Node: Switch Statement418136
-Node: Break Statement420518
-Node: Continue Statement422611
-Node: Next Statement424438
-Node: Nextfile Statement426819
-Node: Exit Statement429447
-Node: Built-in Variables431858
-Node: User-modified432991
-Ref: User-modified-Footnote-1440625
-Node: Auto-set440687
-Ref: Auto-set-Footnote-1453739
-Ref: Auto-set-Footnote-2453944
-Node: ARGC and ARGV454000
-Node: Pattern Action Summary458218
-Node: Arrays460651
-Node: Array Basics461980
-Node: Array Intro462824
-Ref: figure-array-elements464761
-Ref: Array Intro-Footnote-1467384
-Node: Reference to Elements467512
-Node: Assigning Elements469974
-Node: Array Example470465
-Node: Scanning an Array472224
-Node: Controlling Scanning475247
-Ref: Controlling Scanning-Footnote-1480641
-Node: Numeric Array Subscripts480957
-Node: Uninitialized Subscripts483142
-Node: Delete484759
-Ref: Delete-Footnote-1487508
-Node: Multidimensional487565
-Node: Multiscanning490662
-Node: Arrays of Arrays492251
-Node: Arrays Summary497005
-Node: Functions499096
-Node: Built-in500135
-Node: Calling Built-in501213
-Node: Numeric Functions503208
-Ref: Numeric Functions-Footnote-1507236
-Ref: Numeric Functions-Footnote-2507593
-Ref: Numeric Functions-Footnote-3507641
-Node: String Functions507913
-Ref: String Functions-Footnote-1531414
-Ref: String Functions-Footnote-2531543
-Ref: String Functions-Footnote-3531791
-Node: Gory Details531878
-Ref: table-sub-escapes533659
-Ref: table-sub-proposed535174
-Ref: table-posix-sub536536
-Ref: table-gensub-escapes538073
-Ref: Gory Details-Footnote-1538906
-Node: I/O Functions539057
-Ref: I/O Functions-Footnote-1546293
-Node: Time Functions546440
-Ref: Time Functions-Footnote-1556949
-Ref: Time Functions-Footnote-2557017
-Ref: Time Functions-Footnote-3557175
-Ref: Time Functions-Footnote-4557286
-Ref: Time Functions-Footnote-5557398
-Ref: Time Functions-Footnote-6557625
-Node: Bitwise Functions557891
-Ref: table-bitwise-ops558453
-Ref: Bitwise Functions-Footnote-1562781
-Node: Type Functions562953
-Node: I18N Functions564105
-Node: User-defined565752
-Node: Definition Syntax566557
-Ref: Definition Syntax-Footnote-1572216
-Node: Function Example572287
-Ref: Function Example-Footnote-1575208
-Node: Function Caveats575230
-Node: Calling A Function575748
-Node: Variable Scope576706
-Node: Pass By Value/Reference579699
-Node: Return Statement583196
-Node: Dynamic Typing586175
-Node: Indirect Calls587104
-Ref: Indirect Calls-Footnote-1597347
-Node: Functions Summary597475
-Node: Library Functions600177
-Ref: Library Functions-Footnote-1603785
-Ref: Library Functions-Footnote-2603928
-Node: Library Names604099
-Ref: Library Names-Footnote-1607557
-Ref: Library Names-Footnote-2607780
-Node: General Functions607866
-Node: Strtonum Function608969
-Node: Assert Function611991
-Node: Round Function615315
-Node: Cliff Random Function616856
-Node: Ordinal Functions617872
-Ref: Ordinal Functions-Footnote-1620935
-Ref: Ordinal Functions-Footnote-2621187
-Node: Join Function621398
-Ref: Join Function-Footnote-1623168
-Node: Getlocaltime Function623368
-Node: Readfile Function627112
-Node: Shell Quoting629084
-Node: Data File Management630485
-Node: Filetrans Function631117
-Node: Rewind Function635213
-Node: File Checking636599
-Ref: File Checking-Footnote-1637932
-Node: Empty Files638133
-Node: Ignoring Assigns640112
-Node: Getopt Function641662
-Ref: Getopt Function-Footnote-1653126
-Node: Passwd Functions653326
-Ref: Passwd Functions-Footnote-1662166
-Node: Group Functions662254
-Ref: Group Functions-Footnote-1670151
-Node: Walking Arrays670356
-Node: Library Functions Summary673362
-Node: Library Exercises674764
-Node: Sample Programs676044
-Node: Running Examples676814
-Node: Clones677542
-Node: Cut Program678766
-Node: Egrep Program688486
-Ref: Egrep Program-Footnote-1695989
-Node: Id Program696099
-Node: Split Program699775
-Ref: Split Program-Footnote-1703229
-Node: Tee Program703357
-Node: Uniq Program706146
-Node: Wc Program713565
-Ref: Wc Program-Footnote-1717815
-Node: Miscellaneous Programs717909
-Node: Dupword Program719122
-Node: Alarm Program721153
-Node: Translate Program725958
-Ref: Translate Program-Footnote-1730521
-Node: Labels Program730791
-Ref: Labels Program-Footnote-1734142
-Node: Word Sorting734226
-Node: History Sorting738296
-Node: Extract Program740131
-Node: Simple Sed747655
-Node: Igawk Program750725
-Ref: Igawk Program-Footnote-1765051
-Ref: Igawk Program-Footnote-2765252
-Ref: Igawk Program-Footnote-3765374
-Node: Anagram Program765489
-Node: Signature Program768550
-Node: Programs Summary769797
-Node: Programs Exercises771018
-Ref: Programs Exercises-Footnote-1775149
-Node: Advanced Features775240
-Node: Nondecimal Data777222
-Node: Array Sorting778812
-Node: Controlling Array Traversal779512
-Ref: Controlling Array Traversal-Footnote-1787878
-Node: Array Sorting Functions787996
-Ref: Array Sorting Functions-Footnote-1791882
-Node: Two-way I/O792078
-Ref: Two-way I/O-Footnote-1797023
-Ref: Two-way I/O-Footnote-2797209
-Node: TCP/IP Networking797291
-Node: Profiling800163
-Node: Advanced Features Summary807704
-Node: Internationalization809637
-Node: I18N and L10N811117
-Node: Explaining gettext811803
-Ref: Explaining gettext-Footnote-1816828
-Ref: Explaining gettext-Footnote-2817012
-Node: Programmer i18n817177
-Ref: Programmer i18n-Footnote-1822053
-Node: Translator i18n822102
-Node: String Extraction822896
-Ref: String Extraction-Footnote-1824027
-Node: Printf Ordering824113
-Ref: Printf Ordering-Footnote-1826899
-Node: I18N Portability826963
-Ref: I18N Portability-Footnote-1829419
-Node: I18N Example829482
-Ref: I18N Example-Footnote-1832285
-Node: Gawk I18N832357
-Node: I18N Summary833001
-Node: Debugger834341
-Node: Debugging835363
-Node: Debugging Concepts835804
-Node: Debugging Terms837614
-Node: Awk Debugging840186
-Node: Sample Debugging Session841092
-Node: Debugger Invocation841626
-Node: Finding The Bug843011
-Node: List of Debugger Commands849490
-Node: Breakpoint Control850822
-Node: Debugger Execution Control854499
-Node: Viewing And Changing Data857858
-Node: Execution Stack861234
-Node: Debugger Info862869
-Node: Miscellaneous Debugger Commands866914
-Node: Readline Support871915
-Node: Limitations872809
-Node: Debugging Summary874924
-Node: Arbitrary Precision Arithmetic876098
-Node: Computer Arithmetic877514
-Ref: table-numeric-ranges881091
-Ref: Computer Arithmetic-Footnote-1881615
-Node: Math Definitions881672
-Ref: table-ieee-formats884967
-Ref: Math Definitions-Footnote-1885571
-Node: MPFR features885676
-Node: FP Math Caution887347
-Ref: FP Math Caution-Footnote-1888397
-Node: Inexactness of computations888766
-Node: Inexact representation889725
-Node: Comparing FP Values891083
-Node: Errors accumulate892165
-Node: Getting Accuracy893597
-Node: Try To Round896301
-Node: Setting precision897200
-Ref: table-predefined-precision-strings897884
-Node: Setting the rounding mode899713
-Ref: table-gawk-rounding-modes900077
-Ref: Setting the rounding mode-Footnote-1903529
-Node: Arbitrary Precision Integers903708
-Ref: Arbitrary Precision Integers-Footnote-1906692
-Node: POSIX Floating Point Problems906841
-Ref: POSIX Floating Point Problems-Footnote-1910720
-Node: Floating point summary910758
-Node: Dynamic Extensions912945
-Node: Extension Intro914497
-Node: Plugin License915762
-Node: Extension Mechanism Outline916559
-Ref: figure-load-extension916987
-Ref: figure-register-new-function918467
-Ref: figure-call-new-function919471
-Node: Extension API Description921458
-Node: Extension API Functions Introduction922908
-Node: General Data Types927729
-Ref: General Data Types-Footnote-1933629
-Node: Memory Allocation Functions933928
-Ref: Memory Allocation Functions-Footnote-1936767
-Node: Constructor Functions936866
-Node: Registration Functions938605
-Node: Extension Functions939290
-Node: Exit Callback Functions941587
-Node: Extension Version String942835
-Node: Input Parsers943498
-Node: Output Wrappers953373
-Node: Two-way processors957886
-Node: Printing Messages960149
-Ref: Printing Messages-Footnote-1961225
-Node: Updating `ERRNO'961377
-Node: Requesting Values962117
-Ref: table-value-types-returned962844
-Node: Accessing Parameters963801
-Node: Symbol Table Access965035
-Node: Symbol table by name965549
-Node: Symbol table by cookie967569
-Ref: Symbol table by cookie-Footnote-1971714
-Node: Cached values971777
-Ref: Cached values-Footnote-1975273
-Node: Array Manipulation975364
-Ref: Array Manipulation-Footnote-1976462
-Node: Array Data Types976499
-Ref: Array Data Types-Footnote-1979154
-Node: Array Functions979246
-Node: Flattening Arrays983105
-Node: Creating Arrays990007
-Node: Extension API Variables994778
-Node: Extension Versioning995414
-Node: Extension API Informational Variables997305
-Node: Extension API Boilerplate998370
-Node: Finding Extensions1002179
-Node: Extension Example1002739
-Node: Internal File Description1003511
-Node: Internal File Ops1007578
-Ref: Internal File Ops-Footnote-11019329
-Node: Using Internal File Ops1019469
-Ref: Using Internal File Ops-Footnote-11021852
-Node: Extension Samples1022125
-Node: Extension Sample File Functions1023653
-Node: Extension Sample Fnmatch1031334
-Node: Extension Sample Fork1032822
-Node: Extension Sample Inplace1034037
-Node: Extension Sample Ord1036123
-Node: Extension Sample Readdir1036959
-Ref: table-readdir-file-types1037836
-Node: Extension Sample Revout1038647
-Node: Extension Sample Rev2way1039236
-Node: Extension Sample Read write array1039976
-Node: Extension Sample Readfile1041916
-Node: Extension Sample Time1043011
-Node: Extension Sample API Tests1044359
-Node: gawkextlib1044850
-Node: Extension summary1047274
-Node: Extension Exercises1050963
-Node: Language History1052459
-Node: V7/SVR3.11054115
-Node: SVR41056268
-Node: POSIX1057702
-Node: BTL1059083
-Node: POSIX/GNU1059814
-Node: Feature History1065335
-Node: Common Extensions1078626
-Node: Ranges and Locales1079998
-Ref: Ranges and Locales-Footnote-11084617
-Ref: Ranges and Locales-Footnote-21084644
-Ref: Ranges and Locales-Footnote-31084879
-Node: Contributors1085100
-Node: History summary1090640
-Node: Installation1092019
-Node: Gawk Distribution1092965
-Node: Getting1093449
-Node: Extracting1094272
-Node: Distribution contents1095909
-Node: Unix Installation1101663
-Node: Quick Installation1102280
-Node: Additional Configuration Options1104704
-Node: Configuration Philosophy1106507
-Node: Non-Unix Installation1108876
-Node: PC Installation1109334
-Node: PC Binary Installation1110654
-Node: PC Compiling1112502
-Ref: PC Compiling-Footnote-11115523
-Node: PC Testing1115632
-Node: PC Using1116808
-Node: Cygwin1120923
-Node: MSYS1121693
-Node: VMS Installation1122194
-Node: VMS Compilation1122986
-Ref: VMS Compilation-Footnote-11124215
-Node: VMS Dynamic Extensions1124273
-Node: VMS Installation Details1125957
-Node: VMS Running1128208
-Node: VMS GNV1131048
-Node: VMS Old Gawk1131783
-Node: Bugs1132253
-Node: Other Versions1136142
-Node: Installation summary1142576
-Node: Notes1143635
-Node: Compatibility Mode1144500
-Node: Additions1145282
-Node: Accessing The Source1146207
-Node: Adding Code1147642
-Node: New Ports1153799
-Node: Derived Files1158281
-Ref: Derived Files-Footnote-11163756
-Ref: Derived Files-Footnote-21163790
-Ref: Derived Files-Footnote-31164386
-Node: Future Extensions1164500
-Node: Implementation Limitations1165106
-Node: Extension Design1166354
-Node: Old Extension Problems1167508
-Ref: Old Extension Problems-Footnote-11169025
-Node: Extension New Mechanism Goals1169082
-Ref: Extension New Mechanism Goals-Footnote-11172442
-Node: Extension Other Design Decisions1172631
-Node: Extension Future Growth1174739
-Node: Old Extension Mechanism1175575
-Node: Notes summary1177337
-Node: Basic Concepts1178523
-Node: Basic High Level1179204
-Ref: figure-general-flow1179476
-Ref: figure-process-flow1180075
-Ref: Basic High Level-Footnote-11183304
-Node: Basic Data Typing1183489
-Node: Glossary1186817
-Node: Copying1218746
-Node: GNU Free Documentation License1256302
-Node: Index1281438
+Node: Foreword342451
+Node: Foreword446895
+Node: Preface48426
+Ref: Preface-Footnote-151297
+Ref: Preface-Footnote-251404
+Ref: Preface-Footnote-351637
+Node: History51779
+Node: Names54130
+Ref: Names-Footnote-155224
+Node: This Manual55370
+Ref: This Manual-Footnote-161870
+Node: Conventions61970
+Node: Manual History64307
+Ref: Manual History-Footnote-167300
+Ref: Manual History-Footnote-267341
+Node: How To Contribute67415
+Node: Acknowledgments68544
+Node: Getting Started73410
+Node: Running gawk75849
+Node: One-shot77039
+Node: Read Terminal78303
+Node: Long80334
+Node: Executable Scripts81847
+Ref: Executable Scripts-Footnote-184636
+Node: Comments84739
+Node: Quoting87221
+Node: DOS Quoting92739
+Node: Sample Data Files93414
+Node: Very Simple96009
+Node: Two Rules100908
+Node: More Complex102794
+Node: Statements/Lines105656
+Ref: Statements/Lines-Footnote-1110111
+Node: Other Features110376
+Node: When111312
+Ref: When-Footnote-1113066
+Node: Intro Summary113131
+Node: Invoking Gawk114015
+Node: Command Line115529
+Node: Options116327
+Ref: Options-Footnote-1132122
+Ref: Options-Footnote-2132351
+Node: Other Arguments132376
+Node: Naming Standard Input135324
+Node: Environment Variables136417
+Node: AWKPATH Variable136975
+Ref: AWKPATH Variable-Footnote-1140382
+Ref: AWKPATH Variable-Footnote-2140427
+Node: AWKLIBPATH Variable140687
+Node: Other Environment Variables141943
+Node: Exit Status145574
+Node: Include Files146250
+Node: Loading Shared Libraries149839
+Node: Obsolete151266
+Node: Undocumented151958
+Node: Invoking Summary152225
+Node: Regexp153888
+Node: Regexp Usage155342
+Node: Escape Sequences157379
+Node: Regexp Operators163608
+Ref: Regexp Operators-Footnote-1171018
+Ref: Regexp Operators-Footnote-2171165
+Node: Bracket Expressions171263
+Ref: table-char-classes173278
+Node: Leftmost Longest176220
+Node: Computed Regexps177522
+Node: GNU Regexp Operators180951
+Node: Case-sensitivity184623
+Ref: Case-sensitivity-Footnote-1187508
+Ref: Case-sensitivity-Footnote-2187743
+Node: Regexp Summary187851
+Node: Reading Files189318
+Node: Records191480
+Node: awk split records192213
+Node: gawk split records197142
+Ref: gawk split records-Footnote-1201681
+Node: Fields201718
+Ref: Fields-Footnote-1204496
+Node: Nonconstant Fields204582
+Ref: Nonconstant Fields-Footnote-1206820
+Node: Changing Fields207023
+Node: Field Separators212954
+Node: Default Field Splitting215658
+Node: Regexp Field Splitting216775
+Node: Single Character Fields220125
+Node: Command Line Field Separator221184
+Node: Full Line Fields224401
+Ref: Full Line Fields-Footnote-1225922
+Ref: Full Line Fields-Footnote-2225968
+Node: Field Splitting Summary226069
+Node: Constant Size228143
+Node: Splitting By Content232722
+Ref: Splitting By Content-Footnote-1236687
+Node: Multiple Line236850
+Ref: Multiple Line-Footnote-1242731
+Node: Getline242910
+Node: Plain Getline245380
+Node: Getline/Variable248020
+Node: Getline/File249169
+Node: Getline/Variable/File250554
+Ref: Getline/Variable/File-Footnote-1252157
+Node: Getline/Pipe252244
+Node: Getline/Variable/Pipe254922
+Node: Getline/Coprocess256053
+Node: Getline/Variable/Coprocess257317
+Node: Getline Notes258056
+Node: Getline Summary260850
+Ref: table-getline-variants261262
+Node: Read Timeout262091
+Ref: Read Timeout-Footnote-1265994
+Node: Retrying Input266052
+Node: Command-line directories267251
+Node: Input Summary268158
+Node: Input Exercises271543
+Node: Printing272271
+Node: Print274106
+Node: Print Examples275563
+Node: Output Separators278342
+Node: OFMT280360
+Node: Printf281715
+Node: Basic Printf282500
+Node: Control Letters284072
+Node: Format Modifiers288057
+Node: Printf Examples294063
+Node: Redirection296549
+Node: Special FD303387
+Ref: Special FD-Footnote-1306553
+Node: Special Files306627
+Node: Other Inherited Files307244
+Node: Special Network308244
+Node: Special Caveats309106
+Node: Close Files And Pipes310055
+Ref: Close Files And Pipes-Footnote-1317240
+Ref: Close Files And Pipes-Footnote-2317388
+Node: Nonfatal317538
+Node: Output Summary319863
+Node: Output Exercises321084
+Node: Expressions321764
+Node: Values322953
+Node: Constants323630
+Node: Scalar Constants324321
+Ref: Scalar Constants-Footnote-1325183
+Node: Nondecimal-numbers325433
+Node: Regexp Constants328443
+Node: Using Constant Regexps328969
+Node: Variables332132
+Node: Using Variables332789
+Node: Assignment Options334700
+Node: Conversion336575
+Node: Strings And Numbers337099
+Ref: Strings And Numbers-Footnote-1340164
+Node: Locale influences conversions340273
+Ref: table-locale-affects343019
+Node: All Operators343611
+Node: Arithmetic Ops344240
+Node: Concatenation346745
+Ref: Concatenation-Footnote-1349564
+Node: Assignment Ops349671
+Ref: table-assign-ops354650
+Node: Increment Ops355960
+Node: Truth Values and Conditions359391
+Node: Truth Values360474
+Node: Typing and Comparison361523
+Node: Variable Typing362339
+Node: Comparison Operators366006
+Ref: table-relational-ops366416
+Node: POSIX String Comparison369911
+Ref: POSIX String Comparison-Footnote-1370983
+Node: Boolean Ops371122
+Ref: Boolean Ops-Footnote-1375600
+Node: Conditional Exp375691
+Node: Function Calls377429
+Node: Precedence381309
+Node: Locales384969
+Node: Expressions Summary386601
+Node: Patterns and Actions389172
+Node: Pattern Overview390292
+Node: Regexp Patterns391971
+Node: Expression Patterns392514
+Node: Ranges396294
+Node: BEGIN/END399401
+Node: Using BEGIN/END400162
+Ref: Using BEGIN/END-Footnote-1402898
+Node: I/O And BEGIN/END403004
+Node: BEGINFILE/ENDFILE405319
+Node: Empty408225
+Node: Using Shell Variables408542
+Node: Action Overview410815
+Node: Statements413141
+Node: If Statement414989
+Node: While Statement416484
+Node: Do Statement418512
+Node: For Statement419660
+Node: Switch Statement422818
+Node: Break Statement425200
+Node: Continue Statement427293
+Node: Next Statement429120
+Node: Nextfile Statement431501
+Node: Exit Statement434129
+Node: Built-in Variables436540
+Node: User-modified437673
+Ref: User-modified-Footnote-1445307
+Node: Auto-set445369
+Ref: Auto-set-Footnote-1459601
+Ref: Auto-set-Footnote-2459806
+Node: ARGC and ARGV459862
+Node: Pattern Action Summary464080
+Node: Arrays466513
+Node: Array Basics467842
+Node: Array Intro468686
+Ref: figure-array-elements470623
+Ref: Array Intro-Footnote-1473246
+Node: Reference to Elements473374
+Node: Assigning Elements475836
+Node: Array Example476327
+Node: Scanning an Array478086
+Node: Controlling Scanning481109
+Ref: Controlling Scanning-Footnote-1486503
+Node: Numeric Array Subscripts486819
+Node: Uninitialized Subscripts489004
+Node: Delete490621
+Ref: Delete-Footnote-1493370
+Node: Multidimensional493427
+Node: Multiscanning496524
+Node: Arrays of Arrays498113
+Node: Arrays Summary502867
+Node: Functions504958
+Node: Built-in505997
+Node: Calling Built-in507075
+Node: Numeric Functions509070
+Ref: Numeric Functions-Footnote-1513903
+Ref: Numeric Functions-Footnote-2514260
+Ref: Numeric Functions-Footnote-3514308
+Node: String Functions514580
+Ref: String Functions-Footnote-1538081
+Ref: String Functions-Footnote-2538210
+Ref: String Functions-Footnote-3538458
+Node: Gory Details538545
+Ref: table-sub-escapes540326
+Ref: table-sub-proposed541841
+Ref: table-posix-sub543203
+Ref: table-gensub-escapes544740
+Ref: Gory Details-Footnote-1545573
+Node: I/O Functions545724
+Ref: I/O Functions-Footnote-1552960
+Node: Time Functions553107
+Ref: Time Functions-Footnote-1563616
+Ref: Time Functions-Footnote-2563684
+Ref: Time Functions-Footnote-3563842
+Ref: Time Functions-Footnote-4563953
+Ref: Time Functions-Footnote-5564065
+Ref: Time Functions-Footnote-6564292
+Node: Bitwise Functions564558
+Ref: table-bitwise-ops565120
+Ref: Bitwise Functions-Footnote-1569448
+Node: Type Functions569620
+Node: I18N Functions570772
+Node: User-defined572419
+Node: Definition Syntax573224
+Ref: Definition Syntax-Footnote-1578883
+Node: Function Example578954
+Ref: Function Example-Footnote-1581875
+Node: Function Caveats581897
+Node: Calling A Function582415
+Node: Variable Scope583373
+Node: Pass By Value/Reference586366
+Node: Return Statement589863
+Node: Dynamic Typing592842
+Node: Indirect Calls593771
+Ref: Indirect Calls-Footnote-1604014
+Node: Functions Summary604142
+Node: Library Functions606844
+Ref: Library Functions-Footnote-1610452
+Ref: Library Functions-Footnote-2610595
+Node: Library Names610766
+Ref: Library Names-Footnote-1614224
+Ref: Library Names-Footnote-2614447
+Node: General Functions614533
+Node: Strtonum Function615636
+Node: Assert Function618658
+Node: Round Function621982
+Node: Cliff Random Function623523
+Node: Ordinal Functions624539
+Ref: Ordinal Functions-Footnote-1627602
+Ref: Ordinal Functions-Footnote-2627854
+Node: Join Function628065
+Ref: Join Function-Footnote-1629835
+Node: Getlocaltime Function630035
+Node: Readfile Function633779
+Node: Shell Quoting635751
+Node: Data File Management637152
+Node: Filetrans Function637784
+Node: Rewind Function641880
+Node: File Checking643266
+Ref: File Checking-Footnote-1644599
+Node: Empty Files644800
+Node: Ignoring Assigns646779
+Node: Getopt Function648329
+Ref: Getopt Function-Footnote-1659793
+Node: Passwd Functions659993
+Ref: Passwd Functions-Footnote-1668833
+Node: Group Functions668921
+Ref: Group Functions-Footnote-1676818
+Node: Walking Arrays677023
+Node: Library Functions Summary680029
+Node: Library Exercises681431
+Node: Sample Programs682711
+Node: Running Examples683481
+Node: Clones684209
+Node: Cut Program685433
+Node: Egrep Program695153
+Ref: Egrep Program-Footnote-1702656
+Node: Id Program702766
+Node: Split Program706442
+Ref: Split Program-Footnote-1709896
+Node: Tee Program710024
+Node: Uniq Program712813
+Node: Wc Program720232
+Ref: Wc Program-Footnote-1724482
+Node: Miscellaneous Programs724576
+Node: Dupword Program725789
+Node: Alarm Program727820
+Node: Translate Program732625
+Ref: Translate Program-Footnote-1737188
+Node: Labels Program737458
+Ref: Labels Program-Footnote-1740809
+Node: Word Sorting740893
+Node: History Sorting744963
+Node: Extract Program746798
+Node: Simple Sed754322
+Node: Igawk Program757392
+Ref: Igawk Program-Footnote-1771718
+Ref: Igawk Program-Footnote-2771919
+Ref: Igawk Program-Footnote-3772041
+Node: Anagram Program772156
+Node: Signature Program775217
+Node: Programs Summary776464
+Node: Programs Exercises777685
+Ref: Programs Exercises-Footnote-1781816
+Node: Advanced Features781907
+Node: Nondecimal Data783889
+Node: Array Sorting785479
+Node: Controlling Array Traversal786179
+Ref: Controlling Array Traversal-Footnote-1794545
+Node: Array Sorting Functions794663
+Ref: Array Sorting Functions-Footnote-1798549
+Node: Two-way I/O798745
+Ref: Two-way I/O-Footnote-1803690
+Ref: Two-way I/O-Footnote-2803876
+Node: TCP/IP Networking803958
+Node: Profiling806830
+Node: Advanced Features Summary815101
+Node: Internationalization817034
+Node: I18N and L10N818514
+Node: Explaining gettext819200
+Ref: Explaining gettext-Footnote-1824225
+Ref: Explaining gettext-Footnote-2824409
+Node: Programmer i18n824574
+Ref: Programmer i18n-Footnote-1829450
+Node: Translator i18n829499
+Node: String Extraction830293
+Ref: String Extraction-Footnote-1831424
+Node: Printf Ordering831510
+Ref: Printf Ordering-Footnote-1834296
+Node: I18N Portability834360
+Ref: I18N Portability-Footnote-1836816
+Node: I18N Example836879
+Ref: I18N Example-Footnote-1839682
+Node: Gawk I18N839754
+Node: I18N Summary840398
+Node: Debugger841738
+Node: Debugging842760
+Node: Debugging Concepts843201
+Node: Debugging Terms845011
+Node: Awk Debugging847583
+Node: Sample Debugging Session848489
+Node: Debugger Invocation849023
+Node: Finding The Bug850408
+Node: List of Debugger Commands856887
+Node: Breakpoint Control858219
+Node: Debugger Execution Control861896
+Node: Viewing And Changing Data865255
+Node: Execution Stack868631
+Node: Debugger Info870266
+Node: Miscellaneous Debugger Commands874311
+Node: Readline Support879312
+Node: Limitations880206
+Node: Debugging Summary882321
+Node: Arbitrary Precision Arithmetic883495
+Node: Computer Arithmetic884911
+Ref: table-numeric-ranges888488
+Ref: Computer Arithmetic-Footnote-1889012
+Node: Math Definitions889069
+Ref: table-ieee-formats892364
+Ref: Math Definitions-Footnote-1892968
+Node: MPFR features893073
+Node: FP Math Caution894744
+Ref: FP Math Caution-Footnote-1895794
+Node: Inexactness of computations896163
+Node: Inexact representation897122
+Node: Comparing FP Values898480
+Node: Errors accumulate899562
+Node: Getting Accuracy900994
+Node: Try To Round903698
+Node: Setting precision904597
+Ref: table-predefined-precision-strings905281
+Node: Setting the rounding mode907110
+Ref: table-gawk-rounding-modes907474
+Ref: Setting the rounding mode-Footnote-1910926
+Node: Arbitrary Precision Integers911105
+Ref: Arbitrary Precision Integers-Footnote-1916021
+Node: POSIX Floating Point Problems916170
+Ref: POSIX Floating Point Problems-Footnote-1920049
+Node: Floating point summary920087
+Node: Dynamic Extensions922274
+Node: Extension Intro923826
+Node: Plugin License925091
+Node: Extension Mechanism Outline925888
+Ref: figure-load-extension926316
+Ref: figure-register-new-function927796
+Ref: figure-call-new-function928800
+Node: Extension API Description930787
+Node: Extension API Functions Introduction932321
+Node: General Data Types937190
+Ref: General Data Types-Footnote-1943090
+Node: Memory Allocation Functions943389
+Ref: Memory Allocation Functions-Footnote-1946228
+Node: Constructor Functions946327
+Node: Registration Functions948066
+Node: Extension Functions948751
+Node: Exit Callback Functions951048
+Node: Extension Version String952296
+Node: Input Parsers952959
+Node: Output Wrappers962834
+Node: Two-way processors967347
+Node: Printing Messages969610
+Ref: Printing Messages-Footnote-1970686
+Node: Updating `ERRNO'970838
+Node: Requesting Values971578
+Ref: table-value-types-returned972305
+Node: Accessing Parameters973262
+Node: Symbol Table Access974496
+Node: Symbol table by name975010
+Node: Symbol table by cookie977030
+Ref: Symbol table by cookie-Footnote-1981175
+Node: Cached values981238
+Ref: Cached values-Footnote-1984734
+Node: Array Manipulation984825
+Ref: Array Manipulation-Footnote-1985915
+Node: Array Data Types985952
+Ref: Array Data Types-Footnote-1988607
+Node: Array Functions988699
+Node: Flattening Arrays992558
+Node: Creating Arrays999460
+Node: Redirection API1004231
+Node: Extension API Variables1007056
+Node: Extension Versioning1007689
+Node: Extension API Informational Variables1009580
+Node: Extension API Boilerplate1010645
+Node: Finding Extensions1014454
+Node: Extension Example1015014
+Node: Internal File Description1015786
+Node: Internal File Ops1019853
+Ref: Internal File Ops-Footnote-11031604
+Node: Using Internal File Ops1031744
+Ref: Using Internal File Ops-Footnote-11034127
+Node: Extension Samples1034400
+Node: Extension Sample File Functions1035928
+Node: Extension Sample Fnmatch1043609
+Node: Extension Sample Fork1045097
+Node: Extension Sample Inplace1046312
+Node: Extension Sample Ord1048398
+Node: Extension Sample Readdir1049234
+Ref: table-readdir-file-types1050111
+Node: Extension Sample Revout1050922
+Node: Extension Sample Rev2way1051511
+Node: Extension Sample Read write array1052251
+Node: Extension Sample Readfile1054191
+Node: Extension Sample Time1055286
+Node: Extension Sample API Tests1056634
+Node: gawkextlib1057125
+Node: Extension summary1059572
+Node: Extension Exercises1063261
+Node: Language History1064757
+Node: V7/SVR3.11066413
+Node: SVR41068566
+Node: POSIX1070000
+Node: BTL1071381
+Node: POSIX/GNU1072112
+Node: Feature History1077951
+Node: Common Extensions1091941
+Node: Ranges and Locales1093313
+Ref: Ranges and Locales-Footnote-11097932
+Ref: Ranges and Locales-Footnote-21097959
+Ref: Ranges and Locales-Footnote-31098194
+Node: Contributors1098415
+Node: History summary1103955
+Node: Installation1105334
+Node: Gawk Distribution1106280
+Node: Getting1106764
+Node: Extracting1107587
+Node: Distribution contents1109224
+Node: Unix Installation1115326
+Node: Quick Installation1116009
+Node: Shell Startup Files1118420
+Node: Additional Configuration Options1119499
+Node: Configuration Philosophy1121303
+Node: Non-Unix Installation1123672
+Node: PC Installation1124130
+Node: PC Binary Installation1125450
+Node: PC Compiling1127298
+Ref: PC Compiling-Footnote-11130319
+Node: PC Testing1130428
+Node: PC Using1131604
+Node: Cygwin1135719
+Node: MSYS1136489
+Node: VMS Installation1136990
+Node: VMS Compilation1137782
+Ref: VMS Compilation-Footnote-11139011
+Node: VMS Dynamic Extensions1139069
+Node: VMS Installation Details1140753
+Node: VMS Running1143004
+Node: VMS GNV1145844
+Node: VMS Old Gawk1146579
+Node: Bugs1147049
+Node: Other Versions1150938
+Node: Installation summary1157372
+Node: Notes1158431
+Node: Compatibility Mode1159296
+Node: Additions1160078
+Node: Accessing The Source1161003
+Node: Adding Code1162438
+Node: New Ports1168595
+Node: Derived Files1173077
+Ref: Derived Files-Footnote-11178552
+Ref: Derived Files-Footnote-21178586
+Ref: Derived Files-Footnote-31179182
+Node: Future Extensions1179296
+Node: Implementation Limitations1179902
+Node: Extension Design1181150
+Node: Old Extension Problems1182304
+Ref: Old Extension Problems-Footnote-11183821
+Node: Extension New Mechanism Goals1183878
+Ref: Extension New Mechanism Goals-Footnote-11187238
+Node: Extension Other Design Decisions1187427
+Node: Extension Future Growth1189535
+Node: Old Extension Mechanism1190371
+Node: Notes summary1192133
+Node: Basic Concepts1193319
+Node: Basic High Level1194000
+Ref: figure-general-flow1194272
+Ref: figure-process-flow1194871
+Ref: Basic High Level-Footnote-11198100
+Node: Basic Data Typing1198285
+Node: Glossary1201613
+Node: Copying1233542
+Node: GNU Free Documentation License1271098
+Node: Index1296234

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index f1cef1c9..501aacde 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -604,6 +604,7 @@ particular records in a file and perform operations upon them.
@code{getline}.
* Getline Summary:: Summary of @code{getline} Variants.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -633,6 +634,7 @@ particular records in a file and perform operations upon them.
* Special Caveats:: Things to watch out for.
* Close Files And Pipes:: Closing Input and Output Files and
Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
* Values:: Constants, Variables, and Regular
@@ -944,6 +946,7 @@ particular records in a file and perform operations upon them.
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
+* Redirection API:: How to access and manipulate redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
@@ -1002,6 +1005,7 @@ particular records in a file and perform operations upon them.
* Unix Installation:: Installing @command{gawk} under
various versions of Unix.
* Quick Installation:: Compiling @command{gawk} under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
@@ -4082,10 +4086,8 @@ No space is allowed between the @option{-o} and @var{file}, if
@var{file} is supplied.
@quotation NOTE
-Due to the way @command{gawk} has evolved, with this option
-your program still executes. This will change in the
-next major release, such that @command{gawk} will only
-pretty-print the program and not run it.
+In the past, this option would also execute your program.
+This is no longer the case.
@end quotation
@item @option{-O}
@@ -4486,6 +4488,9 @@ searches first in the current directory and then in @file{/usr/local/share/awk}.
In practice, this means that you will rarely need to change the
value of @env{AWKPATH}.
+@xref{Shell Startup Files}, for information on functions that help to
+manipulate the @env{AWKPATH} variable.
+
@command{gawk} places the value of the search path that it used into
@code{ENVIRON["AWKPATH"]}. This provides access to the actual search
path value from within an @command{awk} program.
@@ -4517,6 +4522,9 @@ an empty value, @command{gawk} uses a default path; this
is typically @samp{/usr/local/lib/gawk}, although it can vary depending
upon how @command{gawk} was built.
+@xref{Shell Startup Files}, for information on functions that help to
+manipulate the @env{AWKLIBPATH} variable.
+
@command{gawk} places the value of the search path that it used into
@code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search
path value from within an @command{awk} program.
@@ -4544,6 +4552,8 @@ wait for input before returning with an error.
Controls the number of times @command{gawk} attempts to
retry a two-way TCP/IP (socket) connection before giving up.
@xref{TCP/IP Networking}.
+Note that when nonfatal I/O is enabled (@pxref{Nonfatal}),
+@command{gawk} only tries to open a TCP/IP socket once.
@item POSIXLY_CORRECT
Causes @command{gawk} to switch to POSIX-compatibility
@@ -4593,14 +4603,6 @@ two regexp matchers that @command{gawk} uses internally. (There aren't
supposed to be differences, but occasionally theory and practice don't
coordinate with each other.)
-@item GAWK_NO_PP_RUN
-When @command{gawk} is invoked with the @option{--pretty-print} option,
-it will not run the program if this environment variable exists.
-
-@quotation CAUTION
-This variable will not survive into the next major release.
-@end quotation
-
@item GAWK_STACKSIZE
This specifies the amount by which @command{gawk} should grow its
internal evaluation stack, when needed.
@@ -4898,6 +4900,13 @@ Similarly, you may use @code{print} or @code{printf} statements in the
@var{init} and @var{increment} parts of a @code{for} loop. This is another
long-undocumented ``feature'' of Unix @command{awk}.
+@command{gawk} lets you use the names of built-in functions that are
+@command{gawk} extensions as the names of parameters in user-defined functions.
+This is intended to ``future-proof'' old code that happens to use
+function names added by @command{gawk} after the code was written.
+Standard @command{awk} built-in functions, such as @code{sin()} or
+@code{substr()} are @emph{not} shadowed in this way.
+
@end ignore
@node Invoking Summary
@@ -5180,17 +5189,21 @@ between @samp{0} and @samp{7}. For example, the code for the ASCII ESC
@item \x@var{hh}@dots{}
The hexadecimal value @var{hh}, where @var{hh} stands for a sequence
of hexadecimal digits (@samp{0}--@samp{9}, and either @samp{A}--@samp{F}
-or @samp{a}--@samp{f}). Like the same construct
-in ISO C, the escape sequence continues until the first nonhexadecimal
-digit is seen. @value{COMMONEXT}
-However, using more than two hexadecimal digits produces
-undefined results. (The @samp{\x} escape sequence is not allowed in
-POSIX @command{awk}.)
+or @samp{a}--@samp{f}). A maximum of two digts are allowed after
+the @samp{\x}. Any further hexadecimal digits are treated as simple
+letters or numbers. @value{COMMONEXT}
+(The @samp{\x} escape sequence is not allowed in POSIX awk.)
@quotation CAUTION
-The next major release of @command{gawk} will change, such
-that a maximum of two hexadecimal digits following the
-@samp{\x} will be used.
+In ISO C, the escape sequence continues until the first nonhexadecimal
+digit is seen.
+For many years, @command{gawk} would continue incorporating
+hexadecimal digits into the value until a non-hexadecimal digit
+or the end of the string was encountered.
+However, using more than two hexadecimal digits produced
+undefined results.
+As of @value{PVERSION} 4.2, only two digits
+are processed.
@end quotation
@cindex @code{\} (backslash), @code{\/} escape sequence
@@ -6323,6 +6336,7 @@ used with it do not have to be named on the @command{awk} command line
* Getline:: Reading files under explicit program control
using the @code{getline} function.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -8114,6 +8128,13 @@ a record, such as a file that cannot be opened, then @code{getline}
returns @minus{}1. In this case, @command{gawk} sets the variable
@code{ERRNO} to a string describing the error that occurred.
+If @code{ERRNO} indicates that the I/O operation may be
+retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set,
+then @code{getline} returns @minus{}2
+instead of @minus{}1, and further calls to @code{getline}
+may be attemped. @DBXREF{Retrying Input} for further information about
+this feature.
+
In the following examples, @var{command} stands for a string value that
represents a shell command.
@@ -8768,7 +8789,8 @@ on a per-command or per-connection basis.
the attempt to read from the underlying device may
succeed in a later attempt. This is a limitation, and it also
means that you cannot use this to multiplex input from
-two or more sources.
+two or more sources. @DBXREF{Retrying Input} for a way to enable
+later I/O attempts to succeed.
Assigning a timeout value prevents read operations from
blocking indefinitely. But bear in mind that there are other ways
@@ -8778,6 +8800,36 @@ a connection before it can start reading any data,
or the attempt to open a FIFO special file for reading can block
indefinitely until some other process opens it for writing.
+@node Retrying Input
+@section Retrying Reads After Certain Input Errors
+@cindex retrying input
+
+@cindex differences in @command{awk} and @command{gawk}, retrying input
+This @value{SECTION} describes a feature that is specific to @command{gawk}.
+
+When @command{gawk} encounters an error while reading input, by
+default @code{getline} returns @minus{}1, and subsequent attempts to
+read from that file result in an end-of-file indication. However, you
+may optionally instruct @command{gawk} to allow I/O to be retried when
+certain errors are encountered by setting a special element in
+the @code{PROCINFO} array (@pxref{Auto-set}):
+
+@example
+PROCINFO["@var{input_name}", "RETRY"] = 1
+@end example
+
+When this element exists, @command{gawk} checks the value of the system
+(C language)
+@code{errno} variable when an I/O error occurs. If @code{errno} indicates
+a subsequent I/O attempt may succeed, @code{getline} instead returns
+@minus{}2 and
+further calls to @code{getline} may succeed. This applies to the @code{errno}
+values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}.
+
+This feature is useful in conjunction with
+@code{PROCINFO["@var{input_name}", "READ_TIMEOUT"]} or situations where a file
+descriptor has been configured to behave in a non-blocking fashion.
+
@node Command-line directories
@section Directories on the Command Line
@cindex differences in @command{awk} and @command{gawk}, command-line directories
@@ -8939,6 +8991,7 @@ and discusses the @code{close()} built-in function.
@command{gawk} allows access to inherited file
descriptors.
* Close Files And Pipes:: Closing Input and Output Files and Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
@end menu
@@ -10445,6 +10498,71 @@ when closing a pipe.
@end ifnotdocbook
+@node Nonfatal
+@section Enabling Nonfatal Output
+
+This @value{SECTION} describes a @command{gawk}-specific feature.
+
+In standard @command{awk}, output with @code{print} or @code{printf}
+to a nonexistent file, or some other I/O error (such as filling up the
+disk) is a fatal error.
+
+@example
+$ @kbd{gawk 'BEGIN @{ print "hi" > "/no/such/file" @}'}
+@error{} gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory)
+@end example
+
+@command{gawk} makes it possible to detect that an error has
+occurred, allowing you to possibly recover from the error, or
+at least print an error message of your choosing before exiting.
+You can do this in one of two ways:
+
+@itemize @bullet
+@item
+For all output files, by assigning any value to @code{PROCINFO["NONFATAL"]}.
+
+@item
+On a per-file basis, by assigning any value to
+@code{PROCINFO[@var{filename}, "NONFATAL"]}.
+Here, @var{filename} is the name of the file to which
+you wish output to be nonfatal.
+@end itemize
+
+Once you have enabled nonfatal output, you must check @code{ERRNO}
+after every relevant @code{print} or @code{printf} statement to
+see if something went wrong. It is also a good idea to initialize
+@code{ERRNO} to zero before attempting the output. For example:
+
+@example
+$ @kbd{gawk '}
+> @kbd{BEGIN @{}
+> @kbd{ PROCINFO["NONFATAL"] = 1}
+> @kbd{ ERRNO = 0}
+> @kbd{ print "hi" > "/no/such/file"}
+> @kbd{ if (ERRNO) @{}
+> @kbd{ print("Output failed:", ERRNO) > "/dev/stderr"}
+> @kbd{ exit 1}
+> @kbd{ @}}
+> @kbd{@}'}
+@error{} Output failed: No such file or directory
+@end example
+
+Here, @command{gawk} did not produce a fatal error; instead
+it let the @command{awk} program code detect the problem and handle it.
+
+This mechanism works also for standard output and standard error.
+For standard output, you may use @code{PROCINFO["-", "NONFATAL"]}
+or @code{PROCINFO["/dev/stdout", "NONFATAL"]}. For standard error, use
+@code{PROCINFO["/dev/stderr", "NONFATAL"]}.
+
+When attempting to open a TCP/IP socket (@pxref{TCP/IP Networking}),
+@command{gawk} tries multiple times. The @env{GAWK_SOCK_RETRIES}
+environment variable (@pxref{Other Environment Variables}) allows you to
+override @command{gawk}'s builtin default number of attempts. However,
+once nonfatal I/O is enabled for a given socket, @command{gawk} only
+retries once, relying on @command{awk}-level code to notice that there
+was a problem.
+
@node Output Summary
@section Summary
@@ -10473,6 +10591,12 @@ Use @code{close()} to close open file, pipe, and coprocess redirections.
For coprocesses, it is possible to close only one direction of the
communications.
+@item
+Normally errors with @code{print} or @code{printf} are fatal.
+@command{gawk} lets you make output errors be nonfatal either for
+all files or on a per-file basis. You must then check for errors
+after every relevant output statement.
+
@end itemize
@c EXCLUDE START
@@ -14806,10 +14930,24 @@ opens the next file.
An associative array containing the values of the environment. The array
indices are the environment variable names; the elements are the values of
the particular environment variables. For example,
-@code{ENVIRON["HOME"]} might be @code{"/home/arnold"}. Changing this array
-does not affect the environment passed on to any programs that
-@command{awk} may spawn via redirection or the @code{system()} function.
-(In a future version of @command{gawk}, it may do so.)
+@code{ENVIRON["HOME"]} might be @code{/home/arnold}.
+
+For POSIX @command{awk}, changing this array does not affect the
+environment passed on to any programs that @command{awk} may spawn via
+redirection or the @code{system()} function.
+
+However, beginning with version 4.2, if not in POSIX
+compatibility mode, @command{gawk} does update its own environment when
+@code{ENVIRON} is changed, thus changing the environment seen by programs
+that it creates. You should therefore be especially careful if you
+modify @code{ENVIRON["PATH"]}, which is the search path for finding
+executable programs.
+
+This can also affect the running @command{gawk} program, since some of the
+built-in functions may pay attention to certain environment variables.
+The most notable instance of this is @code{mktime()} (@pxref{Time
+Functions}), which pays attention the value of the @env{TZ} environment
+variable on many systems.
Some operating systems may not have environment variables.
On such systems, the @code{ENVIRON} array is empty (except for
@@ -14843,6 +14981,11 @@ value to be meaningful when an I/O operation returns a failure value,
such as @code{getline} returning @minus{}1. You are, of course, free
to clear it yourself before doing an I/O operation.
+If the value of @code{ERRNO} corresponds to a system error in the C
+@code{errno} variable, then @code{PROCINFO["errno"]} will be set to the value
+of @code{errno}. For non-system errors, @code{PROCINFO["errno"]} will
+be zero.
+
@cindex @code{FILENAME} variable
@cindex dark corner, @code{FILENAME} variable
@item @code{FILENAME}
@@ -14911,6 +15054,10 @@ are guaranteed to be available:
@item PROCINFO["egid"]
The value of the @code{getegid()} system call.
+@item PROCINFO["errno"]
+The value of the C @code{errno} variable when @code{ERRNO} is set to
+the associated error message.
+
@item PROCINFO["euid"]
@cindex effective user ID of @command{gawk} user
The value of the @code{geteuid()} system call.
@@ -15050,6 +15197,11 @@ open input file, pipe, or coprocess.
@DBXREF{Read Timeout} for more information.
@item
+It may be used to indicate that input may be retried when it fails due to
+certain errors.
+@DBXREF{Retrying Input} for more information.
+
+@item
It may be used to cause coprocesses to communicate over pseudo-ttys
instead of through two-way pipes; this is discussed further in
@ref{Two-way I/O}.
@@ -16964,6 +17116,23 @@ truncated toward zero.
For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)}
is @minus{}3, and @code{int(-3)} is @minus{}3 as well.
+@item @code{intdiv(@var{numerator}, @var{denominator}, @var{result})}
+@cindexawkfunc{intdiv}
+@cindex intdiv
+Perform integer division, similar to the standard C function of the
+same name. First, truncate @code{numerator} and @code{denominator}
+towards zero, creating integer values. Clear the @code{result}
+array, and then set @code{result["quotient"]} to the result of
+@samp{numerator / denominator}, truncated towards zero to an integer,
+and set @code{result["remainder"]} to the result of @samp{numerator %
+denominator}, truncated towards zero to an integer. This function is
+primarily intended for use with arbitrary length integers; it avoids
+creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary
+Precision Integers}).
+
+This function is a @code{gawk} extension. It is not available in
+compatibility mode (@pxref{Options}).
+
@item @code{log(@var{x})}
@cindexawkfunc{log}
@cindex logarithm
@@ -27765,8 +27934,7 @@ The profiled version of your program may not look exactly like what you
typed when you wrote it. This is because @command{gawk} creates the
profiled version by ``pretty-printing'' its internal representation of
the program. The advantage to this is that @command{gawk} can produce
-a standard representation. The disadvantage is that all source code
-comments are lost.
+a standard representation.
Also, things such as:
@example
@@ -27860,10 +28028,26 @@ When called this way, @command{gawk} ``pretty-prints'' the program into
@file{awkprof.out}, without any execution counts.
@quotation NOTE
-The @option{--pretty-print} option still runs your program.
-This will change in the next major release.
+Once upon a time, the @option{--pretty-print} option would also run
+your program. This is is no longer the case.
@end quotation
+There is a significant difference between the output created when
+profiling, and that created when pretty-printing. Pretty-printed output
+preserves the original comments that were in the program, although their
+placement may not correspond exactly to their original locations in the
+source code.
+
+However, as a deliberate design decision, profiling output @emph{omits}
+the original program's comments. This allows you to focus on the
+execution count data and helps you avoid the temptation to use the
+profiler for pretty-printing.
+
+Additionally, pretty-printed output does not have the leading indentation
+that the profiling output does. This makes it easy to pretty-print your
+code once development is completed, and then use the result as the final
+version of your program.
+
@node Advanced Features Summary
@section Summary
@@ -30937,6 +31121,122 @@ to just use the following:
gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@end example
+When dividing two arbitrary precision integers with either
+@samp{/} or @samp{%}, the result is typically an arbitrary
+precision floating point value (unless the denominator evenly
+divides into the numerator). In order to do integer division
+or remainder with arbitrary precision integers, use the built-in
+@code{intdiv()} function (@pxref{Numeric Functions}).
+
+You can simulate the @code{intdiv()} function in standard @command{awk}
+using this user-defined function:
+
+@example
+@c file eg/lib/intdiv.awk
+# intdiv --- do integer division
+
+@c endfile
+@ignore
+@c file eg/lib/intdiv.awk
+#
+# Arnold Robbins, arnold@@skeeve.com, Public Domain
+# July, 2014
+#
+# Name changed from div() to intdiv()
+# April, 2015
+
+@c endfile
+
+@end ignore
+@c file eg/lib/intdiv.awk
+function intdiv(numerator, denominator, result)
+@{
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+@}
+@c endfile
+@end example
+
+The following example program, contributed by Katie Wasserman,
+uses @code{intdiv()} to
+compute the digits of @value{PI} to as many places as you
+choose to set:
+
+@example
+@c file eg/prog/pi.awk
+# pi.awk --- compute the digits of pi
+@c endfile
+@c endfile
+@ignore
+@c file eg/prog/pi.awk
+#
+# Katie Wasserman, katie@@wass.net
+# August 2014
+@c endfile
+@end ignore
+@c file eg/prog/pi.awk
+
+BEGIN @{
+ digits = 100000
+ two = 2 * 10 ^ digits
+ pi = two
+ for (m = digits * 4; m > 0; --m) @{
+ d = m * 2 + 1
+ x = pi * m
+ intdiv(x, d, result)
+ pi = result["quotient"]
+ pi = pi + two
+ @}
+ print pi
+@}
+@c endfile
+@end example
+
+@ignore
+Date: Wed, 20 Aug 2014 10:19:11 -0400
+To: arnold@skeeve.com
+From: Katherine Wasserman <katie@wass.net>
+Subject: Re: computation of digits of pi?
+
+Arnold,
+
+>The program that you sent to compute the digits of pi using div(). Is
+>that some standard algorithm that every math student knows? If so,
+>what's it called?
+
+It's not that well known but it's not that obscure either
+
+It's Euler's modification to Newton's method for calculating pi.
+
+Take a look at lines (23) - (25) here: http://mathworld.wolfram.com/PiFormulas.htm
+
+The algorithm I wrote simply expands the multiply by 2 and works from the innermost expression outwards. I used this to program HP calculators because it's quite easy to modify for tiny memory devices with smallish word sizes.
+
+http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=899
+
+-Katie
+@end ignore
+
+When asked about the algorithm used, Katie replied:
+
+@quotation
+It's not that well known but it's not that obscure either.
+It's Euler's modification to Newton's method for calculating pi.
+Take a look at lines (23) - (25) here: @uref{http://mathworld.wolfram.com/PiFormulas.html}.
+
+The algorithm I wrote simply expands the multiply by 2 and works from
+the innermost expression outwards. I used this to program HP calculators
+because it's quite easy to modify for tiny memory devices with smallish
+word sizes. See
+@uref{http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=899}.
+@end quotation
+
@node POSIX Floating Point Problems
@section Standards Versus Existing Practice
@@ -31354,6 +31654,7 @@ This (rather large) @value{SECTION} describes the API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
+* Redirection API:: How to access and manipulate redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
@end menu
@@ -31429,6 +31730,10 @@ Clearing an array
@item
Flattening an array for easy C-style looping over all its indices and elements
@end itemize
+
+@item
+Accessing and manipulating redirections.
+
@end itemize
Some points about using the API:
@@ -33399,6 +33704,75 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk}
(@DBXREF{Finding Extensions} for more information on the
@env{AWKLIBPATH} environment variable.)
+@node Redirection API
+@subsection Accessing and Manipulating Redirections
+
+The following function allows extensions to access and manipulate redirections.
+
+@table @code
+@item awk_bool_t get_file(const char *name,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t name_len,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const char *filetype,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int fd,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_input_buf_t **ibufp,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_output_buf_t **obufp);
+Look up a file in @command{gawk}'s internal redirection table.
+If @code{name} is @code{NULL} or @code{name_len} is zero, return
+data for the currently open input file corresponding to @code{FILENAME}.
+(This does not access the @code{filetype} argument, so that may be undefined).
+If the file is not already open, attempt to open it.
+The @code{filetype} argument must be zero-terminated and should be one of:
+
+@table @code
+@item ">"
+A file opened for output.
+
+@item ">>"
+A file opened for append.
+
+@item "<"
+A file opened for input.
+
+@item "|>"
+A pipe opened for output.
+
+@item "|<"
+A pipe opened for input.
+
+@item "|&"
+A two-way coprocess.
+@end table
+
+On error, return a @code{false} value. Otherwise, return
+@code{true}, and return additional information about the redirection
+in the @code{ibufp} and @code{obufp} pointers. For input
+redirections, the @code{*ibufp} value should be non-@code{NULL},
+and @code{*obufp} should be @code{NULL}. For output redirections,
+the @code{*obufp} value should be non-@code{NULL}, and @code{*ibufp}
+should be @code{NULL}. For two-way coprocesses, both values should
+be non-@code{NULL}.
+
+In the usual case, the extension is interested in @code{(*ibufp)->fd}
+and/or @code{fileno((*obufp)->fp)}. If the file is not already
+open, and the @code{fd} argument is non-negative, @command{gawk}
+will use that file descriptor instead of opening the file in the
+usual way. If @code{fd} is non-negative, but the file exists already,
+@command{gawk} ignores @code{fd} and returns the existing file. It is
+the caller's responsibility to notice that neither the @code{fd} in
+the returned @code{awk_input_buf_t} nor the @code{fd} in the returned
+@code{awk_output_buf_t} matches the requested value.
+
+Note that supplying a file descriptor is currently @emph{not} supported
+for pipes. However, supplying a file descriptor should work for input,
+output, append, and two-way (coprocess) sockets. If @code{filetype}
+is two-way, @command{gawk} assumes that it is a socket! Note that in
+the two-way case, the input and output file descriptors may differ.
+To check for success, you must check whether either matches.
+@end table
+
+It is anticipated that this API function will be used to implement I/O
+multiplexing and a socket library.
+
@node Extension API Variables
@subsection API Variables
@@ -34940,18 +35314,21 @@ As of this writing, there are seven extensions:
GD graphics library extension
@item
+MPFR library extension
+(this provides access to a number of MPFR functions that @command{gawk}'s
+native MPFR support does not)
+
+@item
PDF extension
@item
PostgreSQL extension
@item
-MPFR library extension
-(this provides access to a number of MPFR functions that @command{gawk}'s
-native MPFR support does not)
+Redis extension
@item
-Redis extension
+Select extension
@item
XML parser extension, using the @uref{http://expat.sourceforge.net, Expat}
@@ -35580,6 +35957,10 @@ Indirect function calls
@item
Directories on the command line produce a warning and are skipped
(@pxref{Command-line directories})
+
+@item
+Output with @code{print} and @code{printf} need not be fatal
+(@pxref{Nonfatal})
@end itemize
@item
@@ -35667,6 +36048,11 @@ The @code{isarray()} function to check if a variable is an array or not
The @code{bindtextdomain()}, @code{dcgettext()}, and @code{dcngettext()}
functions for internationalization
(@pxref{Programmer i18n})
+
+@item
+The @code{intdiv()} function for doing integer
+division and remainder
+(@pxref{Numeric Functions})
@end itemize
@item
@@ -35799,6 +36185,16 @@ for @command{gawk} @value{PVERSION} 4.1:
Ultrix
@end itemize
+@item
+Support for the following systems was removed from the code
+for @command{gawk} @value{PVERSION} 4.2:
+
+@c nested table
+@itemize @value{MINUS}
+@item
+MirBSD
+@end itemize
+
@end itemize
@c XXX ADD MORE STUFF HERE
@@ -36420,6 +36816,44 @@ Redirected @code{getline} became allowed inside
The @code{where} command was added to the debugger
(@pxref{Execution Stack}).
+@item
+Support for Ultrix was removed.
+
+@end itemize
+
+Version 4.2 introduced the following changes:
+
+@itemize @bullet
+@item
+Changes to @code{ENVIRON} are reflected into @command{gawk}'s
+environment and that of programs that it runs.
+@xref{Auto-set}.
+
+@item
+The @option{--pretty-print} option no longer runs the @command{awk}
+program too.
+@xref{Options}.
+
+@item
+The @command{igawk} program and its manual page are no longer
+installed when @command{gawk} is built.
+@xref{Igawk Program}.
+
+@item
+The @code{intdiv()} function.
+@xref{Numeric Functions}.
+
+@item
+The maximum number of hexdecimal digits in @samp{\x} escapes
+is now two.
+@xref{Escape Sequences}.
+
+@item
+Nonfatal output with @code{print} and @code{printf}.
+@xref{Nonfatal}.
+
+@item
+Support for MirBSD was removed.
@end itemize
@c XXX ADD MORE STUFF HERE
@@ -37086,6 +37520,8 @@ The generated Info file for
The @command{troff} source for a manual page describing the @command{igawk}
program presented in
@ref{Igawk Program}.
+(Since @command{gawk} can do its own @code{@@include} processing,
+neither @command{igawk} nor @file{igawk.1} are installed.)
@item doc/Makefile.in
The input file used during the configuration process to generate the
@@ -37130,8 +37566,6 @@ source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} fil
@file{Makefile.am} is used by GNU Automake to create @file{Makefile.in}.
The library functions from
@ref{Library Functions},
-and the @command{igawk} program from
-@DBREF{Igawk Program}
are included as ready-to-use files in the @command{gawk} distribution.
They are installed as part of the installation process.
The rest of the programs in this @value{DOCUMENT} are available in appropriate
@@ -37142,6 +37576,12 @@ The source code, manual pages, and infrastructure files for
the sample extensions included with @command{gawk}.
@xref{Dynamic Extensions}, for more information.
+@item extras/*
+Additional non-essential files. Currently, this directory contains some shell
+startup files to be installed in @file{/etc/profile.d} to aid in manipulating
+the @env{AWKPATH} and @env{AWKLIBPATH} environment variables.
+@xref{Shell Startup Files}, for more information.
+
@item posix/*
Files needed for building @command{gawk} on POSIX-compliant systems.
@@ -37173,6 +37613,7 @@ to configure @command{gawk} for your system yourself.
@menu
* Quick Installation:: Compiling @command{gawk} under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.
@end menu
@@ -37253,6 +37694,44 @@ is likely that you will be asked for your password, and you will have
to have been set up previously as a user who is allowed to run the
@command{sudo} command.
+@node Shell Startup Files
+@appendixsubsec Shell Startup Files
+
+The distribution contains shell startup files @file{gawk.sh} and
+@file{gawk.csh} containing functions to aid in manipulating
+the @env{AWKPATH} and @env{AWKLIBPATH} environment variables.
+On a Fedora system, these files should be installed in @file{/etc/profile.d};
+on other platforms, the appropriate location may be different.
+
+@table @command
+
+@cindex @command{gawkpath_default} shell function
+@item gawkpath_default
+Reset the @env{AWKPATH} environment variable to its default value.
+
+@cindex @command{gawkpath_prepend} shell function
+@item gawkpath_prepend
+Add the argument to the front of the @env{AWKPATH} environment variable.
+
+@cindex @command{gawkpath_append} shell function
+@item gawkpath_append
+Add the argument to the end of the @env{AWKPATH} environment variable.
+
+@cindex @command{gawklibpath_default} shell function
+@item gawklibpath_default
+Reset the @env{AWKLIBPATH} environment variable to its default value.
+
+@cindex @command{gawklibpath_prepend} shell function
+@item gawklibpath_prepend
+Add the argument to the front of the @env{AWKLIBPATH} environment variable.
+
+@cindex @command{gawklibpath_append} shell function
+@item gawklibpath_append
+Add the argument to the end of the @env{AWKLIBPATH} environment variable.
+
+@end table
+
+
@node Additional Configuration Options
@appendixsubsec Additional Configuration Options
@cindex @command{gawk}, configuring, options
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index af21c5a2..663353d4 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -599,6 +599,7 @@ particular records in a file and perform operations upon them.
@code{getline}.
* Getline Summary:: Summary of @code{getline} Variants.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on
the command line.
* Input Summary:: Input summary.
@@ -628,6 +629,7 @@ particular records in a file and perform operations upon them.
* Special Caveats:: Things to watch out for.
* Close Files And Pipes:: Closing Input and Output Files and
Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
* Values:: Constants, Variables, and Regular
@@ -939,6 +941,7 @@ particular records in a file and perform operations upon them.
* Array Functions:: Functions for working with arrays.
* Flattening Arrays:: How to flatten arrays.
* Creating Arrays:: How to create and populate arrays.
+* Redirection API:: How to access and manipulate redirections.
* Extension API Variables:: Variables provided by the API.
* Extension Versioning:: API Version information.
* Extension API Informational Variables:: Variables providing information about
@@ -997,6 +1000,7 @@ particular records in a file and perform operations upon them.
* Unix Installation:: Installing @command{gawk} under
various versions of Unix.
* Quick Installation:: Compiling @command{gawk} under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
@@ -3993,10 +3997,8 @@ No space is allowed between the @option{-o} and @var{file}, if
@var{file} is supplied.
@quotation NOTE
-Due to the way @command{gawk} has evolved, with this option
-your program still executes. This will change in the
-next major release, such that @command{gawk} will only
-pretty-print the program and not run it.
+In the past, this option would also execute your program.
+This is no longer the case.
@end quotation
@item @option{-O}
@@ -4397,6 +4399,9 @@ searches first in the current directory and then in @file{/usr/local/share/awk}.
In practice, this means that you will rarely need to change the
value of @env{AWKPATH}.
+@xref{Shell Startup Files}, for information on functions that help to
+manipulate the @env{AWKPATH} variable.
+
@command{gawk} places the value of the search path that it used into
@code{ENVIRON["AWKPATH"]}. This provides access to the actual search
path value from within an @command{awk} program.
@@ -4428,6 +4433,9 @@ an empty value, @command{gawk} uses a default path; this
is typically @samp{/usr/local/lib/gawk}, although it can vary depending
upon how @command{gawk} was built.
+@xref{Shell Startup Files}, for information on functions that help to
+manipulate the @env{AWKLIBPATH} variable.
+
@command{gawk} places the value of the search path that it used into
@code{ENVIRON["AWKLIBPATH"]}. This provides access to the actual search
path value from within an @command{awk} program.
@@ -4455,6 +4463,8 @@ wait for input before returning with an error.
Controls the number of times @command{gawk} attempts to
retry a two-way TCP/IP (socket) connection before giving up.
@xref{TCP/IP Networking}.
+Note that when nonfatal I/O is enabled (@pxref{Nonfatal}),
+@command{gawk} only tries to open a TCP/IP socket once.
@item POSIXLY_CORRECT
Causes @command{gawk} to switch to POSIX-compatibility
@@ -4504,14 +4514,6 @@ two regexp matchers that @command{gawk} uses internally. (There aren't
supposed to be differences, but occasionally theory and practice don't
coordinate with each other.)
-@item GAWK_NO_PP_RUN
-When @command{gawk} is invoked with the @option{--pretty-print} option,
-it will not run the program if this environment variable exists.
-
-@quotation CAUTION
-This variable will not survive into the next major release.
-@end quotation
-
@item GAWK_STACKSIZE
This specifies the amount by which @command{gawk} should grow its
internal evaluation stack, when needed.
@@ -4809,6 +4811,13 @@ Similarly, you may use @code{print} or @code{printf} statements in the
@var{init} and @var{increment} parts of a @code{for} loop. This is another
long-undocumented ``feature'' of Unix @command{awk}.
+@command{gawk} lets you use the names of built-in functions that are
+@command{gawk} extensions as the names of parameters in user-defined functions.
+This is intended to ``future-proof'' old code that happens to use
+function names added by @command{gawk} after the code was written.
+Standard @command{awk} built-in functions, such as @code{sin()} or
+@code{substr()} are @emph{not} shadowed in this way.
+
@end ignore
@node Invoking Summary
@@ -5091,17 +5100,21 @@ between @samp{0} and @samp{7}. For example, the code for the ASCII ESC
@item \x@var{hh}@dots{}
The hexadecimal value @var{hh}, where @var{hh} stands for a sequence
of hexadecimal digits (@samp{0}--@samp{9}, and either @samp{A}--@samp{F}
-or @samp{a}--@samp{f}). Like the same construct
-in ISO C, the escape sequence continues until the first nonhexadecimal
-digit is seen. @value{COMMONEXT}
-However, using more than two hexadecimal digits produces
-undefined results. (The @samp{\x} escape sequence is not allowed in
-POSIX @command{awk}.)
+or @samp{a}--@samp{f}). A maximum of two digts are allowed after
+the @samp{\x}. Any further hexadecimal digits are treated as simple
+letters or numbers. @value{COMMONEXT}
+(The @samp{\x} escape sequence is not allowed in POSIX awk.)
@quotation CAUTION
-The next major release of @command{gawk} will change, such
-that a maximum of two hexadecimal digits following the
-@samp{\x} will be used.
+In ISO C, the escape sequence continues until the first nonhexadecimal
+digit is seen.
+For many years, @command{gawk} would continue incorporating
+hexadecimal digits into the value until a non-hexadecimal digit
+or the end of the string was encountered.
+However, using more than two hexadecimal digits produced
+undefined results.
+As of @value{PVERSION} 4.2, only two digits
+are processed.
@end quotation
@cindex @code{\} (backslash), @code{\/} escape sequence
@@ -6107,6 +6120,7 @@ used with it do not have to be named on the @command{awk} command line
* Getline:: Reading files under explicit program control
using the @code{getline} function.
* Read Timeout:: Reading input with a timeout.
+* Retrying Input:: Retrying input after certain errors.
* Command-line directories:: What happens if you put a directory on the
command line.
* Input Summary:: Input summary.
@@ -7714,6 +7728,13 @@ a record, such as a file that cannot be opened, then @code{getline}
returns @minus{}1. In this case, @command{gawk} sets the variable
@code{ERRNO} to a string describing the error that occurred.
+If @code{ERRNO} indicates that the I/O operation may be
+retried, and @code{PROCINFO["@var{input}", "RETRY"]} is set,
+then @code{getline} returns @minus{}2
+instead of @minus{}1, and further calls to @code{getline}
+may be attemped. @DBXREF{Retrying Input} for further information about
+this feature.
+
In the following examples, @var{command} stands for a string value that
represents a shell command.
@@ -8368,7 +8389,8 @@ on a per-command or per-connection basis.
the attempt to read from the underlying device may
succeed in a later attempt. This is a limitation, and it also
means that you cannot use this to multiplex input from
-two or more sources.
+two or more sources. @DBXREF{Retrying Input} for a way to enable
+later I/O attempts to succeed.
Assigning a timeout value prevents read operations from
blocking indefinitely. But bear in mind that there are other ways
@@ -8378,6 +8400,36 @@ a connection before it can start reading any data,
or the attempt to open a FIFO special file for reading can block
indefinitely until some other process opens it for writing.
+@node Retrying Input
+@section Retrying Reads After Certain Input Errors
+@cindex retrying input
+
+@cindex differences in @command{awk} and @command{gawk}, retrying input
+This @value{SECTION} describes a feature that is specific to @command{gawk}.
+
+When @command{gawk} encounters an error while reading input, by
+default @code{getline} returns @minus{}1, and subsequent attempts to
+read from that file result in an end-of-file indication. However, you
+may optionally instruct @command{gawk} to allow I/O to be retried when
+certain errors are encountered by setting a special element in
+the @code{PROCINFO} array (@pxref{Auto-set}):
+
+@example
+PROCINFO["@var{input_name}", "RETRY"] = 1
+@end example
+
+When this element exists, @command{gawk} checks the value of the system
+(C language)
+@code{errno} variable when an I/O error occurs. If @code{errno} indicates
+a subsequent I/O attempt may succeed, @code{getline} instead returns
+@minus{}2 and
+further calls to @code{getline} may succeed. This applies to the @code{errno}
+values @code{EAGAIN}, @code{EWOULDBLOCK}, @code{EINTR}, or @code{ETIMEDOUT}.
+
+This feature is useful in conjunction with
+@code{PROCINFO["@var{input_name}", "READ_TIMEOUT"]} or situations where a file
+descriptor has been configured to behave in a non-blocking fashion.
+
@node Command-line directories
@section Directories on the Command Line
@cindex differences in @command{awk} and @command{gawk}, command-line directories
@@ -8539,6 +8591,7 @@ and discusses the @code{close()} built-in function.
@command{gawk} allows access to inherited file
descriptors.
* Close Files And Pipes:: Closing Input and Output Files and Pipes.
+* Nonfatal:: Enabling Nonfatal Output.
* Output Summary:: Output summary.
* Output Exercises:: Exercises.
@end menu
@@ -9941,6 +9994,71 @@ when closing a pipe.
@end sidebar
+@node Nonfatal
+@section Enabling Nonfatal Output
+
+This @value{SECTION} describes a @command{gawk}-specific feature.
+
+In standard @command{awk}, output with @code{print} or @code{printf}
+to a nonexistent file, or some other I/O error (such as filling up the
+disk) is a fatal error.
+
+@example
+$ @kbd{gawk 'BEGIN @{ print "hi" > "/no/such/file" @}'}
+@error{} gawk: cmd. line:1: fatal: can't redirect to `/no/such/file' (No such file or directory)
+@end example
+
+@command{gawk} makes it possible to detect that an error has
+occurred, allowing you to possibly recover from the error, or
+at least print an error message of your choosing before exiting.
+You can do this in one of two ways:
+
+@itemize @bullet
+@item
+For all output files, by assigning any value to @code{PROCINFO["NONFATAL"]}.
+
+@item
+On a per-file basis, by assigning any value to
+@code{PROCINFO[@var{filename}, "NONFATAL"]}.
+Here, @var{filename} is the name of the file to which
+you wish output to be nonfatal.
+@end itemize
+
+Once you have enabled nonfatal output, you must check @code{ERRNO}
+after every relevant @code{print} or @code{printf} statement to
+see if something went wrong. It is also a good idea to initialize
+@code{ERRNO} to zero before attempting the output. For example:
+
+@example
+$ @kbd{gawk '}
+> @kbd{BEGIN @{}
+> @kbd{ PROCINFO["NONFATAL"] = 1}
+> @kbd{ ERRNO = 0}
+> @kbd{ print "hi" > "/no/such/file"}
+> @kbd{ if (ERRNO) @{}
+> @kbd{ print("Output failed:", ERRNO) > "/dev/stderr"}
+> @kbd{ exit 1}
+> @kbd{ @}}
+> @kbd{@}'}
+@error{} Output failed: No such file or directory
+@end example
+
+Here, @command{gawk} did not produce a fatal error; instead
+it let the @command{awk} program code detect the problem and handle it.
+
+This mechanism works also for standard output and standard error.
+For standard output, you may use @code{PROCINFO["-", "NONFATAL"]}
+or @code{PROCINFO["/dev/stdout", "NONFATAL"]}. For standard error, use
+@code{PROCINFO["/dev/stderr", "NONFATAL"]}.
+
+When attempting to open a TCP/IP socket (@pxref{TCP/IP Networking}),
+@command{gawk} tries multiple times. The @env{GAWK_SOCK_RETRIES}
+environment variable (@pxref{Other Environment Variables}) allows you to
+override @command{gawk}'s builtin default number of attempts. However,
+once nonfatal I/O is enabled for a given socket, @command{gawk} only
+retries once, relying on @command{awk}-level code to notice that there
+was a problem.
+
@node Output Summary
@section Summary
@@ -9969,6 +10087,12 @@ Use @code{close()} to close open file, pipe, and coprocess redirections.
For coprocesses, it is possible to close only one direction of the
communications.
+@item
+Normally errors with @code{print} or @code{printf} are fatal.
+@command{gawk} lets you make output errors be nonfatal either for
+all files or on a per-file basis. You must then check for errors
+after every relevant output statement.
+
@end itemize
@c EXCLUDE START
@@ -14134,10 +14258,24 @@ opens the next file.
An associative array containing the values of the environment. The array
indices are the environment variable names; the elements are the values of
the particular environment variables. For example,
-@code{ENVIRON["HOME"]} might be @code{"/home/arnold"}. Changing this array
-does not affect the environment passed on to any programs that
-@command{awk} may spawn via redirection or the @code{system()} function.
-(In a future version of @command{gawk}, it may do so.)
+@code{ENVIRON["HOME"]} might be @code{/home/arnold}.
+
+For POSIX @command{awk}, changing this array does not affect the
+environment passed on to any programs that @command{awk} may spawn via
+redirection or the @code{system()} function.
+
+However, beginning with version 4.2, if not in POSIX
+compatibility mode, @command{gawk} does update its own environment when
+@code{ENVIRON} is changed, thus changing the environment seen by programs
+that it creates. You should therefore be especially careful if you
+modify @code{ENVIRON["PATH"]}, which is the search path for finding
+executable programs.
+
+This can also affect the running @command{gawk} program, since some of the
+built-in functions may pay attention to certain environment variables.
+The most notable instance of this is @code{mktime()} (@pxref{Time
+Functions}), which pays attention the value of the @env{TZ} environment
+variable on many systems.
Some operating systems may not have environment variables.
On such systems, the @code{ENVIRON} array is empty (except for
@@ -14171,6 +14309,11 @@ value to be meaningful when an I/O operation returns a failure value,
such as @code{getline} returning @minus{}1. You are, of course, free
to clear it yourself before doing an I/O operation.
+If the value of @code{ERRNO} corresponds to a system error in the C
+@code{errno} variable, then @code{PROCINFO["errno"]} will be set to the value
+of @code{errno}. For non-system errors, @code{PROCINFO["errno"]} will
+be zero.
+
@cindex @code{FILENAME} variable
@cindex dark corner, @code{FILENAME} variable
@item @code{FILENAME}
@@ -14239,6 +14382,10 @@ are guaranteed to be available:
@item PROCINFO["egid"]
The value of the @code{getegid()} system call.
+@item PROCINFO["errno"]
+The value of the C @code{errno} variable when @code{ERRNO} is set to
+the associated error message.
+
@item PROCINFO["euid"]
@cindex effective user ID of @command{gawk} user
The value of the @code{geteuid()} system call.
@@ -14378,6 +14525,11 @@ open input file, pipe, or coprocess.
@DBXREF{Read Timeout} for more information.
@item
+It may be used to indicate that input may be retried when it fails due to
+certain errors.
+@DBXREF{Retrying Input} for more information.
+
+@item
It may be used to cause coprocesses to communicate over pseudo-ttys
instead of through two-way pipes; this is discussed further in
@ref{Two-way I/O}.
@@ -16246,6 +16398,23 @@ truncated toward zero.
For example, @code{int(3)} is 3, @code{int(3.9)} is 3, @code{int(-3.9)}
is @minus{}3, and @code{int(-3)} is @minus{}3 as well.
+@item @code{intdiv(@var{numerator}, @var{denominator}, @var{result})}
+@cindexawkfunc{intdiv}
+@cindex intdiv
+Perform integer division, similar to the standard C function of the
+same name. First, truncate @code{numerator} and @code{denominator}
+towards zero, creating integer values. Clear the @code{result}
+array, and then set @code{result["quotient"]} to the result of
+@samp{numerator / denominator}, truncated towards zero to an integer,
+and set @code{result["remainder"]} to the result of @samp{numerator %
+denominator}, truncated towards zero to an integer. This function is
+primarily intended for use with arbitrary length integers; it avoids
+creating MPFR arbitrary precision floating-point values (@pxref{Arbitrary
+Precision Integers}).
+
+This function is a @code{gawk} extension. It is not available in
+compatibility mode (@pxref{Options}).
+
@item @code{log(@var{x})}
@cindexawkfunc{log}
@cindex logarithm
@@ -26856,8 +27025,7 @@ The profiled version of your program may not look exactly like what you
typed when you wrote it. This is because @command{gawk} creates the
profiled version by ``pretty-printing'' its internal representation of
the program. The advantage to this is that @command{gawk} can produce
-a standard representation. The disadvantage is that all source code
-comments are lost.
+a standard representation.
Also, things such as:
@example
@@ -26951,10 +27119,26 @@ When called this way, @command{gawk} ``pretty-prints'' the program into
@file{awkprof.out}, without any execution counts.
@quotation NOTE
-The @option{--pretty-print} option still runs your program.
-This will change in the next major release.
+Once upon a time, the @option{--pretty-print} option would also run
+your program. This is is no longer the case.
@end quotation
+There is a significant difference between the output created when
+profiling, and that created when pretty-printing. Pretty-printed output
+preserves the original comments that were in the program, although their
+placement may not correspond exactly to their original locations in the
+source code.
+
+However, as a deliberate design decision, profiling output @emph{omits}
+the original program's comments. This allows you to focus on the
+execution count data and helps you avoid the temptation to use the
+profiler for pretty-printing.
+
+Additionally, pretty-printed output does not have the leading indentation
+that the profiling output does. This makes it easy to pretty-print your
+code once development is completed, and then use the result as the final
+version of your program.
+
@node Advanced Features Summary
@section Summary
@@ -30028,6 +30212,122 @@ to just use the following:
gawk -M 'BEGIN @{ n = 13; print n % 2 @}'
@end example
+When dividing two arbitrary precision integers with either
+@samp{/} or @samp{%}, the result is typically an arbitrary
+precision floating point value (unless the denominator evenly
+divides into the numerator). In order to do integer division
+or remainder with arbitrary precision integers, use the built-in
+@code{intdiv()} function (@pxref{Numeric Functions}).
+
+You can simulate the @code{intdiv()} function in standard @command{awk}
+using this user-defined function:
+
+@example
+@c file eg/lib/intdiv.awk
+# intdiv --- do integer division
+
+@c endfile
+@ignore
+@c file eg/lib/intdiv.awk
+#
+# Arnold Robbins, arnold@@skeeve.com, Public Domain
+# July, 2014
+#
+# Name changed from div() to intdiv()
+# April, 2015
+
+@c endfile
+
+@end ignore
+@c file eg/lib/intdiv.awk
+function intdiv(numerator, denominator, result)
+@{
+ split("", result)
+
+ numerator = int(numerator)
+ denominator = int(denominator)
+ result["quotient"] = int(numerator / denominator)
+ result["remainder"] = int(numerator % denominator)
+
+ return 0.0
+@}
+@c endfile
+@end example
+
+The following example program, contributed by Katie Wasserman,
+uses @code{intdiv()} to
+compute the digits of @value{PI} to as many places as you
+choose to set:
+
+@example
+@c file eg/prog/pi.awk
+# pi.awk --- compute the digits of pi
+@c endfile
+@c endfile
+@ignore
+@c file eg/prog/pi.awk
+#
+# Katie Wasserman, katie@@wass.net
+# August 2014
+@c endfile
+@end ignore
+@c file eg/prog/pi.awk
+
+BEGIN @{
+ digits = 100000
+ two = 2 * 10 ^ digits
+ pi = two
+ for (m = digits * 4; m > 0; --m) @{
+ d = m * 2 + 1
+ x = pi * m
+ intdiv(x, d, result)
+ pi = result["quotient"]
+ pi = pi + two
+ @}
+ print pi
+@}
+@c endfile
+@end example
+
+@ignore
+Date: Wed, 20 Aug 2014 10:19:11 -0400
+To: arnold@skeeve.com
+From: Katherine Wasserman <katie@wass.net>
+Subject: Re: computation of digits of pi?
+
+Arnold,
+
+>The program that you sent to compute the digits of pi using div(). Is
+>that some standard algorithm that every math student knows? If so,
+>what's it called?
+
+It's not that well known but it's not that obscure either
+
+It's Euler's modification to Newton's method for calculating pi.
+
+Take a look at lines (23) - (25) here: http://mathworld.wolfram.com/PiFormulas.htm
+
+The algorithm I wrote simply expands the multiply by 2 and works from the innermost expression outwards. I used this to program HP calculators because it's quite easy to modify for tiny memory devices with smallish word sizes.
+
+http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=899
+
+-Katie
+@end ignore
+
+When asked about the algorithm used, Katie replied:
+
+@quotation
+It's not that well known but it's not that obscure either.
+It's Euler's modification to Newton's method for calculating pi.
+Take a look at lines (23) - (25) here: @uref{http://mathworld.wolfram.com/PiFormulas.html}.
+
+The algorithm I wrote simply expands the multiply by 2 and works from
+the innermost expression outwards. I used this to program HP calculators
+because it's quite easy to modify for tiny memory devices with smallish
+word sizes. See
+@uref{http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=899}.
+@end quotation
+
@node POSIX Floating Point Problems
@section Standards Versus Existing Practice
@@ -30445,6 +30745,7 @@ This (rather large) @value{SECTION} describes the API in detail.
* Symbol Table Access:: Functions for accessing global
variables.
* Array Manipulation:: Functions for working with arrays.
+* Redirection API:: How to access and manipulate redirections.
* Extension API Variables:: Variables provided by the API.
* Extension API Boilerplate:: Boilerplate code for using the API.
@end menu
@@ -30520,6 +30821,10 @@ Clearing an array
@item
Flattening an array for easy C-style looping over all its indices and elements
@end itemize
+
+@item
+Accessing and manipulating redirections.
+
@end itemize
Some points about using the API:
@@ -32490,6 +32795,75 @@ $ @kbd{AWKLIBPATH=$PWD ./gawk -f subarray.awk}
(@DBXREF{Finding Extensions} for more information on the
@env{AWKLIBPATH} environment variable.)
+@node Redirection API
+@subsection Accessing and Manipulating Redirections
+
+The following function allows extensions to access and manipulate redirections.
+
+@table @code
+@item awk_bool_t get_file(const char *name,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ size_t name_len,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const char *filetype,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ int fd,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_input_buf_t **ibufp,
+@itemx @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ const awk_output_buf_t **obufp);
+Look up a file in @command{gawk}'s internal redirection table.
+If @code{name} is @code{NULL} or @code{name_len} is zero, return
+data for the currently open input file corresponding to @code{FILENAME}.
+(This does not access the @code{filetype} argument, so that may be undefined).
+If the file is not already open, attempt to open it.
+The @code{filetype} argument must be zero-terminated and should be one of:
+
+@table @code
+@item ">"
+A file opened for output.
+
+@item ">>"
+A file opened for append.
+
+@item "<"
+A file opened for input.
+
+@item "|>"
+A pipe opened for output.
+
+@item "|<"
+A pipe opened for input.
+
+@item "|&"
+A two-way coprocess.
+@end table
+
+On error, return a @code{false} value. Otherwise, return
+@code{true}, and return additional information about the redirection
+in the @code{ibufp} and @code{obufp} pointers. For input
+redirections, the @code{*ibufp} value should be non-@code{NULL},
+and @code{*obufp} should be @code{NULL}. For output redirections,
+the @code{*obufp} value should be non-@code{NULL}, and @code{*ibufp}
+should be @code{NULL}. For two-way coprocesses, both values should
+be non-@code{NULL}.
+
+In the usual case, the extension is interested in @code{(*ibufp)->fd}
+and/or @code{fileno((*obufp)->fp)}. If the file is not already
+open, and the @code{fd} argument is non-negative, @command{gawk}
+will use that file descriptor instead of opening the file in the
+usual way. If @code{fd} is non-negative, but the file exists already,
+@command{gawk} ignores @code{fd} and returns the existing file. It is
+the caller's responsibility to notice that neither the @code{fd} in
+the returned @code{awk_input_buf_t} nor the @code{fd} in the returned
+@code{awk_output_buf_t} matches the requested value.
+
+Note that supplying a file descriptor is currently @emph{not} supported
+for pipes. However, supplying a file descriptor should work for input,
+output, append, and two-way (coprocess) sockets. If @code{filetype}
+is two-way, @command{gawk} assumes that it is a socket! Note that in
+the two-way case, the input and output file descriptors may differ.
+To check for success, you must check whether either matches.
+@end table
+
+It is anticipated that this API function will be used to implement I/O
+multiplexing and a socket library.
+
@node Extension API Variables
@subsection API Variables
@@ -34031,18 +34405,21 @@ As of this writing, there are seven extensions:
GD graphics library extension
@item
+MPFR library extension
+(this provides access to a number of MPFR functions that @command{gawk}'s
+native MPFR support does not)
+
+@item
PDF extension
@item
PostgreSQL extension
@item
-MPFR library extension
-(this provides access to a number of MPFR functions that @command{gawk}'s
-native MPFR support does not)
+Redis extension
@item
-Redis extension
+Select extension
@item
XML parser extension, using the @uref{http://expat.sourceforge.net, Expat}
@@ -34671,6 +35048,10 @@ Indirect function calls
@item
Directories on the command line produce a warning and are skipped
(@pxref{Command-line directories})
+
+@item
+Output with @code{print} and @code{printf} need not be fatal
+(@pxref{Nonfatal})
@end itemize
@item
@@ -34758,6 +35139,11 @@ The @code{isarray()} function to check if a variable is an array or not
The @code{bindtextdomain()}, @code{dcgettext()}, and @code{dcngettext()}
functions for internationalization
(@pxref{Programmer i18n})
+
+@item
+The @code{intdiv()} function for doing integer
+division and remainder
+(@pxref{Numeric Functions})
@end itemize
@item
@@ -34890,6 +35276,16 @@ for @command{gawk} @value{PVERSION} 4.1:
Ultrix
@end itemize
+@item
+Support for the following systems was removed from the code
+for @command{gawk} @value{PVERSION} 4.2:
+
+@c nested table
+@itemize @value{MINUS}
+@item
+MirBSD
+@end itemize
+
@end itemize
@c XXX ADD MORE STUFF HERE
@@ -35511,6 +35907,44 @@ Redirected @code{getline} became allowed inside
The @code{where} command was added to the debugger
(@pxref{Execution Stack}).
+@item
+Support for Ultrix was removed.
+
+@end itemize
+
+Version 4.2 introduced the following changes:
+
+@itemize @bullet
+@item
+Changes to @code{ENVIRON} are reflected into @command{gawk}'s
+environment and that of programs that it runs.
+@xref{Auto-set}.
+
+@item
+The @option{--pretty-print} option no longer runs the @command{awk}
+program too.
+@xref{Options}.
+
+@item
+The @command{igawk} program and its manual page are no longer
+installed when @command{gawk} is built.
+@xref{Igawk Program}.
+
+@item
+The @code{intdiv()} function.
+@xref{Numeric Functions}.
+
+@item
+The maximum number of hexdecimal digits in @samp{\x} escapes
+is now two.
+@xref{Escape Sequences}.
+
+@item
+Nonfatal output with @code{print} and @code{printf}.
+@xref{Nonfatal}.
+
+@item
+Support for MirBSD was removed.
@end itemize
@c XXX ADD MORE STUFF HERE
@@ -36177,6 +36611,8 @@ The generated Info file for
The @command{troff} source for a manual page describing the @command{igawk}
program presented in
@ref{Igawk Program}.
+(Since @command{gawk} can do its own @code{@@include} processing,
+neither @command{igawk} nor @file{igawk.1} are installed.)
@item doc/Makefile.in
The input file used during the configuration process to generate the
@@ -36221,8 +36657,6 @@ source file for this @value{DOCUMENT}. It also contains a @file{Makefile.in} fil
@file{Makefile.am} is used by GNU Automake to create @file{Makefile.in}.
The library functions from
@ref{Library Functions},
-and the @command{igawk} program from
-@DBREF{Igawk Program}
are included as ready-to-use files in the @command{gawk} distribution.
They are installed as part of the installation process.
The rest of the programs in this @value{DOCUMENT} are available in appropriate
@@ -36233,6 +36667,12 @@ The source code, manual pages, and infrastructure files for
the sample extensions included with @command{gawk}.
@xref{Dynamic Extensions}, for more information.
+@item extras/*
+Additional non-essential files. Currently, this directory contains some shell
+startup files to be installed in @file{/etc/profile.d} to aid in manipulating
+the @env{AWKPATH} and @env{AWKLIBPATH} environment variables.
+@xref{Shell Startup Files}, for more information.
+
@item posix/*
Files needed for building @command{gawk} on POSIX-compliant systems.
@@ -36264,6 +36704,7 @@ to configure @command{gawk} for your system yourself.
@menu
* Quick Installation:: Compiling @command{gawk} under Unix.
+* Shell Startup Files:: Shell convenience functions.
* Additional Configuration Options:: Other compile-time options.
* Configuration Philosophy:: How it's all supposed to work.
@end menu
@@ -36344,6 +36785,44 @@ is likely that you will be asked for your password, and you will have
to have been set up previously as a user who is allowed to run the
@command{sudo} command.
+@node Shell Startup Files
+@appendixsubsec Shell Startup Files
+
+The distribution contains shell startup files @file{gawk.sh} and
+@file{gawk.csh} containing functions to aid in manipulating
+the @env{AWKPATH} and @env{AWKLIBPATH} environment variables.
+On a Fedora system, these files should be installed in @file{/etc/profile.d};
+on other platforms, the appropriate location may be different.
+
+@table @command
+
+@cindex @command{gawkpath_default} shell function
+@item gawkpath_default
+Reset the @env{AWKPATH} environment variable to its default value.
+
+@cindex @command{gawkpath_prepend} shell function
+@item gawkpath_prepend
+Add the argument to the front of the @env{AWKPATH} environment variable.
+
+@cindex @command{gawkpath_append} shell function
+@item gawkpath_append
+Add the argument to the end of the @env{AWKPATH} environment variable.
+
+@cindex @command{gawklibpath_default} shell function
+@item gawklibpath_default
+Reset the @env{AWKLIBPATH} environment variable to its default value.
+
+@cindex @command{gawklibpath_prepend} shell function
+@item gawklibpath_prepend
+Add the argument to the front of the @env{AWKLIBPATH} environment variable.
+
+@cindex @command{gawklibpath_append} shell function
+@item gawklibpath_append
+Add the argument to the end of the @env{AWKLIBPATH} environment variable.
+
+@end table
+
+
@node Additional Configuration Options
@appendixsubsec Additional Configuration Options
@cindex @command{gawk}, configuring, options